emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: master a710f8a: * lisp/comint.el (comint-history-isearch-setup): Che


From: Leo Liu
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
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (macOS 10.12.6)

On 2018-02-06 16:39 -0500, Juri Linkov wrote:
> branch: master
> commit a710f8aa61ca73054109dc4f926d1ac6aabdd849
> Author: Juri Linkov <address@hidden>
> Commit: Juri Linkov <address@hidden>
>
>     * 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]