bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#16891: 24.3; [PATCH] align-regexp now has a separate history for its


From: Dima Kogan
Subject: bug#16891: 24.3; [PATCH] align-regexp now has a separate history for its interactive argument
Date: Sat, 27 Feb 2016 18:49:55 -0800
User-agent: mu4e 0.9.11; emacs 25.0.90.1

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Could you resubmit this patch with an etc/NEWS entry, and a possible
> documentation change? I'm not sure whether we usually mention separate
> histories for commands or not, though...

Patch attached. I'm assuming this is going to master (NEWS entry in
25.2) and that no documentation change is necessary. This seems too
small to document

>From c973972cbac84e0c9e228376a547df3eddb001f3 Mon Sep 17 00:00:00 2001
From: Dima Kogan <dima@secretsauce.net>
Date: Thu, 27 Feb 2014 02:45:43 -0800
Subject: [PATCH] `align-regexp' now has a separate history for its interactive
 argument

lisp/align.el (align-regexp-history): New variable (bug#16891)
---
 etc/NEWS      | 5 +++++
 lisp/align.el | 5 ++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/etc/NEWS b/etc/NEWS
index ec68cce..aec34c3 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 @@ align-mode-exclude-rules-list
 (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 @@ align-regexp
     (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"))
-- 
2.1.4


reply via email to

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