diff options
| author | Dmitry Gutov | 2016-01-19 07:58:46 +0300 |
|---|---|---|
| committer | Dmitry Gutov | 2016-01-19 07:58:46 +0300 |
| commit | 29da1cb3e7d54f93c0b4f6de00e9fda294a0cdff (patch) | |
| tree | e35d898dcfc12238b90a5453e36ce63c885b6942 | |
| parent | 874a10b13fb2438322ac1c9b437720ada713631b (diff) | |
| download | emacs-29da1cb3e7d54f93c0b4f6de00e9fda294a0cdff.tar.gz emacs-29da1cb3e7d54f93c0b4f6de00e9fda294a0cdff.zip | |
Propertize backtick in 'def `(abc)' as symbol constituent
* lisp/progmodes/ruby-mode.el (ruby-syntax-propertize):
Propertize backtick in 'def `(abc)' as symbol constituent.
(ruby-syntax-propertize-function):
Rename to ruby-syntax-propertize.
| -rw-r--r-- | lisp/progmodes/ruby-mode.el | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index 8f08b7c9e60..969f2ed4bc4 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el | |||
| @@ -1830,7 +1830,7 @@ It will be properly highlighted even when the call omits parens.") | |||
| 1830 | "\\)\\s *") | 1830 | "\\)\\s *") |
| 1831 | "Regexp to match text that can be followed by a regular expression.")) | 1831 | "Regexp to match text that can be followed by a regular expression.")) |
| 1832 | 1832 | ||
| 1833 | (defun ruby-syntax-propertize-function (start end) | 1833 | (defun ruby-syntax-propertize (start end) |
| 1834 | "Syntactic keywords for Ruby mode. See `syntax-propertize-function'." | 1834 | "Syntactic keywords for Ruby mode. See `syntax-propertize-function'." |
| 1835 | (let (case-fold-search) | 1835 | (let (case-fold-search) |
| 1836 | (goto-char start) | 1836 | (goto-char start) |
| @@ -1856,6 +1856,8 @@ It will be properly highlighted even when the call omits parens.") | |||
| 1856 | (zerop (skip-syntax-backward "w_"))) | 1856 | (zerop (skip-syntax-backward "w_"))) |
| 1857 | (memq (preceding-char) '(?@ ?$)))) | 1857 | (memq (preceding-char) '(?@ ?$)))) |
| 1858 | (string-to-syntax "_")))) | 1858 | (string-to-syntax "_")))) |
| 1859 | ;; Backtick method redefinition. | ||
| 1860 | ("^[ \t]*def +\\(`\\)" (1 "_")) | ||
| 1859 | ;; Regular expressions. Start with matching unescaped slash. | 1861 | ;; Regular expressions. Start with matching unescaped slash. |
| 1860 | ("\\(?:\\=\\|[^\\]\\)\\(?:\\\\\\\\\\)*\\(/\\)" | 1862 | ("\\(?:\\=\\|[^\\]\\)\\(?:\\\\\\\\\\)*\\(/\\)" |
| 1861 | (1 (let ((state (save-excursion (syntax-ppss (match-beginning 1))))) | 1863 | (1 (let ((state (save-excursion (syntax-ppss (match-beginning 1))))) |
| @@ -1891,6 +1893,9 @@ It will be properly highlighted even when the call omits parens.") | |||
| 1891 | (1 (prog1 "|" (ruby-syntax-propertize-percent-literal end))))) | 1893 | (1 (prog1 "|" (ruby-syntax-propertize-percent-literal end))))) |
| 1892 | (point) end))) | 1894 | (point) end))) |
| 1893 | 1895 | ||
| 1896 | (define-obsolete-function-alias | ||
| 1897 | 'ruby-syntax-propertize-function 'ruby-syntax-properize "25.1") | ||
| 1898 | |||
| 1894 | (defun ruby-syntax-propertize-heredoc (limit) | 1899 | (defun ruby-syntax-propertize-heredoc (limit) |
| 1895 | (let ((ppss (syntax-ppss)) | 1900 | (let ((ppss (syntax-ppss)) |
| 1896 | (res '())) | 1901 | (res '())) |
| @@ -2252,7 +2257,7 @@ See `font-lock-syntax-table'.") | |||
| 2252 | (setq-local font-lock-keywords ruby-font-lock-keywords) | 2257 | (setq-local font-lock-keywords ruby-font-lock-keywords) |
| 2253 | (setq-local font-lock-syntax-table ruby-font-lock-syntax-table) | 2258 | (setq-local font-lock-syntax-table ruby-font-lock-syntax-table) |
| 2254 | 2259 | ||
| 2255 | (setq-local syntax-propertize-function #'ruby-syntax-propertize-function)) | 2260 | (setq-local syntax-propertize-function #'ruby-syntax-propertize)) |
| 2256 | 2261 | ||
| 2257 | ;;; Invoke ruby-mode when appropriate | 2262 | ;;; Invoke ruby-mode when appropriate |
| 2258 | 2263 | ||