unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Gnu emacs under Windows: .emacs and _emacs and savehist
@ 2007-07-11  4:04 Murray Eisenberg
  2007-07-11  8:54 ` Peter Dyballa
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Murray Eisenberg @ 2007-07-11  4:04 UTC (permalink / raw)
  To: help-gnu-emacs

I've installed a binary version of Gnu Emacs under Windows 
(specifically,t he latest Gnu Emacs + AUCTeX bundle) directly under 
Windows -- NOT under Cygwin -- and inserted the usual code into _emacs 
to activate savehist:

   (require `savehist)
   (setq savehist-file "~/.emacs/history")
   (setq savehist-length 1000)
   (savehist-load)

But I don't seem to see any difference now, either when I exit emacs or 
when I start it again.  In fact, I'm not even certain that emacs is 
processing the _emacs file.

Part of the problem may be the name, _emacs, of the initialization file: 
Originally, the file was named .emacs and placed inside my home 
directory.  But then I realized that savehist wants to save the history 
to a subdirectory .emacs of my home directory, and of course it's 
impossible to have both a directory and another file of the same name in 
the same directory.  Which is why I renamed the file from .emacs to 
_emacs (which I thought was OK).

Before I did that renaming, at least when I tried to quit emacs I saw a 
message that emacs was trying to save the history but could not find 
subdirectory .emacs of my home directory (because, of course, at that 
point, there was none).

So obviously I'm very confused.  Can you help me straighten this out?
-- 
Murray Eisenberg                     murray@math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower      phone 413 549-1020 (H)
University of Massachusetts                413 545-2859 (W)
710 North Pleasant Street            fax   413 545-1801
Amherst, MA 01003-9305

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Gnu emacs under Windows: .emacs and _emacs and savehist
  2007-07-11  4:04 Gnu emacs under Windows: .emacs and _emacs and savehist Murray Eisenberg
@ 2007-07-11  8:54 ` Peter Dyballa
  2007-07-11 11:29 ` Jason Rumney
       [not found] ` <mailman.3317.1184144075.32220.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 18+ messages in thread
From: Peter Dyballa @ 2007-07-11  8:54 UTC (permalink / raw)
  To: murray; +Cc: help-gnu-emacs


Am 11.07.2007 um 06:04 schrieb Murray Eisenberg:

>   (require `savehist)

Shouldn't here an apostrophe (') be used?

What is the GNU Emacs manual telling you about a personal  
initialisation file under MS Windows?

--
Greetings

   Pete

“I hope to die before I *have* to use Microsoft Word.”
      - Donald E. Knuth, 2001-10-02 in Tübingen.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Gnu emacs under Windows: .emacs and _emacs and savehist
  2007-07-11  4:04 Gnu emacs under Windows: .emacs and _emacs and savehist Murray Eisenberg
  2007-07-11  8:54 ` Peter Dyballa
@ 2007-07-11 11:29 ` Jason Rumney
  2007-07-11 11:34   ` Jason Rumney
  2007-07-11 14:10   ` Murray Eisenberg
       [not found] ` <mailman.3317.1184144075.32220.help-gnu-emacs@gnu.org>
  2 siblings, 2 replies; 18+ messages in thread
From: Jason Rumney @ 2007-07-11 11:29 UTC (permalink / raw)
  To: help-gnu-emacs

On 11 Jul, 05:04, Murray Eisenberg <mur...@math.umass.edu> wrote:

> Originally, the file was named .emacs and placed inside my home
> directory.  But then I realized that savehist wants to save the history
> to a subdirectory .emacs of my home directory

That sounds like a very serious bug in savehist. .emacs is the
standard name for the init file, it should not be trying to create a
subdirectory of that name!

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Gnu emacs under Windows: .emacs and _emacs and savehist
  2007-07-11 11:29 ` Jason Rumney
@ 2007-07-11 11:34   ` Jason Rumney
  2007-07-11 14:10   ` Murray Eisenberg
  1 sibling, 0 replies; 18+ messages in thread
From: Jason Rumney @ 2007-07-11 11:34 UTC (permalink / raw)
  To: help-gnu-emacs

