[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 100/299: Better unbinding of SPC in LaTeX-arg-acro-key-val and La
From: |
Stefan Monnier |
Subject: |
[elpa] 100/299: Better unbinding of SPC in LaTeX-arg-acro-key-val and LaTeX-arg-siunitx-unit. |
Date: |
Sun, 02 Nov 2014 03:10:37 +0000 |
monnier pushed a commit to branch externals/auctex
in repository elpa.
commit d549b79ccdc71b5167df6eb8f58112f9d149780d
Author: Mosè Giordano <address@hidden>
Date: Mon Apr 15 16:00:20 2013 +0200
Better unbinding of SPC in LaTeX-arg-acro-key-val and
LaTeX-arg-siunitx-unit.
* style/acro.el (LaTeX-arg-acro-key-val): Let-bind keymap with SPC
key binding removed, instead of defining a new key binding for
SPC. Use `TeX-arg-key-val' instead of `multi-prompt-key-value'
and `TeX-argument-insert'.
* style/siunitx.el (LaTeX-arg-siunitx-unit): Let-bind keymap with
SPC key binding removed, instead of defining a new key binding for
SPC.
---
ChangeLog | 11 +++++++++--
style/acro.el | 19 ++++++-------------
style/siunitx.el | 36 ++++++++++++++++++------------------
3 files changed, 33 insertions(+), 33 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 24534ef..8ebeec9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,13 +6,20 @@
* tex.el (fboundp): Use `crm-separator' as separator in XEmacs
`TeX-completing-read-multiple' implementation.
+ * style/acro.el (LaTeX-arg-acro-key-val): Let-bind keymap with SPC
+ key binding removed, instead of defining a new key binding for
+ SPC. Use `TeX-arg-key-val' instead of `multi-prompt-key-value'
+ and `TeX-argument-insert'.
+
* style/pst-node.el (LaTeX-pstnode-env-psmatrix): Replace
`completing-read-multiple' with `TeX-completing-read-multiple'.
* style/pstricks.el (LaTeX-package-parameters): Ditto.
- * style/siunitx.el (LaTeX-arg-siunitx-unit): Replace
- `completing-read-multiple' with `TeX-completing-read-multiple'.
+ * style/siunitx.el (LaTeX-arg-siunitx-unit): Let-bind keymap with
+ SPC key binding removed, instead of defining a new key binding for
+ SPC. Replace `completing-read-multiple' with
+ `TeX-completing-read-multiple'.
2013-04-15 Tassilo Horn <address@hidden>
diff --git a/style/acro.el b/style/acro.el
index 61b57a0..d41a9a1 100644
--- a/style/acro.el
+++ b/style/acro.el
@@ -139,24 +139,17 @@ in its optional argument.")
(defun LaTeX-arg-acro-key-val (optional prompt key-val-alist)
"Prompt for keys and values in KEY-VAL-ALIST.
-<SPC> key bindings in minibuffer are removed temporarily. Insert
+<SPC> key binding in minibuffer is removed temporarily. Insert
the given value as a TeX macro argument. If OPTIONAL is non-nil,
insert it as an optional argument. Use PROMPT as the prompt
string. KEY-VAL-ALIST is an alist. The car of each element
should be a string representing a key and the optional cdr should
be a list with strings to be used as values for the key."
- ;; Remove <SPC> key bindings in minibuffer.
- (let ((space-completion (lookup-key minibuffer-local-completion-map " "))
- (space-must-match (lookup-key minibuffer-local-must-match-map " ")))
- (define-key minibuffer-local-completion-map " " nil)
- (define-key minibuffer-local-must-match-map " " nil)
- (let ((var (multi-prompt-key-value
- (TeX-argument-prompt optional "Options (k=v)" prompt)
- (eval key-val-alist))))
- (TeX-argument-insert var optional))
- ;; Restore <SPC> key bindings in minibuffer.
- (define-key minibuffer-local-completion-map " " space-completion)
- (define-key minibuffer-local-must-match-map " " space-must-match)))
+ ;; Remove <SPC> key binding from map used in `multi-prompt-key-value' (called
+ ;; by `TeX-arg-key-val') with `require-match' set to `nil'.
+ (let ((crm-local-completion-map
+ (remove (assoc 32 crm-local-completion-map) crm-local-completion-map)))
+ (TeX-arg-key-val optional key-val-alist prompt)))
(TeX-add-style-hook
"acro"
diff --git a/style/siunitx.el b/style/siunitx.el
index 81981fb..230c62e 100644
--- a/style/siunitx.el
+++ b/style/siunitx.el
@@ -64,24 +64,24 @@ argument, otherwise as a mandatory one. Use PROMPT as the
prompt
string. If INITIAL-INPUT is non-nil, insert it in the minibuffer
initially, with point positioned at the end. If DEFINITION is
non-nil, add the chosen unit to the list of defined units."
- ;; Remove <SPC> key bindings in minibuffer and set completion
- ;; separator to <SPC>.
- (let ((space-completion (lookup-key minibuffer-local-completion-map " "))
- (space-must-match (lookup-key minibuffer-local-must-match-map " "))
- (crm-separator " "))
- (define-key minibuffer-local-completion-map " " nil)
- (define-key minibuffer-local-must-match-map " " nil)
- (let ((unit (mapconcat 'identity
- (TeX-completing-read-multiple
- (TeX-argument-prompt optional prompt "Unit")
- (LaTeX-siunitx-unit-list) nil nil initial-input)
- crm-separator)))
- (if (and definition (not (string-equal "" unit)))
- (LaTeX-add-siunitx-units unit))
- (TeX-argument-insert unit optional))
- ;; Restore <SPC> key bindings in minibuffer.
- (define-key minibuffer-local-completion-map " " space-completion)
- (define-key minibuffer-local-must-match-map " " space-must-match)))
+ ;; Remove <SPC> key binding from map used in `TeX-completing-read-multiple'
+ ;; with `require-match' set to `nil' (it's `crm-local-completion-map' if
+ ;; `completing-read-multiple' is bound, `minibuffer-local-completion-map'
+ ;; otherwise) and set completion separator to <SPC>.
+ (let* ((crm-local-completion-map
+ (remove (assoc 32 crm-local-completion-map) crm-local-completion-map))
+ (minibuffer-local-completion-map
+ (remove (assoc 32 minibuffer-local-completion-map)
+ minibuffer-local-completion-map))
+ (crm-separator " ")
+ (unit (mapconcat 'identity
+ (TeX-completing-read-multiple
+ (TeX-argument-prompt optional prompt "Unit")
+ (LaTeX-siunitx-unit-list) nil nil initial-input)
+ crm-separator)))
+ (if (and definition (not (string-equal "" unit)))
+ (LaTeX-add-siunitx-units unit))
+ (TeX-argument-insert unit optional)))
(defun LaTeX-arg-define-siunitx-unit (optional &optional prompt)
"Prompt for a LaTeX siunitx unit, prefix, power, and qualifier.
- [elpa] 97/299: Replace completing-read-multiple with TeX-completing-read-multiple., (continued)
- [elpa] 97/299: Replace completing-read-multiple with TeX-completing-read-multiple., Stefan Monnier, 2014/11/01
- [elpa] 98/299: Use crm-separator as separator in XEmacs TeX-completing-read-multiple., Stefan Monnier, 2014/11/01
- [elpa] 99/299: Add prompt argument to TeX-read-key-val and TeX-arg-key-val., Stefan Monnier, 2014/11/01
- [elpa] 101/299: Improve Evince backward search., Stefan Monnier, 2014/11/01
- [elpa] 94/299: Fix 2 bugs in DBUS communication., Stefan Monnier, 2014/11/01
- [elpa] 104/299: Change default value of `LaTeX-default-author' and adapt `LaTeX-arg-author'., Stefan Monnier, 2014/11/01
- [elpa] 96/299: Raise frame on backward search., Stefan Monnier, 2014/11/01
- [elpa] 105/299: Fix plain TeX abbrev table name., Stefan Monnier, 2014/11/01
- [elpa] 102/299: Document some missing functions and options., Stefan Monnier, 2014/11/01
- [elpa] 103/299: Use user-full-name as initial input to author macro., Stefan Monnier, 2014/11/01
- [elpa] 100/299: Better unbinding of SPC in LaTeX-arg-acro-key-val and LaTeX-arg-siunitx-unit.,
Stefan Monnier <=
- [elpa] 106/299: Add beamer class options., Stefan Monnier, 2014/11/01
- [elpa] 95/299: Add new style files acro.el and acronym.el., Stefan Monnier, 2014/11/01
- [elpa] 108/299: Some improvements to amsthm style file., Stefan Monnier, 2014/11/01
- [elpa] 107/299: Add counters and pagestyle to some class styles., Stefan Monnier, 2014/11/01
- [elpa] 110/299: Set default environment for some class styles., Stefan Monnier, 2014/11/01
- [elpa] 113/299: Change BibTeX button to Biber when LaTeX-using-biber is non-nil., Stefan Monnier, 2014/11/01
- [elpa] 112/299: Add new variable `LaTeX-default-document-environment'., Stefan Monnier, 2014/11/01
- [elpa] 111/299: Add history variables in some style files., Stefan Monnier, 2014/11/01
- [elpa] 115/299: Document LaTeX-default-document-environment., Stefan Monnier, 2014/11/01
- [elpa] 114/299: Wrap dollars around active region typing `$'., Stefan Monnier, 2014/11/01