mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-06 06:20:55 -08:00
; elisp-mode.el: Improve consistency among face names.
Rename a couple of faces to solidify the convention that the face name 'elisp-foo' implies "references to foo", not "foo definitions". For definitions we use 'elisp-deffoo' if foo is only one word, or 'elisp-bar-baz-definition' otherwise. * lisp/progmodes/elisp-mode.el (elisp-function-reference): Rename to 'elisp-function'. (elisp-macro-call): Rename to 'elisp-macro'. (elisp-non-local-exit): (elisp-unknown-call): (elisp-special-form): * lisp/emacs-lisp/elisp-scope.el: * test/lisp/progmodes/elisp-mode-resources/semantic-highlighting.el: Update references to renamed faces.
This commit is contained in:
parent
026f3bbd8d
commit
73feb431b3
3 changed files with 41 additions and 41 deletions
|
|
@ -292,7 +292,7 @@ symbol role properties."
|
||||||
|
|
||||||
(elisp-scope-define-symbol-role function (callable)
|
(elisp-scope-define-symbol-role function (callable)
|
||||||
:doc "Function names."
|
:doc "Function names."
|
||||||
:face 'elisp-function-reference
|
:face 'elisp-function
|
||||||
:help (lambda (beg end def)
|
:help (lambda (beg end def)
|
||||||
(cond ((equal beg def) "Local function definition")
|
(cond ((equal beg def) "Local function definition")
|
||||||
(def "Local function call")
|
(def "Local function call")
|
||||||
|
|
@ -318,7 +318,7 @@ symbol role properties."
|
||||||
|
|
||||||
(elisp-scope-define-symbol-role macro (callable)
|
(elisp-scope-define-symbol-role macro (callable)
|
||||||
:doc "Macro names."
|
:doc "Macro names."
|
||||||
:face 'elisp-macro-call
|
:face 'elisp-macro
|
||||||
:help (lambda (beg end _def)
|
:help (lambda (beg end _def)
|
||||||
(if-let* ((sym (intern-soft (buffer-substring-no-properties beg end))))
|
(if-let* ((sym (intern-soft (buffer-substring-no-properties beg end))))
|
||||||
(apply-partially #'elisp--function-help-echo sym)
|
(apply-partially #'elisp--function-help-echo sym)
|
||||||
|
|
|
||||||
|
|
@ -328,19 +328,19 @@ code analysis."
|
||||||
(defface elisp-symbol-role-definition '((t :foreground "#00008b" :inherit font-lock-function-name-face))
|
(defface elisp-symbol-role-definition '((t :foreground "#00008b" :inherit font-lock-function-name-face))
|
||||||
"Face for highlighting symbol role definitions in Emacs Lisp code.")
|
"Face for highlighting symbol role definitions in Emacs Lisp code.")
|
||||||
|
|
||||||
(defface elisp-function-reference '((t :inherit font-lock-function-call-face))
|
(defface elisp-function '((t :inherit font-lock-function-call-face))
|
||||||
"Face for highlighting function calls in Emacs Lisp code.")
|
"Face for highlighting function calls in Emacs Lisp code.")
|
||||||
|
|
||||||
(defface elisp-non-local-exit '((t :inherit elisp-function-reference :underline "red"))
|
(defface elisp-non-local-exit '((t :inherit elisp-function :underline "red"))
|
||||||
"Face for highlighting calls to functions that do not return.")
|
"Face for highlighting calls to functions that do not return.")
|
||||||
|
|
||||||
(defface elisp-unknown-call '((t :inherit elisp-function-reference :foreground "#2f4f4f"))
|
(defface elisp-unknown-call '((t :inherit elisp-function :foreground "#2f4f4f"))
|
||||||
"Face for highlighting unknown functions/macros in Emacs Lisp code.")
|
"Face for highlighting unknown functions/macros in Emacs Lisp code.")
|
||||||
|
|
||||||
(defface elisp-macro-call '((t :inherit font-lock-keyword-face))
|
(defface elisp-macro '((t :inherit font-lock-keyword-face))
|
||||||
"Face for highlighting macro calls in Emacs Lisp code.")
|
"Face for highlighting macro calls in Emacs Lisp code.")
|
||||||
|
|
||||||
(defface elisp-special-form '((t :inherit elisp-macro-call))
|
(defface elisp-special-form '((t :inherit elisp-macro))
|
||||||
"Face for highlighting special forms in Emacs Lisp code.")
|
"Face for highlighting special forms in Emacs Lisp code.")
|
||||||
|
|
||||||
(defface elisp-throw-tag '((t :inherit font-lock-constant-face))
|
(defface elisp-throw-tag '((t :inherit font-lock-constant-face))
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
;;; semantic-highlighting.el --- -*- lexical-binding: t; -*-
|
;;; semantic-highlighting.el --- -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
(defun foo (bar)
|
(defun foo (bar)
|
||||||
;; ^ (elisp-macro-call font-lock-keyword-face)
|
;; ^ (elisp-macro font-lock-keyword-face)
|
||||||
;; ^ (elisp-defun font-lock-function-name-face)
|
;; ^ (elisp-defun font-lock-function-name-face)
|
||||||
;; ^ elisp-binding-variable
|
;; ^ elisp-binding-variable
|
||||||
(let ((cpa current-prefix-arg))
|
(let ((cpa current-prefix-arg))
|
||||||
|
|
@ -11,42 +11,42 @@
|
||||||
(or cpa (ignore bar)))
|
(or cpa (ignore bar)))
|
||||||
;; ^ (elisp-special-form font-lock-keyword-face)
|
;; ^ (elisp-special-form font-lock-keyword-face)
|
||||||
;; ^ elisp-bound-variable
|
;; ^ elisp-bound-variable
|
||||||
;; ^ elisp-function-reference
|
;; ^ elisp-function
|
||||||
;; ^ elisp-bound-variable
|
;; ^ elisp-bound-variable
|
||||||
)
|
)
|
||||||
|
|
||||||
(add-face-text-property
|
(add-face-text-property
|
||||||
;; ^ elisp-function-reference
|
;; ^ elisp-function
|
||||||
(point) (mark)
|
(point) (mark)
|
||||||
;; ^ elisp-function-reference
|
;; ^ elisp-function
|
||||||
;; ^ elisp-function-reference
|
;; ^ elisp-function
|
||||||
(if not-good
|
(if not-good
|
||||||
;; ^ (elisp-special-form font-lock-keyword-face)
|
;; ^ (elisp-special-form font-lock-keyword-face)
|
||||||
;; ^ elisp-free-variable
|
;; ^ elisp-free-variable
|
||||||
'error
|
'error
|
||||||
;; ^ elisp-face
|
;; ^ elisp-face
|
||||||
(message "Good.")
|
(message "Good.")
|
||||||
;; ^ elisp-function-reference
|
;; ^ elisp-function
|
||||||
'success))
|
'success))
|
||||||
;; ^ elisp-face
|
;; ^ elisp-face
|
||||||
|
|
||||||
(require 'cl-lib)
|
(require 'cl-lib)
|
||||||
;; ^ (elisp-function-reference font-lock-keyword-face)
|
;; ^ (elisp-function font-lock-keyword-face)
|
||||||
;; ^ (elisp-feature font-lock-constant-face)
|
;; ^ (elisp-feature font-lock-constant-face)
|
||||||
|
|
||||||
;; Taken from `completion-shorthand-try-completion' in minibuffer.el:
|
;; Taken from `completion-shorthand-try-completion' in minibuffer.el:
|
||||||
(defun foobaz (string table pred point)
|
(defun foobaz (string table pred point)
|
||||||
;; ^ (elisp-macro-call font-lock-keyword-face)
|
;; ^ (elisp-macro font-lock-keyword-face)
|
||||||
;; ^ (elisp-defun font-lock-function-name-face)
|
;; ^ (elisp-defun font-lock-function-name-face)
|
||||||
;; ^ ^ ^ ^ elisp-binding-variable
|
;; ^ ^ ^ ^ elisp-binding-variable
|
||||||
(cl-loop with expanded
|
(cl-loop with expanded
|
||||||
;; ^ (elisp-macro-call font-lock-keyword-face)
|
;; ^ (elisp-macro font-lock-keyword-face)
|
||||||
;; ^ elisp-binding-variable
|
;; ^ elisp-binding-variable
|
||||||
for (short . long) in
|
for (short . long) in
|
||||||
;; ^ elisp-binding-variable
|
;; ^ elisp-binding-variable
|
||||||
;; ^ elisp-binding-variable
|
;; ^ elisp-binding-variable
|
||||||
(with-current-buffer minibuffer--original-buffer
|
(with-current-buffer minibuffer--original-buffer
|
||||||
;; ^ (elisp-macro-call font-lock-keyword-face)
|
;; ^ (elisp-macro font-lock-keyword-face)
|
||||||
;; ^ elisp-free-variable
|
;; ^ elisp-free-variable
|
||||||
read-symbol-shorthands)
|
read-symbol-shorthands)
|
||||||
;; ^ elisp-free-variable
|
;; ^ elisp-free-variable
|
||||||
|
|
@ -54,27 +54,27 @@
|
||||||
;; ^ elisp-binding-variable
|
;; ^ elisp-binding-variable
|
||||||
(and (> point (length short))
|
(and (> point (length short))
|
||||||
;; ^ (elisp-special-form font-lock-keyword-face)
|
;; ^ (elisp-special-form font-lock-keyword-face)
|
||||||
;; ^ elisp-function-reference
|
;; ^ elisp-function
|
||||||
;; ^ elisp-bound-variable
|
;; ^ elisp-bound-variable
|
||||||
;; ^ elisp-function-reference
|
;; ^ elisp-function
|
||||||
;; ^ elisp-bound-variable
|
;; ^ elisp-bound-variable
|
||||||
(string-prefix-p short string)
|
(string-prefix-p short string)
|
||||||
;; ^ elisp-function-reference
|
;; ^ elisp-function
|
||||||
;; ^ elisp-bound-variable
|
;; ^ elisp-bound-variable
|
||||||
;; ^ elisp-bound-variable
|
;; ^ elisp-bound-variable
|
||||||
(try-completion (setq expanded
|
(try-completion (setq expanded
|
||||||
;; ^ elisp-function-reference
|
;; ^ elisp-function
|
||||||
;; ^ (elisp-special-form font-lock-keyword-face)
|
;; ^ (elisp-special-form font-lock-keyword-face)
|
||||||
;; ^ elisp-bound-variable
|
;; ^ elisp-bound-variable
|
||||||
(concat long
|
(concat long
|
||||||
;; ^ elisp-function-reference
|
;; ^ elisp-function
|
||||||
;; ^ elisp-bound-variable
|
;; ^ elisp-bound-variable
|
||||||
(substring
|
(substring
|
||||||
;; ^ elisp-function-reference
|
;; ^ elisp-function
|
||||||
string
|
string
|
||||||
;; ^ elisp-bound-variable
|
;; ^ elisp-bound-variable
|
||||||
(length short))))
|
(length short))))
|
||||||
;; ^ elisp-function-reference
|
;; ^ elisp-function
|
||||||
;; ^ elisp-bound-variable
|
;; ^ elisp-bound-variable
|
||||||
table pred))
|
table pred))
|
||||||
;; ^ elisp-bound-variable
|
;; ^ elisp-bound-variable
|
||||||
|
|
@ -82,44 +82,44 @@
|
||||||
when probe
|
when probe
|
||||||
;; ^ elisp-bound-variable
|
;; ^ elisp-bound-variable
|
||||||
do (message "Shorthand expansion")
|
do (message "Shorthand expansion")
|
||||||
;; ^ elisp-function-reference
|
;; ^ elisp-function
|
||||||
and return (cons expanded (max (length long)
|
and return (cons expanded (max (length long)
|
||||||
;; ^ elisp-function-reference
|
;; ^ elisp-function
|
||||||
;; ^ elisp-bound-variable
|
;; ^ elisp-bound-variable
|
||||||
;; ^ elisp-function-reference
|
;; ^ elisp-function
|
||||||
;; ^ elisp-function-reference
|
;; ^ elisp-function
|
||||||
;; ^ elisp-bound-variable
|
;; ^ elisp-bound-variable
|
||||||
(+ (- point (length short))
|
(+ (- point (length short))
|
||||||
;; ^ elisp-function-reference
|
;; ^ elisp-function
|
||||||
;; ^ elisp-function-reference
|
;; ^ elisp-function
|
||||||
;; ^ elisp-function-reference
|
;; ^ elisp-function
|
||||||
;; ^ elisp-bound-variable
|
;; ^ elisp-bound-variable
|
||||||
(length long))))))
|
(length long))))))
|
||||||
;; ^ elisp-function-reference
|
;; ^ elisp-function
|
||||||
;; ^ elisp-bound-variable
|
;; ^ elisp-bound-variable
|
||||||
|
|
||||||
(let ((foo 'bar))
|
(let ((foo 'bar))
|
||||||
;; ^ (elisp-special-form font-lock-keyword-face)
|
;; ^ (elisp-special-form font-lock-keyword-face)
|
||||||
;; ^ elisp-binding-variable
|
;; ^ elisp-binding-variable
|
||||||
(cl-flet ((foo () 'baz))
|
(cl-flet ((foo () 'baz))
|
||||||
;; ^ (elisp-macro-call font-lock-keyword-face)
|
;; ^ (elisp-macro font-lock-keyword-face)
|
||||||
;; ^ elisp-function-reference
|
;; ^ elisp-function
|
||||||
(foo)
|
(foo)
|
||||||
;; ^ elisp-function-reference
|
;; ^ elisp-function
|
||||||
(cl-macrolet ((foo () 'foo))
|
(cl-macrolet ((foo () 'foo))
|
||||||
;; ^ (elisp-macro-call font-lock-keyword-face)
|
;; ^ (elisp-macro font-lock-keyword-face)
|
||||||
;; ^ elisp-macro-call
|
;; ^ elisp-macro
|
||||||
(foo))))
|
(foo))))
|
||||||
;; ^ elisp-macro-call
|
;; ^ elisp-macro
|
||||||
|
|
||||||
(when-let* ((foo (symbol-at-point))
|
(when-let* ((foo (symbol-at-point))
|
||||||
;; ^ (elisp-macro-call font-lock-keyword-face)
|
;; ^ (elisp-macro font-lock-keyword-face)
|
||||||
;; ^ elisp-binding-variable
|
;; ^ elisp-binding-variable
|
||||||
;; ^ elisp-function-reference
|
;; ^ elisp-function
|
||||||
current-prefix-arg
|
current-prefix-arg
|
||||||
;; ^ elisp-shadowing-variable
|
;; ^ elisp-shadowing-variable
|
||||||
((commandp foo)))
|
((commandp foo)))
|
||||||
;; ^ elisp-function-reference
|
;; ^ elisp-function
|
||||||
;; ^ elisp-bound-variable
|
;; ^ elisp-bound-variable
|
||||||
foo)
|
foo)
|
||||||
;; ^ elisp-bound-variable
|
;; ^ elisp-bound-variable
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue