From unknown Fri Aug 15 14:15:45 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#16799 <16799@debbugs.gnu.org> To: bug#16799 <16799@debbugs.gnu.org> Subject: Status: 24.3.50; delete-selection-mode and electric-pair-mode interaction Reply-To: bug#16799 <16799@debbugs.gnu.org> Date: Fri, 15 Aug 2025 21:15:45 +0000 retitle 16799 24.3.50; delete-selection-mode and electric-pair-mode interac= tion reassign 16799 emacs submitter 16799 Harald Hanche-Olsen severity 16799 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 18 15:47:56 2014 Received: (at submit) by debbugs.gnu.org; 18 Feb 2014 20:47:56 +0000 Received: from localhost ([127.0.0.1]:58963 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WFra8-0007TV-8m for submit@debbugs.gnu.org; Tue, 18 Feb 2014 15:47:56 -0500 Received: from eggs.gnu.org ([208.118.235.92]:44004) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WFra5-0007TH-NJ for submit@debbugs.gnu.org; Tue, 18 Feb 2014 15:47:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WFrZr-0005lF-9j for submit@debbugs.gnu.org; Tue, 18 Feb 2014 15:47:48 -0500 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 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:48476) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFrZr-0005lB-7J for submit@debbugs.gnu.org; Tue, 18 Feb 2014 15:47:39 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45654) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFrZj-0007bG-TF for bug-gnu-emacs@gnu.org; Tue, 18 Feb 2014 15:47:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WFrZc-0005cy-FW for bug-gnu-emacs@gnu.org; Tue, 18 Feb 2014 15:47:31 -0500 Received: from hylle05.itea.ntnu.no ([129.241.56.225]:37737) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFrZc-0005Yt-29 for bug-gnu-emacs@gnu.org; Tue, 18 Feb 2014 15:47:24 -0500 Received: from localhost (localhost [127.0.0.1]) by hylle05.itea.ntnu.no (Postfix) with ESMTP id 86E369A4826 for ; Tue, 18 Feb 2014 21:47:15 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at hylle05.itea.ntnu.no Received: from localhost (101.74.9.46.customer.cdi.no [46.9.74.101]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: hanche) by hylle05.itea.ntnu.no (Postfix) with ESMTPSA id 022CA9A3B86; Tue, 18 Feb 2014 21:47:14 +0100 (CET) Date: Tue, 18 Feb 2014 21:47:14 +0100 (CET) Message-Id: <20140218.214714.1545557468915065071.hanche@math.ntnu.no> To: bug-gnu-emacs@gnu.org Subject: 24.3.50; delete-selection-mode and electric-pair-mode interaction From: Harald Hanche-Olsen X-URL: http://www.math.ntnu.no/~hanche/ X-Mailer: Mew version 6.5 on Emacs 24.3.50 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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 (-----) Starting from emacs -Q, switch to the *scratch* buffer and run: M-x electric-pair-mode RET M-x delete-selection-mode RET Place the cursor in the first line, but not at the befinning, and type C-space C-a. Now the region is active, and point is at the beginning of the buffer. Type any character bound to self-insert-command. Result: Error in pre-command-hook (delete-selection-pre-hook): (args-out-of-range= 0 1) As a side effect, delete-selection-pre-hook is removed from pre-command-hook, effectively disabling delete-selection-mode. In GNU Emacs 24.3.50.1 (x86_64-apple-darwin13.0.0, NS apple-appkit-1265.00) of 2014-02-18 on airy Windowing system distributor `Apple', version 10.3.1265 Configured using: `configure --with-ns' The source code was pulled from the git repo less than an hour ago. Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix =E2=80=93 Harald From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 19 17:24:29 2014 Received: (at 16799) by debbugs.gnu.org; 19 Feb 2014 22:24:29 +0000 Received: from localhost ([127.0.0.1]:60742 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WGFZ6-0002mm-OY for submit@debbugs.gnu.org; Wed, 19 Feb 2014 17:24:29 -0500 Received: from mail-qg0-f50.google.com ([209.85.192.50]:38464) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WGFZ3-0002mV-Mr for 16799@debbugs.gnu.org; Wed, 19 Feb 2014 17:24:26 -0500 Received: by mail-qg0-f50.google.com with SMTP id z60so2091516qgd.9 for <16799@debbugs.gnu.org>; Wed, 19 Feb 2014 14:24:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=QGU4olYyhwX2RHkLJIVr5wSH4sAOq9xr+M4ke0NaP/w=; b=y1+Of3eD0foeZdXFOqngwtPVs7gIZskh0y//QAYGXwj5aI+GaxcOtuHaNGlFdB+zCg pa8nwf38Ap/LI5gTlg3Yz+sH8PPyiiPUQMH8zKyrGqqt9uABpyuZV+kghL7NUMeY1aAT LphEC33Dv1cCmr+sKp3MYDXI0XSGCguA2G32sWXs9H3i52MbYIlzXs8c1AlnrP14rWuV IBcLkSfG3X1MnSM0L9yfTHKqWruG/Y6sQFaLK+/AjzZ3qtM/OT5/0CZTUQMY9uegOIE6 pE1nmuRBm5gAebC3czO3RrCXApwyriUd7cgYv9h5oHh0nVY7IGXn19UffzSVrYPANUJA n78w== X-Received: by 10.236.58.200 with SMTP id q48mr35183189yhc.88.1392848660183; Wed, 19 Feb 2014 14:24:20 -0800 (PST) MIME-Version: 1.0 Received: by 10.170.197.1 with HTTP; Wed, 19 Feb 2014 14:23:40 -0800 (PST) In-Reply-To: <20140218.214714.1545557468915065071.hanche@math.ntnu.no> References: <20140218.214714.1545557468915065071.hanche@math.ntnu.no> From: Juanma Barranquero Date: Wed, 19 Feb 2014 23:23:40 +0100 Message-ID: Subject: Re: bug#16799: 24.3.50; delete-selection-mode and electric-pair-mode interaction To: Harald Hanche-Olsen Content-Type: text/plain; charset=UTF-8 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 16799 Cc: 16799@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.0 (/) On Tue, Feb 18, 2014 at 9:47 PM, Harald Hanche-Olsen wrote: > Error in pre-command-hook (delete-selection-pre-hook): (args-out-of-range 0 1) I think something like this is needed to avoid electric-pair-syntax-info parsing before the start of the region/buffer. === modified file 'lisp/elec-pair.el' --- lisp/elec-pair.el 2014-02-03 00:28:57 +0000 +++ lisp/elec-pair.el 2014-02-19 22:18:02 +0000 @@ -215,8 +215,10 @@ `electric-pair-pairs' or `electric-pair-text-pairs' were used to lookup syntax. STRING-OR-COMMENT-START indicates that point is inside a comment of string." - (let* ((pre-string-or-comment (nth 8 (save-excursion - (syntax-ppss (1- (point)))))) + (let* ((pre-string-or-comment (if (> (point) (point-min)) + (nth 8 (save-excursion + (syntax-ppss (1- (point))))) + t)) (post-string-or-comment (nth 8 (syntax-ppss (point)))) (string-or-comment (and post-string-or-comment pre-string-or-comment)) From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 19 23:49:42 2014 Received: (at 16799) by debbugs.gnu.org; 20 Feb 2014 04:49:42 +0000 Received: from localhost ([127.0.0.1]:32853 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WGLZu-0005Fu-2k for submit@debbugs.gnu.org; Wed, 19 Feb 2014 23:49:42 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:22505) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WGLZr-0005Fc-Vu for 16799@debbugs.gnu.org; Wed, 19 Feb 2014 23:49:40 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8EABK/CFFLd/o4/2dsb2JhbABEuzWDWRdzgh8BBVYjEAsOJhIUGA0kiCTBLZEKA4hhnBmBXoMV X-IPAS-Result: Av8EABK/CFFLd/o4/2dsb2JhbABEuzWDWRdzgh8BBVYjEAsOJhIUGA0kiCTBLZEKA4hhnBmBXoMV X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="48208255" Received: from 75-119-250-56.dsl.teksavvy.com (HELO pastel.home) ([75.119.250.56]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 19 Feb 2014 23:49:34 -0500 Received: by pastel.home (Postfix, from userid 20848) id 374276336B; Wed, 19 Feb 2014 23:49:34 -0500 (EST) From: Stefan Monnier To: Juanma Barranquero Subject: Re: bug#16799: 24.3.50; delete-selection-mode and electric-pair-mode interaction Message-ID: References: <20140218.214714.1545557468915065071.hanche@math.ntnu.no> Date: Wed, 19 Feb 2014 23:49:34 -0500 In-Reply-To: (Juanma Barranquero's message of "Wed, 19 Feb 2014 23:23:40 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 16799 Cc: Harald Hanche-Olsen , 16799@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 (/) > - (let* ((pre-string-or-comment (nth 8 (save-excursion > - (syntax-ppss (1- (point)))))) > + (let* ((pre-string-or-comment (if (> (point) (point-min)) > + (nth 8 (save-excursion > + (syntax-ppss (1- (point))))) > + t)) Looks right, except that I'd write (not (bobp)) instead of (> (point) (point-min)). Stefan From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 20 05:39:00 2014 Received: (at 16799-done) by debbugs.gnu.org; 20 Feb 2014 10:39:00 +0000 Received: from localhost ([127.0.0.1]:33065 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WGR1v-0006Wb-P9 for submit@debbugs.gnu.org; Thu, 20 Feb 2014 05:38:59 -0500 Received: from mail-qa0-f49.google.com ([209.85.216.49]:34689) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WGR1t-0006WN-Ah for 16799-done@debbugs.gnu.org; Thu, 20 Feb 2014 05:38:57 -0500 Received: by mail-qa0-f49.google.com with SMTP id w8so2728102qac.36 for <16799-done@debbugs.gnu.org>; Thu, 20 Feb 2014 02:38:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=iXsHkI/pY/41BtXShj5PcL4+6c11GKufntXCD7nNNM8=; b=IyNUAJxfsgFnGIMgBHNWMJ7pJoh1/kDnRuWm18SvqF4jJlj9Ohh/Wa8HaCOomoM+eX 7AqOOLDnXi0rj5FRnKvCzds0+E+DsFtOXosVTgDWjHR9v9BCdUwVbyJ89a+hgWPBchhH Or1rul6H8oPmGk8WSepnIGww0WO1gHh/DDtbhuuSud7VXcr4JMT3niOoALWqNmjr5CWx j8Ir6gnqEVCno3IjJtfuxqrTYBCX+8LDkWkmRlfCh488tALYKmhvyJ2ZP7h/2J71nZwl a6jYat5qY5mOfQKOlAwdakyiiCZ04Kn6V9tJ1fXNGLOsPGSeCFVJXxN6L6amb8Erd1mD AqRA== X-Received: by 10.236.17.195 with SMTP id j43mr1612684yhj.137.1392892731777; Thu, 20 Feb 2014 02:38:51 -0800 (PST) MIME-Version: 1.0 Received: by 10.170.197.1 with HTTP; Thu, 20 Feb 2014 02:38:11 -0800 (PST) In-Reply-To: References: <20140218.214714.1545557468915065071.hanche@math.ntnu.no> From: Juanma Barranquero Date: Thu, 20 Feb 2014 11:38:11 +0100 Message-ID: Subject: Re: bug#16799: 24.3.50; delete-selection-mode and electric-pair-mode interaction To: Stefan Monnier Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 16799-done Cc: Harald Hanche-Olsen , 16799-done@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.7 (/) On Thu, Feb 20, 2014 at 5:49 AM, Stefan Monnier wrote: > Looks right, except that I'd write (not (bobp)) instead of (> (point) > (point-min)). Yes, thanks. I always forget bobp. I've installed the patch using (or (bobp) (nth ...)) which is shorter and pretty clear IMO. From unknown Fri Aug 15 14:15:45 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 20 Mar 2014 11:24:03 +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