Commit graph

272 commits

Author SHA1 Message Date
Paul Eggert
ba3189039a Update copyright year to 2014 by running admin/update-copyright. 2014-01-01 07:43:34 +00:00
Glenn Morris
9c5a5c7700 Every defcustom should specify its type
* apropos.el (apropos-match-face):
* calculator.el (calculator-displayer):
* dabbrev.el (dabbrev-search-these-buffers-only):
* face-remap.el (buffer-face-mode-face):
* simple.el (yank-handled-properties):
* emacs-lisp/testcover.el (testcover-potentially-1value-functions):
* mail/footnote.el (footnote-mode-line-string, footnote-prefix):
* mail/hashcash.el (hashcash-accept-resources, hashcash-program)
(hashcash-double-spend-database):
* progmodes/ruby-mode.el (ruby-deep-indent-paren)
(ruby-deep-indent-paren-style):
* textmodes/flyspell.el (flyspell-auto-correct-binding):
* textmodes/rst.el (rst-toc-indent, rst-toc-insert-style)
(rst-toc-insert-number-separator, rst-toc-insert-max-level):
* vc/pcvs-defs.el (cvs-minor-mode-prefix):
* erc/erc-log.el (erc-log-file-coding-system):
* gnus/gnus-sieve.el (gnus-sieve-select-method):
* gnus/gravatar.el (gravatar-automatic-caching, gravatar-cache-ttl)
(gravatar-rating, gravatar-size):
* gnus/message.el (message-minibuffer-local-map):
* gnus/sieve-manage.el (sieve-manage-authenticators)
(sieve-manage-authenticator-alist):
Specify custom types.

* mail/hashcash.el (hashcash-program): Rename from hashcash-path.
Update callers.
2013-12-28 00:21:33 -08:00
Dmitry Gutov
1f87a56cc7 * lisp/progmodes/ruby-mode.el (ruby--electric-indent-p): Improve the
comments.  Handle electric indent after typing `?' and `!'.
2013-12-22 22:38:26 +02:00
Dmitry Gutov
f235149801 * lisp/progmodes/ruby-mode.el (ruby-smie--implicit-semi-p): Return t
after `{'.  We need it after block openers, and it doesn't seem
to hurt after hash openers.
2013-12-22 08:04:40 +02:00
Dmitry Gutov
6cddebc11b Integrate ruby-mode with electric-indent-mode better
* lisp/progmodes/ruby-mode.el (ruby--at-indentation-p): New function,
extracted from `ruby-smie-rules'.
(ruby--electric-indent-chars): New variable.
(ruby--electric-indent-p): New function.
(ruby-mode): Use `electric-indent-functions' instead of
`electric-indent-chars'.
2013-12-22 06:57:00 +02:00
Dmitry Gutov
65a1da00fe * lisp/progmodes/ruby-mode.el (ruby-align-to-stmt-keywords): Tweak the
docstring.
(ruby-smie-rules): Indent plus one level after `=>'.
2013-12-22 04:31:21 +02:00
Dmitry Gutov
b520f210b1 * lisp/progmodes/ruby-mode.el (ruby-align-to-stmt-keywords): New
option. 
(ruby-smie--indent-to-stmt-p): Use it.
(ruby-smie-rules): Revert the logic in the handling of `when'.
Expand the `begin' clause to handle `ruby-align-to-stmt-keywords'.
(ruby-deep-arglist, ruby-deep-indent-paren)
(ruby-deep-indent-paren-style): Update docstrings to note that the
vars don't have any effect with SMIE.

* test/automated/ruby-mode-tests.el: Add tests for
`ruby-align-to-stmt-keywords'.

* test/indent/ruby.rb: Update examples to reflect the lack of change in
default indentation of `begin' blocks.

Fixes: debbugs:16182
2013-12-20 07:20:33 +02:00
Dmitry Gutov
ce41edb426 * lisp/progmodes/ruby-mode.el (ruby-smie-rules): Indent middle-of-block
keywords to their parent.
2013-12-19 07:06:24 +02:00
Dmitry Gutov
7e1549c91d * lisp/progmodes/ruby-mode.el (ruby-smie--args-separator-p): Allow the
first arg to be a string (fixed dead code), or an operator symbol.
(ruby-smie--forward-token): Tokenize ` @ ' before strings and
operator symbols.
(ruby-smie-rules): Remove parent token check in the `.' clause, it
did nothing.  Don't respond to `(:after ".")', it will be called
with :before anyway.  Remove the ` @ ' rule, it didn't seem to
change anything.  Only return indentation for binary operators
when they are hanging.  De-dent opening paren when its parent is
`.', otherwise it looks bad when the dot is not at bol or eol.

