diff options
| author | Joakim Verona | 2013-07-14 11:04:49 +0200 |
|---|---|---|
| committer | Joakim Verona | 2013-07-14 11:04:49 +0200 |
| commit | 0bb9bb0841d89fff09820a57369df4cb01b16b43 (patch) | |
| tree | 832bf9fa8415eef0ce464d22b3ee1300cfa90bb1 /lisp/progmodes | |
| parent | 3718127221fbbc31f8ebd027ab7c95403dbe9118 (diff) | |
| parent | 3af1c8684ed6e48fbc21481d129e9aa164752c6e (diff) | |
| download | emacs-0bb9bb0841d89fff09820a57369df4cb01b16b43.tar.gz emacs-0bb9bb0841d89fff09820a57369df4cb01b16b43.zip | |
Merge branch 'trunk' into xwidget
Conflicts:
src/xdisp.c
Diffstat (limited to 'lisp/progmodes')
| -rw-r--r-- | lisp/progmodes/cc-engine.el | 32 | ||||
| -rw-r--r-- | lisp/progmodes/cfengine.el | 4 | ||||
| -rw-r--r-- | lisp/progmodes/ebrowse.el | 23 | ||||
| -rw-r--r-- | lisp/progmodes/gdb-mi.el | 23 | ||||
| -rw-r--r-- | lisp/progmodes/python.el | 9 | ||||
| -rw-r--r-- | lisp/progmodes/ruby-mode.el | 108 |
6 files changed, 124 insertions, 75 deletions
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 9077bdbb513..a3bd000a4f3 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el | |||
| @@ -6892,7 +6892,7 @@ comment at the start of cc-engine.el for more info." | |||
| 6892 | (while (and (looking-at c-type-decl-prefix-key) | 6892 | (while (and (looking-at c-type-decl-prefix-key) |
| 6893 | (if (and (c-major-mode-is 'c++-mode) | 6893 | (if (and (c-major-mode-is 'c++-mode) |
| 6894 | (match-beginning 3)) | 6894 | (match-beginning 3)) |
| 6895 | ;; If the second submatch matches in C++ then | 6895 | ;; If the third submatch matches in C++ then |
| 6896 | ;; we're looking at an identifier that's a | 6896 | ;; we're looking at an identifier that's a |
| 6897 | ;; prefix only if it specifies a member pointer. | 6897 | ;; prefix only if it specifies a member pointer. |
| 6898 | (when (setq got-identifier (c-forward-name)) | 6898 | (when (setq got-identifier (c-forward-name)) |
| @@ -7193,19 +7193,23 @@ comment at the start of cc-engine.el for more info." | |||
| 7193 | ;; uncommon (e.g. some placements of "const" in C++) it's not worth | 7193 | ;; uncommon (e.g. some placements of "const" in C++) it's not worth |
| 7194 | ;; the effort to look for them.) | 7194 | ;; the effort to look for them.) |
| 7195 | 7195 | ||
| 7196 | (unless (or at-decl-end (looking-at "=[^=]")) | 7196 | ;;; 2008-04-16: commented out the next form, to allow the function to recognize |
| 7197 | ;; If this is a declaration it should end here or its initializer(*) | 7197 | ;;; "foo (int bar)" in CC (an implicit type (in class foo) without a semicolon) |
| 7198 | ;; should start here, so check for allowed separation tokens. Note | 7198 | ;;; as a(n almost complete) declaration, enabling it to be fontified. |
| 7199 | ;; that this rule doesn't work e.g. with a K&R arglist after a | 7199 | ;; CASE 13 |
| 7200 | ;; function header. | 7200 | ;; (unless (or at-decl-end (looking-at "=[^=]")) |
| 7201 | ;; | 7201 | ;; If this is a declaration it should end here or its initializer(*) |
| 7202 | ;; *) Don't check for C++ style initializers using parens | 7202 | ;; should start here, so check for allowed separation tokens. Note |
| 7203 | ;; since those already have been matched as suffixes. | 7203 | ;; that this rule doesn't work e.g. with a K&R arglist after a |
| 7204 | ;; | 7204 | ;; function header. |
| 7205 | ;; If `at-decl-or-cast' is then we've found some other sign that | 7205 | ;; |
| 7206 | ;; it's a declaration or cast, so then it's probably an | 7206 | ;; *) Don't check for C++ style initializers using parens |
| 7207 | ;; invalid/unfinished one. | 7207 | ;; since those already have been matched as suffixes. |
| 7208 | (throw 'at-decl-or-cast at-decl-or-cast)) | 7208 | ;; |
| 7209 | ;; If `at-decl-or-cast' is then we've found some other sign that | ||
| 7210 | ;; it's a declaration or cast, so then it's probably an | ||
| 7211 | ;; invalid/unfinished one. | ||
| 7212 | ;; (throw 'at-decl-or-cast at-decl-or-cast)) | ||
| 7209 | 7213 | ||
| 7210 | ;; Below are tests that only should be applied when we're certain to | 7214 | ;; Below are tests that only should be applied when we're certain to |
| 7211 | ;; not have parsed halfway through an expression. | 7215 | ;; not have parsed halfway through an expression. |
diff --git a/lisp/progmodes/cfengine.el b/lisp/progmodes/cfengine.el index 55d5b8b0be7..85a9074760d 100644 --- a/lisp/progmodes/cfengine.el +++ b/lisp/progmodes/cfengine.el | |||
| @@ -387,10 +387,10 @@ Intended as the value of `indent-line-function'." | |||
| 387 | (skip-chars-forward " \t") | 387 | (skip-chars-forward " \t") |
| 388 | (current-column))) | 388 | (current-column))) |
| 389 | (error nil))) | 389 | (error nil))) |
| 390 | ;; Inside a string and it starts before this line. | 390 | ;; Inside a string and it starts before this line: do nothing. |
| 391 | ((and (nth 3 parse) | 391 | ((and (nth 3 parse) |
| 392 | (< (nth 8 parse) (save-excursion (beginning-of-line) (point)))) | 392 | (< (nth 8 parse) (save-excursion (beginning-of-line) (point)))) |
| 393 | (indent-line-to 0)) | 393 | ) |
| 394 | 394 | ||
| 395 | ;; Inside a defun, but not a nested list (depth is 1). This is | 395 | ;; Inside a defun, but not a nested list (depth is 1). This is |
| 396 | ;; a promise, usually. | 396 | ;; a promise, usually. |
diff --git a/lisp/progmodes/ebrowse.el b/lisp/progmodes/ebrowse.el index 4957b58d469..6a71ab330a8 100644 --- a/lisp/progmodes/ebrowse.el +++ b/lisp/progmodes/ebrowse.el | |||
| @@ -33,12 +33,12 @@ | |||
| 33 | 33 | ||
| 34 | ;;; Code: | 34 | ;;; Code: |
| 35 | 35 | ||
| 36 | (require 'cl-lib) | ||
| 36 | (require 'easymenu) | 37 | (require 'easymenu) |
| 37 | (require 'view) | 38 | (require 'view) |
| 38 | (require 'ebuff-menu) | 39 | (require 'ebuff-menu) |
| 39 | 40 | ||
| 40 | (eval-when-compile | 41 | (eval-when-compile |
| 41 | (require 'cl-lib) | ||
| 42 | (require 'helper)) | 42 | (require 'helper)) |
| 43 | 43 | ||
| 44 | 44 | ||
| @@ -233,19 +233,6 @@ Compare items with `eq' or TEST if specified." | |||
| 233 | found)) | 233 | found)) |
| 234 | 234 | ||
| 235 | 235 | ||
| 236 | (defun ebrowse-delete-if-not (predicate list) | ||
| 237 | "Remove elements not satisfying PREDICATE from LIST and return the result. | ||
| 238 | This is a destructive operation." | ||
| 239 | (let (result) | ||
| 240 | (while list | ||
| 241 | (let ((next (cdr list))) | ||
| 242 | (when (funcall predicate (car list)) | ||
| 243 | (setq result (nconc result list)) | ||
| 244 | (setf (cdr list) nil)) | ||
| 245 | (setq list next))) | ||
| 246 | result)) | ||
| 247 | |||
| 248 | |||
| 249 | (defmacro ebrowse-output (&rest body) | 236 | (defmacro ebrowse-output (&rest body) |
| 250 | "Eval BODY with a writable current buffer. | 237 | "Eval BODY with a writable current buffer. |
| 251 | Preserve buffer's modified state." | 238 | Preserve buffer's modified state." |
| @@ -1310,17 +1297,17 @@ With PREFIX, insert that many filenames." | |||
| 1310 | 1297 | ||
| 1311 | (defun ebrowse-browser-buffer-list () | 1298 | (defun ebrowse-browser-buffer-list () |
| 1312 | "Return a list of all tree or member buffers." | 1299 | "Return a list of all tree or member buffers." |
| 1313 | (ebrowse-delete-if-not 'ebrowse-buffer-p (buffer-list))) | 1300 | (cl-delete-if-not 'ebrowse-buffer-p (buffer-list))) |
| 1314 | 1301 | ||
| 1315 | 1302 | ||
| 1316 | (defun ebrowse-member-buffer-list () | 1303 | (defun ebrowse-member-buffer-list () |
| 1317 | "Return a list of all member buffers." | 1304 | "Return a list of all member buffers." |
| 1318 | (ebrowse-delete-if-not 'ebrowse-member-buffer-p (buffer-list))) | 1305 | (cl-delete-if-not 'ebrowse-member-buffer-p (buffer-list))) |
| 1319 | 1306 | ||
| 1320 | 1307 | ||
| 1321 | (defun ebrowse-tree-buffer-list () | 1308 | (defun ebrowse-tree-buffer-list () |
| 1322 | "Return a list of all tree buffers." | 1309 | "Return a list of all tree buffers." |
| 1323 | (ebrowse-delete-if-not 'ebrowse-tree-buffer-p (buffer-list))) | 1310 | (cl-delete-if-not 'ebrowse-tree-buffer-p (buffer-list))) |
| 1324 | 1311 | ||
| 1325 | 1312 | ||
| 1326 | (defun ebrowse-known-class-trees-buffer-list () | 1313 | (defun ebrowse-known-class-trees-buffer-list () |
| @@ -1341,7 +1328,7 @@ one buffer. Prefer tree buffers over member buffers." | |||
| 1341 | 1328 | ||
| 1342 | (defun ebrowse-same-tree-member-buffer-list () | 1329 | (defun ebrowse-same-tree-member-buffer-list () |
| 1343 | "Return a list of members buffers with same tree as current buffer." | 1330 | "Return a list of members buffers with same tree as current buffer." |
| 1344 | (ebrowse-delete-if-not | 1331 | (cl-delete-if-not |
| 1345 | (lambda (buffer) | 1332 | (lambda (buffer) |
| 1346 | (eq (buffer-local-value 'ebrowse--tree buffer) | 1333 | (eq (buffer-local-value 'ebrowse--tree buffer) |
| 1347 | ebrowse--tree)) | 1334 | ebrowse--tree)) |
diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index 2c4d6a0e3d7..10472ec5815 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el | |||
| @@ -1759,6 +1759,9 @@ static char *magick[] = { | |||
| 1759 | As long as GDB is in the recursive reading loop, it does not expect | 1759 | As long as GDB is in the recursive reading loop, it does not expect |
| 1760 | commands to be prefixed by \"-interpreter-exec console\".") | 1760 | commands to be prefixed by \"-interpreter-exec console\".") |
| 1761 | 1761 | ||
| 1762 | (defun gdb-strip-string-backslash (string) | ||
| 1763 | (replace-regexp-in-string "\\\\$" "" string)) | ||
| 1764 | |||
| 1762 | (defun gdb-send (proc string) | 1765 | (defun gdb-send (proc string) |
| 1763 | "A comint send filter for gdb." | 1766 | "A comint send filter for gdb." |
| 1764 | (with-current-buffer gud-comint-buffer | 1767 | (with-current-buffer gud-comint-buffer |
| @@ -1766,10 +1769,15 @@ commands to be prefixed by \"-interpreter-exec console\".") | |||
| 1766 | (remove-text-properties (point-min) (point-max) '(face)))) | 1769 | (remove-text-properties (point-min) (point-max) '(face)))) |
| 1767 | ;; mimic <RET> key to repeat previous command in GDB | 1770 | ;; mimic <RET> key to repeat previous command in GDB |
| 1768 | (if (not (string= "" string)) | 1771 | (if (not (string= "" string)) |
| 1769 | (setq gdb-last-command string) | 1772 | (if gdb-continuation |
| 1770 | (if gdb-last-command (setq string gdb-last-command))) | 1773 | (setq gdb-last-command (concat gdb-continuation |
| 1771 | (if (or (string-match "^-" string) | 1774 | (gdb-strip-string-backslash string) |
| 1772 | (> gdb-control-level 0)) | 1775 | " ")) |
| 1776 | (setq gdb-last-command (gdb-strip-string-backslash string))) | ||
| 1777 | (if gdb-last-command (setq string gdb-last-command)) | ||
| 1778 | (setq gdb-continuation nil)) | ||
| 1779 | (if (and (not gdb-continuation) (or (string-match "^-" string) | ||
| 1780 | (> gdb-control-level 0))) | ||
| 1773 | ;; Either MI command or we are feeding GDB's recursive reading loop. | 1781 | ;; Either MI command or we are feeding GDB's recursive reading loop. |
| 1774 | (progn | 1782 | (progn |
| 1775 | (setq gdb-first-done-or-error t) | 1783 | (setq gdb-first-done-or-error t) |
| @@ -1779,10 +1787,13 @@ commands to be prefixed by \"-interpreter-exec console\".") | |||
| 1779 | (setq gdb-control-level (1- gdb-control-level)))) | 1787 | (setq gdb-control-level (1- gdb-control-level)))) |
| 1780 | ;; CLI command | 1788 | ;; CLI command |
| 1781 | (if (string-match "\\\\$" string) | 1789 | (if (string-match "\\\\$" string) |
| 1782 | (setq gdb-continuation (concat gdb-continuation string "\n")) | 1790 | (setq gdb-continuation |
| 1791 | (concat gdb-continuation (gdb-strip-string-backslash | ||
| 1792 | string) | ||
| 1793 | " ")) | ||
| 1783 | (setq gdb-first-done-or-error t) | 1794 | (setq gdb-first-done-or-error t) |
| 1784 | (let ((to-send (concat "-interpreter-exec console " | 1795 | (let ((to-send (concat "-interpreter-exec console " |
| 1785 | (gdb-mi-quote string) | 1796 | (gdb-mi-quote (concat gdb-continuation string " ")) |
| 1786 | "\n"))) | 1797 | "\n"))) |
| 1787 | (if gdb-enable-debug | 1798 | (if gdb-enable-debug |
| 1788 | (push (cons 'mi-send to-send) gdb-debug-log)) | 1799 | (push (cons 'mi-send to-send) gdb-debug-log)) |
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 915b52ce04d..62870f9085b 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -3091,7 +3091,12 @@ you are doing." | |||
| 3091 | ;; Stop collecting nodes after moving to a position with | 3091 | ;; Stop collecting nodes after moving to a position with |
| 3092 | ;; indentation equaling min-indent. This is specially | 3092 | ;; indentation equaling min-indent. This is specially |
| 3093 | ;; useful for navigating nested definitions recursively. | 3093 | ;; useful for navigating nested definitions recursively. |
| 3094 | tree) | 3094 | (if (> num-children 0) |
| 3095 | tree | ||
| 3096 | ;; When there are no children, the collected tree is a | ||
| 3097 | ;; single node intended to be added in the list of defuns | ||
| 3098 | ;; of its parent. | ||
| 3099 | (car tree))) | ||
| 3095 | (t | 3100 | (t |
| 3096 | (python-imenu--build-tree | 3101 | (python-imenu--build-tree |
| 3097 | min-indent | 3102 | min-indent |
| @@ -3131,7 +3136,7 @@ you are doing." | |||
| 3131 | (cons | 3136 | (cons |
| 3132 | (prog1 | 3137 | (prog1 |
| 3133 | (python-imenu--build-tree | 3138 | (python-imenu--build-tree |
| 3134 | prev-indent indent 1 (list (cons label pos))) | 3139 | prev-indent indent 0 (list (cons label pos))) |
| 3135 | ;; Adjustment: after scanning backwards | 3140 | ;; Adjustment: after scanning backwards |
| 3136 | ;; for all deeper children, we need to | 3141 | ;; for all deeper children, we need to |
| 3137 | ;; continue our scan for a parent from | 3142 | ;; continue our scan for a parent from |
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index 0292e40b986..0b83921504b 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el | |||
| @@ -990,13 +990,14 @@ calculating indentation on the lines after it." | |||
| 990 | (defun ruby-move-to-block (n) | 990 | (defun ruby-move-to-block (n) |
| 991 | "Move to the beginning (N < 0) or the end (N > 0) of the | 991 | "Move to the beginning (N < 0) or the end (N > 0) of the |
| 992 | current block, a sibling block, or an outer block. Do that (abs N) times." | 992 | current block, a sibling block, or an outer block. Do that (abs N) times." |
| 993 | (back-to-indentation) | ||
| 993 | (let ((signum (if (> n 0) 1 -1)) | 994 | (let ((signum (if (> n 0) 1 -1)) |
| 994 | (backward (< n 0)) | 995 | (backward (< n 0)) |
| 995 | (depth (or (nth 2 (ruby-parse-region (line-beginning-position) | 996 | (depth (or (nth 2 (ruby-parse-region (point) (line-end-position))) 0)) |
| 996 | (line-end-position))) | ||
| 997 | 0)) | ||
| 998 | case-fold-search | 997 | case-fold-search |
| 999 | down done) | 998 | down done) |
| 999 | (when (looking-at ruby-block-mid-re) | ||
| 1000 | (setq depth (+ depth signum))) | ||
| 1000 | (when (< (* depth signum) 0) | 1001 | (when (< (* depth signum) 0) |
| 1001 | ;; Moving end -> end or beginning -> beginning. | 1002 | ;; Moving end -> end or beginning -> beginning. |
| 1002 | (setq depth 0)) | 1003 | (setq depth 0)) |
| @@ -1033,22 +1034,16 @@ current block, a sibling block, or an outer block. Do that (abs N) times." | |||
| 1033 | (unless (car state) ; Line ends with unfinished string. | 1034 | (unless (car state) ; Line ends with unfinished string. |
| 1034 | (setq depth (+ (nth 2 state) depth)))) | 1035 | (setq depth (+ (nth 2 state) depth)))) |
| 1035 | (cond | 1036 | (cond |
| 1036 | ;; Deeper indentation, we found a block. | 1037 | ;; Increased depth, we found a block. |
| 1037 | ;; FIXME: We can't recognize empty blocks this way. | ||
| 1038 | ((> (* signum depth) 0) | 1038 | ((> (* signum depth) 0) |
| 1039 | (setq down t)) | 1039 | (setq down t)) |
| 1040 | ;; Block found, and same indentation as when started, stop. | 1040 | ;; We're at the same depth as when we started, and we've |
| 1041 | ;; encountered a block before. Stop. | ||
| 1041 | ((and down (zerop depth)) | 1042 | ((and down (zerop depth)) |
| 1042 | (setq done t)) | 1043 | (setq done t)) |
| 1043 | ;; Shallower indentation, means outer block, can stop now. | 1044 | ;; Lower depth, means outer block, can stop now. |
| 1044 | ((< (* signum depth) 0) | 1045 | ((< (* signum depth) 0) |
| 1045 | (setq done t))))) | 1046 | (setq done t))))))) |
| 1046 | (if done | ||
| 1047 | (save-excursion | ||
| 1048 | (back-to-indentation) | ||
| 1049 | ;; Not really at the first or last line of the block, move on. | ||
| 1050 | (if (looking-at (concat "\\<\\(" ruby-block-mid-re "\\)\\>")) | ||
| 1051 | (setq done nil)))))) | ||
| 1052 | (back-to-indentation))) | 1047 | (back-to-indentation))) |
| 1053 | 1048 | ||
| 1054 | (defun ruby-beginning-of-block (&optional arg) | 1049 | (defun ruby-beginning-of-block (&optional arg) |
| @@ -1356,7 +1351,7 @@ If the result is do-end block, it will always be multiline." | |||
| 1356 | (progn | 1351 | (progn |
| 1357 | (eval-and-compile | 1352 | (eval-and-compile |
| 1358 | (defconst ruby-percent-literal-beg-re | 1353 | (defconst ruby-percent-literal-beg-re |
| 1359 | "\\(%\\)[qQrswWx]?\\([[:punct:]]\\)" | 1354 | "\\(%\\)[qQrswWxIi]?\\([[:punct:]]\\)" |
| 1360 | "Regexp to match the beginning of percent literal.") | 1355 | "Regexp to match the beginning of percent literal.") |
| 1361 | 1356 | ||
| 1362 | (defconst ruby-syntax-methods-before-regexp | 1357 | (defconst ruby-syntax-methods-before-regexp |
| @@ -1392,7 +1387,7 @@ It will be properly highlighted even when the call omits parens.") | |||
| 1392 | (funcall | 1387 | (funcall |
| 1393 | (syntax-propertize-rules | 1388 | (syntax-propertize-rules |
| 1394 | ;; $' $" $` .... are variables. | 1389 | ;; $' $" $` .... are variables. |
| 1395 | ;; ?' ?" ?` are ascii codes. | 1390 | ;; ?' ?" ?` are character literals (one-char strings in 1.9+). |
| 1396 | ("\\([?$]\\)[#\"'`]" | 1391 | ("\\([?$]\\)[#\"'`]" |
| 1397 | (1 (unless (save-excursion | 1392 | (1 (unless (save-excursion |
| 1398 | ;; Not within a string. | 1393 | ;; Not within a string. |
| @@ -1523,7 +1518,7 @@ It will be properly highlighted even when the call omits parens.") | |||
| 1523 | (save-match-data | 1518 | (save-match-data |
| 1524 | (save-excursion | 1519 | (save-excursion |
| 1525 | (goto-char (nth 8 parse-state)) | 1520 | (goto-char (nth 8 parse-state)) |
| 1526 | (looking-at "%\\(?:[QWrx]\\|\\W\\)"))))))) | 1521 | (looking-at "%\\(?:[QWrxI]\\|\\W\\)"))))))) |
| 1527 | 1522 | ||
| 1528 | (defun ruby-syntax-propertize-expansions (start end) | 1523 | (defun ruby-syntax-propertize-expansions (start end) |
| 1529 | (save-excursion | 1524 | (save-excursion |
| @@ -1726,7 +1721,7 @@ See `font-lock-syntax-table'.") | |||
| 1726 | (defconst ruby-font-lock-keywords | 1721 | (defconst ruby-font-lock-keywords |
| 1727 | (list | 1722 | (list |
| 1728 | ;; functions | 1723 | ;; functions |
| 1729 | '("^\\s *def\\s +\\([^( \t\n]+\\)" | 1724 | '("^\\s *def\\s +\\(?:[^( \t\n.]*\\.\\)?\\([^( \t\n]+\\)" |
| 1730 | 1 font-lock-function-name-face) | 1725 | 1 font-lock-function-name-face) |
| 1731 | (list (concat | 1726 | (list (concat |
| 1732 | "\\(^\\|[^.@$]\\|\\.\\.\\)\\(" | 1727 | "\\(^\\|[^.@$]\\|\\.\\.\\)\\(" |
| @@ -1767,31 +1762,66 @@ See `font-lock-syntax-table'.") | |||
| 1767 | "yield") | 1762 | "yield") |
| 1768 | 'symbols) | 1763 | 'symbols) |
| 1769 | "\\|" | 1764 | "\\|" |
| 1770 | ;; keyword-like methods on Kernel and Module | ||
| 1771 | (regexp-opt | 1765 | (regexp-opt |
| 1772 | '("alias_method" | 1766 | ;; built-in methods on Kernel |
| 1767 | '("__callee__" | ||
| 1768 | "__dir__" | ||
| 1769 | "__method__" | ||
| 1770 | "abort" | ||
| 1771 | "at_exit" | ||
| 1773 | "autoload" | 1772 | "autoload" |
| 1773 | "autoload?" | ||
| 1774 | "binding" | ||
| 1775 | "block_given?" | ||
| 1776 | "caller" | ||
| 1777 | "catch" | ||
| 1778 | "eval" | ||
| 1779 | "exec" | ||
| 1780 | "exit" | ||
| 1781 | "exit!" | ||
| 1782 | "fail" | ||
| 1783 | "fork" | ||
| 1784 | "format" | ||
| 1785 | "lambda" | ||
| 1786 | "load" | ||
| 1787 | "loop" | ||
| 1788 | "open" | ||
| 1789 | "p" | ||
| 1790 | "print" | ||
| 1791 | "printf" | ||
| 1792 | "proc" | ||
| 1793 | "putc" | ||
| 1794 | "puts" | ||
| 1795 | "raise" | ||
| 1796 | "rand" | ||
| 1797 | "readline" | ||
| 1798 | "readlines" | ||
| 1799 | "require" | ||
| 1800 | "require_relative" | ||
| 1801 | "sleep" | ||
| 1802 | "spawn" | ||
| 1803 | "sprintf" | ||
| 1804 | "srand" | ||
| 1805 | "syscall" | ||
| 1806 | "system" | ||
| 1807 | "throw" | ||
| 1808 | "trap" | ||
| 1809 | "warn" | ||
| 1810 | ;; keyword-like private methods on Module | ||
| 1811 | "alias_method" | ||
| 1774 | "attr" | 1812 | "attr" |
| 1775 | "attr_accessor" | 1813 | "attr_accessor" |
| 1776 | "attr_reader" | 1814 | "attr_reader" |
| 1777 | "attr_writer" | 1815 | "attr_writer" |
| 1778 | "catch" | ||
| 1779 | "define_method" | 1816 | "define_method" |
| 1780 | "extend" | 1817 | "extend" |
| 1781 | "fail" | ||
| 1782 | "include" | 1818 | "include" |
| 1783 | "lambda" | ||
| 1784 | "loop" | ||
| 1785 | "module_function" | 1819 | "module_function" |
| 1820 | "prepend" | ||
| 1786 | "private" | 1821 | "private" |
| 1787 | "proc" | ||
| 1788 | "protected" | 1822 | "protected" |
| 1789 | "public" | 1823 | "public" |
| 1790 | "raise" | ||
| 1791 | "refine" | 1824 | "refine" |
| 1792 | "require" | ||
| 1793 | "require_relative" | ||
| 1794 | "throw" | ||
| 1795 | "using") | 1825 | "using") |
| 1796 | 'symbols) | 1826 | 'symbols) |
| 1797 | "\\)") | 1827 | "\\)") |
| @@ -1799,12 +1829,16 @@ See `font-lock-syntax-table'.") | |||
| 1799 | '(if (match-beginning 4) | 1829 | '(if (match-beginning 4) |
| 1800 | font-lock-builtin-face | 1830 | font-lock-builtin-face |
| 1801 | font-lock-keyword-face)) | 1831 | font-lock-keyword-face)) |
| 1832 | ;; Perl-ish keywords | ||
| 1833 | "\\_<\\(?:BEGIN\\|END\\)\\_>\\|^__END__$" | ||
| 1802 | ;; here-doc beginnings | 1834 | ;; here-doc beginnings |
| 1803 | `(,ruby-here-doc-beg-re 0 (unless (ruby-singleton-class-p (match-beginning 0)) | 1835 | `(,ruby-here-doc-beg-re 0 (unless (ruby-singleton-class-p (match-beginning 0)) |
| 1804 | 'font-lock-string-face)) | 1836 | 'font-lock-string-face)) |
| 1805 | ;; variables | 1837 | ;; variables |
| 1806 | '("\\(^\\|[^.@$]\\|\\.\\.\\)\\_<\\(nil\\|self\\|true\\|false\\)\\>" | 1838 | '("\\(^\\|[^.@$]\\|\\.\\.\\)\\_<\\(nil\\|self\\|true\\|false\\)\\>" |
| 1807 | 2 font-lock-variable-name-face) | 1839 | 2 font-lock-variable-name-face) |
| 1840 | ;; keywords that evaluate to certain values | ||
| 1841 | '("\\_<__\\(?:LINE\\|ENCODING\\|FILE\\)__\\_>" 0 font-lock-variable-name-face) | ||
| 1808 | ;; symbols | 1842 | ;; symbols |
| 1809 | '("\\(^\\|[^:]\\)\\(:\\([-+~]@?\\|[/%&|^`]\\|\\*\\*?\\|<\\(<\\|=>?\\)?\\|>[>=]?\\|===?\\|=~\\|![~=]?\\|\\[\\]=?\\|@?\\(\\w\\|_\\)+\\([!?=]\\|\\b_*\\)\\|#{[^}\n\\\\]*\\(\\\\.[^}\n\\\\]*\\)*}\\)\\)" | 1843 | '("\\(^\\|[^:]\\)\\(:\\([-+~]@?\\|[/%&|^`]\\|\\*\\*?\\|<\\(<\\|=>?\\)?\\|>[>=]?\\|===?\\|=~\\|![~=]?\\|\\[\\]=?\\|@?\\(\\w\\|_\\)+\\([!?=]\\|\\b_*\\)\\|#{[^}\n\\\\]*\\(\\\\.[^}\n\\\\]*\\)*}\\)\\)" |
| 1810 | 2 font-lock-constant-face) | 1844 | 2 font-lock-constant-face) |
| @@ -1815,14 +1849,22 @@ See `font-lock-syntax-table'.") | |||
| 1815 | 0 font-lock-variable-name-face) | 1849 | 0 font-lock-variable-name-face) |
| 1816 | ;; constants | 1850 | ;; constants |
| 1817 | '("\\(?:\\_<\\|::\\)\\([A-Z]+\\(\\w\\|_\\)*\\)" | 1851 | '("\\(?:\\_<\\|::\\)\\([A-Z]+\\(\\w\\|_\\)*\\)" |
| 1818 | 1 font-lock-type-face) | 1852 | 1 (unless (eq ?\( (char-after)) font-lock-type-face)) |
| 1819 | '("\\(^\\s *\\|[\[\{\(,]\\s *\\|\\sw\\s +\\)\\(\\(\\sw\\|_\\)+\\):[^:]" 2 font-lock-constant-face) | 1853 | '("\\(^\\s *\\|[\[\{\(,]\\s *\\|\\sw\\s +\\)\\(\\(\\sw\\|_\\)+\\):[^:]" 2 font-lock-constant-face) |
| 1854 | ;; conversion methods on Kernel | ||
| 1855 | (list (concat "\\(?:^\\|[^.@$]\\|\\.\\.\\)" | ||
| 1856 | (regexp-opt '("Array" "Complex" "Float" "Hash" | ||
| 1857 | "Integer" "Rational" "String") 'symbols)) | ||
| 1858 | 1 font-lock-builtin-face) | ||
| 1820 | ;; expression expansion | 1859 | ;; expression expansion |
| 1821 | '(ruby-match-expression-expansion | 1860 | '(ruby-match-expression-expansion |
| 1822 | 2 font-lock-variable-name-face t) | 1861 | 2 font-lock-variable-name-face t) |
| 1823 | ;; warn lower camel case | 1862 | ;; negation char |
| 1824 | ;'("\\<[a-z]+[a-z0-9]*[A-Z][A-Za-z0-9]*\\([!?]?\\|\\>\\)" | 1863 | '("[^[:alnum:]_]\\(!\\)[^=]" |
| 1825 | ; 0 font-lock-warning-face) | 1864 | 1 font-lock-negation-char-face) |
| 1865 | ;; character literals | ||
| 1866 | ;; FIXME: Support longer escape sequences. | ||
| 1867 | '("\\?\\\\?\\S " 0 font-lock-string-face) | ||
| 1826 | ) | 1868 | ) |
| 1827 | "Additional expressions to highlight in Ruby mode.") | 1869 | "Additional expressions to highlight in Ruby mode.") |
| 1828 | 1870 | ||