From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nicolas Richard Newsgroups: gmane.emacs.bugs Subject: bug#18913: 24.4.51; point going back to bol after every insertion Date: Thu, 30 Oct 2014 13:03:57 +0100 Message-ID: <87ioj1sr0y.fsf@yahoo.fr> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1414781133 19970 80.91.229.3 (31 Oct 2014 18:45:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 31 Oct 2014 18:45:33 +0000 (UTC) To: 18913@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Oct 31 19:45:27 2014 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 1XkHCM-0006zP-MU for geb-bug-gnu-emacs@m.gmane.org; Fri, 31 Oct 2014 19:45:22 +0100 Original-Received: from localhost ([::1]:41051 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XkHCM-0005NO-9v for geb-bug-gnu-emacs@m.gmane.org; Fri, 31 Oct 2014 14:45:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39658) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XkEVi-0007Vz-JQ for bug-gnu-emacs@gnu.org; Fri, 31 Oct 2014 11:53:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XkEVb-0003aX-8D for bug-gnu-emacs@gnu.org; Fri, 31 Oct 2014 11:53:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:49314) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XkEVb-0003Yu-3f for bug-gnu-emacs@gnu.org; Fri, 31 Oct 2014 11:53:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XkEVa-0004Dm-LA for bug-gnu-emacs@gnu.org; Fri, 31 Oct 2014 11:53:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Nicolas Richard Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 31 Oct 2014 15:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 18913 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.141477074516125 (code B ref -1); Fri, 31 Oct 2014 15:53:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 31 Oct 2014 15:52:25 +0000 Original-Received: from localhost ([127.0.0.1]:41409 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XkEUy-0004C1-U3 for submit@debbugs.gnu.org; Fri, 31 Oct 2014 11:52:25 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:37058) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XkEUx-0004Be-9q for submit@debbugs.gnu.org; Fri, 31 Oct 2014 11:52:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XkEU7-0001cL-CA for submit@debbugs.gnu.org; Fri, 31 Oct 2014 11:52:18 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:35089) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XkEU7-0001cE-9c for submit@debbugs.gnu.org; Fri, 31 Oct 2014 11:51:31 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35954) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XkESv-0002S5-7n for bug-gnu-emacs@gnu.org; Fri, 31 Oct 2014 11:51:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XjoT9-0006oF-6e for bug-gnu-emacs@gnu.org; Thu, 30 Oct 2014 08:04:54 -0400 Original-Received: from mxin.ulb.ac.be ([164.15.128.112]:61521) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjoT9-0006no-0p for bug-gnu-emacs@gnu.org; Thu, 30 Oct 2014 08:04:47 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnwKAL8oUlSkD4Xx/2dsb2JhbABcg2JYuU4BAQEBAQEGBZN0iRMBAQEBAX2FGiQ0AQSJBwEVpB2RNIt0AYc7hjaCRogxhDUFkWSMBodXjmiBfiCBWzwvgksBAQE Original-Received: from mathsrv4.ulb.ac.be (HELO localhost) ([164.15.133.241]) by smtp.ulb.ac.be with ESMTP; 30 Oct 2014 13:04:16 +0100 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.51 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). 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:95315 Hello, I found myself in the situation where cursor would go to bol after every character I would insert. The reason was I had a compiled function in my post-self-insert-hook -- its bytecode disassembled to : byte code: doc: ... args: 0 0 varref use-hard-newlines 1 goto-if-nil 1 4 constant set-hard-newline-properties 5 point 6 constant prefix-numeric-value 7 constant nil 8 call 1 9 diff 10 point 11 call 2 12 discard 13:1 save-excursion 14 constant 102025 15 goto-char 16 discard 17 constant beginning-of-line 18 call 0 19 discard 20 constant looking-at 21 constant "[ ]$" 22 call 1 23 goto-if-nil 2 26 constant current-left-margin 27 call 0 28 constant 0 29 gtr 30 goto-if-nil 2 33 point 34 constant line-end-position 35 call 0 36 delete-region 37 discard 38:2 unbind 1 39 constant nil 40 goto-if-not-nil-else-pop 3 43 constant move-to-left-margin 44 constant nil 45 constant t 46 call 2 47:3 return A bit of grepping shows that this is the following lambda defined in the function newline (bound to `postproc'): (lambda () ;; Mark the newline(s) `hard'. (if use-hard-newlines (set-hard-newline-properties (- (point) (prefix-numeric-value arg)) (point))) ;; If the newline leaves the previous line blank, and we ;; have a left margin, delete that from the blank line. (save-excursion (goto-char beforepos) (beginning-of-line) (and (looking-at "[ \t]$") (> (current-left-margin) 0) (delete-region (point) (line-end-position)))) ;; Indent the line after the newline, except in one case: ;; when we added the newline at the beginning of a line which ;; starts a page. (or was-page-start (move-to-left-margin nil t))) OTOH in that function, post-self-insert-hook is changed in a let binding or it is protected with unwind-protect, so i don't understand how it could happen. FWIW I was in ielm when it happened, and here's the rest of my post-self-insert-hook => (electric-indent-post-self-insert-function blink-paren-post-self-insert-function) In GNU Emacs 24.4.51.2 (i686-pc-linux-gnu, X toolkit, Xaw3d scroll bars) of 2014-10-30 on localhost Windowing system distributor `The X.Org Foundation', version 11.0.11304000 System Description: Gentoo Base System release 2.2 Configured using: `configure --with-x-toolkit=lucid --enable-checking --with-wide-int 'CFLAGS= -O0 -g3'' Important settings: value of $LANG: fr_FR.UTF-8 locale-coding-system: utf-8-unix Major mode: Lisp Interaction Memory information: ((conses 16 2102837 191830) (symbols 40 93520 37) (miscs 36 26347 11976) (strings 16 200774 27097) (string-bytes 1 6588284) (vectors 12 83543) (vector-slots 8 1452046 54417) (floats 8 1173 1233) (intervals 36 139920 380) (buffers 828 237) (heap 1024 87889 11076)) -- Nicolas Richard