On 11 Jul, 12:29, Jason Rumney <jasonrum...@gmail.com> wrote:
>
> That sounds like a very serious bug in savehist. .emacs is the
> standard name for the init file, it should not be trying to create a
> subdirectory of that name!

Actually, the bug is not in savehist, it is in your .emacs:

> On 11 Jul, 05:04, Murray Eisenberg <mur...@math.umass.edu> wrote:
>
>>   (setq savehist-file "~/.emacs/history")

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Gnu emacs under Windows: .emacs and _emacs and savehist
       [not found] ` <mailman.3317.1184144075.32220.help-gnu-emacs@gnu.org>
@ 2007-07-11 14:08   ` Murray Eisenberg
  2007-07-11 15:24     ` Peter Dyballa
                       ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Murray Eisenberg @ 2007-07-11 14:08 UTC (permalink / raw)
  Cc: help-gnu-emacs

Peter Dyballa wrote:
> 
> Am 11.07.2007 um 06:04 schrieb Murray Eisenberg:
> 
>>   (require `savehist)
> 
> Shouldn't here an apostrophe (') be used?
> 
> What is the GNU Emacs manual telling you about a personal initialisation 
> file under MS Windows?

The manual says ".emacs" although other docs, for Windows emacs, say 
"_emacs" will do.  So I changed the file to ".emacs" and instead of 
pointing save-hist to a file in directory .emacs, changed it to a file 
in directory .emacs.d.  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)

I changed the backquote to an apostrophe; changed the directory that's 
the target of savehist-file; and as seemed to be suggested by help for 
savehist, added the line setting savehist-mode to the positive value 1.

Now how do I USE savehist?  This I cannot discern from the documentation.

(Sorry about asking such presumably elementary questions but, despite my 
some 30+ years experience with computing, nothing about emacs is clear 
or intuitive to me.)

-- 
Murray Eisenberg                     murray@math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower      phone 413 549-1020 (H)
University of Massachusetts                413 545-2859 (W)
710 North Pleasant Street            fax   413 545-1801
Amherst, MA 01003-9305

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Gnu emacs under Windows: .emacs and _emacs and savehist
  2007-07-11 11:29 ` Jason Rumney
  2007-07-11 11:34   ` Jason Rumney
@ 2007-07-11 14:10   ` Murray Eisenberg
  2007-07-11 14:58     ` Vagn Johansen
  2007-07-11 15:31     ` Peter Dyballa
  1 sibling, 2 replies; 18+ messages in thread
From: Murray Eisenberg @ 2007-07-11 14:10 UTC (permalink / raw)
  To: help-gnu-emacs

Jason Rumney wrote:
> 
>  .emacs is the
> standard name for the init file....

So why in the world to the emacs docs simply refer to the file as "init" 
throughout instead of saying ".emacs"??

-- 
Murray Eisenberg                     murray@math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower      phone 413 549-1020 (H)
University of Massachusetts                413 545-2859 (W)
710 North Pleasant Street            fax   413 545-1801
Amherst, MA 01003-9305

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Gnu emacs under Windows: .emacs and _emacs and savehist
  2007-07-11 14:10   ` Murray Eisenberg
@ 2007-07-11 14:58     ` Vagn Johansen
  2007-07-11 15:31     ` Peter Dyballa
  1 sibling, 0 replies; 18+ messages in thread
From: Vagn Johansen @ 2007-07-11 14:58 UTC (permalink / raw)
  To: help-gnu-emacs

Murray Eisenberg <murray@math.umass.edu> writes:

> Jason Rumney wrote:
>>  .emacs is the
>> standard name for the init file....
>
> So why in the world to the emacs docs simply refer to the file as "init"
> throughout instead of saying ".emacs"??

Because there are other possible file names for the init file (see the docs).
.emacs is probably the most frequently used name ("standard").

>From the emacs 22.1 news file (C-h N)

* Startup Changes in Emacs 22.1

** Init file changes
If the init file ~/.emacs does not exist, Emacs will try
~/.emacs.d/init.el or ~/.emacs.d/init.elc.  Likewise, if the shell init file
~/.emacs_SHELL is not found, Emacs will try ~/.emacs.d/init_SHELL.sh.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Gnu emacs under Windows: .emacs and _emacs and savehist
  2007-07-11 14:08   ` Murray Eisenberg
@ 2007-07-11 15:24     ` Peter Dyballa
       [not found]     ` <mailman.3344.1184167477.32220.help-gnu-emacs@gnu.org>
  2007-07-11 18:48     ` Drew Adams
  2 siblings, 0 replies; 18+ messages in thread
