auctex-diffs
[Top][All Lists]
Advanced

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

[AUCTeX-diffs] GNU AUCTeX branch, master, updated. 3cdfdc8dd92c0c2a16a83


From: Mosè Giordano
Subject: [AUCTeX-diffs] GNU AUCTeX branch, master, updated. 3cdfdc8dd92c0c2a16a8333eeea24d0fc216fc33
Date: Wed, 20 Dec 2017 07:03:58 -0500 (EST)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU AUCTeX".

The branch, master has been updated
       via  3cdfdc8dd92c0c2a16a8333eeea24d0fc216fc33 (commit)
       via  62d3606da37b7ec11af46efcf83d7909f63b105b (commit)
       via  bd21b34ecb22bafbd93eb18c8dc83204e17f670a (commit)
       via  f7a462295e8628ad5a01ca70044e005ceaa9c628 (commit)
      from  77c2cda99c60108cf9bb7e5706101bf8cd1ae20e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 3cdfdc8dd92c0c2a16a8333eeea24d0fc216fc33
Author: Mosè Giordano <address@hidden>
Date:   Wed Dec 20 12:58:53 2017 +0100

    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.

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.

commit 62d3606da37b7ec11af46efcf83d7909f63b105b
Author: Mosè Giordano <address@hidden>
Date:   Wed Dec 20 12:47:52 2017 +0100

    Remove compatibility code for XEmacs in tex-fold.el
    
    * tex-fold.el (TeX-fold-overfull-p):
    (TeX-fold-macro-nth-arg):
    (TeX-fold-hide-item):
    (TeX-fold-show-item):
    (TeX-fold-post-command): Remove code for compatibility with XEmacs.

