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: Gnu emacs under Windows: .emacs and _emacs and savehist Date: Wed, 11 Jul 2007 11:48:13 -0700 Message-ID: References: <4694E478.6060703@math.umass.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1184179785 30963 80.91.229.12 (11 Jul 2007 18:49:45 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 11 Jul 2007 18:49:45 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jul 11 20:49:42 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 1I8hFt-0007v0-K6 for geh-help-gnu-emacs@m.gmane.org; Wed, 11 Jul 2007 20:49:41 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I8hFt-0002zD-0m for geh-help-gnu-emacs@m.gmane.org; Wed, 11 Jul 2007 14:49:41 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1I8hFd-0002ys-Kl for help-gnu-emacs@gnu.org; Wed, 11 Jul 2007 14:49:25 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1I8hFa-0002vu-QE for help-gnu-emacs@gnu.org; Wed, 11 Jul 2007 14:49:24 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I8hFa-0002vm-Nc for help-gnu-emacs@gnu.org; Wed, 11 Jul 2007 14:49:22 -0400 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 1I8hFa-0004U6-7p for help-gnu-emacs@gnu.org; Wed, 11 Jul 2007 14:49:22 -0400 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 l6BInIPu009605; Wed, 11 Jul 2007 12:49:18 -0600 Original-Received: from acsmt351.oracle.com (acsmt351.oracle.com [141.146.40.151]) by rgmgw2.us.oracle.com (Switch-3.2.4/Switch-3.1.7) with ESMTP id l6BHODYF012870; Wed, 11 Jul 2007 12:49:17 -0600 Original-Received: from dhcp-4op11-4op12-west-130-35-178-179.us.oracle.com by acsmt351.oracle.com with ESMTP id 3031264541184179694; Wed, 11 Jul 2007 11:48:14 -0700 X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138 In-Reply-To: <4694E478.6060703@math.umass.edu> Importance: Normal X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE X-detected-kernel: 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:45615 Archived-At: > The manual says ".emacs" although other docs, for Windows emacs, say > "_emacs" will do. Yes, _emacs also works, at least on MS Windows. I use _emacs, for Emacs 20, 21, and 22 - it works fine. > So I changed the file to ".emacs" and instead of > pointing save-hist to a file in directory .emacs, .emacs is not a directory; it is an initialization file. If you use _emacs, then you don't also need .emacs; they serve the same purpose: init file. I don't explicitly point `savehist-file' anywhere; I use the default value, which is ~/.emacs-history. You can use any file you want. > changed it to a file in directory .emacs.d. That should be OK. > So here's the relevant portion of my file ~/.emacs: > > (require 'savehist) > (setq savehist-file "~/.emacs.d/history") > (setq savehist-length 1000) > (savehist-load) > (setq savehist-mode 1) IIUC, savehist-load and savehist-mode do the same thing. savehist-mode replaces savehist-load, which is now obsolete. If your version of savehist.el defines savehist-mode, then you should not need to use savehist-load. Second, you should turn on the mode by using the mode function (command), `savehist-mode', not by setting the mode variable, `savehist-mode'. Third, AFAIK, savehist-length is also obsolete, unless you use XEmacs. FYI, I do (only) this, in my _emacs: (require 'savehist) (savehist-mode 1) Actually, I use savehist-20+.el instead of savehist.el, since it works with any version of Emacs (20, 21, 22). If that interests you, you can get it here: http://www.emacswiki.org/cgi-bin/wiki/savehist-20%2b.el. So, what I really do is this: (require 'savehist-20+) (savehist-mode 1) > I changed the backquote to an apostrophe; changed the directory that's > the target of savehist-file; `savehist-file' should point to a file, not a directory. It is the file where your minibuffer histories will be saved. > and as seemed to be suggested by help for > savehist, added the line setting savehist-mode to the positive value 1. No, that last part is wrong, I believe. Call the mode function instead. > Now how do I USE savehist? This I cannot discern from the documentation. If you have things set up right, then you do nothing (beyond the `require' and turning on `savehist-mode'). When you exit Emacs, it writes your minibuffer histories to the file that is the value of `savehist-file'. When you start Emacs up again, it reads the saved histories, so you can immediately use them when Emacs reads minibuffer input. HTH.