From: Peter Dyballa @ 2007-07-11 15:24 UTC (permalink / raw)
  To: murray; +Cc: help-gnu-emacs


Am 11.07.2007 um 16:08 schrieb Murray Eisenberg:

> Now how do I USE savehist?

I don't know, I use save-session and desktop. Could be there is some  
init command to run first:

	C-h f savehist TAB TAB
	C-h v savehist TAB TAB


--
Greetings

   Pete

                (This space left blank for technical reasons.)

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Gnu emacs under Windows: .emacs and _emacs and savehist
  2007-07-11 14:10   ` Murray Eisenberg
  2007-07-11 14:58     ` Vagn Johansen
@ 2007-07-11 15:31     ` Peter Dyballa
  2007-07-11 15:50       ` Lennart Borgman (gmail)
  1 sibling, 1 reply; 18+ messages in thread
From: Peter Dyballa @ 2007-07-11 15:31 UTC (permalink / raw)
  To: murray; +Cc: help-gnu-emacs


Am 11.07.2007 um 16:10 schrieb Murray Eisenberg:

> Jason Rumney wrote:
>>  .emacs is the
>> standard name for the init file....
>
> So why in the world to the emacs docs simply refer to the file as  
> "init" throughout instead of saying ".emacs"??

GNU Emacs, I think, either loads ~/.emacs or default.el, could be the  
latter has to reside in a directory ~/.emacs.d (or in load-path?) or  
is meant for a world with files that don't start with `.´, could be  
this all is only valid in some UNIX and only for GNU Emacs 22 ...

--
Greetings

   Pete

Globalisation -- communism from above.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Gnu emacs under Windows: .emacs and _emacs and savehist
  2007-07-11 15:31     ` Peter Dyballa
@ 2007-07-11 15:50       ` Lennart Borgman (gmail)
  0 siblings, 0 replies; 18+ messages in thread
From: Lennart Borgman (gmail) @ 2007-07-11 15:50 UTC (permalink / raw)
  To: Peter Dyballa; +Cc: help-gnu-emacs, murray

Peter Dyballa wrote:
> 
> Am 11.07.2007 um 16:10 schrieb Murray Eisenberg:
> 
>> Jason Rumney wrote:
>>>  .emacs is the
>>> standard name for the init file....
>>
>> So why in the world to the emacs docs simply refer to the file as 
>> "init" throughout instead of saying ".emacs"??
> 
> GNU Emacs, I think, either loads ~/.emacs or default.el, could be the 
> latter has to reside in a directory ~/.emacs.d (or in load-path?) or is 
> meant for a world with files that don't start with `.´, could be this 
> all is only valid in some UNIX and only for GNU Emacs 22 ...


See

    M-: (info "(emacs) Init File")

There can be 3 initialization files, executed in this order

    site-start.el
    .emacs
    default.el

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Gnu emacs under Windows: .emacs and _emacs and savehist
       [not found]     ` <mailman.3344.1184167477.32220.help-gnu-emacs@gnu.org>
@ 2007-07-11 16:25       ` Murray Eisenberg
  2007-07-11 17:16         ` Peter Dyballa
  0 siblings, 1 reply; 18+ messages in thread
From: Murray Eisenberg @ 2007-07-11 16:25 UTC (permalink / raw)
  To: help-gnu-emacs

Peter Dyballa wrote:
> 
> Am 11.07.2007 um 16:08 schrieb Murray Eisenberg:
> 
>> Now how do I USE savehist?
> 
> I don't know, I use save-session and desktop. Could be there is some 
> init command to run first:
> 
>     C-h f savehist TAB TAB
>     C-h v savehist TAB TAB

The help was less not terribly informative to this emacs newbie.  I do have

   '(savehist-mode t nil (savehist)))

in my .emacs and it seems to be saving the history, but I have no idea 
how to retrieve it!

I did get save desktop working by putting

   (desktop-save-mode 1)

into my .emacs.

But what is "save-session"?  I tried finding that in help, but it tells 
me no match.  (And searching on functions beginning "save" turns up no 
match, either, for "save-session" or "savesession", etc.)

-- 
Murray Eisenberg                     murray@math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower      phone 413 549-1020 (H)
University of Massachusetts                413 545-2859 (W)
710 North Pleasant Street            fax   413 545-1801
Amherst, MA 01003-9305

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Gnu emacs under Windows: .emacs and _emacs and savehist
  2007-07-11 16:25       ` Murray Eisenberg
