From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Joseph Xu Newsgroups: gmane.emacs.help Subject: Re: Multiple M-x shells sharing input ring Date: Fri, 5 Sep 2014 00:33:57 -0700 Message-ID: References: <87ppfbkw31.fsf@web.de> <7fba0cb5-c7a9-40ef-9de4-3191a6c52f3a@default> <87bnqvktkf.fsf@web.de> <6938458c-7116-458a-9e10-8397dfa5b25a@default> <87ha0njd4s.fsf@web.de> <5aed63a6-1ff4-46f5-a417-f2db62251da5@default> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1409902608 14649 80.91.229.3 (5 Sep 2014 07:36:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 5 Sep 2014 07:36:48 +0000 (UTC) Cc: Michael Heerdegen , "help-gnu-emacs@gnu.org" To: Drew Adams Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Sep 05 09:36:40 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 1XPo4V-00008f-Vu for geh-help-gnu-emacs@m.gmane.org; Fri, 05 Sep 2014 09:36:40 +0200 Original-Received: from localhost ([::1]:55893 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPo4V-0006Jx-8M for geh-help-gnu-emacs@m.gmane.org; Fri, 05 Sep 2014 03:36:39 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:32785) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPo2Z-0003YZ-Dv for help-gnu-emacs@gnu.org; Fri, 05 Sep 2014 03:34:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XPo2T-00073L-75 for help-gnu-emacs@gnu.org; Fri, 05 Sep 2014 03:34:39 -0400 Original-Received: from mail-oi0-f47.google.com ([209.85.218.47]:52765) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPo2T-00073H-2V for help-gnu-emacs@gnu.org; Fri, 05 Sep 2014 03:34:33 -0400 Original-Received: by mail-oi0-f47.google.com with SMTP id a141so5420759oig.20 for ; Fri, 05 Sep 2014 00:33:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=panbNNGqPds2qzhr07fEp6K5+MRcxp4E5+p8iRjNtx8=; b=PvQujAQEQYbialo+pHD+1pHZEqEpKfo/2sXLx/aDsu4eX++eMGxji3j7QwY30ydnfG 4BXcvGIHwgkuhzRg3K976ioTUzMZjwtKk7JzNC7VQP5N62SF7xetgHrlmOuDCe+ttdLx L0KpBWO5GxekoBsG8bQIrSkoLcEZy1/P85lG0vFbYwTfrGhaMk0UsBmpv5BrYcexTNob qAjcsrUVETu6uF/FyyDMvZ7FeqGQbBpRm4wfl6pe/6d+0CEe7bCJL71cOt5gmMlkzmia j2eUJU619e/7JzHviK99TVAvgUw22B67pFtFBpv9rr7Pd6urE6ssBvqEQH2i2w5LDVWs 7kIw== X-Received: by 10.182.220.226 with SMTP id pz2mr126075obc.76.1409902437620; Fri, 05 Sep 2014 00:33:57 -0700 (PDT) Original-Received: by 10.182.92.137 with HTTP; Fri, 5 Sep 2014 00:33:57 -0700 (PDT) In-Reply-To: <5aed63a6-1ff4-46f5-a417-f2db62251da5@default> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.218.47 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 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:99661 Archived-At: Thanks for all the feedback. Unfortunately I'm not very familiar with elisp, and most of the discussion went over my head. In the end I was able to get the behavior I wanted by just adding a hook to comint-input-filter-functions that executes comint-read-input-ring, which reloads the history ring from file after every command. This only works because I use zsh and have SHARED_HISTORY on, so every executed command is immediately written to ~/.history. Not very elegant, but I don't have to hack elisp, and has the extra benefit of being able to share history with other terminals. Regards, Joseph