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

From: Dima Kogan <[email-masked]>
Date: Thu, 27 Feb 2014 02:54:20 -0800

Here's a tiny patch to align-regexp. With a prefix argument several
things are read from the minibuffer using read-input, with one (the
regex) being much more complicated than the others. It's convenient to
keep that one in a separate history to make previous entries easily
selectable.

>From 87b7d1b978e427768fa38b09000eb16e2101dad2 Mon Sep 17 00:00:00 2001
From: Dima Kogan <[email-masked]>
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 | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lisp/align.el b/lisp/align.el
index 1efc6e6..6dba225 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"))
-- 
1.9.0