From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Nicolas Goaziou Newsgroups: gmane.emacs.bugs Subject: bug#31361: 25.3; Issue when advising `indent-line-function' Date: Thu, 03 May 2018 23:15:46 +0200 Message-ID: <87sh78phj1.fsf@nicolasgoaziou.fr> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1525382524 25079 195.159.176.226 (3 May 2018 21:22:04 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 3 May 2018 21:22:04 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) Cc: Stefan Monnier To: 31361@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu May 03 23:21:59 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fELfr-0006Of-AS for geb-bug-gnu-emacs@m.gmane.org; Thu, 03 May 2018 23:21:59 +0200 Original-Received: from localhost ([::1]:59148 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fELhw-00071n-AD for geb-bug-gnu-emacs@m.gmane.org; Thu, 03 May 2018 17:24:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37594) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fELb8-0001en-Bc for bug-gnu-emacs@gnu.org; Thu, 03 May 2018 17:17:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fELb5-0000No-Ld for bug-gnu-emacs@gnu.org; Thu, 03 May 2018 17:17:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:40762) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fELb5-0000NZ-IH for bug-gnu-emacs@gnu.org; Thu, 03 May 2018 17:17:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fELb4-0005DH-Fb; Thu, 03 May 2018 17:17:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Nicolas Goaziou Original-Sender: "Debbugs-submit" Resent-CC: monnier@IRO.UMontreal.CA, bug-gnu-emacs@gnu.org Resent-Date: Thu, 03 May 2018 21:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 31361 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org X-Debbugs-Original-Xcc: Stefan Monnier Original-Received: via spool by submit@debbugs.gnu.org id=B.152538216419967 (code B ref -1); Thu, 03 May 2018 21:17:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 3 May 2018 21:16:04 +0000 Original-Received: from localhost ([127.0.0.1]:48658 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fELa7-0005Bz-TK for submit@debbugs.gnu.org; Thu, 03 May 2018 17:16:04 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:45572) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fELa6-0005BF-So for submit@debbugs.gnu.org; Thu, 03 May 2018 17:16:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fELa0-0007da-Hz for submit@debbugs.gnu.org; Thu, 03 May 2018 17:15:57 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:36848) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fELa0-0007d2-B9 for submit@debbugs.gnu.org; Thu, 03 May 2018 17:15:56 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36475) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fELZy-0000uR-Jb for bug-gnu-emacs@gnu.org; Thu, 03 May 2018 17:15:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fELZv-0007Tg-FS for bug-gnu-emacs@gnu.org; Thu, 03 May 2018 17:15:54 -0400 Original-Received: from relay1-d.mail.gandi.net ([217.70.183.193]:56783) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fELZv-0007QQ-2o for bug-gnu-emacs@gnu.org; Thu, 03 May 2018 17:15:51 -0400 X-Originating-IP: 185.131.40.67 Original-Received: from saiph (40-67.ipv4.commingeshautdebit.fr [185.131.40.67]) (Authenticated sender: admin@nicolasgoaziou.fr) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 3FE88240007 for ; Thu, 3 May 2018 23:15:50 +0200 (CEST) Original-Received: from ngz by saiph with local (Exim 4.89) (envelope-from ) id 1fELZq-0004C2-8C for bug-gnu-emacs@gnu.org; Thu, 03 May 2018 23:15:46 +0200 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:145997 Archived-At: Hello, When `indent-line-function' is advised, using `add-function', and the variable contains `indent-relative', `indent-according-to-mode' has an erratic behavior. In the following code, from `indent-according-to-mode', (if (memq indent-line-function '(indent-relative indent-relative-maybe)) ... ;; The normal case. (funcall indent-line-function)) the if branch is no longer executed because `indent-line-function' is no longer `indent-relative' but a closure around it. You can reproduce the issue with the following recipe: - Open a new buffer in Fundamental mode (so `indent-line-function' is `indent-relative') - Insert : "-- Test" - From there, returns to column 0. However, upon evaluating the following: M-: (add-function :before-until (local 'indent-line-function) #'ignore) now moves point at the same column as the "T" from "Test", in the new line. Regards, -- Nicolas Goaziou 0x80A93738