[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auctex 25a9c18 76/78: Define TeX-completing-read-multip
From: |
Tassilo Horn |
Subject: |
[elpa] externals/auctex 25a9c18 76/78: Define TeX-completing-read-multiple for Emacs 24.4 and later. |
Date: |
Mon, 19 Oct 2015 09:11:20 +0000 |
branch: externals/auctex
commit 25a9c18d1712d7f2c221a4a14b72c178b7d6bd5a
Author: Mosè Giordano <address@hidden>
Commit: Mosè Giordano <address@hidden>
Define TeX-completing-read-multiple for Emacs 24.4 and later.
* tex.el (fboundp): Define a `TeX-completing-read-multiple'
version for GNU Emacs >= 24.4. Fixes bug#19504.
---
ChangeLog | 5 +++++
tex.el | 59 +++++++++++++++++++++++++++++++++++++++++++++++++----------
2 files changed, 54 insertions(+), 10 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index cd4d925..20bd1dc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-10-18 Mos� Giordano <address@hidden>
+
+ * tex.el (fboundp): Define a `TeX-completing-read-multiple'
+ version for GNU Emacs >= 24.4. Fixes bug#19504.
+
2015-10-13 Mos� Giordano <address@hidden>
* style/pstricks.el ("pstricks"): Do not disable PDF mode if XeTeX
diff --git a/tex.el b/tex.el
index 56fb51b..6bd7a95 100644
--- a/tex.el
+++ b/tex.el
@@ -778,18 +778,57 @@ overlays."
edit-utils >= 2.32 for XEmacs.")))
(if (fboundp 'completing-read-multiple)
- (defun TeX-completing-read-multiple
- (prompt table &optional predicate require-match initial-input
- hist def inherit-input-method)
- "Like `completing-read-multiple' which see.
+ (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)))
+ (let ((result (completing-read-multiple prompt table predicate
+ require-match initial-input
+ hist def inherit-input-method)))
+ (if (equal result '("")) nil result))))
+ ;; For XEmacs.
(defun TeX-completing-read-multiple
- (prompt table &optional predicate require-match initial-input
- hist def inherit-input-method)
+ (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
- [elpa] externals/auctex 320de59 53/78: Apply some fixes to caption.el., (continued)
- [elpa] externals/auctex 320de59 53/78: Apply some fixes to caption.el., Tassilo Horn, 2015/10/19
- [elpa] externals/auctex ce8981a 64/78: Fontify math environment, Tassilo Horn, 2015/10/19
- [elpa] externals/auctex 0c4e740 62/78: Fix typo in comment., Tassilo Horn, 2015/10/19
- [elpa] externals/auctex 3b5f047 67/78: Add supporto to ConTeXt Mark IV in some sentinels., Tassilo Horn, 2015/10/19
- [elpa] externals/auctex 4a12225 72/78: Use `LaTeX-add-counters' on "LTchunksize"., Tassilo Horn, 2015/10/19
- [elpa] externals/auctex 1f116b8 74/78: Fill $...$ like \(...\) (bug#21645), Tassilo Horn, 2015/10/19
- [elpa] externals/auctex 93d50ea 75/78: Do not disable PDF when using pstricks with XeTeX., Tassilo Horn, 2015/10/19
- [elpa] externals/auctex f9a7928 59/78: Add new style newfloat.el., Tassilo Horn, 2015/10/19
- [elpa] externals/auctex 5ee567c 60/78: Append entries to LaTeX-label-alist in newfloat.el., Tassilo Horn, 2015/10/19
- [elpa] externals/auctex 96639fb 61/78: Fix previous commit., Tassilo Horn, 2015/10/19
- [elpa] externals/auctex 25a9c18 76/78: Define TeX-completing-read-multiple for Emacs 24.4 and later.,
Tassilo Horn <=
- [elpa] externals/auctex 1ec0278 65/78: Different approach to support ConTeXt Mark IV., Tassilo Horn, 2015/10/19
- [elpa] externals/auctex 6f77ad9 73/78: Split TeX-expand-list into a builtin and a custom list., Tassilo Horn, 2015/10/19
- [elpa] externals/auctex 7332f76 70/78: Add user-defined values to "style" key., Tassilo Horn, 2015/10/19
- [elpa] externals/auctex b072f9c 77/78: Make sure there is a working TeX distribution before running *tex., Tassilo Horn, 2015/10/19
- [elpa] externals/auctex 7df138d 71/78: Remove unused `prompt' from arguments list., Tassilo Horn, 2015/10/19
- [elpa] externals/auctex 2f22938 78/78: Merge branch 'master' into elpa, Tassilo Horn, 2015/10/19