]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/emacs-lisp/lisp-mode.el (lisp--match-hidden-arg): New function.
authorStefan Monnier <monnier@iro.umontreal.ca>
Tue, 22 Apr 2014 17:45:43 +0000 (13:45 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Tue, 22 Apr 2014 17:45:43 +0000 (13:45 -0400)
(lisp-el-font-lock-keywords-2, lisp-cl-font-lock-keywords-2): Use it.
(lisp-mode-variables): Set font-lock-extra-managed-props.

lisp/ChangeLog
lisp/emacs-lisp/lisp-mode.el

index 54e1933ecf0e0ee3a29dff1931f47b533a31dc1f..4d73c602def3bbf9a955fef665418e71253bbee9 100644 (file)
@@ -1,5 +1,9 @@
 2014-04-22  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+       * 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.
+
        * emacs-lisp/byte-run.el (function-put): New function.
        (defun-declarations-alist): Use it.  Add `pure' and `side-effect-free'.
        * emacs-lisp/cl-macs.el (cl-defstruct, cl-struct-sequence-type)
index 11c75416ea811d2ede23b0ab3fca0166906a3c1c..30df19d5f6315cee1a7b109047fc342aa786578a 100644 (file)
@@ -157,6 +157,23 @@ It has `lisp-mode-abbrev-table' as its parent."
 
 ;;;; Font-lock support.
 
+(defun lisp--match-hidden-arg (limit)
+  (let ((res nil))
+    (while
+        (let ((ppss (parse-partial-sexp (line-beginning-position)
+                                        (line-end-position)
+                                        -1)))
+          (if (or (>= (car ppss) 0)
+                  (looking-at "[]) \t]*\\(;\\|$\\)"))
+              (progn
+                (forward-line 1)
+                (< (point) limit))
+            (looking-at ".*")           ;Set the match-data.
+           (forward-line 1)
+            (setq res (point))
+            nil)))
+    res))
+
 (pcase-let
     ((`(,vdefs ,tdefs
         ,el-defs-re ,cl-defs-re
@@ -348,6 +365,9 @@ It has `lisp-mode-abbrev-table' as its parent."
        ;; and that they get the wrong color.
        ;; ;; CL `with-' and `do-' constructs
        ;;("(\\(\\(do-\\|with-\\)\\(\\s_\\|\\w\\)*\\)" 1 font-lock-keyword-face)
+       (lisp--match-hidden-arg
+        (0 '(face font-lock-warning-face
+             help-echo "Hidden behind deeper element; move to another line?")))
        ))
     "Gaudy level highlighting for Emacs Lisp mode.")
 
@@ -378,6 +398,9 @@ It has `lisp-mode-abbrev-table' as its parent."
        ;; and that they get the wrong color.
        ;; ;; CL `with-' and `do-' constructs
        ;;("(\\(\\(do-\\|with-\\)\\(\\s_\\|\\w\\)*\\)" 1 font-lock-keyword-face)
+       (lisp--match-hidden-arg
+        (0 '(face font-lock-warning-face
+             help-echo "Hidden behind deeper element; move to another line?")))
        ))
     "Gaudy level highlighting for Lisp modes."))
 
@@ -466,10 +489,10 @@ font-lock keywords will not be case sensitive."
                lisp-cl-font-lock-keywords-2))
          nil ,keywords-case-insensitive nil nil
          (font-lock-mark-block-function . mark-defun)
+          (font-lock-extra-managed-props help-echo)
          (font-lock-syntactic-face-function
           . lisp-font-lock-syntactic-face-function)))
   (setq-local prettify-symbols-alist lisp--prettify-symbols-alist)
-  ;; electric
   (when elisp
     (setq-local electric-pair-text-pairs
                 (cons '(?\` . ?\') electric-pair-text-pairs)))