Fixes: debbugs:16182
2013-12-19 06:21:44 +02:00
Dmitry Gutov
35b249a653 * lisp/progmodes/ruby-mode.el (ruby-smie-rules): Indent ternary if. 2013-12-17 14:04:23 +02:00
Dmitry Gutov
660efa1a14 Fix comment from the last change to `ruby-smie-rules' 2013-12-14 15:57:58 +02:00
Dmitry Gutov
276bc3337b Fix bug#16118
* lisp/progmodes/ruby-mode.el (ruby-smie-rules): Return nil before
open-paren tokens when preceded by a open-paren, too.
(ruby-smie-rules): Handle virtual indentation after open-paren
tokens specially.  If there is code between it and eol, return the
column where is starts.

* test/indent/ruby.rb: New examples.
2013-12-14 08:46:13 +02:00
Dmitry Gutov
8212d9c0da * lisp/progmodes/ruby-mode.el (ruby-smie--implicit-semi-p): Return t
after the end of a percent literal.
2013-12-09 06:19:16 +02:00
Cameron Desautels
8f48d13181 * lisp/progmodes/ruby-mode.el (ruby-forward-string): Document.
Handle caret-delimited strings.

Fixes: debbugs:16079
2013-12-09 05:43:34 +02:00
Dmitry Gutov
ff8c976420 * lisp/progmodes/ruby-mode.el (ruby-accurate-end-of-block): When
`ruby-use-smie' is t, use `smie-forward-sexp' instead of
`ruby-parse-partial'.

Fixes: debbugs:16078
2013-12-09 05:27:21 +02:00
Dmitry Gutov
fa834a93da * lisp/progmodes/ruby-mode.el (ruby-syntax-propertize-function): Touch
up the last change.
2013-12-06 16:24:10 +02:00
Dmitry Gutov
af67e79a52 Fix Bug#15874
* lisp/progmodes/ruby-mode.el (ruby-mode-syntax-table): Don't modify
syntax for `?'.
(ruby-expr-beg): Expect that `!' will have syntax class "symbol"
where appropriate already.
(ruby-syntax-propertize-function): Propertize `?' and `!' at the
end of method names.
2013-12-06 06:22:08 +02:00
Bozhidar Batsov
15ba218206 * progmodes/ruby-mode.el (ruby-custom-encoding-magic-comment-template),
(ruby-encoding-magic-comment-style): Add :version.
2013-11-22 14:36:38 +02:00
Bozhidar Batsov
d19ffd647d * lisp/progmodes/ruby-mode.el (ruby-custom-encoding-magic-comment-template):
Improve docstring.
2013-11-22 14:28:23 +02:00
Bozhidar Batsov
638af3a10f * lisp/progmodes/ruby-mode.el (ruby-custom-encoding-magic-comment-template):
Change default to "# encoding: %s" to differentiate it from the
default Ruby encoding comment template.
2013-11-20 12:52:07 +02:00
Adam Sokolnicki
56cd894e90 * lisp/progmodes/ruby-mode.el (ruby-toggle-block): Don't stop at
interpolation curlies.

