From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: Changes to comint-line-beginning-position Date: Thu, 29 Oct 2015 02:05:37 +0200 Organization: LINKOV.NET Message-ID: <87mvv27d4e.fsf@mail.linkov.net> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1446077367 3096 80.91.229.3 (29 Oct 2015 00:09:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 29 Oct 2015 00:09:27 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 29 01:09:11 2015 Return-path: Envelope-to: ged-emacs-devel@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 1ZramE-0004Mr-1W for ged-emacs-devel@m.gmane.org; Thu, 29 Oct 2015 01:09:10 +0100 Original-Received: from localhost ([::1]:41209 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZramD-0003yD-Q5 for ged-emacs-devel@m.gmane.org; Wed, 28 Oct 2015 20:09:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55783) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zram2-0003y8-2T for emacs-devel@gnu.org; Wed, 28 Oct 2015 20:08:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zralx-0001AF-1Y for emacs-devel@gnu.org; Wed, 28 Oct 2015 20:08:57 -0400 Original-Received: from hapkido.dreamhost.com ([66.33.216.122]:44733) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zralw-00019r-Rz for emacs-devel@gnu.org; Wed, 28 Oct 2015 20:08:52 -0400 Original-Received: from homiemail-a75.g.dreamhost.com (sub3.mail.dreamhost.com [69.163.253.7]) by hapkido.dreamhost.com (Postfix) with ESMTP id 0F946AD736 for ; Wed, 28 Oct 2015 17:08:50 -0700 (PDT) Original-Received: from homiemail-a75.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a75.g.dreamhost.com (Postfix) with ESMTP id 89C0E5EC07C; Wed, 28 Oct 2015 17:08:48 -0700 (PDT) Original-Received: from localhost.linkov.net (m213-100-246-8.cust.tele2.ee [213.100.246.8]) (Authenticated sender: jurta@jurta.org) by homiemail-a75.g.dreamhost.com (Postfix) with ESMTPA id 8BA985EC079; Wed, 28 Oct 2015 17:08:47 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Wed, 28 Oct 2015 14:12:27 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 66.33.216.122 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:192837 Archived-At: > Your changes to comint-line-beginning-position (back in Feb) have broken > indentation in IELM: > > IELM> (foo > bar > > where hitting TAB with point in from of "bar" should indent it (and used > to indent it), but it doesn't any more. > > It's because IELM uses (save-excursion (comint-bol) (bolp)) to check if > we want to indent, but now (comint-bol) doesn't just jump to the > beginning of the second line but all the way to the end of the prompt. > > Could you try and fix it? To better support multi-line command lines, functions used to jump to the beginning of the non-first non-prompt line, now jump to the beginning of the command line. Apparently, this change breaks some existing functions whereas the same change improves other functions to do the right thing with multiple lines. The problem is in different interpretation of logical units used by comint-bol as commands lines vs text lines. The functions that previously assumed only single-line commands benefit from this change when encountering multi-line commands. To fix IELM the following patch should suffice that ignores field boundaries. Also I grepped for other usages of comint-bol and it seems there is no more such problems in the source tree. diff --git a/lisp/ielm.el b/lisp/ielm.el index 183f8a6..b035432 100644 --- a/lisp/ielm.el +++ b/lisp/ielm.el @@ -217,7 +217,7 @@ (defun ielm-complete-filename nil (defun ielm-indent-line nil "Indent the current line as Lisp code if it is not a prompt line." - (when (save-excursion (comint-bol) (bolp)) + (when (save-excursion (comint-bol t) (bolp)) (lisp-indent-line))) ;;; Working buffer manipulation