[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] trunk r117012: * lisp/emacs-lisp/lisp-mode.el (lisp--match
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] trunk r117012: * lisp/emacs-lisp/lisp-mode.el (lisp--match-hidden-arg): New function. |
Date: |
Tue, 22 Apr 2014 17:45:48 +0000 |
User-agent: |
Bazaar (2.6b2) |
------------------------------------------------------------
revno: 117012
revision-id: address@hidden
parent: address@hidden
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Tue 2014-04-22 13:45:43 -0400
message:
* 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.
modified:
lisp/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-1432
lisp/emacs-lisp/lisp-mode.el lispmode.el-20091113204419-o5vbwnq5f7feedwu-205
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2014-04-22 16:22:13 +0000
+++ b/lisp/ChangeLog 2014-04-22 17:45:43 +0000
@@ -1,5 +1,9 @@
2014-04-22 Stefan Monnier <address@hidden>
+ * 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)
=== modified file 'lisp/emacs-lisp/lisp-mode.el'
--- a/lisp/emacs-lisp/lisp-mode.el 2014-04-05 02:33:36 +0000
+++ b/lisp/emacs-lisp/lisp-mode.el 2014-04-22 17:45:43 +0000
@@ -157,6 +157,23 @@
;;;; 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 @@
;; 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 @@
;; 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 @@
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)))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] trunk r117012: * lisp/emacs-lisp/lisp-mode.el (lisp--match-hidden-arg): New function.,
Stefan Monnier <=