From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Markus Dehmann Newsgroups: gmane.emacs.help Subject: Re: Restore minibuffer history, e.g. for compile commands, after restart? Date: Thu, 13 Dec 2007 07:11:36 -0800 (PST) Organization: http://groups.google.com Message-ID: <3e86cb5a-4cf0-4d06-b6f0-08e74e949493@s12g2000prg.googlegroups.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1197560468 27244 80.91.229.12 (13 Dec 2007 15:41:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 13 Dec 2007 15:41:08 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 13 16:41:18 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1J2qBO-00079f-Cy for geh-help-gnu-emacs@m.gmane.org; Thu, 13 Dec 2007 16:41:06 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J2qB6-0007h4-9H for geh-help-gnu-emacs@m.gmane.org; Thu, 13 Dec 2007 10:40:48 -0500 Original-Path: shelby.stanford.edu!headwall.stanford.edu!newsfeed.stanford.edu!postnews.google.com!s12g2000prg.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 88 Original-NNTP-Posting-Host: 71.166.16.133 Original-X-Trace: posting.google.com 1197558696 28916 127.0.0.1 (13 Dec 2007 15:11:36 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Thu, 13 Dec 2007 15:11:36 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: s12g2000prg.googlegroups.com; posting-host=71.166.16.133; posting-account=S9AQIAoAAAB4GxI-BGAtHONr33Ny0Xlu User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.1.3) Gecko/20070329 Firefox/2.0.0.3,gzip(gfe),gzip(gfe) Original-Xref: shelby.stanford.edu gnu.emacs.help:154641 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:50069 Archived-At: On Dec 9, 1:39 pm, "Drew Adams" wrote: > > On Dec 9, 12:22 am, "Drew Adams" wrote: > > > > > How can I keep thehistoryof minibuffer commands, e.g. the compile > > > > > commands? > > > > > The package is called `savehist'. > > > >Emacs-22 bundles it so you can just add (savehist-mode 1) to > > > > your .emacs. > > > > And here is the same thing (CVS from 2007-11-28), but fixed so > > > it also works withEmacsversions prior to 22.1, if you should > > > need that:http://www.emacswiki.org/cgi-bin/wiki/savehist-20%2b.el > > > Thanks! I haveemacs21.3.1. I installed the package and it works! > > > There is just one bug, > > Never say that. ;-) > > > and I thought I'd share it here, maybe others > > experience the same: If I do M-x compile and go arrow-up to get the > > most recent command it says "no preceding item", then I go "arrow- > > down" and "arrow-up" again, and there it is, the most recent compile > > command, from my lastemacsrun. Or, once I have several in the list > > it won't show the most recent one on "arrow-up", but the next-to-last > > one, then after pressing "arrow-down" it shows the most recent one. > > Sorry, I can't reproduce that. > > My guess is that it might be a problem with vanilla `savehist.el' as well, > because I don't think I changed any of the code concerning that. Or it might > be a problem withEmacs21's treatment of `compile-history' - that is, it > might be completely unrelated to savehist. > > La petite histoire : `savehist-20+.el' is only a trivially modified > `savehist.el': it just doesn't rely upon features that olderEmacsversions > don't have.Emacsdevelopers didn't want to make the trivial changes that > would let `savehist.el' play well with other versions - they don't care > about that. So I posted `savehist-20+.el' atEmacsWiki. > > Perhaps someone else can reproduce the problem you see? Either using > `savehist-20+.el' or `savehist.el' (withEmacs22 or later). > > Try testing with a .emacsthat contains only (require 'save-hist-20+). And > perhap try starting over by deleting your file `savehist-file' (default: > `~/.emacs-history'). > > I think you're saying that this is what you see: > > 1. OpenEmacs, then `M-x compile RET foobar'. > 2. Close and reopenEmacs. > 3. `M-x compile RET ' shows message "no preceding item". > 4. shows ? (what does it show?) > 5. shows `foobar'. > > Is that right? I don't see that. At step 3, I see `foobar'. > Sorry for the late reply! 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 (shows 'compile') RET (shows 'Compile command: make -k') 4. (shows 'Beginning of buffer. No preceding item' and jumps back to 'Compile command: make -k') 5. (shows 'Compile command:') 6. (shows 'Compile command: foobar') If on 6., I type again, instead of , I get 'End of history: No default available', then 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. > 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'? If you want me to do M-x savehist-file -- that's not available. Or did you mean something else? (sorry, although I'm a heavy emacs user, I'm not an expert in the jargon! ;-) --Markus