From: Leo Liu <sdl.web@gmail.com>
To: emacs-devel@gnu.org
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 [thread overview]
Message-ID: <m1372dzjeb.fsf@gmail.com> (raw)
In-Reply-To: 20180206213908.03CCC208E4@vcs0.savannah.gnu.org
On 2018-02-06 16:39 -0500, Juri Linkov wrote:
> branch: master
> commit a710f8aa61ca73054109dc4f926d1ac6aabdd849
> Author: Juri Linkov <juri@linkov.net>
> Commit: Juri Linkov <juri@linkov.net>
>
> * 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
next parent reply other threads:[~2018-02-07 1:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20180206213907.23079.76097@vcs0.savannah.gnu.org>
[not found] ` <20180206213908.03CCC208E4@vcs0.savannah.gnu.org>
2018-02-07 1:19 ` Leo Liu [this message]
2018-02-07 21:20 ` bug#30187: master a710f8a: * lisp/comint.el (comint-history-isearch-setup): Check if process is live Juri Linkov
2018-02-08 3:13 ` Leo Liu
2018-02-08 21:29 ` Juri Linkov
2018-02-09 2:45 ` Leo Liu
2018-02-11 21:44 ` Juri Linkov
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=m1372dzjeb.fsf@gmail.com \
--to=sdl.web@gmail.com \
--cc=emacs-devel@gnu.org \
/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.