From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] minibuffer issue with eshell-command Date: Fri, 07 Oct 2011 21:12:39 +0200 Message-ID: <87botsobtk.fsf@gmail.com> References: <87lisy7g00.fsf@gmail.com> <87hb3me15c.fsf@gmail.com> <877h4irsye.fsf@gmail.com> <878vowj3t4.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1318014784 13800 80.91.229.12 (7 Oct 2011 19:13:04 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 7 Oct 2011 19:13:04 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Oct 07 21:13:00 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RCFqt-0000Zy-Ih for ged-emacs-devel@m.gmane.org; Fri, 07 Oct 2011 21:12:59 +0200 Original-Received: from localhost ([::1]:44850 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RCFqt-0003Rf-0J for ged-emacs-devel@m.gmane.org; Fri, 07 Oct 2011 15:12:59 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:54090) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RCFqp-0003RK-RN for emacs-devel@gnu.org; Fri, 07 Oct 2011 15:12:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RCFqo-00083m-Jc for emacs-devel@gnu.org; Fri, 07 Oct 2011 15:12:55 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:44733) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RCFqo-00083b-7n for emacs-devel@gnu.org; Fri, 07 Oct 2011 15:12:54 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1RCFqm-0000XR-4n for emacs-devel@gnu.org; Fri, 07 Oct 2011 21:12:52 +0200 Original-Received: from 83.78.88.79.rev.sfr.net ([79.88.78.83]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 07 Oct 2011 21:12:52 +0200 Original-Received: from thierry.volpiatto by 83.78.88.79.rev.sfr.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 07 Oct 2011 21:12:52 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 60 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 83.78.88.79.rev.sfr.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.90 (gnu/linux) Cancel-Lock: sha1:sQXIV/bKPuv1xfoUFs+PK1q2MrU= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:144716 Archived-At: Thierry Volpiatto writes: > Thierry Volpiatto writes: > >> Stefan Monnier writes: >> >>>>> When eshell-command start, it set eshell-mode in all minibuffers: >>>>> ;(add-hook 'minibuffer-setup-hook 'eshell-mode) >>>>> So when running another minibuffer, while eshell-command is started, >>>>> it enable eshell-mode in this one, which is wrong. >>>>> This patch fix this: >>> >>>> Any objections to push this on trunk? >>> >>> That looks OK, except that I think the add-hooks should be moved to the >>> setup-hook function where they can be made to only apply locally (and >>> I guess at that point you can get rid of the remove-hooks). >> Right. >> I have already commited this, i will modify tomorrow. > I don't see the post of this morning to Leo, so i resend here. > > diff --git a/lisp/eshell/eshell.el b/lisp/eshell/eshell.el > index 08bb30d..c33c2cc 100644 > --- a/lisp/eshell/eshell.el > +++ b/lisp/eshell/eshell.el > @@ -344,16 +344,16 @@ With prefix ARG, insert output into the current buffer at point." > (require 'esh-cmd) > (unless arg > (setq arg current-prefix-arg)) > - (unwind-protect > - (let ((eshell-non-interactive-p t)) > - ;; Enable `eshell-mode' only in this minibuffer. > - (minibuffer-with-setup-hook 'eshell-mode > - (add-hook 'minibuffer-exit-hook 'eshell-add-command-to-history) > - (add-hook 'eshell-mode-hook 'eshell-return-exits-minibuffer) > - (unless command > - (setq command (read-from-minibuffer "Emacs shell command: "))))) > - (remove-hook 'eshell-mode-hook 'eshell-return-exits-minibuffer) > - (remove-hook 'minibuffer-exit-hook 'eshell-add-command-to-history)) > + (let ((eshell-non-interactive-p t)) > + ;; Enable `eshell-mode' only in this minibuffer. > + (minibuffer-with-setup-hook #'(lambda () > + (eshell-mode) > + (eshell-return-exits-minibuffer)) > + (unwind-protect > + (unless command > + (setq command (read-from-minibuffer "Emacs shell command: "))) > + (when command > + (eshell-add-input-to-history command))))) > (unless command > (error "No command specified!")) > ;; redirection into the current buffer is achieved by adding an > > Have a look please. Ok, if no more comments, i will push tomorrow. -- 𝕋𝕙𝕚𝕖𝕣𝕣𝕪 Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997