emacs-devel
[Top][All Lists]
Advanced

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

Re: Saving minibuffer history


From: Stefan Monnier
Subject: Re: Saving minibuffer history
Date: Tue, 25 Oct 2005 10:39:31 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

> You never informed me about those changes so I missed them.  I did
> notice the changes in the patch you sent me.  Please remember that
> this package is normally also maintained for XEmacs, and as an
> external package (although it probably doesn't have many external
> users).

Sorry.

> I also don't understand why you removed the "*" markers from the
> beginning of docstrings.  Those variables *are* intended to be "set
> and modified by users".

All defcustom vars can be set via M-x set-variable: the * has no effect on
them.

>> E.g. please preserve the arch-tag.
> I don't know what it does and I don't use arch.  Is it always the
> same?  What purpose does it serve?

By its very nature it should never ever change: it represents the identity
of the file, so that if you send it by email, edit it, move it or whatever
else, Arch can still figure out which file is which.

This can even be used for files which live in several repositories (e.g. in
Emacs and in Gnus), since the arch-tag is supposed to be globally unique.

> > It [...] introduces savehist-mode, which would become the main
> > advertized way to turn the feature ON (can also be done via
> > Customize) in place of savehist-load.

> I'm not sure that's a good idea.  savehist-load replaces existing
> minibuffer histories with the loaded ones, which is why it is
> recommended to only call it from `.emacs'.  Since turning on a
> savehist mode calls `savehist-load', it has the nasty side effect of
> ruining existing minibuffer histories.  This is alleviated by the use
> of `savehist-loaded', but it will still ruin the minibuffer histories
> when savehist is first run.

It's a risk, but the same risk exists with savehist-load.  So the same
"solution" should work as well: warn that it should only be used in your
.emacs.

Maybe an alternative is to not do the load immediately, but instead
place it on emacs-startup-hook, so that if it is executed after
emacs-startup-hook was run, it won't be run at all.

> savehist is IMO not a good candidate for a minor mode because turning
> it on and off during an Emacs session does not make much sense.

Yet you provided savehist-uninstall.  To me, the main benefit of making it
a minor mode is that it follows the usual rules of customization.  No need
to read the Commentary, or look through docstrings to find the entry point.
It can even be set via Custom.
Most minor modes are never turned off.

> Also note that XEmacs doesn't support `define-minor-mode', so it would
> complexify the code.

That can be fixed easily.


        Stefan




reply via email to

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