diff options
| author | Stefan Monnier | 2014-04-22 13:45:43 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2014-04-22 13:45:43 -0400 |
| commit | 4f96579371290b201a973072a1c2f237755bb954 (patch) | |
| tree | c75ef6ad6f1726b1954b11297f9087143918e6b3 | |
| parent | 67c477ae67ae3e83b027fb03c5d11f47fa30566c (diff) | |
| download | emacs-4f96579371290b201a973072a1c2f237755bb954.tar.gz emacs-4f96579371290b201a973072a1c2f237755bb954.zip | |
* lisp/emacs-lisp/lisp-mode.el (lisp--match-hidden-arg): New function.
(lisp-el-font-lock-keywords-2, lisp-cl-font-lock-keywords-2): Use it.
(lisp-mode-variables): Set font-lock-extra-managed-props.
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/emacs-lisp/lisp-mode.el | 25 |
2 files changed, 28 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 54e1933ecf0..4d73c602def 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,9 @@ | |||
| 1 | 2014-04-22 Stefan Monnier <monnier@iro.umontreal.ca> | 1 | 2014-04-22 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 2 | ||
| 3 | * emacs-lisp/lisp-mode.el (lisp--match-hidden-arg): New function. | ||
| 4 | (lisp-el-font-lock-keywords-2, lisp-cl-font-lock-keywords-2): Use it. | ||
| 5 | (lisp-mode-variables): Set font-lock-extra-managed-props. | ||
| 6 | |||
| 3 | * emacs-lisp/byte-run.el (function-put): New function. | 7 | * emacs-lisp/byte-run.el (function-put): New function. |
| 4 | (defun-declarations-alist): Use it. Add `pure' and `side-effect-free'. | 8 | (defun-declarations-alist): Use it. Add `pure' and `side-effect-free'. |
| 5 | * emacs-lisp/cl-macs.el (cl-defstruct, cl-struct-sequence-type) | 9 | * emacs-lisp/cl-macs.el (cl-defstruct, cl-struct-sequence-type) |
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index 11c75416ea8..30df19d5f63 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el | |||
| @@ -157,6 +157,23 @@ It has `lisp-mode-abbrev-table' as its parent." | |||
| 157 | 157 | ||
| 158 | ;;;; Font-lock support. | 158 | ;;;; Font-lock support. |
| 159 | 159 | ||
| 160 | (defun lisp--match-hidden-arg (limit) | ||
| 161 | (let ((res nil)) | ||
| 162 | (while | ||
| 163 | (let ((ppss (parse-partial-sexp (line-beginning-position) | ||
| 164 | (line-end-position) | ||
| 165 | -1))) | ||
| 166 | (if (or (>= (car ppss) 0) | ||
| 167 | (looking-at "[]) \t]*\\(;\\|$\\)")) | ||
| 168 | (progn | ||
| 169 | (forward-line 1) | ||
| 170 | (< (point) limit)) | ||
| 171 | (looking-at ".*") ;Set the match-data. | ||
| 172 | (forward-line 1) | ||
| 173 | (setq res (point)) | ||
| 174 | nil))) | ||
| 175 | res)) | ||
| 176 | |||
| 160 | (pcase-let | 177 | (pcase-let |
| 161 | ((`(,vdefs ,tdefs | 178 | ((`(,vdefs ,tdefs |
| 162 | ,el-defs-re ,cl-defs-re | 179 | ,el-defs-re ,cl-defs-re |
| @@ -348,6 +365,9 @@ It has `lisp-mode-abbrev-table' as its parent." | |||
| 348 | ;; and that they get the wrong color. | 365 | ;; and that they get the wrong color. |
| 349 | ;; ;; CL `with-' and `do-' constructs | 366 | ;; ;; CL `with-' and `do-' constructs |
| 350 | ;;("(\\(\\(do-\\|with-\\)\\(\\s_\\|\\w\\)*\\)" 1 font-lock-keyword-face) | 367 | ;;("(\\(\\(do-\\|with-\\)\\(\\s_\\|\\w\\)*\\)" 1 font-lock-keyword-face) |
| 368 | (lisp--match-hidden-arg | ||
| 369 | (0 '(face font-lock-warning-face | ||
| 370 | help-echo "Hidden behind deeper element; move to another line?"))) | ||
| 351 | )) | 371 | )) |
| 352 | "Gaudy level highlighting for Emacs Lisp mode.") | 372 | "Gaudy level highlighting for Emacs Lisp mode.") |
| 353 | 373 | ||
| @@ -378,6 +398,9 @@ It has `lisp-mode-abbrev-table' as its parent." | |||
| 378 | ;; and that they get the wrong color. | 398 | ;; and that they get the wrong color. |
| 379 | ;; ;; CL `with-' and `do-' constructs | 399 | ;; ;; CL `with-' and `do-' constructs |
| 380 | ;;("(\\(\\(do-\\|with-\\)\\(\\s_\\|\\w\\)*\\)" 1 font-lock-keyword-face) | 400 | ;;("(\\(\\(do-\\|with-\\)\\(\\s_\\|\\w\\)*\\)" 1 font-lock-keyword-face) |
| 401 | (lisp--match-hidden-arg | ||
| 402 | (0 '(face font-lock-warning-face | ||
| 403 | help-echo "Hidden behind deeper element; move to another line?"))) | ||
| 381 | )) | 404 | )) |
| 382 | "Gaudy level highlighting for Lisp modes.")) | 405 | "Gaudy level highlighting for Lisp modes.")) |
| 383 | 406 | ||
| @@ -466,10 +489,10 @@ font-lock keywords will not be case sensitive." | |||
| 466 | lisp-cl-font-lock-keywords-2)) | 489 | lisp-cl-font-lock-keywords-2)) |
| 467 | nil ,keywords-case-insensitive nil nil | 490 | nil ,keywords-case-insensitive nil nil |
| 468 | (font-lock-mark-block-function . mark-defun) | 491 | (font-lock-mark-block-function . mark-defun) |
| 492 | (font-lock-extra-managed-props help-echo) | ||
| 469 | (font-lock-syntactic-face-function | 493 | (font-lock-syntactic-face-function |
| 470 | . lisp-font-lock-syntactic-face-function))) | 494 | . lisp-font-lock-syntactic-face-function))) |
| 471 | (setq-local prettify-symbols-alist lisp--prettify-symbols-alist) | 495 | (setq-local prettify-symbols-alist lisp--prettify-symbols-alist) |
| 472 | ;; electric | ||
| 473 | (when elisp | 496 | (when elisp |
| 474 | (setq-local electric-pair-text-pairs | 497 | (setq-local electric-pair-text-pairs |
| 475 | (cons '(?\` . ?\') electric-pair-text-pairs))) | 498 | (cons '(?\` . ?\') electric-pair-text-pairs))) |