From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Leo Liu Newsgroups: gmane.emacs.devel Subject: Re: master a710f8a: * lisp/comint.el (comint-history-isearch-setup): Check if process is live. Date: Wed, 07 Feb 2018 09:19:08 +0800 Message-ID: References: <20180206213907.23079.76097@vcs0.savannah.gnu.org> <20180206213908.03CCC208E4@vcs0.savannah.gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1517966340 32364 195.159.176.226 (7 Feb 2018 01:19:00 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 7 Feb 2018 01:19:00 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (macOS 10.12.6) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Feb 07 02:18:56 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ejENe-0006vg-57 for ged-emacs-devel@m.gmane.org; Wed, 07 Feb 2018 02:18:34 +0100 Original-Received: from localhost ([::1]:59174 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ejEPf-0000ii-Jt for ged-emacs-devel@m.gmane.org; Tue, 06 Feb 2018 20:20:39 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41422) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ejEOt-0000gd-Ve for emacs-devel@gnu.org; Tue, 06 Feb 2018 20:19:52 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ejEOq-0000AI-J3 for emacs-devel@gnu.org; Tue, 06 Feb 2018 20:19:51 -0500 Original-Received: from [195.159.176.226] (port=56694 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ejEOp-00009P-P7 for emacs-devel@gnu.org; Tue, 06 Feb 2018 20:19:48 -0500 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1ejEMS-0002cw-Sq for emacs-devel@gnu.org; Wed, 07 Feb 2018 02:17:20 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 48 Original-X-Complaints-To: usenet@blaine.gmane.org Face: iVBORw0KGgoAAAANSUhEUgAAACgAAAAoBAMAAAB+0KVeAAAAElBMVEUAAAAAAP+LRRP0pGC+ vr7///+7mT1iAAAAAWJLR0QAiAUdSAAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9cBBwMO DhglKe4AAAEsSURBVCjPbZNBboQwDEV/Cd4X9QJRThApmn0XYW+Jyf2v0m+HhqDBgiAe9rcTG7QH w/1Vn2Ar8gBb/ocywSN3qK9T3z4eFDB4eApocBpeBs1RSykoJd8gQcm8pGmHXFso3ajnmsqV0TnY DQkOfXUfN5NwaI7AWTVOyEhcu1aHmdWItHddUVUcUgUBCkitu8V6ditHVOVdqzl2EQ1ZVGTbdK0V 7cqn8vWzoU5Q/bF9Y/Y0cRU1xwkys5dJ+Dt6pBDWifcNQml8Gh2JVmPSoQzo7en0grswkxrUGYJ7 0hSxxAGr7ZMwYcHIzprpi7TENEE1xtiYxixRlCfPBsUUrwHD7uGIwATrbnODJcVrPpVn3hxiGloe m/S+z3CtuzUSMo83N4DPH+F0evwR3P4A2k+75838OKQAAAAASUVORK5CYII= Cancel-Lock: sha1:i1ZHmsMan5uVc4FolVTP/7NRhsA= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:222607 Archived-At: On 2018-02-06 16:39 -0500, Juri Linkov wrote: > branch: master > commit a710f8aa61ca73054109dc4f926d1ac6aabdd849 > Author: Juri Linkov > Commit: Juri Linkov > > * lisp/comint.el (comint-history-isearch-setup): Check if process is live. > > Don't activate comint-history isearch when shell prompt is empty > like in all *Async Shell Command* buffers. (Bug#30187) > --- > lisp/comint.el | 15 +++++++++++---- > 1 file changed, 11 insertions(+), 4 deletions(-) > > diff --git a/lisp/comint.el b/lisp/comint.el > index 8dba317..b4fbfc8 100644 > --- a/lisp/comint.el > +++ b/lisp/comint.el > @@ -1448,10 +1448,17 @@ If nil, Isearch operates on the whole comint buffer." > (defun comint-history-isearch-setup () > "Set up a comint for using Isearch to search the input history. > Intended to be added to `isearch-mode-hook' in `comint-mode'." > - (when (or (eq comint-history-isearch t) > - (and (eq comint-history-isearch 'dwim) > - ;; Point is at command line. > - (comint-after-pmark-p))) > + (when (and (get-buffer-process (current-buffer)) > + (or (eq comint-history-isearch t) > + (and (eq comint-history-isearch 'dwim) > + ;; Point is at command line. > + (comint-after-pmark-p) > + ;; Prompt is not empty like in Async Shell Command buffers > + (not (eq (save-excursion > + (goto-char (comint-line-beginning-position)) > + (forward-line 0) > + (point)) > + (comint-line-beginning-position)))))) > (setq isearch-message-prefix-add "history ") > (setq-local isearch-search-fun-function > #'comint-history-isearch-search) > Changing comint-history-isearch-setup this way seems too pervasive. I have a use case where (get-buffer-process (current-buffer)) is always nil. Is there another way to work around the issue in *Async Shell Command*? Thanks. Leo