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

235 Коммитов

Автор SHA1 Сообщение Дата
nobu f7228ad8e4 ruby-style.el: add an instruction to load
[ci skip]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53967 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-29 05:54:24 +00:00
nobu 8d6d6116ac ruby-additional.el: ruby-decode-unicode
* misc/ruby-additional.el (ruby-decode-unicode): new function to
  convert escaped Unicode to raw string.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53578 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-18 13:49:51 +00:00
nobu 3e0f09dbe5 ruby-additional.el: escape control code
* misc/ruby-additional.el (ruby-encode-unicode): escape control
  code except for LF.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53393 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-31 01:38:28 +00:00
nobu 34167345ac ruby-additional.el: encode non-ASCII code only
* misc/ruby-additional.el (ruby-encode-unicode): encode non-ASCII
  code only, excluding ASCII control code, e.g. \t, \n, etc.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53392 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-31 00:39:03 +00:00
nobu 68e16ddd79 parse.y: ANDDOT fluent interface
* parse.y (parser_yylex): ANDDOT at the head of the line denote
  line continuation from previous one to support fluent interface,
  as well as single dot.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52548 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-12 05:17:06 +00:00
knu 9955bb0130 Import ruby-electric.el version 2.2.3 from upstream
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50385 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-24 14:52:31 +00:00
nobu dd939a3886 ruby-additional.el: monkey-patching ruby-mode.el
* misc/ruby-additional.el: monkey-patch ruby-mode.el in Emacs 24,
  to fix regexp parsing as r49872.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49880 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-07 01:59:32 +00:00
