Граф коммитов

157 Коммитов

Автор SHA1 Сообщение Дата
nobu 378d20f80d ruby-mode.el: expand/unexpand block
* misc/ruby-mode.el (ruby-brace-to-do-end): split single line block.
* misc/ruby-mode.el (ruby-do-end-to-brace): shrink single line block
  to one line.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44033 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-06 07:47:47 +00:00
knu 6fa584e2a5 Fix a typo: s/preceging/preceding/
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43200 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-08 12:42:37 +00:00
knu 20eff9bd7c * misc/ruby-mode.el: Use preceding-char/following-char
(returning 0 at BOF/EOF) instead of char-before/char-after
  (returning nil at BOF/EOF) to avoid error from char-syntax when
  at BOF/EOF.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-07 19:29:41 +00:00
knu 593855a0ff * misc/ruby-additional.el (ruby-mode-set-encoding): Add a missing
else clause to unbreak with `cp932`, etc.

* misc/ruby-mode.el (ruby-mode-set-encoding): Ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-07 19:15:11 +00:00
knu 449822c76c * misc/ruby-additional.el (ruby-mode-set-encoding): Use
`default-buffer-file-coding-system` if the :prefer-utf-8
  property is not available.

* misc/ruby-mode.el (ruby-mode-set-encoding): Ditto.

* misc/ruby-additional.el (ruby-encoding-map): Override the
  default value.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43187 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-07 19:03:03 +00:00
knu 1ecf20cda2 misc/ruby-mode.el: Improve `ruby-mode-set-encoding`.
* misc/ruby-additional.el (ruby-mode-set-encoding): Add support
  for `prefer-utf-8` which was introduced in Emacs trunk.

* misc/ruby-additional.el (ruby-encoding-map): Add a mapping from
  `japanese-cp932` to `cp932` to fix the problem where saving a
  source file written in Shift_JIS twice would end up having
  `coding: japanese-cp932` which Ruby could not recognize.

* misc/ruby-additional.el (ruby-mode-set-encoding): Add support
  for encodings mapped to nil in `ruby-encoding-map`.

* misc/ruby-additional.el (ruby-encoding-map): Map `us-ascii` and
  `utf-8` to nil by default, meaning they need not be explicitly
  declared in magic comment.

* misc/ruby-additional.el (ruby-encoding-map): Add type
  declaration for better customize UI.

* misc/ruby-mode.el: Ditto for the above.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43186 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-07 18:21:21 +00:00
hsbt 595825dc57 Replace use of obsolete variable `last-command-char` by @maser [fix GH-290]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-21 10:04:54 +00:00
nobu 983c2e874f ruby-mode.el: fix argument indent
* misc/ruby-mode.el (ruby-block-end-re, ruby-delimiter)
  (ruby-mode-syntax-table, ruby-parse-partial, ruby-beginning-of-indent):
  merge from Emacs.