@ 2007-07-11 17:16         ` Peter Dyballa
  0 siblings, 0 replies; 18+ messages in thread
From: Peter Dyballa @ 2007-07-11 17:16 UTC (permalink / raw)
  To: murray; +Cc: help-gnu-emacs


Am 11.07.2007 um 18:25 schrieb Murray Eisenberg:

> I did get save desktop working by putting
>
>   (desktop-save-mode 1)
>
> into my .emacs.

Some description in the Emacs manual under "Saving Emacs Sessions."

>
> But what is "save-session"?  I tried finding that in help, but it  
> tells me no match.  (And searching on functions beginning "save"  
> turns up no match, either, for "save-session" or "savesession", etc.)

Ah, sorry: it's just session.el (mixed with desktop):

       (setq desktop-globals-to-save '(desktop-missing-file-warning))
       (setq desktop-dirname (format "~/.emacs.d/PDesktop-%d" emacs- 
major-version))	; multi-version
       (require 'session)				; "load" session
       (add-hook 'after-init-hook 'session-initialize)	; init
       (unless (string-match "Step 8" mEV)		; elderly Emacs
         (unless buffer-read-only
           (delete-trailing-whitespace))			; convenient for *me*
         (desktop-save-mode 1)
         (setq session-save-file-coding-system 'utf-8-unix))	; dito
       (setq desktop-base-file-name "emacs.desktop")	; useless?
       (setq session-save-file
           (format "%s/Psession-%d" desktop-dirname emacs-major- 
version))	; multi-version


Save-hist has to do with saving mini-buffer contents. I have no  
experience with this (I am not knowingly using it). Could be it means  
that when you enter the mini-buffer (not the echo area) you have a  
history of previous commands by using the up and down keys (including  
some extras!). It might be that you see only replace or only shell- 
command or only whatever commands you did before depending on the way  
you entered mini-buffer. Just try a few things with M-x!

--
Greetings

   Pete

"engineer: a mechanism for converting caffeine into designs"

^ permalink raw reply	[flat|nested] 18+ messages in thread

* RE: Gnu emacs under Windows: .emacs and _emacs and savehist
  2007-07-11 14:08   ` Murray Eisenberg
  2007-07-11 15:24     ` Peter Dyballa
       [not found]     ` <mailman.3344.1184167477.32220.help-gnu-emacs@gnu.org>
@ 2007-07-11 18:48     ` Drew Adams
  2 siblings, 0 replies; 18+ messages in thread
From: Drew Adams @ 2007-07-11 18:48 UTC (permalink / raw)
  To: murray; +Cc: help-gnu-emacs

> 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.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Gnu emacs under Windows: .emacs and _emacs and savehist
       [not found] <mailman.3365.1184179766.32220.help-gnu-emacs@gnu.org>
@ 2007-07-12 16:52 ` Murray Eisenberg
  2007-07-12 17:05   ` Peter Dyballa
  2007-07-12 17:09   ` Drew Adams
  0 siblings, 2 replies; 18+ messages in thread
From: Murray Eisenberg @ 2007-07-12 16:52 UTC (permalink / raw)
  Cc: help-gnu-emacs


