emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master f4b057c 2/2: Use a separate history variable for al


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] master f4b057c 2/2: Use a separate history variable for align-regexp
Date: Sun, 28 Feb 2016 04:47:33 +0000

branch: master
commit f4b057c67f74e0a7a2c4ff03c19c8236989465d0
Author: Dima Kogan <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>

    Use a separate history variable for align-regexp
    
    * lisp/align.el (align-regexp-history): New variable (bug#16891).
    (align-regexp): Use it.
---
 etc/NEWS      |    5 +++++
 lisp/align.el |    5 ++++-
 2 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index c12f4d1..2cb46a1 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -31,6 +31,11 @@ otherwise leave it unmarked.
 
 * Changes in Emacs 25.2
 
+---
+** `align-regexp' has a separate history for its interactive argument
+`align-regexp' no longer shares its history with all other
+history-less functions that use `read-string'
+
 +++
 ** The networking code has been reworked so that it's more
 asynchronous than it was (when specifying :nowait t in
diff --git a/lisp/align.el b/lisp/align.el
index 7e439f3..c3389dc 100644
--- a/lisp/align.el
+++ b/lisp/align.el
@@ -802,6 +802,9 @@ See the variable `align-exclude-rules-list' for more 
details.")
 (defvar align-highlight-overlays nil
   "The current overlays highlighting the text matched by a rule.")
 
+(defvar align-regexp-history nil
+  "Input history for the full user-entered regex in `align-regexp'")
+
 ;; Sample extension rule set, for vhdl-mode.  This should properly be
 ;; in vhdl-mode.el itself.
 
@@ -946,7 +949,7 @@ construct a rule to pass to `align-region', which does the 
real work."
     (list (region-beginning) (region-end))
     (if current-prefix-arg
        (list (read-string "Complex align using regexp: "
-                          "\\(\\s-*\\)")
+                          "\\(\\s-*\\)" 'align-regexp-history)
              (string-to-number
               (read-string
                "Parenthesis group to modify (justify if negative): " "1"))



reply via email to

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