From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 31 11:52:25 2014 Received: (at submit) by debbugs.gnu.org; 31 Oct 2014 15:52:25 +0000 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 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 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 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM autolearn=disabled version=3.3.2 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 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 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 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 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 From: Nicolas Richard To: bug-gnu-emacs@gnu.org Subject: 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> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.51 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) 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 From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 31 16:27:44 2014 Received: (at 18913) by debbugs.gnu.org; 31 Oct 2014 20:27:44 +0000 Received: from localhost ([127.0.0.1]:44121 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XkInP-0007BL-BV for submit@debbugs.gnu.org; Fri, 31 Oct 2014 16:27:43 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:6301) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XkInN-0007B8-6l for 18913@debbugs.gnu.org; Fri, 31 Oct 2014 16:27:41 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvAMAOatTlRFpY87/2dsb2JhbABcgw6DYoZ+yDmDGgQCAoEcFwEBfIQDAQEDAVYjBQsLNBIUGA0kiEsJy3IBAQEBAQEEAQEBAR6RCAeESwWyIIFvhBQhgnoBAQE X-IPAS-Result: AvAMAOatTlRFpY87/2dsb2JhbABcgw6DYoZ+yDmDGgQCAoEcFwEBfIQDAQEDAVYjBQsLNBIUGA0kiEsJy3IBAQEBAQEEAQEBAR6RCAeESwWyIIFvhBQhgnoBAQE X-IronPort-AV: E=Sophos;i="5.04,797,1406606400"; d="scan'208";a="95698092" Received: from 69-165-143-59.dsl.teksavvy.com (HELO pastel.home) ([69.165.143.59]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 31 Oct 2014 16:27:35 -0400 Received: by pastel.home (Postfix, from userid 20848) id F2AA162BA; Fri, 31 Oct 2014 16:27:34 -0400 (EDT) From: Stefan Monnier To: Nicolas Richard Subject: Re: bug#18913: 24.4.51; point going back to bol after every insertion Message-ID: References: <87ioj1sr0y.fsf@yahoo.fr> Date: Fri, 31 Oct 2014 16:27:34 -0400 In-Reply-To: <87ioj1sr0y.fsf@yahoo.fr> (Nicolas Richard's message of "Thu, 30 Oct 2014 13:03:57 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 18913 Cc: 18913@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > I found myself in the situation where cursor would go to bol after every > character I would insert. Could you rebuild with the patch below (and run with debug-on-error enabled) and see if you can get those asserts to trigger, which would give us some information about how/when this happens. Stefan === modified file 'lisp/simple.el' --- lisp/simple.el 2014-08-18 15:20:27 +0000 +++ lisp/simple.el 2014-10-31 20:25:11 +0000 @@ -28,6 +28,8 @@ ;;; Code: +(eval-when-compile (require 'cl-lib)) + (declare-function widget-convert "wid-edit" (type &rest args)) (declare-function shell-mode "shell" ()) @@ -428,6 +430,7 @@ ;; starts a page. (or was-page-start (move-to-left-margin nil t))))) + (unwind-protect (if (not interactive) ;; FIXME: For non-interactive uses, many calls actually just want ;; (insert "\n"), so maybe we should do just that, so as to avoid @@ -441,7 +444,9 @@ ;; We first used let-binding to protect the hook, but that was naive ;; since add-hook affects the symbol-default value of the variable, ;; whereas the let-binding might only protect the buffer-local value. - (remove-hook 'post-self-insert-hook postproc)))) + (remove-hook 'post-self-insert-hook postproc))) + (cl-assert (not (member postproc post-self-insert-hook))) + (cl-assert (not (member postproc (default-value 'post-self-insert-hook)))))) nil) (defun set-hard-newline-properties (from to) From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 08 14:45:51 2019 Received: (at control) by debbugs.gnu.org; 8 Jan 2019 19:45:51 +0000 Received: from localhost ([127.0.0.1]:50368 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ggxJs-00065d-35 for submit@debbugs.gnu.org; Tue, 08 Jan 2019 14:45:51 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39116) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ggxJp-00060T-NM for control@debbugs.gnu.org; Tue, 08 Jan 2019 14:45:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ggxJj-0002lD-OS for control@debbugs.gnu.org; Tue, 08 Jan 2019 14:45:40 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:470:142:3::e]:40688) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ggxJj-0002id-Ku for control@debbugs.gnu.org; Tue, 08 Jan 2019 14:45:39 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1ggxJi-0005iY-Ig for control@debbugs.gnu.org; Tue, 08 Jan 2019 14:45:38 -0500 Subject: control message for bug 18913 To: X-Mailer: mail (GNU Mailutils 2.99.98) Message-Id: From: Glenn Morris Date: Tue, 08 Jan 2019 14:45:38 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:470:142:3::e X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tag 18913 + wontfix close 18913 From unknown Fri Jun 20 20:10:58 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 06 Feb 2019 12:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator