emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/auctex 3cdfdc8 19/43: Remove compatibility code for XEm


From: Tassilo Horn
Subject: [elpa] externals/auctex 3cdfdc8 19/43: Remove compatibility code for XEmacs in font-latex.el
Date: Tue, 20 Mar 2018 11:34:08 -0400 (EDT)

branch: externals/auctex
commit 3cdfdc8dd92c0c2a16a8333eeea24d0fc216fc33
Author: Mosè Giordano <address@hidden>
Commit: Mosè Giordano <address@hidden>

    Remove compatibility code for XEmacs in font-latex.el
    
    * font-latex.el (font-latex-sectioning-5-face):
    (font-latex-update-sectioning-faces):
    (font-latex-make-sectioning-faces):
    (font-latex-user-keyword-classes):
    (font-latex-fontify-script):
    (font-latex-verbatim-face):
    (font-latex-slide-title-face):
    (font-latex-setup): Remove code for compatibility with XEmacs.
---
 font-latex.el | 97 ++++++++++-------------------------------------------------
 1 file changed, 16 insertions(+), 81 deletions(-)

diff --git a/font-latex.el b/font-latex.el
index 7a6d9da..797d74f 100644
--- a/font-latex.el
+++ b/font-latex.el
@@ -155,25 +155,15 @@ correct value from document properties."
 (defconst font-latex-sectioning-max 5
   "Highest number for font-latex-sectioning-N-face")
 (defface font-latex-sectioning-5-face
-  (if (featurep 'xemacs)
-      '((((type tty pc) (class color) (background light))
-        (:foreground "blue4" :bold t))
-       (((type tty pc) (class color) (background dark))
-        (:foreground "yellow" :bold t))
-       (((class color) (background light))
-        (:bold t :foreground "blue4" :family "helvetica"))
-       (((class color) (background dark))
-        (:bold t :foreground "yellow" :family "helvetica"))
-       (t (:bold t :family "helvetica")))
-    '((((type tty pc) (class color) (background light))
-       (:foreground "blue4" :weight bold))
-      (((type tty pc) (class color) (background dark))
-       (:foreground "yellow" :weight bold))
-      (((class color) (background light))
-       (:weight bold :inherit variable-pitch :foreground "blue4"))
-      (((class color) (background dark))
-       (:weight bold :inherit variable-pitch :foreground "yellow"))
-      (t (:weight bold :inherit variable-pitch))))
+  '((((type tty pc) (class color) (background light))
+     (:foreground "blue4" :weight bold))
+    (((type tty pc) (class color) (background dark))
+     (:foreground "yellow" :weight bold))
+    (((class color) (background light))
+     (:weight bold :inherit variable-pitch :foreground "blue4"))
+    (((class color) (background dark))
+     (:weight bold :inherit variable-pitch :foreground "yellow"))
+    (t (:weight bold :inherit variable-pitch)))
   "Face for sectioning commands at level 5."
   :group 'font-latex-highlighting-faces)
 
