[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auctex 12618af 09/43: Remove code for compatibility wit
From: |
Tassilo Horn |
Subject: |
[elpa] externals/auctex 12618af 09/43: Remove code for compatibility with old Emacsens in tex.el |
Date: |
Tue, 20 Mar 2018 11:34:06 -0400 (EDT) |
branch: externals/auctex
commit 12618afcb5d1a774adc47eb98b66d76e1353daf8
Author: Mosè Giordano <address@hidden>
Commit: Mosè Giordano <address@hidden>
Remove code for compatibility with old Emacsens in tex.el
* tex.el: Always require `crm', which is available in all supported version
of
Emacs.
(TeX-completing-read-multiple): Remove function definition for XEmacs.
(TeX-view-predicate-list-builtin):
(TeX-source-correlate-sync-source):
(TeX-tree-expand):
(TeX-comment-forward): Remove code for compatibility with old Emacsens.
---
tex.el | 145 +++++++++++++++++++++++------------------------------------------
1 file changed, 52 insertions(+), 93 deletions(-)
diff --git a/tex.el b/tex.el
index 9768327..6e220e4 100644
--- a/tex.el
+++ b/tex.el
@@ -772,70 +772,55 @@ overlays."
;; (TeX-completing-read-multiple ...))
;;
;; which results in a void-variable error if crm hasn't been loaded before.
-;; XEmacs 21.4 `require' doesn't have the third NOERROR argument, thus we
handle
-;; the file-error signal with a `condition-case' also in GNU Emacs.
-(condition-case nil
- (require 'crm)
- (file-error
- (error "AUCTeX requires crm.el which is included in Emacs and
-edit-utils >= 2.32 for XEmacs.")))
-
-(if (fboundp 'completing-read-multiple)
- (if (or (and (= emacs-major-version 24) (>= emacs-minor-version 4))
- (>= emacs-major-version 25))
- ;; For GNU Emacs 24.4 or later, based on `completing-read-multiple' of
- ;; git commit b14abca9476cba2f500b5eda89441d593dd0f12b
- ;; 2013-01-10 * lisp/emacs-lisp/crm.el: Allow any regexp for
separators.
- (defun TeX-completing-read-multiple
- (prompt table &optional predicate require-match initial-input
- hist def inherit-input-method)
- "Like `completing-read-multiple' which see.
+(require 'crm)
+
+(if (or (and (= emacs-major-version 24) (>= emacs-minor-version 4))
+ (>= emacs-major-version 25))
+ ;; For GNU Emacs 24.4 or later, based on `completing-read-multiple' of
+ ;; git commit b14abca9476cba2f500b5eda89441d593dd0f12b
+ ;; 2013-01-10 * lisp/emacs-lisp/crm.el: Allow any regexp for separators.
+ (defun TeX-completing-read-multiple
+ (prompt table &optional predicate require-match initial-input
+ hist def inherit-input-method)
+ "Like `completing-read-multiple' which see.
Retain zero-length substrings but ensure that empty input results
in nil across different emacs versions."
- (unwind-protect
- (progn
- (add-hook 'choose-completion-string-functions
- 'crm--choose-completion-string)
- (let* ((minibuffer-completion-table #'crm--collection-fn)
- (minibuffer-completion-predicate predicate)
- ;; see completing_read in src/minibuf.c
- (minibuffer-completion-confirm
- (unless (eq require-match t) require-match))
- (crm-completion-table table)
- (map (if require-match
- crm-local-must-match-map
- crm-local-completion-map))
- ;; If the user enters empty input, `read-from-minibuffer'
- ;; returns the empty string, not DEF.
- (input (read-from-minibuffer
- prompt initial-input map
- nil hist def inherit-input-method))
- result)
- (and def (string-equal input "") (setq input def))
- (if (equal (setq result (split-string input crm-separator))
- '(""))
- nil
- result)))
- (remove-hook 'choose-completion-string-functions
- 'crm--choose-completion-string)))
- ;; For GNU Emacs <= 24.3.
- (defun TeX-completing-read-multiple
- (prompt table &optional predicate require-match initial-input
- hist def inherit-input-method)
- "Like `completing-read-multiple' which see.
-Ensures that empty input results in nil across different emacs versions."
- (let ((result (completing-read-multiple prompt table predicate
- require-match initial-input
- hist def inherit-input-method)))
- (if (equal result '("")) nil result))))
- ;; For XEmacs.
+ (unwind-protect
+ (progn
+ (add-hook 'choose-completion-string-functions
+ 'crm--choose-completion-string)
+ (let* ((minibuffer-completion-table #'crm--collection-fn)
+ (minibuffer-completion-predicate predicate)
+ ;; see completing_read in src/minibuf.c
+ (minibuffer-completion-confirm
+ (unless (eq require-match t) require-match))
+ (crm-completion-table table)
+ (map (if require-match
+ crm-local-must-match-map
+ crm-local-completion-map))
+ ;; If the user enters empty input, `read-from-minibuffer'
+ ;; returns the empty string, not DEF.
+ (input (read-from-minibuffer
+ prompt initial-input map
+ nil hist def inherit-input-method))
+ result)
+ (and def (string-equal input "") (setq input def))
+ (if (equal (setq result (split-string input crm-separator))
+ '(""))
+ nil
+ result)))
+ (remove-hook 'choose-completion-string-functions
+ 'crm--choose-completion-string)))
+ ;; For GNU Emacs <= 24.3.
(defun TeX-completing-read-multiple
(prompt table &optional predicate require-match initial-input
hist def inherit-input-method)
- "Poor mans implementation of Emacs' `completing-read-multiple' for XEmacs.
-The XEmacs package edit-utils-2.32 includes `crm.el'."
- (multi-prompt (if (boundp 'crm-separator) crm-separator ",") nil prompt
- table predicate require-match initial-input hist)))
+ "Like `completing-read-multiple' which see.
+Ensures that empty input results in nil across different emacs versions."
+ (let ((result (completing-read-multiple prompt table predicate
+ require-match initial-input
+ hist def inherit-input-method)))
+ (if (equal result '("")) nil result))))
;;; Special support for GNU Emacs
@@ -1147,11 +1132,7 @@ all the regular expressions must match for the element
to apply."
(output-html
(string-match "html" (TeX-output-extension)))
(has-no-display-manager
- ;; Compatibility for Emacs <= 22: older Emacsen don't have FRAME argument
- ;; to `getenv', later versions have the `display-graphic-p' function.
- (not (if (< emacs-major-version 23)
- (or window-system (getenv "DISPLAY"))
- (display-graphic-p))))
+ (not (display-graphic-p)))
(style-pstricks
(TeX-match-style "^pstricks$\\|^pst-\\|^psfrag$"))
(engine-omega
@@ -1924,14 +1905,10 @@ If the Emacs frame isn't raised, customize
;; FILE may be given as relative path to the TeX-master root document or as
;; absolute file:// URL. In the former case, the tex file has to be already
;; opened.
- (let* ((file (condition-case nil
- (progn
- (require 'url-parse)
- (require 'url-util)
- (url-unhex-string (aref (url-generic-parse-url file) 6)))
- ;; For Emacs 21 compatibility, which doesn't have the
- ;; url package.
- (file-error (TeX-replace-regexp-in-string "^file://" ""
file))))
+ (let* ((file (progn
+ (require 'url-parse)
+ (require 'url-util)
+ (url-unhex-string (aref (url-generic-parse-url file) 6))))
(flc (or (apply #'TeX-source-correlate-handle-TeX-region file linecol)
(apply #'list file linecol)))
(file (car flc))
@@ -2733,10 +2710,7 @@ are returned."
(setq TeX-kpathsea-path-delimiter nil)
(let ((separators (format "[\n\r%s]" TeX-kpathsea-path-delimiter))
path input-dir-list)
- (dolist (item (condition-case nil
- (split-string path-list separators t)
- ;; COMPATIBILITY for XEmacs <= 21.4.15
- (error (delete "" (split-string path-list
separators)))))
+ (dolist (item (split-string path-list separators t))
(if subdirs
(dolist (subdir subdirs)
(setq path (file-name-as-directory (concat item subdir)))
@@ -5398,27 +5372,12 @@ not move point to a position less than this value."
(unless limit (setq limit (point-min)))
(TeX-forward-comment-skip (- count) limit))
-;; Taken from `comment-forward' in Emacs' CVS on 2006-12-26. Used as
-;; a compatibility function for XEmacs 21.4.
(defun TeX-comment-forward (&optional n)
"Skip forward over N comments.
Just like `forward-comment' but only for positive N
and can use regexps instead of syntax."
- (when (fboundp 'comment-normalize-vars)
- (comment-normalize-vars))
- (if (fboundp 'comment-forward)
- (comment-forward n)
- (setq n (or n 1))
- (if (< n 0) (error "No comment-backward")
- (if comment-use-syntax (forward-comment n)
- (while (> n 0)
- (setq n
- (if (or (forward-comment 1)
- (and (looking-at comment-start-skip)
- (goto-char (match-end 0))
- (re-search-forward comment-end-skip nil 'move)))
- (1- n) -1)))
- (= n 0)))))
+ (comment-normalize-vars)
+ (comment-forward n))
(defun TeX-comment-padding-string ()
"Return comment padding as a string.
- [elpa] externals/auctex updated (aeeedbd -> 0011b68), Tassilo Horn, 2018/03/20
- [elpa] externals/auctex 6cb1e7d 07/43: Remove XEmacs compatibility code in tex.el, Tassilo Horn, 2018/03/20
- [elpa] externals/auctex 2df2746 14/43: Delete unused options, Tassilo Horn, 2018/03/20
- [elpa] externals/auctex 52e1426 02/43: Remove XEmacs compatibility code in latex.el, Tassilo Horn, 2018/03/20
- [elpa] externals/auctex 8f46dea 08/43: Remove TeX-line-number-at-pos, Tassilo Horn, 2018/03/20
- [elpa] externals/auctex 9ba765e 04/43: Remove TeX-deactivate-mark, Tassilo Horn, 2018/03/20
- [elpa] externals/auctex 12618af 09/43: Remove code for compatibility with old Emacsens in tex.el,
Tassilo Horn <=
- [elpa] externals/auctex 77c2cda 15/43: Remove XEmacs compatibility code in tex-jp.el, Tassilo Horn, 2018/03/20
- [elpa] externals/auctex 6861a88 10/43: Change encoding of Elisp source files to UTF-8, Tassilo Horn, 2018/03/20
- [elpa] externals/auctex 62d3606 18/43: Remove compatibility code for XEmacs in tex-fold.el, Tassilo Horn, 2018/03/20
- [elpa] externals/auctex 05c09bd 06/43: Remove TeX-how-many function, Tassilo Horn, 2018/03/20
- [elpa] externals/auctex f366130 03/43: Remove old compat functions for commenting and uncommenting, Tassilo Horn, 2018/03/20
- [elpa] externals/auctex f8290fc 21/43: Restore loading of prv-emacs, Tassilo Horn, 2018/03/20
- [elpa] externals/auctex 39d4959 23/43: * texmathp.el (texmathp-tex-commands-default): Add entries for breqn.sty., Tassilo Horn, 2018/03/20
- [elpa] externals/auctex d3d321a 05/43: Remove TeX-assoc-string, Tassilo Horn, 2018/03/20
- [elpa] externals/auctex d86e95e 30/43: Support flymake in Emacs 26+ using chktex, Tassilo Horn, 2018/03/20
- [elpa] externals/auctex 7f9d64b 39/43: * font-latex.el (font-latex--get-script-props): Use `cl-case' instead of `case'., Tassilo Horn, 2018/03/20