unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Hrvoje Niksic <hniksic@xemacs.org>
Cc: rms@gnu.org, emacs-devel@gnu.org
Subject: Re: Saving minibuffer history
Date: 18 Oct 2005 16:27:35 +0200	[thread overview]
Message-ID: <87hdbe2948.fsf@xemacs.org> (raw)
In-Reply-To: <87zmp9sd0o.fsf-monnier+emacs@gnu.org>

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> Thank you.  Installed.  Along with a few minor changes, mostly to
> remove run-time dependency on CL

These changes seem to make the code less readable.  For example:

    (delete-if-not #'savehist-printable value)

is changed to:

    (delq nil (mapcar (lambda (x) (if (savehist-printable x) x)) value))

And:

    (subseq value 0 savehist-length)

is changed to:

    (setq value (copy-sequence value))
    (setcdr (nthcdr savehist-length value) nil)

While I understand the desire to leave the namespace unfettered by cl
compatibility code, maybe you should at least leave the original forms
commented-out, so that the intention is clear(er)?

> and to get rid of most checks for XEmacs, replaced by checks for
> features.

This is a bad idea.  There are extensions out there that approach
cross-emacs compatibility by defining functions normally not present
in the other implementation.  For example, w3 used to define (and
maybe still does) `map-extents' under Emacs.  There are extensions
that define `run-with-timer' under XEmacs.  Such emulations are
incomplete and one does not wish to use them unless necessary.

In other words, I intentionally checked for XEmacs to decide which API
to use.  I would appreciate if you left this intact.

> I have one question: what's the point of savehist-no-conversion?

The code simply needs to check whether the buffer contents has changed
since the last save.  I wanted to checksum the raw buffer data, which
'no-conversion achieves in Emacs, and 'binary in XEmacs.  To make the
intentions clear and remove an `if' from the code, I used a defconst.

> Also see attached a proposed patch (100% guaranteed untested).  If
> nobody objects, I'll install it.
> 
> I could also get rid of savehist-history-variables altogether.

What is your intended replacement?  If I understand
minibuffer-history-variable, it only records the minibuffer history
for minibuffer input whose history is not otherwise specified.  Which
means that it doesn't record the history of M-x, M-:, C-x C-f, etc.

But the point of savehist is to be as easy as possible to set up,
because other editors have such a feature built-in.  Being easy to set
up means saving the most important minibuffer histories by default,
with the ability to save more (or less!) if one chooses to.  As the
commentary says, putting (savehist-load) to `.emacs' should be enough.

  reply	other threads:[~2005-10-18 14:27 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-14 13:40 Saving minibuffer history Hrvoje Niksic
2005-10-14 23:29 ` Hrvoje Niksic
2005-10-14 23:44   ` Drew Adams
2005-10-15 16:13 ` Richard M. Stallman
2005-10-15 22:28   ` Hrvoje Niksic
2005-10-15 23:29     ` Drew Adams
2005-10-16  7:28       ` David Kastrup
2005-10-16 15:49         ` Drew Adams
2005-10-16 16:16           ` Stefan Monnier
2005-10-16 17:58             ` Drew Adams
2005-10-16 21:52               ` David Kastrup
2005-10-17  1:10               ` Stefan Monnier
2005-10-17  8:25                 ` Hrvoje Niksic
2005-10-16 12:32       ` Hrvoje Niksic
2005-10-16 13:02       ` Stefan Monnier
2005-10-18 14:41         ` Hrvoje Niksic
2005-10-24 16:55           ` Drew Adams
2005-10-24 17:02             ` Drew Adams
2005-10-24 17:48               ` Stefan Monnier
2005-10-16 15:39     ` Stefan Monnier
2005-10-18 14:27       ` Hrvoje Niksic [this message]
2005-10-18 16:12         ` Stefan Monnier
2005-10-18 23:34           ` Hrvoje Niksic
2005-10-19 18:51             ` Stefan Monnier
2005-10-20  9:09               ` Hrvoje Niksic
2005-10-20  9:12                 ` Hrvoje Niksic
2005-10-20 16:25                   ` Stefan Monnier
2005-10-20 21:04                     ` Hrvoje Niksic
2005-10-24 16:02       ` Hrvoje Niksic
2005-10-24 17:16         ` Stefan Monnier
2005-10-25  9:04           ` Hrvoje Niksic
2005-10-26 16:46             ` Richard M. Stallman
2005-10-24 22:24         ` Stefan Monnier
2005-10-25  4:37           ` Stefan Monnier
2005-10-25  9:46             ` Hrvoje Niksic
2005-10-25 14:51               ` Stefan Monnier
2005-10-25 21:04             ` Hrvoje Niksic
2005-11-01  6:12               ` Stefan Monnier
2005-10-25  9:20           ` Hrvoje Niksic
2005-10-25 12:34             ` Miles Bader
2005-10-25 13:58               ` Hrvoje Niksic
2005-10-25 14:00                 ` Miles Bader
2005-10-25 14:39             ` Stefan Monnier
2005-10-25 19:07               ` Hrvoje Niksic
2005-10-25 15:58         ` Richard M. Stallman
2005-10-16 17:36     ` Richard M. Stallman
2005-10-16 20:18       ` Hrvoje Niksic
2005-10-16 21:55       ` David Kastrup

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87hdbe2948.fsf@xemacs.org \
    --to=hniksic@xemacs.org \
    --cc=emacs-devel@gnu.org \
    --cc=rms@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).