]> git.eshelyaron.com Git - sweep.git/commitdiff
MODIFIED: Remove '-face' suffix from face names
authorEshel Yaron <me@eshelyaron.com>
Wed, 24 May 2023 07:10:40 +0000 (10:10 +0300)
committerEshel Yaron <me@eshelyaron.com>
Wed, 24 May 2023 09:08:52 +0000 (12:08 +0300)
Remove the '-face' suffix from the names of all defined faces as
prescribed in (info "(elisp)Defining Faces").

sweeprolog-tests.el
sweeprolog.el

index 42ebabaa3fee631eea9d2941737b344feb99f814..48b35cefd37af301850c8f7169ca07e66be2d7b3 100644 (file)
@@ -214,44 +214,44 @@ foo(Foo) :- bar.
     (sweeprolog-mode)
     (should (equal (get-text-property (+ (point-min) 1)
                                       'font-lock-face)
-                   '(sweeprolog-neck-default-face
-                     sweeprolog-directive-default-face)))
+                   '(sweeprolog-neck
+                     sweeprolog-directive)))
     (should (equal (get-text-property (+ (point-min) 2)
                                       'font-lock-face)
-                   '(sweeprolog-directive-default-face)))
+                   '(sweeprolog-directive)))
     (should (equal (get-text-property (+ (point-min) 3)
                                       'font-lock-face)
-                   '(sweeprolog-built-in-default-face
-                     sweeprolog-body-default-face)))
+                   '(sweeprolog-built-in
+                     sweeprolog-body)))
     (should (equal (get-text-property (+ (point-min) 9)
                                       'font-lock-face)
-                   '(sweeprolog-body-default-face)))
+                   '(sweeprolog-body)))
     (should (equal (get-text-property (+ (point-min) 10)
                                       'font-lock-face)
-                   '(sweeprolog-identifier-default-face
-                     sweeprolog-body-default-face)))
+                   '(sweeprolog-identifier
+                     sweeprolog-body)))
     (should (equal (get-text-property (+ (point-min) 13)
                                       'font-lock-face)
-                   '(sweeprolog-body-default-face)))
+                   '(sweeprolog-body)))
     (should (equal (get-text-property (+ (point-min) 16)
                                       'font-lock-face)
-                   '(sweeprolog-local-default-face
-                     sweeprolog-body-default-face)))
+                   '(sweeprolog-local
+                     sweeprolog-body)))
     (should (equal (get-text-property (+ (point-min) 23)
                                       'font-lock-face)
-                   '(sweeprolog-fullstop-default-face)))
+                   '(sweeprolog-fullstop)))
     (should (equal (get-text-property (+ (point-min) 26)
                                       'font-lock-face)
-                   '(sweeprolog-head-exported-default-face
-                     sweeprolog-clause-default-face)))
+                   '(sweeprolog-head-exported
+                     sweeprolog-clause)))
     (should (equal (get-text-property (+ (point-min) 31)
                                       'font-lock-face)
-                   '(sweeprolog-singleton-default-face
-                     sweeprolog-clause-default-face)))
+                   '(sweeprolog-singleton
+                     sweeprolog-clause)))
     (should (equal (get-text-property (+ (point-min) 39)
                                       'font-lock-face)
-                   '(sweeprolog-undefined-default-face
-                     sweeprolog-body-default-face)))))
+                   '(sweeprolog-undefined
+                     sweeprolog-body)))))
 
 (ert-deftest yank-hole ()
   "Test killing and yanking a hole as a plain variable."
@@ -750,8 +750,8 @@ bar(Bar) :- baz(Bar).
                (prop-match-end
                 (text-property-search-forward
                  'font-lock-face
-                 '(sweeprolog-syntax-error-default-face
-                   sweeprolog-around-syntax-error-default-face)))))))
+                 '(sweeprolog-syntax-error
+                   sweeprolog-around-syntax-error)))))))
 
 (ert-deftest file-at-point ()
   "Test recognizing file specifications."
index e0faa1418dd2c2171bdf36b13b67726c9d927566..624f2e50ab7fc5d561ee2cc0f6e479dcf40acf1d 100644 (file)
@@ -750,44 +750,44 @@ the order of the arguments is reversed."
 
 ;;;; Prolog messages
 
-(defface sweeprolog-debug-prefix-face
+(defface sweeprolog-debug-prefix
   '((default :inherit shadow))
   "Face used to highlight the \"DEBUG\" message prefix."
   :group 'sweeprolog-faces)
 
-(defvar sweeprolog-debug-prefix-face 'sweeprolog-debug-prefix-face
+(defvar sweeprolog-debug-prefix-face 'sweeprolog-debug-prefix
   "Name of the face used to highlight the \"DEBUG\" message prefix.")
 
-(defface sweeprolog-debug-topic-face
+(defface sweeprolog-debug-topic
   '((default :inherit shadow))
   "Face used to highlight the topic in debug messages."
   :group 'sweeprolog-faces)
 
-(defvar sweeprolog-debug-topic-face 'sweeprolog-debug-topic-face
+(defvar sweeprolog-debug-topic-face 'sweeprolog-debug-topic
   "Name of the face used to highlight the topic in debug messages.")
 
-(defface sweeprolog-info-prefix-face
+(defface sweeprolog-info-prefix
   '((default :inherit default))
   "Face used to highlight the \"INFO\" message prefix."
   :group 'sweeprolog-faces)
 
-(defvar sweeprolog-info-prefix-face 'sweeprolog-info-prefix-face
+(defvar sweeprolog-info-prefix-face 'sweeprolog-info-prefix
   "Name of the face used to highlight the \"INFO\" message prefix.")
 
-(defface sweeprolog-warning-prefix-face
+(defface sweeprolog-warning-prefix
   '((default :inherit font-lock-warning-face))
   "Face used to highlight the \"WARNING\" message prefix."
   :group 'sweeprolog-faces)
 
-(defvar sweeprolog-warning-prefix-face 'sweeprolog-warning-prefix-face
+(defvar sweeprolog-warning-prefix-face 'sweeprolog-warning-prefix
   "Name of the face used to highlight the \"WARNING\" message prefix.")
 
-(defface sweeprolog-error-prefix-face
+(defface sweeprolog-error-prefix
   '((default :inherit error))
   "Face used to highlight the \"ERROR\" message prefix."
   :group 'sweeprolog-faces)
 
-(defvar sweeprolog-error-prefix-face 'sweeprolog-error-prefix-face
+(defvar sweeprolog-error-prefix-face 'sweeprolog-error-prefix
   "Name of the face used to highlight the \"ERROR\" message prefix.")
 
 (defun sweeprolog-view-messages ()
@@ -1323,11 +1323,12 @@ resulting list even when found in the current clause."
     "Define sweeprolog face FACE with doc DOC."
     (declare
      (indent defun)
-     (doc-string 4))
-    (let ((func (intern (concat "sweeprolog-" (symbol-name name) "-face")))
-          (facd (intern (concat "sweeprolog-" (symbol-name name) "-dark-face")))
-          (facl (intern (concat "sweeprolog-" (symbol-name name) "-light-face")))
-          (face (intern (concat "sweeprolog-" (symbol-name name) "-default-face"))))
+     (doc-string 5))
+    (let* ((sn (symbol-name name))
+           (func (intern (concat "sweeprolog-" sn "-face")))
+           (facd (intern (concat "sweeprolog-" sn "-dark")))
+           (facl (intern (concat "sweeprolog-" sn "-light")))
+           (face (intern (concat "sweeprolog-" sn))))
       `(progn
          (defface ,facl
            '((default              . ,light))