From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#19710: 24.4.51; Isearch is broken in comints which relly on regexp Date: Wed, 18 Feb 2015 19:01:52 +0200 Organization: LINKOV.NET Message-ID: <874mqjfa3n.fsf@mail.linkov.net> References: <87oapjmfth.fsf@gmail.com> <874mrawgcu.fsf@mail.linkov.net> <87oapi6m3v.fsf@gmail.com> <87vbjhdvas.fsf@mail.linkov.net> <877fvwvfnm.fsf@gmail.com> <87pp9ipplf.fsf@mail.linkov.net> <878ufvkyd9.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1424279195 11380 80.91.229.3 (18 Feb 2015 17:06:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 18 Feb 2015 17:06:35 +0000 (UTC) Cc: 19710@debbugs.gnu.org To: Vitalie Spinu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Feb 18 18:06:21 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YO84q-0006cR-AC for geb-bug-gnu-emacs@m.gmane.org; Wed, 18 Feb 2015 18:06:20 +0100 Original-Received: from localhost ([::1]:51939 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YO84p-0000mA-KL for geb-bug-gnu-emacs@m.gmane.org; Wed, 18 Feb 2015 12:06:19 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59419) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YO84e-0000Yj-Uq for bug-gnu-emacs@gnu.org; Wed, 18 Feb 2015 12:06:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YO84Y-000572-F5 for bug-gnu-emacs@gnu.org; Wed, 18 Feb 2015 12:06:08 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:56705) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YO84Y-00056x-CO for bug-gnu-emacs@gnu.org; Wed, 18 Feb 2015 12:06:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YO84Y-0003G3-1S for bug-gnu-emacs@gnu.org; Wed, 18 Feb 2015 12:06:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 18 Feb 2015 17:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19710 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 19710-submit@debbugs.gnu.org id=B19710.142427914912503 (code B ref 19710); Wed, 18 Feb 2015 17:06:01 +0000 Original-Received: (at 19710) by debbugs.gnu.org; 18 Feb 2015 17:05:49 +0000 Original-Received: from localhost ([127.0.0.1]:47945 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YO84L-0003Fb-9J for submit@debbugs.gnu.org; Wed, 18 Feb 2015 12:05:49 -0500 Original-Received: from ps18281.dreamhost.com ([69.163.222.226]:58140 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YO84I-0003FS-UJ for 19710@debbugs.gnu.org; Wed, 18 Feb 2015 12:05:47 -0500 Original-Received: from localhost.linkov.net (ps18281.dreamhostps.com [69.163.222.226]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 6D8E7302ADCDD6; Wed, 18 Feb 2015 09:05:45 -0800 (PST) In-Reply-To: <878ufvkyd9.fsf@gmail.com> (Vitalie Spinu's message of "Wed, 18 Feb 2015 17:55:46 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (x86_64-pc-linux-gnu) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:99547 Archived-At: > 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.