[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Turning on savehist-mode by default
|
From: |
Eli Zaretskii |
|
Subject: |
Re: Turning on savehist-mode by default |
|
Date: |
Tue, 28 Nov 2023 16:38:26 +0200 |
> From: Thanos Apollo <public@thanosapollo.org>
> Date: Tue, 28 Nov 2023 13:04:41 +0200
>
> > savehist-mode is a useful mode which is turned on by many Emacs
> > users. [1] It matches the default behavior of programs like bash and
> > vim, which save command history by default. I suggest that we should
> > find some way to enable savehist by default.
> >
>
> What is the recommended way for package authors to disable
> savehist-mode?
>
> If savehist-mode is enabled by default, it is advisable to also consider
> a simple way to disable it for a specific package mode.
>
> for example I'm using emacs to answer a MCQ, such as:
>
> Q:Which one of the following statements concerning the
> ability of acidosis to precipitate a crisis in sickle cell
> anemia is correct?
>
> ```emacs-lisp
> (completing-read "Answer: "
> '("Fetal blood has a higher affinity for oxygen than does
> adult blood because Hb F has a decreased affinity for
> 2,3-BPG."
> "Purified Hb F (stripped of 2,3-BPG) has a higher affin-
> ity for oxygen than does purified Hb A."
> "The globin chain composition of Hb F is α2δ2."))
> ```
> Saving the latest and usually correct answer defeats the purpose of an MCQ.
>
> One workaround for this is to set minibuffer-history to nil, although it
> is unclear whether this is advised, even with a let statement.
You could instead bind history-add-new-input to nil around calls to
completing-read.
- Re: Turning on savehist-mode by default, (continued)
- Re: [OT] Not clobbering bash history, brickviking, 2023/11/20
- Re: Not clobbering bash history, Juri Linkov, 2023/11/20
- Re: [OT] Not clobbering bash history, Richard Stallman, 2023/11/21
- Re: [OT] Not clobbering bash history, Arsen Arsenović, 2023/11/21
- Re: [OT] Not clobbering bash history, Richard Stallman, 2023/11/24
Re: Turning on savehist-mode by default, Richard Stallman, 2023/11/19
Re: Turning on savehist-mode by default, Thanos Apollo, 2023/11/28
- Re: Turning on savehist-mode by default,
Eli Zaretskii <=
Re: Turning on savehist-mode by default, Thanos Apollo, 2023/11/28
Re: Turning on savehist-mode by default, Björn Bidar, 2023/11/30