Fixes: debbugs:15914
2013-11-17 23:39:13 +02:00
Dmitry Gutov
43cebc237c * lisp/progmodes/ruby-mode.el (ruby-font-lock-keywords): End regexp for
nil/self/true/false with "end of symbol".
2013-11-15 20:09:10 +02:00
Bozhidar Batsov
99f5d0744e * lisp/progmodes/ruby-mode.el (ruby-mode-set-encoding):
Fix and simplify encoding comment update logic.
2013-11-14 14:39:41 +02:00
Bozhidar Batsov
6c1bf08604 * lisp/progmodes/ruby-mode.el (ruby-mode-set-encoding):
Add support for always inserting an utf-8 encoding comment.
2013-11-14 12:35:49 +02:00
Dmitry Gutov
7b08f97e71 * lisp/progmodes/ruby-mode.el (ruby-smie-grammar): Disambiguate between
binary "|" operator and closing block args delimiter.  Remove
FIXME comment referring to Ruby 1.8-only syntax.
(ruby-smie--implicit-semi-p): Not after "|" operator.
(ruby-smie--closing-pipe-p): New function.
(ruby-smie--forward-token, ruby-smie--backward-token): Use it.
(ruby-smie-rules): Indent after "|".
2013-11-12 16:15:14 +02:00
Dmitry Gutov
1629a32997 * lisp/progmodes/ruby-mode.el (ruby-smie--implicit-semi-p):
Not after "||".
(ruby-smie-rules): Indent non-hanging "begin" blocks as part of
their parent.
2013-11-09 01:59:56 +02:00
Stefan Monnier
ad16897ceb * lisp/progmodes/ruby-mode.el: Don't require cl any more. Use pcase instead.
(ruby-font-lock-keywords): Use backquote.
2013-11-08 17:53:41 -05:00
Bozhidar Batsov
25864c18c5 * lisp/progmodes/ruby-mode.el (ruby-mode-set-encoding):
Fix incorrect case conditions.
2013-11-08 23:41:25 +02:00
Dmitry Gutov
ffa2df72a8 * lisp/progmodes/ruby-mode.el (ruby-smie--forward-token)
(ruby-smie--backward-token): Only consider full-string matches.
2013-11-08 23:23:11 +02:00
Bozhidar Batsov
71731c0338 * lisp/progmodes/ruby-mode.el (ruby-mode-set-encoding): Use
`ruby-encoding-magic-comment-style' to control the
style of the auto-inserted encoding comment.
2013-11-08 18:01:55 +02:00
Dmitry Gutov
da3b328da0 * lisp/progmodes/ruby-mode.el (ruby-smie--indent-to-stmt): Use
`smie-backward-sexp' with token argument.
2013-11-08 13:22:52 +02:00
Dmitry Gutov
1f92392383 * lisp/progmodes/ruby-mode.el (ruby-smie-grammar): Improve precedences
of "and", "or", "&&" and "||".
(ruby-smie--args-separator-p): Prohibit keyword "do" as the first
argument.  Prohibit opening curly brace because it could only be a
block opener in that position.
(ruby-smie--forward-token, ruby-smie--backward-token): Separate
"|" from "&" or "*" going after it.  That can happen in block
arguments.
(ruby-smie--indent-to-stmt): New function, seeks the end of
previous statement or beginning of buffer.
(ruby-smie-rules): Use it.
(ruby-smie-rules): Check if there's a ":" before a curly block
opener candidate; if there is, it's a hash.

* test/indent/ruby.rb: New examples.
2013-11-08 04:31:51 +02:00
Dmitry Gutov
1d1c86daf7 * lisp/progmodes/ruby-mode.el (ruby-smie--implicit-semi-p):
No implicit semi after "^", "and" or "or".
(ruby-smie-grammar): New tokens: "and" and "or".
(ruby-smie--args-separator-p): Fix the check for tokens at POS.
Exclude "and" and "or".  Remove "do" in order to work around token
priorities.
(ruby-smie-rules): Add all infix tokens.  Handle the case of
beginning-of-buffer.
2013-11-07 05:02:01 +02:00
Dmitry Gutov
b420ccfc4c * lisp/progmodes/ruby-mode.el (ruby-smie-grammar): Lower priority of
"." compared to "do".
2013-11-07 03:58:12 +02:00
Bozhidar Batsov
03177f98c9 * lisp/progmodes/ruby-mode.el: Improve a few error messages. 2013-11-05 18:28:40 +02:00
Bozhidar Batsov
ae93bc7480 * lisp/progmodes/ruby-mode.el (ruby-mode): Remove incorrect text from docstring. 2013-11-05 11:30:15 +02:00
Bozhidar Batsov
2ea53115b4 * lisp/progmodes/ruby-mode.el (ruby-mode): Clean up docstring. 2013-11-04 16:20:58 +02:00
Dmitry Gutov
dca01b0923 * lisp/progmodes/ruby-mode.el (ruby-smie--forward-token)
(ruby-smie--backward-token): Tokenize heredocs as semicolons.