diff --git a/tex-fold.el b/tex-fold.el
index 356c268..72e1a58 100644
--- a/tex-fold.el
+++ b/tex-fold.el
@@ -46,8 +46,6 @@
 
 (eval-when-compile (require 'cl))
 
-(when (featurep 'xemacs)
-  (require 'overlay))
 (require 'tex)
 (autoload 'LaTeX-forward-paragraph "latex")
 (autoload 'LaTeX-backward-paragraph "latex")
@@ -570,22 +568,20 @@ TYPE can be either 'env for environments, 'macro for 
macros or
   "Return t if an overfull line will result after adding an overlay.
 The overlay extends from OV-START to OV-END and will display the
 string DISPLAY-STRING."
-  (and (not (featurep 'xemacs)) ; Linebreaks in glyphs don't
-                               ; work in XEmacs anyway.
-       (save-excursion
-        (goto-char ov-end)
-        (search-backward "\n" ov-start t))
-       (not (string-match "\n" display-string))
-       (> (+ (- ov-start
-               (save-excursion
-                 (goto-char ov-start)
-                 (line-beginning-position)))
-            (length display-string)
-            (- (save-excursion
-                 (goto-char ov-end)
-                 (line-end-position))
-               ov-end))
-         (current-fill-column))))
+  (save-excursion
+    (goto-char ov-end)
+    (search-backward "\n" ov-start t))
+  (not (string-match "\n" display-string))
+  (> (+ (- ov-start
+          (save-excursion
+            (goto-char ov-start)
+            (line-beginning-position)))
+       (length display-string)
+       (- (save-excursion
+            (goto-char ov-end)
+            (line-end-position))
+          ov-end))
+     (current-fill-column)))
 
 (defun TeX-fold-macro-nth-arg (n macro-start &optional macro-end delims)
   "Return a property list of the argument number N of a macro.
@@ -635,12 +631,7 @@ of the resulting list."
                  (setq n (1- n)))
                t)
            (error nil))
-         (list (TeX-fold-buffer-substring content-start content-end)
-               (when (and (featurep 'xemacs)
-                          (extent-at content-start))
-                 ;; A glyph in XEmacs does not seem to be able to hold more
-                 ;; than one face, so we just use the first one we get.
-                 (car (extent-property (extent-at content-start) 'face))))
+         (list (TeX-fold-buffer-substring content-start content-end))
        nil))))
 
 (defun TeX-fold-buffer-substring (start end)
@@ -833,34 +824,20 @@ That means, put respective properties onto overlay OV."
                                  (point))))
     (overlay-put ov 'mouse-face 'highlight)
     (overlay-put ov 'display display-string)
-    (if (featurep 'xemacs)
-       (let ((glyph (make-glyph (if (listp display-string)
-                                    (car display-string)
-                                  display-string))))
-         (overlay-put ov 'invisible t)
-         (when font-lock-mode
-           (if face
-               (set-glyph-property glyph 'face face)
-             (set-glyph-property glyph 'face TeX-fold-folded-face)))
-         (set-extent-property ov 'end-glyph glyph))
-      (when font-lock-mode
-       (overlay-put ov 'face TeX-fold-folded-face))
-      (unless (zerop TeX-fold-help-echo-max-length)
-       (overlay-put ov 'help-echo (TeX-fold-make-help-echo
-                                   (overlay-start ov) (overlay-end ov)))))))
+    (when font-lock-mode
+      (overlay-put ov 'face TeX-fold-folded-face))
+    (unless (zerop TeX-fold-help-echo-max-length)
+      (overlay-put ov 'help-echo (TeX-fold-make-help-echo
+                                 (overlay-start ov) (overlay-end ov))))))
 
 (defun TeX-fold-show-item (ov)
   "Show a single LaTeX macro or environment.
 Remove the respective properties from the overlay OV."
   (overlay-put ov 'mouse-face nil)
-  (if (featurep 'xemacs)
-      (progn
-       (set-extent-property ov 'end-glyph nil)
-       (overlay-put ov 'invisible nil))
-    (overlay-put ov 'display nil)
-    (overlay-put ov 'help-echo nil)
-    (when font-lock-mode
-      (overlay-put ov 'face TeX-fold-unfolded-face))))
+  (overlay-put ov 'display nil)
+  (overlay-put ov 'help-echo nil)
+  (when font-lock-mode
+    (overlay-put ov 'face TeX-fold-unfolded-face)))
 
 ;; Copy and adaption of `reveal-post-command' from reveal.el in GNU
 ;; Emacs on 2004-07-04.
@@ -904,10 +881,7 @@ Remove the respective properties from the overlay OV."
              ;; Close old overlays.
              (dolist (ol old-ols)
                (when (and (eq (current-buffer) (overlay-buffer ol))
-                          (not (rassq ol TeX-fold-open-spots))
-                          (or (not (featurep 'xemacs))
-                              (and (featurep 'xemacs)
-                                   (not (extent-detached-p ol)))))
+                          (not (rassq ol TeX-fold-open-spots)))
                  (if (and (>= (point) (overlay-start ol))
                           (<= (point) (overlay-end ol)))
                      ;; Still near the overlay: keep it open.

commit bd21b34ecb22bafbd93eb18c8dc83204e17f670a
Author: Mosè Giordano <address@hidden>
Date:   Wed Dec 20 12:38:31 2017 +0100

    Remove code for compatibility with very old emacsens in bib-cite.el
    
    * bib-cite.el (bib-cite-minor-mode):
    (bib-cite-setup-highlight-mouse-keymap):
    (bib-cite-fontify-help-as-bibtex):
    (bib-cite-fontify-help-as-latex):
    (bib-etags):
    (bib-highlight-mouse):
    (bib-toggle-highlight):
    (bib-guess-or-prompt-for-label):
    (bib-etags-find-noselect): Remove compatibility code.

diff --git a/bib-cite.el b/bib-cite.el
index 0ff47fb..0be0eb0 100644
--- a/bib-cite.el
+++ b/bib-cite.el
@@ -759,32 +759,17 @@ runs bib-find, and [mouse-3] runs bib-display."
        (progn
          (bib-cite-setup-highlight-mouse-keymap)
          (bib-highlight-mouse)
-         (when (featurep 'xemacs)
-           (make-local-hook 'after-change-functions))
          (add-hook 'after-change-functions
-                   'bib-cite-setup-mouse-function nil t)))
-    (if (featurep 'xemacs)
-       (progn
-         (or (local-variable-p 'current-menubar (current-buffer))
-             (set-buffer-menubar current-menubar))
-         (add-submenu nil bib-cite-minor-mode-menu))))
+                   'bib-cite-setup-mouse-function nil t))))
    (t
    ;;;Undo the minor-mode
     ;; mouse overlay
-    (cond
-     ((featurep 'xemacs)
-      (while bib-ext-list
-       (delete-extent (car bib-ext-list))
-       (setq bib-ext-list (cdr bib-ext-list))))
-     (t
-      (remove-hook 'after-change-functions 'bib-cite-setup-mouse-function t)
-      (let ((before-change-functions) (after-change-functions))
-       ;; FIXME This detroys all mouse-faces and local-maps!
-       ;; FIXME Hope no other package is using them in this buffer!
-       (remove-text-properties (point-min) (point-max)
-                               '(mouse-face t local-map t)))))
-    (if (featurep 'xemacs)
-       (delete-menu-item '("BCite"))))))
+    (remove-hook 'after-change-functions 'bib-cite-setup-mouse-function t)
+    (let ((before-change-functions) (after-change-functions))
+      ;; FIXME This detroys all mouse-faces and local-maps!
+      ;; FIXME Hope no other package is using them in this buffer!
+      (remove-text-properties (point-min) (point-max)
+                             '(mouse-face t local-map t))))))
 
 ;;This must be eval'ed when the LaTeX mode is in use.
 ;; bib-highlight-mouse-keymap is a local variable so each buffer can have it's
@@ -799,46 +784,22 @@ runs bib-find, and [mouse-3] runs bib-display."
    ;;;        menus to display.  Maybe on `highlighted' commands we could only
    ;;;        display the bib-cite stuff (or a subset of it).
        (let ((m (copy-keymap (current-local-map))))
+         ;; emacs 19
          (cond
-          ((featurep 'xemacs)
-           (set-keymap-name m 'bib-highlight-mouse-keymap)
-           (cond
-            ;;action-key stuff from Vladimir Alexiev <address@hidden>
-            ((commandp 'action-key)
-             ;; for hyperbole. The Right Way is to define implicit buttons
-             ;; (defib) bib-cite and label-ref instead of overriding
-             ;; action-key and assist key, so that eg smart key help can
-             ;; be obtained, but I'm lazy.
-             (substitute-key-definition 'action-key 'bib-find m global-map)
-             (substitute-key-definition 'assist-key 'bib-display m global-map)
-             (substitute-key-definition 'action-key-depress
-                                        'bib-find-mouse m global-map)
-             (substitute-key-definition 'assist-key-depress
-                                        'bib-display-mouse m global-map)
-             (substitute-key-definition 'action-mouse-key nil m global-map)
-             (substitute-key-definition 'assist-mouse-key nil m global-map))
-            (t                               ; xemacs, not hyperbole
-             (define-key m "\e\r" 'bib-find-mouse) ;   bug Fixed in V2.17
-             (define-key m "\e\n" 'bib-display-mouse) ;bug Fixed in V2.17
-             ;;(define-key m [(shift button1)] 'bib-display-mouse)
-             (define-key m [button3] 'bib-display-mouse)
-             (define-key m [button2] 'bib-find-mouse))))
-           (t                                 ; emacs 19
-            (cond
-             ((commandp 'action-key)
-              (substitute-key-definition 'action-key 'bib-find m global-map)
-              (substitute-key-definition 'assist-key 'bib-display m global-map)
-              (substitute-key-definition 'action-mouse-key-emacs19
-                                         'bib-find-mouse m global-map)
-              (substitute-key-definition 'assist-mouse-key-emacs19
-                                         'bib-display-mouse m global-map)
-              (substitute-key-definition 'action-key-depress-emacs19
-                                         nil m global-map)
-              (substitute-key-definition 'assist-key-depress-emacs19
-                                         nil m global-map))
-             (t                               ; emacs 19, not hyperbole
-              (define-key m [down-mouse-3] 'bib-display-mouse)
-              (define-key m [mouse-2] 'bib-find-mouse)))))
+          ((commandp 'action-key)
+           (substitute-key-definition 'action-key 'bib-find m global-map)
+           (substitute-key-definition 'assist-key 'bib-display m global-map)
+           (substitute-key-definition 'action-mouse-key-emacs19
+                                      'bib-find-mouse m global-map)
+           (substitute-key-definition 'assist-mouse-key-emacs19
+                                      'bib-display-mouse m global-map)
+           (substitute-key-definition 'action-key-depress-emacs19
+                                      nil m global-map)
+           (substitute-key-definition 'assist-key-depress-emacs19
+                                      nil m global-map))
+          (t                               ; emacs 19, not hyperbole
+           (define-key m [down-mouse-3] 'bib-display-mouse)
+           (define-key m [mouse-2] 'bib-find-mouse)))
          m)))
 
 ;;;###autoload
@@ -888,83 +849,6 @@ runs bib-find, and [mouse-3] runs bib-display."
                minor-mode-map-alist)))
 
 
-;;; Add a menu entry to bibtex.el (Perhaps I should not do this).
-(cond
- ((and (featurep 'xemacs)
-       (or window-system
-          (fboundp 'smart-menu)))      ;text menus by Bob Weiner
-  ;;
-  ;; xemacs under X with AUCTeX
-  ;;
-
-  ;; Add to bibtex.el's popup menu
-  (defvar bib-cite-xemacs-bibtex-mode-menu
-    '("---"
-      "Bib-Cite"
-      "---"
-      ["Search apropos BibTeX files" bib-apropos t]
-      ["Create AUCTeX auto parsing file" bib-create-auto-file t])
-    "Submenu of bibtex-mode menu, used by bib-cite.")
-
-  (if (boundp 'bibtex-menu)
-      ;; Add menu now
-      (setq bibtex-menu
-           (append
-            bibtex-menu
-            bib-cite-xemacs-bibtex-mode-menu))
-    ;; Setup to add menu later
-    (defun bib-cite-bibtex-mode-hook ()
-      (if (boundp 'bibtex-menu)
-         (progn
-           (setq bibtex-menu
-                 (append
-                  bibtex-menu
-                  bib-cite-xemacs-bibtex-mode-menu))
-           (remove-hook 'bibtex-mode-hook 'bib-cite-bibtex-mode-hook))))
-    (add-hook 'bibtex-mode-hook 'bib-cite-bibtex-mode-hook))
-  )
-
- ((and (not (featurep 'xemacs))
-       (string-equal "19" (substring emacs-version 0 2))
-       (or window-system
-          (fboundp 'tmm-menubar)))     ; 19.30 - Will autoload if necessary
-  ;;
-  ;; emacs-19 under X-windows (or non-X with tmm)
-  ;;
-
-  ;; This *almost* makes me want to switch over to XEmacs...
-
-  ;; to AUCTeX auto file for a bibtex buffer
-  (eval-after-load
-   "bibtex"
-   '(progn
-      (add-hook 'bibtex-mode-hook 'TeX-bibtex-set-BibTeX-dialect)
-      (cond
-       ((lookup-key bibtex-mode-map [menu-bar move/edit])
-       (define-key-after
-         (lookup-key bibtex-mode-map [menu-bar move/edit])
-         [bib-nil] '("---" . nil) '"--")
-       (define-key-after
-         (lookup-key bibtex-mode-map [menu-bar move/edit])
-         [bib-apropos] '("Search Apropos" . bib-apropos) 'bib-nil)
-       (define-key-after
-         (lookup-key bibtex-mode-map [menu-bar move/edit])
-         [auc-tex-parse]
-         '("Create AUCTeX auto parsing file" . bib-create-auto-file)
-         'bib-apropos))
-       ((lookup-key bibtex-mode-map [menu-bar bibtex-edit])
-       (define-key-after
-         (lookup-key bibtex-mode-map [menu-bar bibtex-edit])
-         [bib-nil] '("---" . nil) '"--")
-       (define-key-after
-         (lookup-key bibtex-mode-map [menu-bar bibtex-edit])
-         [bib-apropos] '("Search Apropos" . bib-apropos) 'bib-nil)
-       (define-key-after
-         (lookup-key bibtex-mode-map [menu-bar bibtex-edit])
-         [auc-tex-parse]
-         '("Create AUCTeX auto parsing file" . bib-create-auto-file)
-         'bib-apropos)))))))
-
 ;; Following from bibtex.el
 (defvar
   bib-cite-bibtex-font-lock-keywords
@@ -1227,19 +1111,6 @@ to create a bibtex file containing only the references 
used in the document."
       (put-text-property (point-min)(or limit (point-max))
                         'face 'red-bold))))
 
-(when (featurep 'xemacs)
-  (defun bib-cite-fontify-help-xemacs (defaults)
-    (if (fboundp 'font-lock-set-defaults-1) ; >= XEmacs 19.14
-        (with-current-buffer "*Help*"
-          (setq font-lock-defaults-computed nil
-                font-lock-keywords nil)
-          (font-lock-set-defaults-1
-           (and defaults (font-lock-find-font-lock-defaults defaults)))
-          (font-lock-fontify-buffer)
-          (setq font-lock-defaults-computed nil
-                font-lock-keywords nil)
-          (font-lock-set-defaults-1)))))
-
 (defun bib-cite--fontify-help ()
   ;; FIXME: This looks ugly and incorrect.
   (if font-lock-mode
@@ -1254,10 +1125,6 @@ to create a bibtex file containing only the references 
used in the document."
   (cond
    ((not (featurep 'font-lock))
     nil)                                ;No font-lock! Stop here.
-   ;; font-lock under Emacs and XEmacs
-   ((featurep 'xemacs)
-    ;; XEmacs
-    (bib-cite-fontify-help-xemacs 'bibtex-mode))
    (t
     ;; Emacs
     (with-current-buffer "*Help*"
@@ -1270,11 +1137,6 @@ to create a bibtex file containing only the references 
used in the document."
   (cond
    ((not (featurep 'font-lock))
     nil)                                ;No font-lock! Stop here.
-   ;; font-lock under Emacs and XEmacs
-   ((featurep 'xemacs)
-    ;; XEmacs, not necessary to do s.th. special for font-latex, we do *not*
-    ;; want the buffer-local faces!
-    (bib-cite-fontify-help-xemacs 'latex-mode))
    (t
     ;; Emacs
     (with-current-buffer "*Help*"
@@ -1337,9 +1199,8 @@ See variables bib-etags-command and bib-etags-filename"
     ;;  buffer and returns an error because TAGS buffer does have
     ;;  tags-file-name set.
     ;;  To get around this.  I'm setting this variable in the TAGS buffer.
-    ;; Skip this in XEmacs (Changed by Anders Stenman)
-    (if (and (not (featurep 'xemacs))
-            (get-file-buffer the-tags-file))
+    ;; (Changed by Anders Stenman)
+    (if (get-file-buffer the-tags-file)
        (with-current-buffer (get-file-buffer the-tags-file)
          (set (make-local-variable 'tags-file-name) the-tags-file))))
 
@@ -1381,21 +1242,12 @@ See variables bib-etags-command and bib-etags-filename"
       ;; * peta Wed Nov  8 16:27:29 1995 -- better remove the mouse face
       ;;   properties first.
       (setq bib-ext-list nil)          ;Reconstructed below...
-      (if (featurep 'xemacs)
-         (while local-extent-list
-           (setq extent (car local-extent-list))
-           (if (or (extent-detached-p extent)
-                   (and (<= (point-min)(extent-start-position extent))
-                        (>= (point-max)(extent-end-position extent))))
-               (delete-extent extent)
-             (setq bib-ext-list (cons extent bib-ext-list)))
-           (setq local-extent-list (cdr local-extent-list)))
-       ;; Remove properties for regular emacs
-       ;; FIXME This detroys all mouse-faces and local-maps!
-       ;; FIXME Hope no other package is using them in this buffer!
-       (let ((before-change-functions) (after-change-functions))
-         (remove-text-properties (point-min) (point-max)
-                                 '(mouse-face t local-map t))))
+      ;; Remove properties for regular emacs
+      ;; FIXME This detroys all mouse-faces and local-maps!
+      ;; FIXME Hope no other package is using them in this buffer!
+      (let ((before-change-functions) (after-change-functions))
+       (remove-text-properties (point-min) (point-max)
+                               '(mouse-face t local-map t)))
       (goto-char (point-min))
       (while
          (re-search-forward
@@ -1405,29 +1257,19 @@ See variables bib-etags-command and bib-etags-filename"
           nil t)
        (setq s (match-beginning 0))
        (setq e (match-end 0))
-       (cond
-        ((featurep 'xemacs)
-         (setq extent (make-extent s e))
-         (setq bib-ext-list (cons extent bib-ext-list))
-         (set-extent-property extent 'highlight t)
-         (set-extent-property extent 'start-open t)
-         (set-extent-property extent 'balloon-help 'bib-label-help)
-         (set-extent-property extent 'help-echo 'bib-label-help-echo)
-         (set-extent-property extent 'keymap bib-highlight-mouse-keymap))
-        (t
-         (let ((before-change-functions) (after-change-functions)
-               ;;(this-overlay (make-overlay s e))
-               )
+       (let ((before-change-functions) (after-change-functions)
+             ;;(this-overlay (make-overlay s e))
+             )
 ;;;  Even using overlays doesn't help here.  If bib-highlight-mouse-keymap
 ;;;  does not include the AucTeX menus, then these disappear when we click
 ;;;  onto a \cite command.  Perhaps using bib-cite as a minor mode will fix
 ;;;  this?  For now, bib-cite must be loaded after these menus are built.
 ;;;  It must therefore be loaded in a mode-hook.
-           (put-text-property s e 'local-map bib-highlight-mouse-keymap)
-           (put-text-property s e 'mouse-face 'highlight)
+         (put-text-property s e 'local-map bib-highlight-mouse-keymap)
+         (put-text-property s e 'mouse-face 'highlight)
          ;;(overlay-put this-overlay 'local-map bib-highlight-mouse-keymap)
          ;;(overlay-put this-overlay 'mouse-face 'highlight)
-           ))))
+         ))
       (set-buffer-modified-p modified))))
 
 (defun bib-toggle-highlight ()
@@ -1438,15 +1280,9 @@ See variables bib-etags-command and bib-etags-filename"
       (bib-highlight-mouse)
     (let ((modified (buffer-modified-p))
          (inhibit-read-only t))
-      (cond
-       ((featurep 'xemacs)
-       (while bib-ext-list
-         (delete-extent (car bib-ext-list))
-         (setq bib-ext-list (cdr bib-ext-list))))
-       (t
-       (let ((before-change-functions) (after-change-functions))
-         (remove-text-properties (point-min) (point-max)
-                                 '(mouse-face local-map)))))
+      (let ((before-change-functions) (after-change-functions))
+       (remove-text-properties (point-min) (point-max)
+                               '(mouse-face local-map)))
       (set-buffer-modified-p modified))))
 
 (defun bib-label-help-echo (object)
@@ -1676,17 +1512,13 @@ If within a multi-file document (in auctex only)
        ;;;  '(("label3" "label4")("label1" "label2") nil)
        ;; so let's get rid of that nil part in embedded list.
             (the-name
-             (if (string-equal "18" (substring emacs-version 0 2))
-                 (completing-read "Label: " the-alist nil nil nil)
-               (completing-read "Label: " the-alist nil nil nil
-                                'LaTeX-find-label-hist-alist))))
+             (completing-read "Label: " the-alist nil nil nil
+                              'LaTeX-find-label-hist-alist)))
        (if (not (equal the-name ""))
            (concat "\\\\label{" (regexp-quote the-name) "}")
          ;; else try to get a \ref
-         (if (string-equal "18" (substring emacs-version 0 2))
-             (setq the-name (completing-read "Ref: " the-alist nil nil nil))
-           (setq the-name (completing-read "Ref: " the-alist nil nil nil
-                                           'LaTeX-find-label-hist-alist)))
+         (setq the-name (completing-read "Ref: " the-alist nil nil nil
+                                         'LaTeX-find-label-hist-alist))
          (if (not (equal the-name ""))
              (concat bib-ref-regexpc (regexp-quote the-name) "}")
            nil)))))))
@@ -2296,15 +2128,9 @@ Makes sure TAGS file exists, etc."
        (visit-tags-table the-tags-file-name))
     ;; find-tag-noselect should set the TAGS file for the new buffer
     ;; that's what C-h f visit-tags-table says...
-    (cond
-     ((featurep 'xemacs)
-      (find-tag tag)
-      (setq new-buffer (current-buffer))
-      (set-buffer the-buffer))
-     (t
-      (setq new-buffer (find-tag-noselect tag nil t))
+    (setq new-buffer (find-tag-noselect tag nil t))
                                        ; -> Seems to set buffer to TAGS
-      (set-buffer the-buffer)))
+    (set-buffer the-buffer)
     new-buffer))
 
 ;; --------------------------------------------------------------------------

commit f7a462295e8628ad5a01ca70044e005ceaa9c628
Author: Mosè Giordano <address@hidden>
Date:   Wed Dec 20 12:37:16 2017 +0100

    Delte prv-xemacs.el
    
    * prv-xemacs.el: Delete file.
    * preview.el.in (preview): Remove code to load prv-xemacs.

diff --git a/preview.el.in b/preview.el.in
index f0c1288..30051db 100644
--- a/preview.el.in
+++ b/preview.el.in
@@ -54,16 +54,6 @@ preview-latex buffers will not survive across sessions.")))
 preview-latex's bug reporting commands will probably not work.")))
   (require 'info))
 
-;; we need the compatibility macros which do _not_ get byte-compiled.
-(eval-when-compile
-  (if (featurep 'xemacs)
-      (load-library "prv-xemacs.el")))
-
-;; if the above load-library kicked in, this will not cause anything
-;; to get loaded.
-(require (if (featurep 'xemacs)
-            'prv-xemacs 'prv-emacs))
-
 (defgroup preview nil "Embed Preview images into LaTeX buffers."
   :group 'AUCTeX
   :prefix "preview-"
diff --git a/prv-xemacs.el b/prv-xemacs.el
deleted file mode 100644
index ae20402..0000000
--- a/prv-xemacs.el
+++ /dev/null
@@ -1,759 +0,0 @@
-;;; prv-xemacs.el --- XEmacs support for preview-latex
-
-;; Copyright (C) 2001-2006, 2017 Free Software Foundation, Inc.
-
-;; Author: David Kastrup
-;; Keywords: convenience, tex, wp
-
-;; This file is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
-
-;; This file is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to
-;; the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
-
-;;; Commentary:
-
-;; 
-
-;;; Code:
-
-(require 'overlay)
-(require 'tex-site)
-(require 'tex)
-(require 'latex)
-
-;; Compatibility macros and functions.
-
-(eval-when-compile
-  (defvar preview-compatibility-macros nil
-    "List of macros only present when compiling/loading uncompiled.")
-
-  (defmacro preview-defmacro (name &rest rest)
-    (when (featurep 'xemacs)
-      (push
-       (if (fboundp name)
-          (cons name (symbol-function name))
-        name)
-       preview-compatibility-macros)
-      `(eval-when-compile (defmacro ,name ,@rest))))
-  (push 'preview-defmacro preview-compatibility-macros))
-
-(preview-defmacro assoc-default (key alist test)
-  `(cdr (assoc* ,key ,alist
-                :test #'(lambda(a b) (funcall ,test b a)))))
-
-(preview-defmacro display-mm-height () '(device-mm-height))
-(preview-defmacro display-mm-width () '(device-mm-width))
-(preview-defmacro display-pixel-height () '(device-pixel-height))
-(preview-defmacro display-pixel-width () '(device-pixel-width))
-(preview-defmacro line-beginning-position () '(point-at-bol))
-(preview-defmacro line-end-position () '(point-at-eol))
-
-;; This is not quite the case, but unless we're playing with duplicable 
extents,
-;; the two are equivalent in XEmacs.
-(preview-defmacro match-string-no-properties (&rest args)
-  `(match-string ,@args))
-
-(preview-defmacro face-attribute (face attr)
-  (cond
-    ((eq attr :height)
-     `(round (/ (* ,(/ 720.0 25.4)
-                  (face-height ,face)
-                  (device-mm-height))
-               (device-pixel-height))))
-    ((eq attr :foreground)
-     `(face-foreground-instance ,face))
-    ((eq attr :background)
-     `(face-background-instance ,face))
-    (t
-     (error 'unimplemented (format "Don't know how to fake %s" attr)))))
-
-(preview-defmacro make-temp-file (prefix dir-flag)
-  (if (not dir-flag)
-      (error 'unimplemented "Can only fake make-temp-file for directories"))
-  `(let (file)
-     (while (condition-case ()
-                (progn
-                  (setq file
-                        (make-temp-name ,prefix))
-                  (make-directory file)
-                  nil)
-              (file-already-exists t))
-       nil)
-     file))
-
-(preview-defmacro set-buffer-multibyte (multibyte)
-  "Set the representation type of the current buffer.  If MULTIBYTE
-is non-`nil', the buffer becomes multibyte.  If MULTIBYTE is
-`nil', the buffer becomes unibyte.
-
-Because XEmacs does not implement multibyte versus unibyte buffers
-per se (they just have encodings which may be unibyte or multibyte),
-this is only implemented for the `nil' case."
-  (if (not multibyte)
-      `(if (fboundp 'set-buffer-file-coding-system)
-           (set-buffer-file-coding-system 'binary))
-    (error 'unimplemented "`set-buffer-multibyte is only implemented for the 
binary case.")))
-
-(preview-defmacro next-single-char-property-change (pos prop)
-  "Return the position of next property change for a specific property.
-This is like `next-single-property-change', except that if no
-change is found before the end of the buffer, it returns
-\(point-max) rather than `nil'."
-  `(or (next-single-property-change ,pos ,prop)
-       (point-max)))
-
-(preview-defmacro previous-single-char-property-change (pos prop)
-  "Return the position of previous property change for a specific property.
-This is like `next-single-property-change', except that if no
-change is found before the end of the buffer, it returns
-\(point-min) rather than `nil'."
-  `(or (previous-single-property-change ,pos ,prop)
-       (point-min)))
-
-(preview-defmacro with-temp-message (message &rest body)
-  "Display MESSAGE temporarily if non-nil while BODY is evaluated.
-The original message is restored to the echo area after BODY has finished.
-The value returned is the value of the last form in BODY.
-MESSAGE is written to the message log buffer if `message-log-max' is non-nil.
-If MESSAGE is nil, the echo area and message log buffer are unchanged.
-Use a MESSAGE of \"\" to temporarily clear the echo area.
-
-The message is displayed with label `progress'; see `display-message'."
-  (let ((current-message (make-symbol "current-message"))
-        (temp-message (make-symbol "with-temp-message")))
-    `(let ((,temp-message ,message)
-           (,current-message))
-       (unwind-protect
-           (progn
-             (when ,temp-message
-               (setq ,current-message (current-message))
-               (display-message 'progress ,temp-message))
-             ,@body)
-         (and ,temp-message
-              (if ,current-message
-                  (display-message 'progress ,current-message)
-                (message nil)))))))
-
-(defun preview-mark-active ()
-  "Return t if the mark is active."
-  (and (mark)
-       t))
-
-(defvar preview-transparent-border)
-
-;; Images.
-
-(defsubst preview-supports-image-type (imagetype)
-  "Return whether IMAGETYPE is supported by XEmacs."
-  (memq imagetype (image-instantiator-format-list)))
-
-;; TODO: Generalize this so we can create the fixed icons using it.
-
-;; Argh, dired breaks :file :(
-;; This is a temporary kludge to get around that until a fixed dired
-;; or a fixed XEmacs is released.
-
-(defun preview-create-icon-1 (file type ascent)
-  "Create an icon from FILE, image TYPE and ASCENT."
-  (let ((glyph
-        (make-glyph
-         (vector type
-                 :file file
-                 :data (with-temp-buffer
-                         (insert-file-contents-literally file)
-                         (buffer-string))))))
-    (set-glyph-baseline glyph ascent)
-    glyph))
-
-(defun preview-create-icon (file type ascent border)
-  "Create an icon from FILE, image TYPE, ASCENT and BORDER."
-  (list
-   (preview-create-icon-1 file type ascent)
-   file type ascent border))
-
-(defvar preview-ascent-spec)
-
-(put 'preview-filter-specs :type
-     #'(lambda (keyword value &rest args)
-        (if (preview-supports-image-type value)
-            (let* (preview-ascent-spec
-                   (glyph (make-glyph `[,value
-                                        ,@(preview-filter-specs-1 args)])))
-              (when preview-ascent-spec
-                (set-glyph-baseline glyph preview-ascent-spec))
-              glyph)
-          (throw 'preview-filter-specs nil))))
-
-(put 'preview-filter-specs :ascent
-     #'(lambda (keyword value &rest args)
-        (setq preview-ascent-spec value)
-        (preview-filter-specs-1 args)))
-
-;; No defcustom here: does not seem to make sense.
-
-(defvar preview-tb-icon-specs
-  '((:type xpm :file "prvtex-cap-up.xpm" :ascent 75)
-    (:type xbm :file "prvtex24.xbm" :ascent 75)))
-
-(defvar preview-tb-icon nil)
-
-;; Image frobbing.
-
-(defun preview-add-urgentization (fun ov &rest rest)
-  "Cause FUN (function call form) to be called when redisplayed.
-FUN must be a form with OV as first argument,
-REST as the remainder, returning T.  An alternative is to give
-what `preview-remove-urgentization' returns, this will reinstate
-the previous state."
-  (set-extent-initial-redisplay-function
-   ov
-   (if (null rest)
-       fun
-     `(lambda (ov) (,fun ,ov ,@rest)))))
-
-(defun preview-remove-urgentization (ov)
-  "Undo urgentization of OV by `preview-add-urgentization'.
-Returns the old arguments to `preview-add-urgentization'
-if there was any urgentization."
-  (prog1 (list (extent-property ov 'initial-redisplay-function) ov)
-    (set-extent-initial-redisplay-function ov nil)))
-
-(defsubst preview-icon-copy (icon)
-  "Prepare for a later call of `preview-replace-active-icon'."
-  icon)
-
-(defsubst preview-replace-active-icon (ov replacement)
-  "Replace the active Icon in OV by REPLACEMENT, another icon."
-  (set-extent-property ov 'preview-image replacement)
-  (add-text-properties 0 1 (list 'end-glyph (car replacement))
-                      (car (extent-property ov 'strings)))
-  (if (eq (extent-property ov 'preview-state) 'active)
-      (set-extent-end-glyph ov (car replacement))))
-
-(defvar preview-button-1 'button2)
-(defvar preview-button-2 'button3)
-
-;; The `x' and invisible junk is because XEmacs doesn't bother to insert
-;; the extents of a zero-length string. Bah.
-;; When this is fixed, we'll autodetect this case and use zero-length
-;; strings where possible.
-(defmacro preview-make-clickable (&optional map glyph helpstring click1 click2)
-  "Generate a clickable string or keymap.
-If MAP is non-nil, it specifies a keymap to add to, otherwise
-a new one is created.  If GLYPH is given, the result is made
-to display it wrapped in a string.  In that case,
-HELPSTRING is a format string with one or two %s specifiers
-for preview's clicks, displayed as a help-echo.  CLICK1 and CLICK2
-are functions to call on preview's clicks."
-  `(let (,@(and glyph '((res (copy-sequence "x"))))
-           (resmap ,(or map '(make-sparse-keymap))))
-     ,@(if click1
-           `((define-key resmap preview-button-1 ,click1)))
-     ,@(if click2
-           `((define-key resmap preview-button-2 ,click2)))
-     ,@(if glyph
-          `((add-text-properties
-              0 1
-              (list 'end-glyph ,glyph
-                   'mouse-face 'highlight
-              'preview-balloon-help
-             ,(if (stringp helpstring)
-                  (format helpstring preview-button-1 preview-button-2)
-                `(format ,helpstring preview-button-1 preview-button-2))
-              'preview-keymap resmap)
-              res)
-             res)
-        '(resmap))))
-
-(defun preview-click-reroute (ov event)
-  "If OV received a click EVENT on a glyph, reroute to special map."
-  (let ((oldmap (extent-keymap ov)))
-    (unwind-protect
-       (progn
-         (set-extent-keymap ov
-                            (and (event-over-glyph-p event)
-                                 (extent-property ov 'preview-keymap)))
-         (dispatch-event event))
-      (set-extent-keymap ov oldmap))))
-
-(defun preview-reroute-map (ov)
-  "Get rerouting keymap for OV for catching glyph clicks only."
-  (let ((map (make-sparse-keymap))
-       (fun `(lambda (event)
-               (interactive "e")
-               (preview-click-reroute ,ov event))))
-    (define-key map preview-button-1 fun)
-    (define-key map preview-button-2 fun)
-    map))
-
-(defun preview-balloon-reroute (ov)
-  "Give balloon help only if over glyph of OV."
-  (and (eq ov (event-glyph-extent (mouse-position-as-motion-event)))
-       (extent-property ov 'preview-balloon-help)))
-
-;; Most of the changes to this are junking the use of overlays;
-;; a bit of it is different, and there's a little extra paranoia.
-
-;; We also have to move the image from the begin to the end-glyph
-;; whenever the extent is invisible because of a bug in XEmacs-21.4's
-;; redisplay engine.
-(defun preview-toggle (ov &optional arg event)
-  "Toggle visibility of preview overlay OV.
-ARG can be one of the following: t displays the overlay,
-nil displays the underlying text, and 'toggle toggles.
-If EVENT is given, it indicates the window where the event
-occured, either by being a mouse event or by directly being
-the window in question.  This may be used for cursor restoration
-purposes."
-  (if (not (bufferp (extent-object ov)))
-      (error 'wrong-type-argument ov))
-  (let ((old-urgent (preview-remove-urgentization ov))
-        (preview-state
-         (if (if (eq arg 'toggle)
-                 (not (eq (extent-property ov 'preview-state) 'active))
-               arg)
-             'active
-           'inactive))
-        (strings (extent-property ov 'strings)))
-    (unless (eq (extent-property ov 'preview-state) 'disabled)
-      (set-extent-property ov 'preview-state preview-state)
-      (if (eq preview-state 'active)
-          (progn
-           (unless (extent-keymap ov)
-             (set-extent-keymap ov (preview-reroute-map ov))
-             (set-extent-property ov 'balloon-help #'preview-balloon-reroute))
-           (set-extent-begin-glyph ov nil)
-           (set-extent-end-glyph-layout ov 'text)
-           (set-extent-end-glyph ov (get-text-property
-                                     0 'end-glyph (car strings)))
-            (set-extent-properties ov '(invisible t
-                                       isearch-open-invisible ignore
-                                       isearch-invisible t
-                                        face nil))
-           (dolist (prop '(preview-keymap
-                           mouse-face preview-balloon-help))
-              (set-extent-property ov prop
-                                   (get-text-property 0 prop (car strings)))))
-       (unless (cdr strings)
-         (setcdr strings (preview-inactive-string ov)))
-       (set-extent-end-glyph ov nil)
-       (set-extent-begin-glyph-layout ov 'text)
-       (set-extent-begin-glyph ov (get-text-property
-                                   0 'end-glyph (cdr strings)))
-        (set-extent-properties ov `(face preview-face
-                                   mouse-face nil
-                                   invisible nil
-                                   isearch-invisible nil
-                                   preview-keymap
-                                   ,(get-text-property
-                                    0 'preview-keymap (cdr strings))
-                                   preview-balloon-help
-                                   ,(get-text-property
-                                    0 'preview-balloon-help (cdr strings)))))
-      (if old-urgent
-          (apply 'preview-add-urgentization old-urgent))))
-  (if event
-      (preview-restore-position
-       ov
-       (if (windowp event)
-          event
-        (event-window event)))))
-
-; Does FALLBACKS need to be implemented? Likely not.
-(defmacro preview-inherited-face-attribute (face attribute &optional
-                                              fallbacks)
-  "Fetch face attribute while adhering to inheritance.
-This searches FACE and all its ancestors for an ATTRIBUTE.
-FALLBACKS is unused."
-  `(face-attribute ,face ,attribute))
-
-(defun preview-get-colors ()
-  "Return colors from the current display.
-Fetches the current screen colors and makes a vector
-of colors as numbers in the range 0..65535.
-Pure borderless black-on-white will return quadruple NIL."
-  (let
-      ((bg (color-instance-rgb-components (preview-inherited-face-attribute
-             'preview-reference-face :background 'default)))
-       (fg (color-instance-rgb-components (preview-inherited-face-attribute
-                                           'preview-reference-face :foreground 
'default))))
-    (if (equal '(65535 65535 65535) bg)
-        (setq bg nil))
-    (if (equal '(0 0 0) fg)
-        (setq fg nil))
-    (vector bg fg nil nil)))
-
-(defcustom preview-use-balloon-help nil
-  "*Is balloon help enabled in preview-latex?"
-  :group 'preview-appearance
-  :type 'boolean)
-
-(defcustom preview-buffer-recoding-alist
-  (if (and (= emacs-major-version 21)
-          (< emacs-minor-version 5))
-      '((utf-8-unix . raw-text-unix)
-       (utf-8-dos . raw-text-dos)
-       (utf-8-mac . raw-text-mac)
-       (utf-8 . raw-text)))
-  "Translate buffer encodings into process encodings.
-TeX is sometimes bad dealing with 8bit encodings and rather bad
-dealing with multibyte encodings.  So the process encoding output
-might need to get temporarily reprocessed into the original byte
-stream before the buffer characters can be identified.  XEmacs
-21.4 is rather bad at preserving incomplete multibyte characters
-in that process.  This variable makes it possible to use a
-reconstructable coding system in the run buffer instead.  Specify
-an alist of coding system names here, which you can get using
-
-  \(coding-system-name buffer-file-coding-system)
-
-in properly detected buffers."
-  :group 'preview-latex
-  :type '(repeat (cons symbol symbol)))
-
-(defun preview-buffer-recode-system (base)
-  "This is supposed to translate unrepresentable base encodings
- into something that can be used safely for byte streams in the
- run buffer.  XEmacs mule-ucs is so broken that this may be
- needed."
-  (or (cdr (assq (coding-system-name base)
-                preview-buffer-recoding-alist))
-      base))
-
-(if (and (featurep 'mule)
-        (= emacs-major-version 21)
-        (< emacs-minor-version 5))
-    (defadvice coding-system-change-eol-conversion
-       (after fallback activate)
-      "Return CODING-SYSTEM as-is if the result is nil.
-XEmacs 21.4 mule-ucs fails to define utf-8 to respond properly to
-this function."
-      (unless ad-return-value
-       (setq ad-return-value (ad-get-arg 0)))))
-
-(defun preview-mode-setup ()
-  "Setup proper buffer hooks and behavior for previews."
-  (set (make-local-variable 'desktop-save-buffer)
-       #'desktop-buffer-preview-misc-data)
-  (mapc #'make-local-hook
-        '(pre-command-hook post-command-hook
-         before-change-functions after-change-functions))
-  (add-hook 'pre-command-hook #'preview-mark-point nil t)
-  (add-hook 'post-command-hook #'preview-move-point nil t)
-  (and preview-use-balloon-help
-       (not (and (boundp 'balloon-help-mode)
-                balloon-help-mode))
-       (balloon-help-minor-mode 1))
-  (add-hook 'before-change-functions #'preview-handle-before-change nil t)
-  (add-hook 'after-change-functions #'preview-handle-after-change nil t)
-  (easy-menu-add preview-menu)
-  (unless preview-tb-icon
-    (setq preview-tb-icon (preview-filter-specs
-                                      preview-tb-icon-specs))
-    (when preview-tb-icon
-      (setq preview-tb-icon
-           (vector
-            (list preview-tb-icon)
-            #'preview-at-point
-            t
-            "Preview on/off at point"))))
-;;; [Courtesy Stephen J. Turnbull, with some modifications
-;;;  Message-ID: <address@hidden>
-;;;  I could not have figured this out for the world]
-;;; Hm, there really ought to be a way to get the spec that would be
-;;; instantiated in a given domain
-  (when preview-tb-icon
-    (let ((tb (cdadar (or (specifier-spec-list default-toolbar 
(current-buffer))
-                         (specifier-spec-list default-toolbar 'global)))))
-      (unless (member preview-tb-icon tb)
-       (set-specifier default-toolbar
-                      (append tb (list preview-tb-icon))
-                      (current-buffer)))))
-  (when buffer-file-name
-    (let* ((filename (expand-file-name buffer-file-name))
-          format-cons)
-      (when (string-match (concat "\\." TeX-default-extension "\\'")
-                         filename)
-       (setq filename (substring filename 0 (match-beginning 0))))
-      (setq format-cons (assoc filename preview-dumped-alist))
-      (when (consp (cdr format-cons))
-       (preview-unwatch-preamble format-cons)
-       (preview-watch-preamble (current-buffer)
-                               (cadr format-cons)
-                               format-cons)))))
-
-(defvar preview-marker (make-marker)
-  "Marker for fake intangibility.")
-
-(defvar preview-temporary-opened nil)
-
-(defvar preview-last-location nil
-  "Restored cursor position marker for reopened previews.")
-(make-variable-buffer-local 'preview-last-location)
-
-(defun preview-mark-point ()
-  "Mark position for fake intangibility."
-  (when (eq (get-char-property (point) 'preview-state) 'active)
-    (unless preview-last-location
-      (setq preview-last-location (make-marker)))
-    (set-marker preview-last-location (point))
-    (set-marker preview-marker (point))
-    (preview-move-point))
-  (set-marker preview-marker (point)))
-
-(defun preview-restore-position (ov window)
-  "Tweak position after opening/closing preview.
-The treated overlay OV has been triggered in WINDOW.  This function
-records the original buffer position for reopening, or restores it
-after reopening.  Note that by using the mouse, you can open/close
-overlays not in the active window."
-  (when (eq (extent-object ov) (window-buffer window))
-    (with-current-buffer (extent-object ov)
-      (if (eq (extent-property ov 'preview-state) 'active)
-         (setq preview-last-location
-               (set-marker (or preview-last-location (make-marker))
-                           (window-point window)))
-       (when (and
-              (markerp preview-last-location)
-              (eq (extent-object ov) (marker-buffer preview-last-location))
-              (< (extent-start-position ov) preview-last-location)
-              (> (extent-end-position ov) preview-last-location))
-         (set-window-point window preview-last-location))))))
-
-(defun preview-move-point ()
-  "Move point out of fake-intangible areas."
-  (preview-check-changes)
-  (let (newlist (pt (point)) distance)
-    (setq preview-temporary-opened
-         (dolist (ov preview-temporary-opened newlist)
-           (and (extent-object ov)
-                (not (extent-detached-p ov))
-                (eq (extent-property ov 'preview-state) 'inactive)
-                (if (and (eq (extent-object ov) (current-buffer))
-                         (or (<= pt (extent-start-position ov))
-                             (>= pt (extent-end-position ov))))
-                    (preview-toggle ov t)
-                  (push ov newlist)))))
-    (if        (preview-auto-reveal-p
-        preview-auto-reveal
-        (setq distance
-              (and (eq (marker-buffer preview-marker)
-                       (current-buffer))
-                   (- pt (marker-position preview-marker)))))
-       (map-extents #'preview-open-overlay nil
-                    pt pt nil nil 'preview-state 'active)
-      (let (newpt)
-       (while (setq newpt
-                    (map-extents #'preview-skip-overlay nil
-                                 pt pt (and distance (< distance 0)) nil
-                                 'preview-state 'active))
-         (setq pt newpt))
-       (goto-char pt)))))
-
-(defun preview-skip-overlay (ovr backward)
-  "Skip point over OVR, BACKWARD is set if backwards.
-Returns new position or NIL."
-  (if backward
-      (and (> (extent-start-position ovr) (point-min))
-          (1- (extent-start-position ovr)))
-    (and (<= (extent-end-position ovr) (point-max))
-        (> (extent-end-position ovr) (extent-start-position ovr))
-        (extent-end-position ovr))))
-
-(defun preview-open-overlay (ovr ignored)
-  "Open the active preview OVR, IGNORED gets ignored.
-NIL is returned: this is for `map-extents'."
-  (preview-toggle ovr)
-  (push ovr preview-temporary-opened)
-  nil)
-
-(defadvice isearch-highlight (before preview protect disable)
-  "Make isearch open preview text that's a search hit.
-Also make `query-replace' open preview text about to be replaced."
-  (map-extents #'preview-open-overlay nil
-              (ad-get-arg 0) (ad-get-arg 1)
-              nil nil 'preview-state 'active))
-
-(defcustom preview-query-replace-reveal t
-  "*Make `isearch' and `query-replace' autoreveal previews."
-  :group 'preview-appearance
-  :type 'boolean
-  :require 'preview
-  :set (lambda (symbol value)
-        (set-default symbol value)
-        (if value
-            (ad-enable-advice 'isearch-highlight 'before 'preview)
-          (ad-disable-advice 'isearch-highlight 'before 'preview))
-        (ad-activate 'isearch-highlight))
-  :initialize #'custom-initialize-reset)
-
-;; Here is the beef: for best intuitiveness, we want to have
-;; insertions be carried out as expected before iconized text
-;; passages, but we want to insert *into* the overlay when not
-;; iconized.  A preview that has become empty can not get content
-;; again: we remove it.  A disabled preview needs no insert-in-front
-;; handler.
-
-(defvar preview-change-list nil
-  "List of tentatively changed overlays.")
-
-(defcustom preview-dump-threshold
-  "^ *\\\\begin *{document}[ %]*$"
-  "*Regexp denoting end of preamble.
-This is the location up to which preamble changes are considered
-to require redumping of a format."
-  :group 'preview-latex
-  :type 'string)
-
-(defvar preview-preamble-format-cons nil
-  "Where our preamble is supposed to end.")
-(make-variable-buffer-local 'preview-preamble-format-cons)
-
-(defun preview-preamble-check-change (beg end)
-  "Hook function for change hooks on preamble.
-Reacts to changes between BEG and END."
-  (when (and (consp (cdr preview-preamble-format-cons))
-            (cddr preview-preamble-format-cons)
-            (< beg (cddr preview-preamble-format-cons)))
-    (preview-unwatch-preamble preview-preamble-format-cons)
-    (preview-format-kill preview-preamble-format-cons)
-    (setcdr preview-preamble-format-cons t)))
-
-(defun preview-watch-preamble (file command format-cons)
-  "Set up a watch on master file FILE.
-FILE can be an associated buffer instead of a filename.
-COMMAND is the command that generated the format.
-FORMAT-CONS contains the format info for the main
-format dump handler."
-  (let ((buffer (if (bufferp file)
-                   file
-                 (find-buffer-visiting file))) ov)
-    (setq preview-preamble-format-cons nil)
-    (setcdr
-     format-cons
-     (cons command
-          (when buffer
-            (with-current-buffer buffer
-              (save-excursion
-                (save-restriction
-                  (widen)
-                  (goto-char (point-min))
-                  (unless (re-search-forward preview-dump-threshold nil t)
-                    (error "Can't find preamble of `%s'" file))
-                  (setq preview-preamble-format-cons format-cons)
-                  (point)))))))))
-
-(defun preview-unwatch-preamble (format-cons)
-  "Stop watching a format on FORMAT-CONS.
-The watch has been set up by `preview-watch-preamble'."
-  (when (consp (cdr format-cons))
-    (setcdr (cdr format-cons) nil)))
-
-(defun preview-register-change (ov map-arg)
-  "Register not yet changed OV for verification.
-This stores the old contents of the overlay in the
-`preview-prechange' property and puts the overlay into
-`preview-change-list' where `preview-check-changes' will
-find it at some later point of time.  MAP-ARG is ignored;
-it is usually generated by `map-extents'."
-  (unless (extent-property ov 'preview-prechange)
-    (if (eq (extent-property ov 'preview-state) 'disabled)
-       (set-extent-property ov 'preview-prechange t)
-      (set-extent-property ov
-                          'preview-prechange
-                          (save-restriction
-                            (widen)
-                            (buffer-substring-no-properties
-                             (extent-start-position ov)
-                             (extent-end-position ov)))))
-    (push ov preview-change-list))
-  nil)
-
-(defun preview-check-changes ()
-  "Check whether the contents under the overlay have changed.
-Disable it if that is the case.  Ignores text properties."
-  (dolist (ov preview-change-list)
-    (condition-case nil
-       (with-current-buffer (extent-object ov)
-         (let ((text (save-restriction
-                       (widen)
-                       (buffer-substring-no-properties
-                        (extent-start-position ov)
-                        (extent-end-position ov)))))
-           (if (or (zerop (length text))
-                   (extent-detached-p ov))
-               (preview-delete ov)
-             (unless
-                 (or (eq (extent-property ov 'preview-state) 'disabled)
-                     (preview-relaxed-string=
-                      text (extent-property ov 'preview-prechange)))
-               (preview-disable ov)))))
-      (error nil))
-    (set-extent-property ov 'preview-prechange nil))
-  (setq preview-change-list nil))
-
-(defun preview-handle-before-change (beg end)
-  "Hook function for `before-change-functions'.
-Receives BEG and END, the affected region."
-  (map-extents #'preview-register-change nil beg end
-              nil nil 'preview-state)
-  (preview-preamble-check-change beg end))
-
-(defun preview-handle-after-change (beg end length)
-  "Hook function for `after-change-functions'.
-Receives BEG and END, the affected region, and LENGTH
-of an insertion."
-  (when (and preview-change-list
-            (zerop length)
-            (not (eq this-command 'undo)))
-    (map-extents (lambda (ov maparg)
-                  (set-extent-endpoints
-                   ov maparg (extent-end-position ov))) nil
-                   beg beg end 'start-in-region 'preview-state 'active)
-    (map-extents (lambda (ov maparg)
-                  (set-extent-endpoints
-                   ov (extent-start-position ov) maparg)) nil
-                   end end beg 'end-in-region 'preview-state 'active)))
-
-(defun preview-import-image (image)
-  "Convert the printable IMAGE rendition back to an image."
-  (cond ((stringp image)
-        (setq image (copy-sequence image))
-        (add-text-properties 0 (length image)
-                             '(face preview-face)
-                             image)
-        image)
-       ((eq (car image) 'image)
-        (let ((plist (cdr image)))
-          (preview-create-icon-1
-           (plist-get plist :file)
-           (plist-get plist :type)
-           (plist-get plist :ascent))))
-       (t
-        (preview-create-icon-1 (nth 0 image)
-                               (nth 1 image)
-                               (nth 2 image)))))
-
-(if (eq system-type 'windows-nt)
-    (defadvice preview-ps-quote-filename (around path-sep-to-slash)
-      "Make path separator to slash so that the function will not be confused."
-      (let ((directory-sep-char ?/))
-       ad-do-it)))
-
-(provide 'prv-xemacs)
-
-;;; Local variables:
-;;; eval: (put 'preview-defmacro 'lisp-indent-function 'defun)
-;;; end:
-
-;;; prv-xemacs.el ends here

-----------------------------------------------------------------------

Summary of changes:
 bib-cite.el   | 264 ++++----------------
 font-latex.el |  97 ++------
 preview.el.in |  10 -
 prv-xemacs.el | 759 ----------------------------------------------------------
 tex-fold.el   |  76 ++----
 5 files changed, 86 insertions(+), 1120 deletions(-)
 delete mode 100644 prv-xemacs.el


hooks/post-receive
-- 
GNU AUCTeX



reply via email to

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