nobu fe2440261c ruby-mode.el: fix regexp syntax
* misc/ruby-mode.el (ruby-font-lock-syntactic-keywords): division
  operator can't follow '{' and '|' too.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-06 12:12:11 +00:00
knu 210357fad0 * misc/ruby-electric.el: Import version 2.2.2 from
https://github.com/knu/ruby-electric.el.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49412 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-26 09:06:54 +00:00
knu e65fa1f467 Import ruby-electric.el 2.2.1.
* misc/ruby-electric.el: Import version 2.2.1 from
  https://github.com/knu/ruby-electric.el.  Improve compatibility
  with and optimize for Emacs 24.4.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-21 13:39:25 +00:00
nobu 9a8b21b3b6 ruby-additional.el: change key
* misc/ruby-additional.el (ruby-encode-unicode): change key
  binding to get rid of conflict with uncomment-region.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46995 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-29 07:41:42 +00:00
nobu c82b44e1b4 ruby-additional.el: track by marker
* misc/ruby-additional.el (ruby-encode-unicode): use marker
  instead of offset to track insertion.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46994 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-29 07:41:35 +00:00
hsbt f4e9aa370d * misc/README: use github link instead of rubyforge.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46352 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-05 03:47:46 +00:00
nobu 4332617032 ruby-additional.el: ruby-encode-unicode
* misc/ruby-additional.el (ruby-encode-unicode): convert non-ascii
  string to \\u{} form.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45675 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-23 02:03:24 +00:00
nobu a6c8346da1 rdoc-mode.el: fill indented block
* misc/rdoc-mode.el (rdoc-fill-paragraph): fill indented block by
  list.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45333 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-14 04:29:35 +00:00
knu f38a2926e0 misc/ruby-electric.el: Import version 2.1.1.
* ruby-electric-delete-backward-char: Enable support for number
    prefix.

  * ruby-electric-curlies: Fix electric operation after an open
    curly.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-17 08:33:01 +00:00
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 9f01bdae2a Record dependency on Emacs 24.3 and update commentary.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43477 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-31 04:13:43 +00:00
knu 6ca6820a56 misc/ruby-additional.el: Remove functions implemented in Emacs 24.3.
* misc/ruby-additional.el (ruby-brace-to-do-end)
  (ruby-do-end-to-brace, ruby-toggle-block): Remove functions that
  are already in the latest released version of Emacs (24.3).
  [Bug #7565]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43475 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-30 10:11:20 +00:00
knu 3701549796 * misc/ruby-electric.el: Import ruby-electric.el 2.1 from
https://github.com/knu/ruby-electric.el.

  * Hitting the newline-and-indent key within a comment fires
    comment-indent-new-line.

  * Introduce a new feature
    `ruby-electric-autoindent-on-closing-char`.

  * Fix fallback behavior of ruby-electric-space/return that
    caused error with auto-complete.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43448 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-28 05:45:23 +00:00
knu 73e014407f Import ruby-electric.el 2.0.1, a bug fix release.
* misc/ruby-electric.el: Import ruby-electric.el 2.0.1 which fixes
  a bug and a flaw with auto-end introduced in the revamp.

  * ruby-forward-sexp is inappropriate here because it moves the
    cursor past the keyword.

  * Fix a reversed looking-back check in
    ruby-electric--block-beg-keyword-at-point-p.

  * Do not add end again if space or return is hit repeatedly
    after a block beginning keyword.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43254 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-11 10:31:03 +00:00
knu 86597752f7 Import ruby-electric.el 2.0.
* misc/ruby-electric.el: Import ruby-electric.el 2.0 from
  https://github.com/knu/ruby-electric.el which integrates changes
  from another fork by @qoobaa.
  * Allow ruby-electric-mode to be disabled by introducing a
    dedicated key map.  Electric key bindings are now defined in
    ruby-electric-mode-map instead of overwriting ruby-mode-map.
  * Add ruby-electric-mode-hook.
  * Use a remap in binding ruby-electric-delete-backward-char.
  * Totally revamp electric keywords and then introduce electric
    return.  Modifier keywords are now properly detected making
    use of ruby-mode's indentation level calculator, and
  * block-mid keywords (then, else, elsif, when, rescue and
    ensure) also become electric with automatic reindentation.
  * Add standarized comments for ELPA integration.
  * Fix interaction with smartparens-mode by disabling its end
    keyword completion, since ruby-electric has become more clever
    at it.
  * The custom variable `ruby-electric-keywords` is changed to
    `ruby-electric-keywords-alist`, allowing user to fine-grained
    configuration.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43251 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-11 08:38:52 +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
knu 965854205b * misc/ruby-additional.el: Add a standard header and footer,
including (provide 'ruby-additional).

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43184 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-07 15:16:38 +00:00
knu 1189b5fe99 Make ruby-electric play nicely with smartparens-mode.
* misc/ruby-electric.el (ruby-electric-space-can-be-expanded-p):
  Return nil to avoid "end" insertion when in smartparens-mode
  that is configured to insert "end" for the same keyword.

* misc/ruby-electric.el (ruby-electric-keywords): New custom
  variable to replace `ruby-electric-simple-keywords-re` with.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43183 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-07 14:47:32 +00:00
knu ae8870e9e0 * misc/ruby-additional.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@43182 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-07 14:47:29 +00:00
knu 42b72a08d1 * misc/ruby-additional.el: Properly quote the body. An unquoted
body given to eval-after-load is evaluated immediately!

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43122 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-02 15:25:34 +00:00
knu e59f453e88 * misc/ruby-electric.el (ruby-electric-delete-backward-char): Add
support for smartparen-mode.

* misc/ruby-electric.el (ruby-electric-cua-replace-region-maybe)
  (ruby-electric-cua-delete-region-maybe): New functions that
  combine `ruby-electric-cua-*-region` with
  `ruby-electric-cua-*-region-p`, using a slightly better way to
  detect if it is in cua-mode.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-26 12:16:22 +00:00
knu 26f7f7da27 * misc/ruby-electric.el: Avoid use of the interactive function
`self-insert-command` which fires `post-self-insert-hook` and
  `post-command-hook`, to make the ruby-electric commands work
  nicely with those minor modes that make use of them to do
  similar input assistance, such as electric-pair-mode,
  autopair-mode and smartparens-mode.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43051 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-26 07:50:19 +00:00
knu afcabde71b Add magic autoload comments to misc/*.el.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42804 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-03 09:29:22 +00:00
knu 0687ed1e59 * misc/ruby-electric.el (ruby-electric-delete-backward-char): Use
delete-char instead of delete-backward-char, which is an
  interactive function.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40823 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-19 01:41:47 +00:00
knu 041224017c * misc/ruby-electric.el (ruby-electric-setup-keymap): Make
backquotes electric as well.  It was listed in
  ruby-electric-expand-delimiters-list but not activated.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40818 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-18 17:38:08 +00:00
knu 616084fd97 * misc/ruby-electric.el (ruby-electric-delete-backward-char):
Introduce electric DEL that deletes what the previous electric
  command has input.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-18 17:38:04 +00:00
knu 30034b5536 * misc/ruby-electric.el (ruby-electric-matching-char): Make
electric quotes work again at the end of buffer.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40816 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-18 17:38:02 +00:00
knu 53fa01d060 * misc/ruby-electric.el (ruby-electric-matching-char): Do not put
a closing quote when the quote typed does not start a string, as
  in $', ?\' or ?\".


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40797 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-17 10:27:32 +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
knu 7190cc5df9 misc/ruby-electric.el: Decrease the excess voltage of automatic matching.
* misc/ruby-electric.el (ruby-electric-closing-char): New
  interactive function bound to closing characters.  Typing one of
  those closing characters right after the matching counterpart
  cancels the effect of automatic closing.  For example, typing
  "{" followed by "}" simply makes "{}" instead of "{ } }".

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40307 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-15 13:15:20 +00:00
knu ed3b657d7d misc/ruby-electric.el: Minor refactoring.
* misc/ruby-electric.el (ruby-electric-insert): Check
  ruby-electric-is-last-command-char-expandable-punct-p here.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40306 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-15 13:15:17 +00:00
nobu fa93be2f05 * remove trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40196 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-08 20:27:01 +00:00
knu 59eacb45e5 Improve ruby-electric-mode.
* misc/ruby-electric.el (ruby-electric-hash): New electric
  function that expands a hash sign inside a string or regexp to
  "#{}".

* misc/ruby-electric.el (ruby-electric-curlies): Do not insert
  spaces inside when the curly brace is a delimiter of %r, %w,
  etc.

* misc/ruby-electric.el (ruby-electric-curlies): Insert another
  space before a closing curly brace when
  ruby-electric-newline-before-closing-bracket is nil.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40166 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-06 16:43:32 +00:00
knu 5b7d2440ca misc/ruby-electric.el: Avoid electric insertion in some cases.
* misc/ruby-electric.el (ruby-electric-curlies)
  (ruby-electric-matching-char, ruby-electric-bar): Avoid electric
  insertion when there is a prefix argument.

* misc/ruby-electric.el (ruby-electric-insert)
  (ruby-electric-cua-replace-region-p)
  (ruby-electric-cua-replace-region): Avoid electric insertion and
  fall back when cua-mode is enabled and a region is active.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-23 03:55:39 +00:00
knu 9545483ad3 Fix ruby-electric-curlies.
* misc/ruby-electric.el (ruby-electric-curlies): Fix the bug where
  an open curly is always replaced with a hash sign.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-22 14:05:40 +00:00
knu 7bc4cfe479 ruby-electric.el (ruby-electric-curlies): Automatically indent "}".
* misc/ruby-electric.el (ruby-electric-curlies): Automatically
  indent closing curly brackets when
  ruby-electric-newline-before-closing-bracket is true.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38642 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-28 08:10:01 +00:00
knu ca4a5bd9d7 Fix a typo in misc/ruby-additional.el.
* misc/ruby-additional.el (ruby-mode-set-encoding): Unbreak by
  fixing a typo, s/set/setq/.




git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38152 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-03 06:52:47 +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
nobu f9aef18497 ruby-electric.el: use kill-region
* misc/ruby-electric.el (ruby-electric-curlies): use kill-region
  instead of interactive command delete-backward-char.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38108 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-01 08:17:05 +00:00