Drew Adams wrote:
> [Murray Eisenberg wrote:]
>>  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'....
> 
> FYI, I do (only) this, in my _emacs:
> 
> (require 'savehist)
> (savehist-mode 1)

OK, I've pared my manual additions to .emacs relevant to savehist to:

   (require 'savehist)
   (setq savehist-file "~/.emacs.d/history")

So should I delete is the following part of .emacs, which was 
automatically inserted when I was doing configuration by pressing some 
buttons:

  (custom-set-variables
   ;; custom-set-variables was added by Custom.
   ;; If you edit it by hand, you could mess it up, so be careful.
   ;; Your init file should contain only one such instance.
   ;; If there is more than one, they won't work right.
  '(savehist-mode t nil (savehist)))


-- 
Murray Eisenberg                     murray@math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower      phone 413 549-1020 (H)
University of Massachusetts                413 545-2859 (W)
710 North Pleasant Street            fax   413 545-1801
Amherst, MA 01003-9305

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Gnu emacs under Windows: .emacs and _emacs and savehist
  2007-07-12 16:52 ` Murray Eisenberg
@ 2007-07-12 17:05   ` Peter Dyballa
  2007-07-12 17:09   ` Drew Adams
  1 sibling, 0 replies; 18+ messages in thread
From: Peter Dyballa @ 2007-07-12 17:05 UTC (permalink / raw)
  To: murray; +Cc: help-gnu-emacs


Am 12.07.2007 um 18:52 schrieb Murray Eisenberg:

> So should I delete is the following part of .emacs, which was  
> automatically inserted when I was doing configuration by pressing  
> some buttons:
>
>  (custom-set-variables
>   ;; custom-set-variables was added by Custom.
>   ;; If you edit it by hand, you could mess it up, so be careful.
>   ;; Your init file should contain only one such instance.
>   ;; If there is more than one, they won't work right.
>  '(savehist-mode t nil (savehist)))

No. This seems to activate savehist-mode. Since it's in the  
customisation section of ~/.emacs you should change the settings via  
the customise interface – or you know *exactly* what you're doing here!

--
Greetings

   Pete

Increase the size of your bike by at least *five* inches!

^ permalink raw reply	[flat|nested] 18+ messages in thread

* RE: Gnu emacs under Windows: .emacs and _emacs and savehist
  2007-07-12 16:52 ` Murray Eisenberg
  2007-07-12 17:05   ` Peter Dyballa
@ 2007-07-12 17:09   ` Drew Adams
  1 sibling, 0 replies; 18+ messages in thread
From: Drew Adams @ 2007-07-12 17:09 UTC (permalink / raw)
  To: murray; +Cc: help-gnu-emacs

> > 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'....
> >
> > FYI, I do (only) this, in my _emacs:
> >
> > (require 'savehist)
> > (savehist-mode 1)
>
> OK, I've pared my manual additions to .emacs relevant to savehist to:
>
>    (require 'savehist)
>    (setq savehist-file "~/.emacs.d/history")
>
> So should I delete is the following part of .emacs, which was
> automatically inserted when I was doing configuration by pressing some
> buttons:
>
>   (custom-set-variables
>    ;; custom-set-variables was added by Custom.
>    ;; If you edit it by hand, you could mess it up, so be careful.
>    ;; Your init file should contain only one such instance.
>    ;; If there is more than one, they won't work right.
>   '(savehist-mode t nil (savehist)))

Did you try it? It's hard for us to know if you're still having a problem or
not.

I'm no expert on this, but I think that the custom-set-variables should
still be OK. However, it's not clear to me that you won't still need to call
(savehist-mode 1). That custom-set-variables sets the mode variable, and
sometimes that is sufficient to turn on a mode, but sometimes it is not.

Things might also depend on which version of savehist.el and which version
of Emacs you use. As I said, I just require the library and call the mode -
I didn't customize anything.

I'd say, try it and see if it works. If not, try contacting the savehist.el
author or filing an Emacs bug (if the savehist version you have is included
with Emacs).

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Gnu emacs under Windows: .emacs and _emacs and savehist
       [not found] <mailman.3405.1184260312.32220.help-gnu-emacs@gnu.org>
@ 2007-07-12 22:03 ` David Kastrup
  2007-07-12 23:21   ` Drew Adams
  0 siblings, 1 reply; 18+ messages in thread
From: David Kastrup @ 2007-07-12 22:03 UTC (permalink / raw)
  To: help-gnu-emacs

"Drew Adams" <drew.adams@oracle.com> writes:

>>   (custom-set-variables
>>    ;; custom-set-variables was added by Custom.
>>    ;; If you edit it by hand, you could mess it up, so be careful.
>>    ;; Your init file should contain only one such instance.
>>    ;; If there is more than one, they won't work right.
>>   '(savehist-mode t nil (savehist)))
>
> Did you try it? It's hard for us to know if you're still having a
> problem or not.
>
> I'm no expert on this,

Yes.

> but I think that the custom-set-variables should still be
> OK. However, it's not clear to me that you won't still need to call
> (savehist-mode 1). That custom-set-variables sets the mode variable,

No.  It uses the customize setter function for setting this variable.
Unless the defcustom is completely broken (and I see no reason to
assume so), this will do whatever is required to activate the mode.

> and sometimes that is sufficient to turn on a mode, but sometimes it
> is not.

If the invocation saved by customize is not sufficient for setting a
mode, this is a bug.

> Things might also depend on which version of savehist.el and which
>version of Emacs you use. As I said, I just require the library and
>call the mode - I didn't customize anything.

In that case, of course, you are yourself responsible for doing
everything necessary for setting the mode.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

^ permalink raw reply	[flat|nested] 18+ messages in thread

* RE: Gnu emacs under Windows: .emacs and _emacs and savehist
  2007-07-12 22:03 ` David Kastrup
@ 2007-07-12 23:21   ` Drew Adams
  0 siblings, 0 replies; 18+ messages in thread
From: Drew Adams @ 2007-07-12 23:21 UTC (permalink / raw)
  To: David Kastrup, help-gnu-emacs

> > As I said, I just require the library and
> > call the mode - I didn't customize anything.
>
> In that case, of course, you are yourself responsible for doing
> everything necessary for setting the mode.

Huh?

(1) That works; it is sufficient, at least with Emacs 22 and its version of
savehist.el.

(2) That is just what the commentary in the library says to do: put
(savehist-mode 1) in ~/.emacs.

;; To use savehist, turn on savehist-mode by putting the following in
;; `~/.emacs': (savehist-mode 1)

It does also say that you can alternatively customize the option:

;; or with customize: `M-x customize-option RET savehist-mode RET'.

In neither case should "you, yourself, be responsible for doing everything
necessary for setting the mode", whatever that might mean. Either method
should work fine.

The important things wrt the OP are: (1) to know how savehist works and what
it does (how the history is used), (2) to know that _emacs should work as
well as .emacs on Windows, (3) to know that .emacs is a file, not a
directory, (4) to get rid of the `savehist-length' setting, which is not
used in savehist versions that have `savehist-mode', (5) to get rid of
`savehist-load', which is obsolete for the same versions, (6) to either (a)
call function `savehist-mode' with a positive arg or (b) customize variable
`savehist-mode', to turn the mode on.

David reminded us that customizing the variable (= 6b) will work because of
the custom setter function; I helped with the rest. Hopefully, it should
work for you now. Let us know if you still have a problem. We still don't
know what version of savehist and Emacs you have, but that's only important
if things still do not work for you.

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2007-07-12 23:21 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-11  4:04 Gnu emacs under Windows: .emacs and _emacs and savehist Murray Eisenberg
2007-07-11  8:54 ` Peter Dyballa
2007-07-11 11:29 ` Jason Rumney
2007-07-11 11:34   ` Jason Rumney
2007-07-11 14:10   ` Murray Eisenberg
2007-07-11 14:58     ` Vagn Johansen
2007-07-11 15:31     ` Peter Dyballa
2007-07-11 15:50       ` Lennart Borgman (gmail)
     [not found] ` <mailman.3317.1184144075.32220.help-gnu-emacs@gnu.org>
2007-07-11 14:08   ` Murray Eisenberg
2007-07-11 15:24     ` Peter Dyballa
     [not found]     ` <mailman.3344.1184167477.32220.help-gnu-emacs@gnu.org>
2007-07-11 16:25       ` Murray Eisenberg
2007-07-11 17:16         ` Peter Dyballa
2007-07-11 18:48     ` Drew Adams
     [not found] <mailman.3365.1184179766.32220.help-gnu-emacs@gnu.org>
2007-07-12 16:52 ` Murray Eisenberg
2007-07-12 17:05   ` Peter Dyballa
2007-07-12 17:09   ` Drew Adams
     [not found] <mailman.3405.1184260312.32220.help-gnu-emacs@gnu.org>
2007-07-12 22:03 ` David Kastrup
2007-07-12 23:21   ` Drew Adams

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).