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: Multiple M-x shells sharing input ring Date: Thu, 4 Sep 2014 13:09:42 -0700 (PDT) Message-ID: <7fba0cb5-c7a9-40ef-9de4-3191a6c52f3a@default> References: <87ppfbkw31.fsf@web.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1409861428 17654 80.91.229.3 (4 Sep 2014 20:10:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 4 Sep 2014 20:10:28 +0000 (UTC) To: Michael Heerdegen , help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Sep 04 22:10:21 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XPdMK-00031z-SX for geh-help-gnu-emacs@m.gmane.org; Thu, 04 Sep 2014 22:10:20 +0200 Original-Received: from localhost ([::1]:53938 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPdMJ-0005fh-UJ for geh-help-gnu-emacs@m.gmane.org; Thu, 04 Sep 2014 16:10:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50617) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPdLy-0005bq-2f for help-gnu-emacs@gnu.org; Thu, 04 Sep 2014 16:10:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XPdLp-0005ZP-CF for help-gnu-emacs@gnu.org; Thu, 04 Sep 2014 16:09:58 -0400 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:31116) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPdLp-0005ZG-5s for help-gnu-emacs@gnu.org; Thu, 04 Sep 2014 16:09:49 -0400 Original-Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s84K9jeA025993 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 4 Sep 2014 20:09:46 GMT Original-Received: from aserz7021.oracle.com (aserz7021.oracle.com [141.146.126.230]) by ucsinet22.oracle.com (8.14.5+Sun/8.14.5) with ESMTP id s84K9hgp025579 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 4 Sep 2014 20:09:45 GMT Original-Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s84K9hOX027393; Thu, 4 Sep 2014 20:09:43 GMT In-Reply-To: <87ppfbkw31.fsf@web.de> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8.2 (807160) [OL 12.0.6691.5000 (x86)] X-Source-IP: ucsinet22.oracle.com [156.151.31.94] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 141.146.126.69 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:99647 Archived-At: > > Is there a way to have multiple M-x shell buffers share an input > > ring? >=20 > Not without some dirty hack. >=20 > `shell' is based on comint.el that uses a buffer local history > variable (`comint-input-ring') for every buffer. However, you can > try to copy the history from one buffer to the other:... Too bad that `comint-input-ring' is "permanent local". Should it be, or is that a bug? (elisp) `' says that a permanent-local variable is one that is "appropriate for data pertaining to where the file came from or how to save it, rather than with how to edit the contents." It does not sound to me like `comint-input-ring' fits that description at all. Anyway, presumably you could remove its permanent-local status, by removing property `permanent-local' from symbol `comint-input-ring'. Then you should be able to use `kill-local-variable', to have all comint buffers share the same variable (value). (Dunno whether that is what is what Joseph wants.) >From (emacs) `Locals': `M-x kill-local-variable' makes a specified variable cease to be local to the current buffer. The global value of the variable henceforth is in effect in this buffer. Setting the major mode kills all the local variables of the buffer except for a few variables specially marked as "permanent locals". Presumably, any buffer where you do that would then use the global value of `comint-input-ring'. (And of course that would=20 then be the ring that gets updated from any such buffer.) I haven't tried any of this, but you might want to give it a try: (put 'comint-input-ring 'permanent-local nil) ; Do once (kill-local-variable 'comint-input-ring) ; Do in each shell buffer