mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
bfea5bc277
commit
6ca6820a56
2 changed files with 7 additions and 42 deletions
|
@ -1,3 +1,10 @@
|
|||
Wed Oct 30 19:07:57 2013 Akinori MUSHA <knu@iDaemons.org>
|
||||
|
||||
* 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]
|
||||
|
||||
Wed Oct 30 12:44:28 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* win32/Makefile.sub (config.status): add missing variables,
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
(eval-after-load 'ruby-mode
|
||||
'(progn
|
||||
(define-key ruby-mode-map "\C-c\C-e" 'ruby-insert-end)
|
||||
(define-key ruby-mode-map "\C-c{" 'ruby-toggle-block)
|
||||
|
||||
(defun ruby-insert-end ()
|
||||
(interactive)
|
||||
|
@ -32,47 +31,6 @@
|
|||
(ruby-indent-line t)
|
||||
(end-of-line)))
|
||||
|
||||
(defun ruby-brace-to-do-end ()
|
||||
(when (looking-at "{")
|
||||
(let ((orig (point)) (end (progn (ruby-forward-sexp) (point))))
|
||||
(when (eq (preceding-char) ?\})
|
||||
(delete-char -1)
|
||||
(if (eq (char-syntax (preceding-char)) ?w)
|
||||
(insert " "))
|
||||
(insert "end")
|
||||
(if (eq (char-syntax (following-char)) ?w)
|
||||
(insert " "))
|
||||
(goto-char orig)
|
||||
(delete-char 1)
|
||||
(if (eq (char-syntax (preceding-char)) ?w)
|
||||
(insert " "))
|
||||
(insert "do")
|
||||
(when (looking-at "\\sw\\||")
|
||||
(insert " ")
|
||||
(backward-char))
|
||||
t))))
|
||||
|
||||
(defun ruby-do-end-to-brace ()
|
||||
(when (and (or (bolp)
|
||||
(not (memq (char-syntax (preceding-char)) '(?w ?_))))
|
||||
(looking-at "\\<do\\(\\s \\|$\\)"))
|
||||
(let ((orig (point)) (end (progn (ruby-forward-sexp) (point))))
|
||||
(backward-char 3)
|
||||
(when (looking-at ruby-block-end-re)
|
||||
(delete-char 3)
|
||||
(insert "}")
|
||||
(goto-char orig)
|
||||
(delete-char 2)
|
||||
(insert "{")
|
||||
(if (looking-at "\\s +|")
|
||||
(delete-char (- (match-end 0) (match-beginning 0) 1)))
|
||||
t))))
|
||||
|
||||
(defun ruby-toggle-block ()
|
||||
(interactive)
|
||||
(or (ruby-brace-to-do-end)
|
||||
(ruby-do-end-to-brace)))
|
||||
|
||||
(defconst ruby-default-encoding-map
|
||||
'((us-ascii . nil) ;; Do not put coding: us-ascii
|
||||
(utf-8 . nil) ;; Do not put coding: utf-8
|
||||
|
|
Loading…
Add table
Reference in a new issue