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. 25a9c18d1712d7f2c221a


From: Mosè Giordano
Subject: [AUCTeX-diffs] GNU AUCTeX branch, master, updated. 25a9c18d1712d7f2c221a4a14b72c178b7d6bd5a
Date: Sun, 18 Oct 2015 21:15:40 +0000

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  25a9c18d1712d7f2c221a4a14b72c178b7d6bd5a (commit)
      from  93d50ea9920767901221f54ad566c6b3e9a1f462 (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 25a9c18d1712d7f2c221a4a14b72c178b7d6bd5a
Author: Mosè Giordano <address@hidden>
Date:   Sun Oct 18 23:06:13 2015 +0200

    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.

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

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

Summary of changes:
 ChangeLog |    5 +++++
 tex.el    |   59 +++++++++++++++++++++++++++++++++++++++++++++++++----------
 2 files changed, 54 insertions(+), 10 deletions(-)


hooks/post-receive
-- 
GNU AUCTeX



reply via email to

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