aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/ruby-mode.el
diff options
context:
space:
mode:
authorPaul Eggert2015-09-17 16:08:20 -0700
committerPaul Eggert2015-09-17 16:09:39 -0700
commit284c470ef752967fcd8bae6a450dc138462b1e49 (patch)
tree83e8bcfe4c756e741ee9d4ecdf80f6b8d0e73c91 /lisp/progmodes/ruby-mode.el
parentd149ff5233805c0a09b6067e0cf27549291cc83a (diff)
downloademacs-284c470ef752967fcd8bae6a450dc138462b1e49.tar.gz
emacs-284c470ef752967fcd8bae6a450dc138462b1e49.zip
Backslash cleanup in Elisp source files
This patch should not change behavior. It typically omits backslashes where they are redundant (e.g., in the string literal "^\$"). In a few places, insert backslashes where they make regular expressions clearer: e.g., replace "^\*" (equivalent to "^*") with "^\\*", which has the same effect as a regular expression. Also, use ‘\ %’ instead of ‘\%’ when avoiding confusion with SCCS IDs, and similarly use ‘\ $’ instead of ‘\$’ when avoiding confusion with RCS IDs, as that makes it clearer that the backslash is intended.
Diffstat (limited to 'lisp/progmodes/ruby-mode.el')
-rw-r--r--lisp/progmodes/ruby-mode.el6
1 files changed, 3 insertions, 3 deletions
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index 026616e68f4..a5efb934a22 100644
--- a/lisp/progmodes/ruby-mode.el
+++ b/lisp/progmodes/ruby-mode.el
@@ -695,7 +695,7 @@ It is used when `ruby-encoding-magic-comment-style' is set to `custom'."
695 (let ((index-alist '()) (case-fold-search nil) 695 (let ((index-alist '()) (case-fold-search nil)
696 name next pos decl sing) 696 name next pos decl sing)
697 (goto-char beg) 697 (goto-char beg)
698 (while (re-search-forward "^\\s *\\(\\(class\\s +\\|\\(class\\s *<<\\s *\\)\\|module\\s +\\)\\([^\(<\n ]+\\)\\|\\(def\\|alias\\)\\s +\\([^\(\n ]+\\)\\)" end t) 698 (while (re-search-forward "^\\s *\\(\\(class\\s +\\|\\(class\\s *<<\\s *\\)\\|module\\s +\\)\\([^(<\n ]+\\)\\|\\(def\\|alias\\)\\s +\\([^(\n ]+\\)\\)" end t)
699 (setq sing (match-beginning 3)) 699 (setq sing (match-beginning 3))
700 (setq decl (match-string 5)) 700 (setq decl (match-string 5))
701 (setq next (match-end 0)) 701 (setq next (match-end 0))
@@ -1795,7 +1795,7 @@ If the result is do-end block, it will always be multiline."
1795 (setq content 1795 (setq content
1796 (if (equal string-quote "\"") 1796 (if (equal string-quote "\"")
1797 (replace-regexp-in-string "\\\\\"" "\"" (replace-regexp-in-string "\\([^\\\\]\\)'" "\\1\\\\'" content)) 1797 (replace-regexp-in-string "\\\\\"" "\"" (replace-regexp-in-string "\\([^\\\\]\\)'" "\\1\\\\'" content))
1798 (replace-regexp-in-string "\\\\\'" "'" (replace-regexp-in-string "\\([^\\\\]\\)\"" "\\1\\\\\"" content)))) 1798 (replace-regexp-in-string "\\\\'" "'" (replace-regexp-in-string "\\([^\\\\]\\)\"" "\\1\\\\\"" content))))
1799 (let ((orig-point (point))) 1799 (let ((orig-point (point)))
1800 (delete-region min max) 1800 (delete-region min max)
1801 (insert 1801 (insert
@@ -2192,7 +2192,7 @@ See `font-lock-syntax-table'.")
2192 ;; Constants. 2192 ;; Constants.
2193 ("\\(?:\\_<\\|::\\)\\([A-Z]+\\(\\w\\|_\\)*\\)" 2193 ("\\(?:\\_<\\|::\\)\\([A-Z]+\\(\\w\\|_\\)*\\)"
2194 1 (unless (eq ?\( (char-after)) font-lock-type-face)) 2194 1 (unless (eq ?\( (char-after)) font-lock-type-face))
2195 ("\\(^\\s *\\|[\[\{\(,]\\s *\\|\\sw\\s +\\)\\(\\(\\sw\\|_\\)+\\):[^:]" 2195 ("\\(^\\s *\\|[[{(,]\\s *\\|\\sw\\s +\\)\\(\\(\\sw\\|_\\)+\\):[^:]"
2196 (2 font-lock-constant-face)) 2196 (2 font-lock-constant-face))
2197 ;; Conversion methods on Kernel. 2197 ;; Conversion methods on Kernel.
2198 (,(concat ruby-font-lock-keyword-beg-re 2198 (,(concat ruby-font-lock-keyword-beg-re