GNU bug report logs - #19710
24.4.51; Isearch is broken in comints which relly on regexp

Previous Next

Package: emacs;

Reported by: Vitalie Spinu <spinuvit <at> gmail.com>

Date: Wed, 28 Jan 2015 09:11:02 UTC

Severity: normal

Found in version 24.4.51

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Vitalie Spinu <spinuvit <at> gmail.com>
To: Juri Linkov <juri <at> linkov.net>
Cc: 19710 <at> debbugs.gnu.org
Subject: bug#19710: 24.4.51; Isearch is broken in comints which relly on regexp
Date: Wed, 18 Feb 2015 20:18:25 +0200
Works. Thanks!

 >>> Juri Linkov on Wed, 18 Feb 2015 19:01:52 +0200 wrote:

 >> Relatedly, comint-bol inside multiline output regions is broken.
 >> 
 >> In shell buffer:
 >> 
 >> $ locate pwd
 >> 
 >> then go to a previous line and M-x comint-bol. It will jump all the way
 >> back to comint-prompt-regexp.

 > The following patch for the emacs-24 branch should fix this regression.

 > It distinguishes two cases: when point is on the output or input
 > depending on the field property, for the case of comint-use-prompt-regexp=nil.

 > This means that we can't support multi-line commands for the case
 > when comint-use-prompt-regexp=t because it doesn't use fields, thus
 > there is no way to distinguish input from output.

 > So for comint-use-prompt-regexp=t `M-x comint-bol' will work
 > as in the previous release, but `M-x comint-bol' will be
 > fixed for comint-use-prompt-regexp=nil:

 > diff --git a/lisp/comint.el b/lisp/comint.el
 > index c81551a..2532dd7 100644
 > --- a/lisp/comint.el
 > +++ b/lisp/comint.el
 > @@ -2267,8 +2267,6 @@ (defun comint-line-beginning-position ()
 >        ;; Use comint-prompt-regexp
 >        (save-excursion
 >  	(beginning-of-line)
 > -	(unless (looking-at comint-prompt-regexp)
 > -	  (re-search-backward comint-prompt-regexp nil t))
 >  	(comint-skip-prompt)
 >  	(point))
 >      ;; Use input fields.  Note that, unlike the behavior of
 > @@ -2278,7 +2276,10 @@ (defun comint-line-beginning-position ()
 >      ;; if there are two fields on a line, then the first one is the
 >      ;; prompt, and the second one is an input field, and is front-sticky
 >      ;; (as input fields should be).
 > -    (constrain-to-field (field-beginning) (line-end-position))))
 > +    (constrain-to-field (if (eq (field-at-pos (point)) 'output)
 > +			    (line-beginning-position)
 > +			  (field-beginning))
 > +			(line-end-position))))

 >  (defun comint-bol (&optional arg)
 >    "Go to the beginning of line, then skip past the prompt, if any.




This bug report was last modified 10 years and 156 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.