all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Michael Heerdegen <michael_heerdegen@web.de>, help-gnu-emacs@gnu.org
Subject: RE: Multiple M-x shells sharing input ring
Date: Thu, 4 Sep 2014 13:09:42 -0700 (PDT)	[thread overview]
Message-ID: <7fba0cb5-c7a9-40ef-9de4-3191a6c52f3a@default> (raw)
In-Reply-To: <87ppfbkw31.fsf@web.de>

> > Is there a way to have multiple M-x shell buffers share an input
> > ring?
> 
> Not without some dirty hack.
> 
> `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 
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



  reply	other threads:[~2014-09-04 20:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-04  8:54 Multiple M-x shells sharing input ring Joseph Xu
2014-09-04 14:58 ` Subhan Michael Tindall
2014-09-04 15:55   ` Joseph Xu
2014-09-04 19:46 ` Michael Heerdegen
2014-09-04 20:09   ` Drew Adams [this message]
2014-09-04 20:40     ` Michael Heerdegen
2014-09-04 20:58       ` Drew Adams
2014-09-04 21:21         ` Michael Heerdegen
2014-09-04 21:33           ` Drew Adams
2014-09-05  7:33             ` Joseph Xu
     [not found]       ` <mailman.8284.1409864361.1147.help-gnu-emacs@gnu.org>
2014-09-04 21:09         ` Stefan Monnier
2014-09-04 21:20           ` Drew Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7fba0cb5-c7a9-40ef-9de4-3191a6c52f3a@default \
    --to=drew.adams@oracle.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=michael_heerdegen@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.