@@ -193,19 +183,7 @@ correct value from document properties."
           (num (- max (1+ num)))
           (face-name (intern (format "font-latex-sectioning-%s-face" num))))
       (unless (get face-name 'saved-face) ; Do not touch customized faces.
-       (if (featurep 'xemacs)
-           (let ((size
-                  ;; Multiply with .9 because `face-height' returns a value
-                  ;; slightly larger than the actual font size.
-                  ;; `make-face-size' takes numeric points according to Aidan
-                  ;; Kehoe in <address@hidden> (not
-                  ;; documented).
-                  (round (* 0.9
-                            (face-height 'default)
-                            (expt height-scale (- max 1 num))))))
-             ;; (message "%s - %s" face-name size)
-             (make-face-size face-name size))
-         (set-face-attribute face-name nil :height  height-scale))))))
+       (set-face-attribute face-name nil :height  height-scale)))))
 
 (defcustom font-latex-fontify-sectioning 1.1
   "Whether to fontify sectioning macros with varying height or a color face.
@@ -244,31 +222,16 @@ Emacs."
                           (float font-latex-fontify-sectioning)
                         1.1)))
   (dotimes (num max)
-    (let* (;; reverse for XEmacs:
-          (num (- max (1+ num)))
-          (face-name (intern (format "font-latex-sectioning-%s-face" num)))
-          (f-inherit (intern (format "font-latex-sectioning-%s-face" (1+ 
num))))
-          (size (when (featurep 'xemacs)
-                  (round (* 0.9 (face-height 'default)
-                            (expt height-scale (- max 1 num)))))))
+    (let* ((num (- max (1+ num)))
+          (face-name (intern (format "font-latex-sectioning-%s-face" num))))
       (eval
        `(defface ,face-name
-         (if (featurep 'xemacs)
-             '((t (:size ,(format "%spt" size))))
-           '((t (:height ,height-scale :inherit ,f-inherit))))
          (format "Face for sectioning commands at level %s.
 
 Probably you don't want to customize this face directly.  Better
 change the base face `font-latex-sectioning-5-face' or customize the
 variable `font-latex-fontify-sectioning'." ',num)
-         :group 'font-latex-highlighting-faces))
-      (when (and (featurep 'xemacs)
-                ;; Do not touch customized  faces.
-                (not (get face-name 'saved-face)))
-       (set-face-parent face-name f-inherit)
-       ;; Explicitely set the size again to code around the bug that
-       ;; `set-face-parent' overwrites the original face size.
-       (make-face-size face-name size)))))
+         :group 'font-latex-highlighting-faces)))))
 
 (font-latex-make-sectioning-faces font-latex-sectioning-max)
 
@@ -736,10 +699,6 @@ restart Emacs."
                                :tag "Keywords with specs"
                                (group (string :tag "Keyword")
                                       (string :tag "Format specifier"))))
-                      ,(if (featurep 'xemacs)
-                           '(face :tag "Face name")
-                         '(choice (face :tag "Face name")
-                                  (custom-face-edit :tag "Face attributes")))
                       (choice :tag "Type"
                               ;; Maps to
                               ;;`font-latex-match-command-with-arguments'
@@ -869,7 +828,7 @@ locking machinery will be triggered."
 
 ;;; Subscript and superscript
 
-(defcustom font-latex-fontify-script (not (featurep 'xemacs))
+(defcustom font-latex-fontify-script t
   "If non-nil, fontify subscript and superscript strings.
 This feature does not work in XEmacs.
 
@@ -1156,9 +1115,7 @@ have changed."
 
 (defface font-latex-verbatim-face
   (let ((font (if (and (assq :inherit custom-face-attributes)
-                      (if (featurep 'xemacs)
-                          (find-face 'fixed-pitch)
-                        (facep 'fixed-pitch)))
+                      (facep 'fixed-pitch))
                  '(:inherit fixed-pitch)
                '(:family "courier"))))
     `((((class grayscale) (background light))
@@ -1200,19 +1157,8 @@ have changed."
   :group 'font-latex-highlighting-faces)
 
 (defface font-latex-slide-title-face
-  (let* ((scale 1.2)
-        (size (when (featurep 'xemacs)
-                (round (* 0.9 (face-height 'default) scale)))))
-    (if (featurep 'xemacs)
-       `((t (:bold t :family "helvetica" :size ,size)))
-      `((t (:inherit (variable-pitch font-lock-type-face)
-                    :weight bold :height ,scale)))))
   "Face for slide titles."
   :group 'font-latex-highlighting-faces)
-(when (featurep 'xemacs)
-  (set-face-parent 'font-latex-slide-title-face 'font-lock-type-face
-                  nil nil 'append))
-
 
 ;;; Setup
 
@@ -1316,19 +1262,8 @@ triggers Font Lock to recognize the change."
                       . font-latex-syntactic-face-function)
                      (font-lock-syntactic-keywords
                       . font-latex-syntactic-keywords)))))
-    ;; Cater for the idiosyncrasies of Emacs and XEmacs.
-    (if (featurep 'xemacs)
-       (progn
-         ;; XEmacs does not set these variables via `font-lock-defaults'
-         ;; but requires them to be set explicitely.
-         (mapc (lambda (alist)
-                 (set (car alist) (cdr alist))) variables)
-         ;; Has to be set to t as otherwise syntax properties will not be
-         ;; be picked up during fontification.
-         (set (make-local-variable 'lookup-syntax-properties) t))
-      (setq defaults (append defaults variables)))
     ;; Set the defaults.
-    (setq font-lock-defaults defaults))
+    (setq font-lock-defaults (append defaults variables)))
 
   ;; Make sure fontification will be refreshed if a user sets variables
   ;; influencing fontification in her file-local variables section.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]