* misc/ruby-mode.el (ruby-calculate-indent): fix indentation of
  argument lines in parentheses.  [Bug #5140]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38150 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-03 03:43:40 +00:00
mrkn be5e17704c * misc/ruby-mode.el (ruby-indent-beg-re): Fix broken regular
expression.  Fixes #4546

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32338 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-30 14:54:11 +00:00
nobu d9e6b7d6a5 * misc/ruby-mode.el (ruby-parse-partial): use position of open paren.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31308 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-19 15:02:16 +00:00
nobu 2cda63027d * misc/ruby-mode.el (ruby-brace-to-do-end, ruby-do-end-to-brace):
adjust space between block beginning and block arguments

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-31 14:15:48 +00:00
nobu 633cf770f0 * misc/ruby-mode.el (ruby-toggle-block): toggle do/end and {}.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31218 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-30 13:55:50 +00:00
nobu 764c486b84 * misc/ruby-mode.el (ruby-move-to-block): move to opening of
block.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31217 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-30 13:54:26 +00:00
nobu 1f1c31e355 * misc/ruby-mode.el (ruby-mode-map): remove unnecessary
binding. fixes
  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=468952

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-27 07:55:43 +00:00
nobu 69a6b860ef * misc/ruby-mode.el: suppress warnings at byte compile. fixes
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=502926

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-27 06:45:56 +00:00
nobu 862048e28d * misc/ruby-mode.el (ruby-parse-partial): fix indent after aref.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31076 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-09 14:06:15 +00:00
nobu 6b0dc7fd81 * misc/ruby-mode.el (ruby-parse-partial): fix for array in block.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31065 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-08 14:10:19 +00:00
nobu 85df40e9ab * misc/ruby-mode.el (ruby-deep-indent-paren-p, ruby-calculate-indent):
do not apply deep-indent inside parens at the beginning of
  expressions.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31061 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-08 03:30:23 +00:00
nobu 787686ffa7 * misc/ruby-mode.el (ruby-expr-beg): fix for invalid nest errors.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30825 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-08 10:38:01 +00:00
nobu 5f3e191f95 * misc/ruby-mode.el (ruby-expr-beg, ruby-in-here-doc-p): tell
singleton class definitions from here documents.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30819 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-07 15:56:34 +00:00
nobu 360e0b93fd * misc/ruby-mode.el (ruby-expr-beg, ruby-parse-partial): keyword
followed by colon is label.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30818 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-07 15:53:15 +00:00
nobu c5b45d252a * misc/ruby-mode.el (ruby-mode-map): remove deprecated binding.
use M-; instead.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30674 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-27 14:14:24 +00:00
nobu 29ed2f308c * misc/ruby-mode.el (ruby-mode-variables), misc/ruby-style.el:
show trailing whitespace.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30485 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-07 12:57:34 +00:00
nobu a262f71f37 * misc/ruby-mode.el (ruby-font-lock-syntactic-keywords): highlight
regexp after open bracket.  [ruby-core:34183]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30484 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-07 12:54:10 +00:00
nobu f4c909b965 * misc/ruby-mode.el (ruby-forward-sexp): stop after literal hash
key labels.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-29 12:12:54 +00:00
nobu 05a0c30adc * misc/ruby-mode.el (ruby-font-lock-keywords): highlight literal
hash key labels as symbols.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29972 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-29 12:11:19 +00:00
nobu 671b498070 Commit miss.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-19 03:25:29 +00:00
nobu 12cbb58819 * test/ruby/test_sprintf.rb: fix ML ref. [ruby-core:32848]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29533 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-19 03:22:03 +00:00
nobu 4acf013ffd * misc/ruby-mode.el (ruby-mode-set-encoding): commit miss.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28107 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-31 09:27:06 +00:00
nobu 97a1d656f8 * misc/ruby-mode.el (ruby-mode-set-encoding): skip shebang line
always regardless of ruby.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-31 09:22:25 +00:00
kosaki ceb62c31a1 * misc/ruby-mode.el (ruby-mode-map): binded C-c C-c and C-c C-c C-u
to comment-region and uncomment-region. Thanks Michael Klishin!
         [Feature #872] [ruby-core:20552]




git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27251 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-07 14:39:28 +00:00
nobu 33ede4d01c * misc/ruby-mode.el (ruby-here-doc-beg-match): fix for here-doc
which ends with an underscore.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26294 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-12 03:49:42 +00:00
knu ae846f9fb8 * lib/irb/completion.rb (IRB::InputCompletor::Operators): Add
overloadable negative operators.

* lib/irb/ruby-lex.rb (RubyLex#lex_init): Support overloadable
  negative operators.

* lib/irb/ruby-lex.rb (RubyLex#identify_identifier): Minus signs
  need to be escaped in regexp character class.

* misc/ruby-mode.el (ruby-font-lock-keywords, ruby-parse-partial):
  Support overloadable negative operators.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23129 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-04-03 05:04:02 +00:00
matz 568b743442 * misc/ruby-mode.el: added comment to mention newer version
bundled with Emacs 23 or later.  a patch from Phil Hagelberg
  <phil at hagelb.org> in [ruby-core:20838].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-23 18:23:15 +00:00
nobu 00ae128346 * misc/ruby-mode.el: safe custimizable variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19582 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-26 09:24:31 +00:00
matz fb01457265 * misc/ruby-mode.el (ruby-keyword-end-re): emacs21 support. a
patch from Hiroshi Moriyama <hiroshi at kvd.biglobe.ne.jp> in
  [ruby-dev:36471].

* misc/ruby-mode.el (ruby-in-ppss-context-p): ditto.

* misc/ruby-mode.el (ruby-here-doc-end-syntax):

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-22 23:09:21 +00:00
matz 120772041e * misc/emacs-mode.el: don't set case-fold-search globally to nil;
instead just set it when we need it.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19208 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-06 22:38:08 +00:00
matz e39aa51dfa * misc/ruby-mode.el: fix a variable-name error.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19207 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-06 22:37:17 +00:00
matz 4cbbf3bdfc * misc/*.el: untabify, for interal consistency and consistency
with standard Emacs elisp files.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19206 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-06 22:36:10 +00:00
matz d250d79e5b * misc/ruby-mode.el, misc/ruby-electric.el: use regexp-opt where
possible for more efficient regexps.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19205 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-06 22:34:46 +00:00
matz 3f3584d623 * misc/ruby-mode.el: don't highlight keywords when they're the
beginning of non-keyword symbols.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-06 22:33:43 +00:00
matz ce231cdbdd * misc/ruby-mode.el: don't crash the whole mode if the Subversion
$ keyword isn't interpolated.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19203 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-06 22:32:38 +00:00
matz 2d1c5d2c24 * misc/*.el: merged the following patches from Nathan Weizenbaum
<nex342 at gmail.com>.   [ruby-core:18424]

* misc/ruby-mode.el: improve here-doc performance.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19202 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-06 22:30:34 +00:00
knu 3f91366caf * misc/ruby-mode.el (ruby-imenu-create-index-in-block): Fix the
regexp to only pick definition lines properly.  `module_funtion'
  is not a definition of a module named `_function'.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-07 09:04:27 +00:00
nobu 1bcbc29d95 * misc/ruby-mode.el: fix here-doc strings with inner quotes. patches
by Nathan Weizenbaum <nex342 AT gmail.com> from [ruby-core:17615]
  through [ruby-core:17910].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18150 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-22 00:51:35 +00:00
matz cf5cf236d7 * misc/ruby-mode.el (ruby-mode): use run-hooks if run-mode-hook is
not available.  a patch from Kazuhiro NISHIYAMA <zn at mbf.nifty.com>
  in [ruby-dev:34853].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16611 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-26 07:51:21 +00:00
matz f145325797 * misc/ruby-mode.el: move fontifying code from hook.
[ruby-core:16636]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16266 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-02 06:01:13 +00:00
nobu 6a98d417f0 * misc/ruby-mode.el (ruby-encoding-map): added shift-jis for older
versions.

* misc/ruby-mode.el (ruby-mode-set-encoding):
  coding-system-to-mime-charset is not a standard function.
  [carbon-emacs:795]
  fix for the case that magic comment exists but coding system is
  absent.

* misc/ruby-mode.el (ruby-mode): use write-contents-functions or
  write-contents-hooks for older versions.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16028 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-15 06:38:13 +00:00
nobu c97735b53c * misc/ruby-mode.el (ruby-mode): should use `run-mode-hooks' instead
of calling `run-hooks' directly to run the mode hook.  patch from
  Chiyuan Zhang <pluskid AT gmail.com> in [ruby-core:15915]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-17 08:11:15 +00:00
nobu 05eeb60259 * misc/ruby-mode.el (ruby-encoding-map, ruby-use-encoding-map): added
to customize.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-14 02:24:32 +00:00