|
From: | Kevin Rodgers |
Subject: | Re: Saving/Recalling Shell Commands History? |
Date: | Mon, 21 Aug 2006 15:32:46 -0600 |
User-agent: | Thunderbird 1.5.0.5 (Windows/20060719) |
Peter Dyballa wrote:
Am 21.08.2006 um 22:17 schrieb Drew Adams:Although I have set comint-input-ring-file-name, this file never gets written.Did you set it locally in the shell buffer (mode)? The doc string says this:"This variable is buffer-local, and is a good thing to set in mode hooks."No. I found it in a *customise* buffer and set it there first.What is the value of comint-input-ring-file-name in your shell buffer if you don't ever explicitly set it?Now, edited to fit into a system of a handful Emacsen, it is set as: '(comint-input-ring-file-name (concat desktop-dirname "/history"))Desktop-dirname is defined in .emacs. In recent GNU Emacs 23 the variable's value is described as:comint-input-ring-file-name is a variable defined in `comint.el'. Its value is "~/.history" Local in buffer *shell*; global value is "~/.emacs.d/PDesktop-23/history"
So you have managed to change its global value, but not the value in the *shell* buffer.
Documentation: *If non-nil, name of the file to read/write input history. See also `comint-read-input-ring' and `comint-write-input-ring'.This variable is buffer-local, and is a good thing to set in mode hooks. You can /customize/ this variable.When I comment the comint-input-ring-file-name setting line, its value is simply "~/.history."
So leave it commented out, and put this in your ~/.emacs file: (add-hook 'shell-mode-hook (lambda () (setq comint-input-ring-file-name ; buffer-local (expand-file-name "history" desktop-dirname))))
I retrieved the values by pasting comint-input-ring-file-name into *shell* buffer and pressing C-h v.
OK. -- Kevin
[Prev in Thread] | Current Thread | [Next in Thread] |