* test/automated/ruby-mode-tests.el: Remove outdated comment.

* test/indent/ruby.rb: Add a statement on the line after heredoc.
2013-11-04 12:50:47 +02:00
Stefan Monnier
e61845c1db * lisp/emacs-lisp/smie.el (smie-rule-parent): Always call
smie-indent-virtual rather than only for hanging tokens.
(smie--next-indent-change): New helper command.
* lisp/progmodes/ruby-mode.el (ruby-smie--rule-parent-skip-assign): Remove.
(ruby-smie-rules): Use smie-rule-parent instead.
2013-11-03 17:56:03 -05:00
Dmitry Gutov
3d42b96899 * lisp/progmodes/ruby-mode.el (ruby-smie--rule-parent-skip-assign): New
function, replacement for `smie-rule-parent' for when we want to
skip over our direct parent if it's an assignment token..
(ruby-smie-rules): Use it.
2013-11-02 09:18:11 +04:00
Dmitry Gutov
7ffd37219b * lisp/progmodes/ruby-mode.el Use `syntax-propertize-function'
unconditionally.  Remove now unnecessary forward declarations.
Remove XEmacs-specific setup.
(ruby-here-doc-end-re, ruby-here-doc-beg-match)
(ruby-font-lock-syntactic-keywords)
(ruby-comment-beg-syntax, ruby-in-here-doc-p)
(ruby-here-doc-find-end, ruby-here-doc-beg-syntax)
(ruby-here-doc-end-syntax): Remove.
(ruby-mode): Don't check whether `syntax-propertize-rules' is
defined as function.
2013-11-02 05:10:10 +04:00
Bozhidar Batsov
a3996a2eba * lisp/progmodes/ruby-mode.el (ruby-mode-variables, ruby-mode): Use `setq-local'. 2013-11-02 04:17:54 +04:00
Bozhidar Batsov
6f9260e8f8 * lisp/progmodes/ruby-mode.el (ruby-mode-variables): Don't set syntax
table and abbrev table, `define-derived-mode' does that for us
anyway.
2013-11-02 03:55:15 +04:00
Bozhidar Batsov
983d0df5e1 * lisp/progmodes/ruby-mode.el (ruby-indent-tabs-mode)
(ruby-indent-level, ruby-comment-column, ruby-deep-arglist):
Add property :safe.
(ruby-deep-arglist): Add property :type.
2013-11-01 07:35:35 +04:00
Dmitry Gutov
c8c605ac9c * lisp/progmodes/ruby-mode.el (ruby-smie--bosp): Anything that goes
after `=' is probably a new expression.
2013-10-27 07:25:03 +04:00
Dmitry Gutov
bae91342a4 * lisp/progmodes/ruby-mode.el (ruby-smie--args-separator-p): Be more
specific in what the first arg can be: a non-keyword word,
string/regexp/percent literal opener, opening paren, or unary
operator followed directly by word.

* test/automated/ruby-mode-tests.el (ruby-toggle-block-to-brace): Fix
the test, in respect to adding the space after the curly.
2013-10-26 05:16:37 +04:00
Dmitry Gutov
963ce6361a * lisp/progmodes/ruby-mode.el (ruby-mode-menu): Use proper
capitalization.  Use :visible instead of :active.  Fix
`ruby-indent-exp' reference.  Add menu items for the generic
commands that are used with SMIE.
(ruby-do-end-to-brace): Insert space after `{'.
2013-10-25 08:35:56 +04:00
John Anthony
f73754c923 * lisp/progmodes/ruby-mode.el (ruby-mode-menu): Add a menu
Fixes: debbugs:15600
2013-10-24 19:38:39 -07:00
Dmitry Gutov
369bbf7198 * lisp/progmodes/ruby-mode.el (ruby-smie-rules): Fix the "curly block
with parameters" example.  Simplify the "is it block or is it
hash" check, but also make it more thorough.

* test/indent/ruby.rb: Fix syntax error in the latest example.
2013-10-24 04:47:28 +04:00
Stefan Monnier
03d44565bb * lisp/progmodes/ruby-mode.el (ruby-smie-rules): Only align with parent of
{ if it is hanging.
2013-10-23 13:55:53 -04:00