From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Seb Newsgroups: gmane.emacs.help,gmane.comp.gis.grass.user Subject: Re: changing comint-input-ring-file-name in process in shell Date: Sun, 08 Nov 2009 11:57:41 -0600 Organization: Church of Emacs Message-ID: <87vdhkx5ka.fsf@kolob.sebmags.homelinux.org> References: <87my2z88g2.fsf@kolob.sebmags.homelinux.org> <87vdhm6mdy.fsf@kolob.sebmags.homelinux.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1257703128 11292 80.91.229.12 (8 Nov 2009 17:58:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 8 Nov 2009 17:58:48 +0000 (UTC) Cc: grass-user@lists.osgeo.org To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Nov 08 18:58:41 2009 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 1N7C2A-00038T-9p for geh-help-gnu-emacs@m.gmane.org; Sun, 08 Nov 2009 18:58:38 +0100 Original-Received: from localhost ([127.0.0.1]:40976 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N7C29-000320-QL for geh-help-gnu-emacs@m.gmane.org; Sun, 08 Nov 2009 12:58:37 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N7C1f-0002xW-Hr for help-gnu-emacs@gnu.org; Sun, 08 Nov 2009 12:58:07 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N7C1b-0002vq-RD for help-gnu-emacs@gnu.org; Sun, 08 Nov 2009 12:58:07 -0500 Original-Received: from [199.232.76.173] (port=46029 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N7C1b-0002vi-Ey for help-gnu-emacs@gnu.org; Sun, 08 Nov 2009 12:58:03 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:54638) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1N7C1a-0007Tr-Rm for help-gnu-emacs@gnu.org; Sun, 08 Nov 2009 12:58:03 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.50) id 1N7C1Z-0002tb-9b for help-gnu-emacs@gnu.org; Sun, 08 Nov 2009 18:58:01 +0100 Original-Received: from s01060015e975d7fb.wp.shawcable.net ([24.77.73.195]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 08 Nov 2009 18:58:01 +0100 Original-Received: from spluque by s01060015e975d7fb.wp.shawcable.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 08 Nov 2009 18:58:01 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Followup-To: gmane.comp.gis.grass.user Original-Lines: 60 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: s01060015e975d7fb.wp.shawcable.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) Cancel-Lock: sha1:fJD7qHaL1x4gGgF4WEmbc397bgo= X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) 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:69612 gmane.comp.gis.grass.user:32049 Archived-At: On Sat, 07 Nov 2009 15:44:09 -0600, Seb wrote: > On Sat, 07 Nov 2009 00:10:28 -0700, > Kevin Rodgers wrote: [...] >> How about: >> (let ((comint-input-ring-file-name "/path/to/local/.bash_history")) >> (shell)) > Thanks for the explanation Kevin. There is no difference with your > suggestion, however. In the resulting shell buffer I see: > ,-----[ C-h v comint-input-ring-file-name RET ] >> comint-input-ring-file-name's value is "~/.bash_history" Local in >> buffer *shell*; global value is nil >> >> 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. >> >> [back] > `----- > and cycling shows that: i.e. "M-n" and "M-p" cycle through > ~/bash_history, rather than the value in the `let' statement. This is > strange. This is on Emacs 23. I eventually solved this with: (defun grass (full-location) "Call grass with FULL-LOCATION arguments and set up a shell buffer to work on. FULL-LOCATION must be a fully-qualified GRASS location; i.e. it must include GISDBASE/LOCATION_NAME/MAPSET. The GRASS process runs in a shell buffer, named *GRASS*." (interactive "DLocation: ") (let ((grassbuf "*GRASS*")) (shell grassbuf) (comint-send-string grassbuf (concat "grass " full-location "\n")) (setq comint-input-ring-file-name (or (getenv "HISTFILE") (concat (directory-file-name full-location) "/.bash_history"))) (comint-read-input-ring))) Cc'ing the grass-user list where it might be of interest. Thanks, -- Seb