all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#16891: 24.3; [PATCH] align-regexp now has a separate history for its interactive argument
@ 2014-02-27 10:54 Dima Kogan
  2016-02-24  3:05 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Dima Kogan @ 2014-02-27 10:54 UTC (permalink / raw
  To: 16891

[-- Attachment #1: Type: text/plain, Size: 288 bytes --]

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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-align-regexp-now-has-a-separate-history-for-its-inte.patch --]
[-- Type: text/x-diff, Size: 1250 bytes --]

From 87b7d1b978e427768fa38b09000eb16e2101dad2 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 | 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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* bug#16891: 24.3; [PATCH] align-regexp now has a separate history for its interactive argument
  2014-02-27 10:54 bug#16891: 24.3; [PATCH] align-regexp now has a separate history for its interactive argument Dima Kogan
@ 2016-02-24  3:05 ` Lars Ingebrigtsen
  2016-02-28  2:49   ` Dima Kogan
  0 siblings, 1 reply; 4+ messages in thread
From: Lars Ingebrigtsen @ 2016-02-24  3:05 UTC (permalink / raw
  To: Dima Kogan; +Cc: 16891

Dima Kogan <dima@secretsauce.net> writes:

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

[...]

> +(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)

I think that makes sense.  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...

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#16891: 24.3; [PATCH] align-regexp now has a separate history for its interactive argument
  2016-02-24  3:05 ` Lars Ingebrigtsen
@ 2016-02-28  2:49   ` Dima Kogan
  2016-02-28  4:45     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Dima Kogan @ 2016-02-28  2:49 UTC (permalink / raw
  To: Lars Ingebrigtsen; +Cc: 16891

[-- Attachment #1: Type: text/plain, Size: 387 bytes --]

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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-align-regexp-now-has-a-separate-history-for-its-inte.patch --]
[-- Type: text/x-diff, Size: 1726 bytes --]

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.
 \f
 * 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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* bug#16891: 24.3; [PATCH] align-regexp now has a separate history for its interactive argument
  2016-02-28  2:49   ` Dima Kogan
@ 2016-02-28  4:45     ` Lars Ingebrigtsen
  0 siblings, 0 replies; 4+ messages in thread
From: Lars Ingebrigtsen @ 2016-02-28  4:45 UTC (permalink / raw
  To: Dima Kogan; +Cc: 16891

Dima Kogan <dima@secretsauce.net> writes:

> 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

Thanks; applied.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-02-28  4:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-27 10:54 bug#16891: 24.3; [PATCH] align-regexp now has a separate history for its interactive argument Dima Kogan
2016-02-24  3:05 ` Lars Ingebrigtsen
2016-02-28  2:49   ` Dima Kogan
2016-02-28  4:45     ` Lars Ingebrigtsen

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.