all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "Markus Dehmann" <markus.dehmann@gmail.com>, <help-gnu-emacs@gnu.org>
Subject: RE: Restore minibuffer history, e.g. for compile commands, after restart?
Date: Thu, 13 Dec 2007 10:17:27 -0800	[thread overview]
Message-ID: <DNEMKBNJBGPAOPIJOOICGEPHEBAA.drew.adams@oracle.com> (raw)
In-Reply-To: <3e86cb5a-4cf0-4d06-b6f0-08e74e949493@s12g2000prg.googlegroups.com>

> Okay, here is what I get with a fresh .emacs that contains only
> (require 'save-hist-20+), also I delete any old .emacs.d/history file.
> 1. open emacs, `M-x compile RET' (shows 'Compile command: make -k'),
>    remove 'make -k' and type 'foobar' RET.
> 2. close and reopen emacs
> 3. M-x <up> (shows 'compile') RET (shows 'Compile command: make -k')
> 4. <up> (shows 'Beginning of buffer. No preceding item' and jumps back
>    to 'Compile command: make -k')
> 5. <down> (shows 'Compile command:')
> 6. <up> (shows 'Compile command: foobar')

I assume that you also put (savehist-mode 1) in your .emacs.

> If on 6., I type <down> again, instead of <up>, I get 'End of history:
> No default available', then <up> shows 'Compile command: foobar'
>
> The fact that the fresh emacs shows 'make -k' as a default is kind of
> unexpected, right? May this pre-setting be the cause of the trouble?
> Note that on step 1., I did not press RET for make -k, and still it
> shows up again after restarting emacs.

If `compilation-read-command' is non-nil (the default value is t) then
"make -k" is always the default value for the compile command. To have the
default value for the compile command be the last compile command you
entered, set `compilation-read-command' to nil.

Check the value of variable `compile-history' after step 2, using `C-h v'.
If it includes the last compile command you entered, then the problem is not
with savehist. In that case, you might want to report an Emacs bug for
command `compile'.

> > After step 2, visit `savehist-file'. What do you see recorded for
> > `compile-history'? You should see something like (setq compile-history
> > '("foobar")).
>
> What is 'savehist-file'?

It's the variable that tells savehist where you want to save the histories.
By default, its value is "~/.emacs-history". You can customize this
variable.

In sum, check the saved value of `compile-history'. If it looks good, then
the problem is not with savehist.

  reply	other threads:[~2007-12-13 18:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.4805.1197225563.18990.help-gnu-emacs@gnu.org>
2007-12-13 15:11 ` Restore minibuffer history, e.g. for compile commands, after restart? Markus Dehmann
2007-12-13 18:17   ` Drew Adams [this message]
     [not found] <mailman.4784.1197177791.18990.help-gnu-emacs@gnu.org>
2007-12-09 17:38 ` Markus Dehmann
2007-12-09 18:39   ` Drew Adams
2007-12-08  6:07 Markus Dehmann
2007-12-09  3:28 ` Stefan Monnier
2007-12-09  5:22   ` Drew Adams

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

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

  git send-email \
    --in-reply-to=DNEMKBNJBGPAOPIJOOICGEPHEBAA.drew.adams@oracle.com \
    --to=drew.adams@oracle.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=markus.dehmann@gmail.com \
    /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 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.