From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: Restore minibuffer history, e.g. for compile commands, after restart? Date: Sun, 9 Dec 2007 10:39:33 -0800 Message-ID: References: <655ccf70-6a77-4e8d-a4ad-7624435466d9@d61g2000hsa.googlegroups.com> 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 1197225591 14350 80.91.229.12 (9 Dec 2007 18:39:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 9 Dec 2007 18:39:51 +0000 (UTC) To: "Markus Dehmann" , Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Dec 09 19:40:00 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 1J1R4I-00023f-VP for geh-help-gnu-emacs@m.gmane.org; Sun, 09 Dec 2007 19:39:59 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J1R41-0001kz-IL for geh-help-gnu-emacs@m.gmane.org; Sun, 09 Dec 2007 13:39:41 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1J1R3h-0001jp-5R for help-gnu-emacs@gnu.org; Sun, 09 Dec 2007 13:39:21 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1J1R3e-0001jQ-Ok for help-gnu-emacs@gnu.org; Sun, 09 Dec 2007 13:39:19 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J1R3e-0001jN-IR for help-gnu-emacs@gnu.org; Sun, 09 Dec 2007 13:39:18 -0500 Original-Received: from rgminet01.oracle.com ([148.87.113.118]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1J1R3e-00018l-4F for help-gnu-emacs@gnu.org; Sun, 09 Dec 2007 13:39:18 -0500 Original-Received: from rgmgw2.us.oracle.com (rgmgw2.us.oracle.com [138.1.186.111]) by rgminet01.oracle.com (Switch-3.2.4/Switch-3.1.6) with ESMTP id lB9IdFTR008398; Sun, 9 Dec 2007 11:39:15 -0700 Original-Received: from rcsmt251.oracle.com (rcsmt251.oracle.com [148.87.90.196]) by rgmgw2.us.oracle.com (Switch-3.2.4/Switch-3.2.4) with ESMTP id lB9GdtEl017414; Sun, 9 Dec 2007 11:39:13 -0700 Original-Received: from dhcp-amer-csvpn-gw1-141-144-64-3.vpn.oracle.com by acsmt351.oracle.com with ESMTP id 3423041151197225538; Sun, 09 Dec 2007 10:38:58 -0800 X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 In-Reply-To: <655ccf70-6a77-4e8d-a4ad-7624435466d9@d61g2000hsa.googlegroups.com> X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 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:49965 Archived-At: > On Dec 9, 12:22 am, "Drew Adams" wrote: > > > > How can I keep the history of 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 with Emacs versions prior to 22.1, if you should > > need that: http://www.emacswiki.org/cgi-bin/wiki/savehist-20%2b.el > > Thanks! I have emacs 21.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 last emacs run. 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 with Emacs 21'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 older Emacs versions don't have. Emacs developers 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' at Emacs Wiki. Perhaps someone else can reproduce the problem you see? Either using `savehist-20+.el' or `savehist.el' (with Emacs 22 or later). Try testing with a .emacs that 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. Open Emacs, then `M-x compile RET foobar'. 2. Close and reopen Emacs. 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'. After step 2, visit `savehist-file'. What do you see recorded for `compile-history'? You should see something like (setq compile-history '("foobar")).