unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#65318: 29.1.50; `comint-run' should read-string with specified history list
@ 2023-08-15 20:15 bruno cuconato
  2023-08-16 11:44 ` Eli Zaretskii
  2023-08-20 16:58 ` Juri Linkov
  0 siblings, 2 replies; 3+ messages in thread
From: bruno cuconato @ 2023-08-15 20:15 UTC (permalink / raw)
  To: 65318


Not really a bug, but a feature request. When I run `comint-run' I use
the history to find the switches I need, and often have to waddle
through a bunch of unrelated input. As I understand it, that is
because the interactive `read-string' call does not specify a history
list (and thus a global one is used, I assume.¹) I'm not sure what the
best solution is: do we want to add a history list just for the
switches, or do we want it to be shared with other commands (like
`shell-command'?), or would any change to the history list argument
break people's workflows? I for one would prefer the first option.

¹: An unrelated mini-bug: `read-string's docstring does not say what
 happens when the argument is nil, although maybe the manual might do
 so (I haven't checked). Obviously, one can simply check the C source.






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

* bug#65318: 29.1.50; `comint-run' should read-string with specified history list
  2023-08-15 20:15 bug#65318: 29.1.50; `comint-run' should read-string with specified history list bruno cuconato
@ 2023-08-16 11:44 ` Eli Zaretskii
  2023-08-20 16:58 ` Juri Linkov
  1 sibling, 0 replies; 3+ messages in thread
From: Eli Zaretskii @ 2023-08-16 11:44 UTC (permalink / raw)
  To: bruno cuconato; +Cc: 65318

> From: bruno cuconato <bcclaro@gmail.com>
> Date: Tue, 15 Aug 2023 17:15:41 -0300
> 
> 
> Not really a bug, but a feature request. When I run `comint-run' I use
> the history to find the switches I need, and often have to waddle
> through a bunch of unrelated input. As I understand it, that is
> because the interactive `read-string' call does not specify a history
> list (and thus a global one is used, I assume.¹) I'm not sure what the
> best solution is: do we want to add a history list just for the
> switches, or do we want it to be shared with other commands (like
> `shell-command'?), or would any change to the history list argument
> break people's workflows? I for one would prefer the first option.

Since the best solution is not clear, I think we should provide a user
option that would name the history to use, and make it nil by default,
to preserve the current behavior.  Patches welcome.

> ¹: An unrelated mini-bug: `read-string's docstring does not say what
>  happens when the argument is nil, although maybe the manual might do
>  so (I haven't checked). Obviously, one can simply check the C source.

The doc string says to check the documentation of read-from-minibuffer
for the details of HISTORY, and read-from-minibuffer says that if the
argument is nil or omitted, it defaults to minibuffer-history.  So I
think we are okay in that department.

Thanks.





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

* bug#65318: 29.1.50; `comint-run' should read-string with specified history list
  2023-08-15 20:15 bug#65318: 29.1.50; `comint-run' should read-string with specified history list bruno cuconato
  2023-08-16 11:44 ` Eli Zaretskii
@ 2023-08-20 16:58 ` Juri Linkov
  1 sibling, 0 replies; 3+ messages in thread
From: Juri Linkov @ 2023-08-20 16:58 UTC (permalink / raw)
  To: bruno cuconato; +Cc: 65318

> Not really a bug, but a feature request. When I run `comint-run' I use
> the history to find the switches I need, and often have to waddle
> through a bunch of unrelated input. As I understand it, that is
> because the interactive `read-string' call does not specify a history
> list (and thus a global one is used, I assume.¹) I'm not sure what the
> best solution is: do we want to add a history list just for the
> switches, or do we want it to be shared with other commands (like
> `shell-command'?), or would any change to the history list argument
> break people's workflows? I for one would prefer the first option.

Instead of adding new history variables with user options
to every use of 'read-string' such as in 'comint-run':
(read-string "Run program: ") and (read-string "Switches: "),
maybe better to add a single common option with a mapping
from a command and a prompt regexp to the history variable.

Then you could customize it to e.g.:

  (setq read-history-variables
   '((comint-run "Run program" shell-command-history)
     (comint-run "Switches" my-switches-history)))





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

end of thread, other threads:[~2023-08-20 16:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-15 20:15 bug#65318: 29.1.50; `comint-run' should read-string with specified history list bruno cuconato
2023-08-16 11:44 ` Eli Zaretskii
2023-08-20 16:58 ` Juri Linkov

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).