[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[AUCTeX-diffs] master c39fe6d1: Delete compatibility code
From: |
auctex-commit |
Subject: |
[AUCTeX-diffs] master c39fe6d1: Delete compatibility code |
Date: |
Tue, 3 May 2022 03:35:02 -0400 (EDT) |
branch: master
commit c39fe6d1d6295943252fc068a53d488f14f74767
Author: Arash Esbati <arash@gnu.org>
Commit: Arash Esbati <arash@gnu.org>
Delete compatibility code
* tex.el (TeX-completing-read-multiple): Remove compatibility code
for Emacs <= 24.3.
---
tex.el | 78 ++++++++++++++++++++++++++++--------------------------------------
1 file changed, 33 insertions(+), 45 deletions(-)
diff --git a/tex.el b/tex.el
index 1d091e1d..8a80f13f 100644
--- a/tex.el
+++ b/tex.el
@@ -767,53 +767,41 @@ overlays between two existing ones.")
;; which results in a void-variable error if crm hasn't been loaded before.
(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.
+;; 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))))
+ (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)))
(defun TeX-read-string (prompt &optional initial-input history default-value)
(read-string prompt initial-input history default-value t))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [AUCTeX-diffs] master c39fe6d1: Delete compatibility code,
auctex-commit <=