From unknown Wed Aug 20 01:18:21 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#74415 <74415@debbugs.gnu.org> To: bug#74415 <74415@debbugs.gnu.org> Subject: Status: 29.4; mouse-start-end does not respect syntax-table text properties Reply-To: bug#74415 <74415@debbugs.gnu.org> Date: Wed, 20 Aug 2025 08:18:21 +0000 retitle 74415 29.4; mouse-start-end does not respect syntax-table text prop= erties reassign 74415 emacs submitter 74415 Guillaume Brunerie severity 74415 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 18 05:24:39 2024 Received: (at submit) by debbugs.gnu.org; 18 Nov 2024 10:24:39 +0000 Received: from localhost ([127.0.0.1]:60085 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tCyvu-0001qY-Qx for submit@debbugs.gnu.org; Mon, 18 Nov 2024 05:24:39 -0500 Received: from lists.gnu.org ([209.51.188.17]:48166) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tCyki-0001KG-F6 for submit@debbugs.gnu.org; Mon, 18 Nov 2024 05:13:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tCyki-00055a-9O for bug-gnu-emacs@gnu.org; Mon, 18 Nov 2024 05:13:04 -0500 Received: from mail-qt1-x831.google.com ([2607:f8b0:4864:20::831]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tCykg-00080m-KI for bug-gnu-emacs@gnu.org; Mon, 18 Nov 2024 05:13:04 -0500 Received: by mail-qt1-x831.google.com with SMTP id d75a77b69052e-460b2e4c50fso28154211cf.0 for ; Mon, 18 Nov 2024 02:13:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731924781; x=1732529581; darn=gnu.org; h=content-transfer-encoding:to:subject:message-id:date:from :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=nXkGaefjmJ1WIs7oEnnHXQ4Dkl6bPSzyGvZrjKT9qfI=; b=lM4h+2rxCDnFMchl53/8uQdTFQvvGo+lOWFsjObFJ9flgpjwYJ3yJKlFpyBp7hta/C OGaOWz912+b5tywh5NDgIEQVbhqjTQgwrxP3ksTqBbiVtGH8cVlypwd2Dpb9kNG6PUY5 82/a9xrIt9qdIP30Jbnm+ohjahfEk8KGMIMrrpGXOSbj7XVfEwsDUpLufSuhksjRlGh1 dEXbEFZs31qtCiWg9VLa0wPw0YEdUaxIQCVh+9xG0NkV585xLwIYZAkdJfjoAm/Np7Yx 99VZuzAB4iRxQRTLqLsPMczKzd4WAIPTSsS4tfE8P6rcFJMbXr6i68Lz7warzLu/Fl+p fIrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731924781; x=1732529581; h=content-transfer-encoding:to:subject:message-id:date:from :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=nXkGaefjmJ1WIs7oEnnHXQ4Dkl6bPSzyGvZrjKT9qfI=; b=NQQIXoDHhXwsi4G3MZHpgRI2TAlL4OmdcMZEvcIonICncG2eCL7cchBfzema2QeT7x 8K04J96fbpRuDfnQDQOvLdJy7MtmWE8efJBLtOHSI4axYjp86FFsFiUVP7c4pCPdl2LU eJ2Otl60wbSaJ+t9X3XhftSWatWM/GF17DyOBNIfmTcui97lrkYRuhV8IVmnuvaRpJmz 6zSsWdAcSunN7uOl1e5FJWWN7e5F/VEYecyFZv1PkhuIHMV0hQs9ZCmnozSL0/ONbvuR P7ASjKDw01z4IVyghIRHit5HRsBW8m2+EfBPiuApizwAlVCsKQl51uMLBgZay09bV/Xl gBXA== X-Gm-Message-State: AOJu0Ywutvsm7v9WZlMZnjs2TTwL5ocR73fw5ZcYlT5GtlhyMdIbYOno V7x8oF2itiU5BlbV833DSM0o50YMUDaFrREP4+67s+l/BJqVZ4xkVj0Uh6/NzRaIJFM0GVozZW1 9iGc3I90D8vryWPADe4XvTmO6Uy1guQo= X-Google-Smtp-Source: AGHT+IHTDnNhJJ7eBart7L8al7rEChg3Lpp4e522nGez5g7jF/EzViJm9KXW6GyxPX6hmHe263ZhYzopkA7ZDa6X3do= X-Received: by 2002:a05:622a:8e:b0:461:3653:54f with SMTP id d75a77b69052e-46363df2604mr178482971cf.11.1731924780705; Mon, 18 Nov 2024 02:13:00 -0800 (PST) MIME-Version: 1.0 From: Guillaume Brunerie Date: Mon, 18 Nov 2024 11:12:49 +0100 Message-ID: Subject: 29.4; mouse-start-end does not respect syntax-table text properties To: bug-gnu-emacs@gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::831; envelope-from=guillaume.brunerie@gmail.com; helo=mail-qt1-x831.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Mon, 18 Nov 2024 05:24:32 -0500 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: -2.3 (--) Hello, The `mouse-start-end` function (used in particular when double clicking on = an opening parenthesis to select the region from that opening parenthesis to t= he matching closing parenthesis) does not respect syntax-table text properties= to determine if the character at point is an opening parenthesis. Looking at t= he code, it is at line 1941 in lisp/mouse.el (and there are more instances fur= ther down in the same file) (https://github.com/emacs-mirror/emacs/blob/eee0ed8442aa78320a3e578ab290df1= 45fb49624/lisp/mouse.el#L1941): ((and (=3D mode 1) (=3D start end) (char-after start) (=3D (char-syntax (char-after start)) ?\()) Note that the documentation of `char-syntax` says: > If you=E2=80=99re trying to determine the syntax of characters in the buf= fer, this is > probably the wrong function to use, because it can=E2=80=99t take =E2=80= =98syntax-table=E2=80=99 text > properties into account. Consider using =E2=80=98syntax-after=E2=80=99 in= stead. The line just below does use `syntax-after`, but it looks like something th= at was added later to work around a related bug. I think this function should = be refactored to only use `syntax-after` instead of `char-syntax`. For context, I'm writing my own Typescript major mode where the < and > sym= bols are sometimes balanced delimiters, sometimes not (determined via Tree-sitte= r). I could get most things working using syntax-table text properties, like forward-sexp and show-paren-mode, but not double-click selection due to thi= s issue. Related: https://lists.gnu.org/archive/html/bug-gnu-emacs/2016-02/msg00988.= html In that issue, the opposite problem occurred, double clicking on an unmatch= ed open parenthesis did not take into account the "punctuation" text property.= But the fix only fixed one half of the issue (when a text property makes a parenthesis into not a parenthesis) and I am facing the other half (a text property makes a punctuation character into a parenthesis). Best, Guillaume From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 24 04:59:28 2024 Received: (at 74415) by debbugs.gnu.org; 24 Nov 2024 09:59:28 +0000 Received: from localhost ([127.0.0.1]:32898 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tF9Oq-00020k-1V for submit@debbugs.gnu.org; Sun, 24 Nov 2024 04:59:28 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49230) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tF9On-00020U-Sq for 74415@debbugs.gnu.org; Sun, 24 Nov 2024 04:59:26 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tF9Og-0006Sv-FM; Sun, 24 Nov 2024 04:59:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=Ni2KOKbEOxX2vjtbwkWdrHXYBVo4/F5f/TCwpPKnIxY=; b=bl8CGwE5im0T5IR+lTgo ILU+EagZK+F9MXQwFrqLyx79++QXtXrtrXO9xEZHMFLcuLEErmvVSQhcwmiM9hY0GCrrohcBzem/0 HfsMEuwP26MYg1YSHxy0jeDBmN11jlghd/O47mzUV6D88X3fJQ8/qKpyuvAUCvUmeRWZIEB1VM0ha 5+d2yK3arsx9DtIF8kqZz8ysMHDmKwgj7nvrCAlZPhpAYfzO7JbUh+JH71USM1zMed585wrlQ/oCj bJAGPrWXCoYGKvpb6vCoEpZFv1VF8oX+VPwDOa75h1P8td8B3U3qr1yk9iLmzd+SHY1mqY9iZq2Wn 5Cq4gd8rRHYcnw==; Date: Sun, 24 Nov 2024 11:59:15 +0200 Message-Id: <86cyilj6ks.fsf@gnu.org> From: Eli Zaretskii To: Guillaume Brunerie , Stefan Monnier In-Reply-To: (message from Guillaume Brunerie on Mon, 18 Nov 2024 11:12:49 +0100) Subject: Re: bug#74415: 29.4; mouse-start-end does not respect syntax-table text properties References: MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -1.8 (-) X-Debbugs-Envelope-To: 74415 Cc: 74415@debbugs.gnu.org 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: -2.8 (--) > From: Guillaume Brunerie > Date: Mon, 18 Nov 2024 11:12:49 +0100 > > The `mouse-start-end` function (used in particular when double clicking on an > opening parenthesis to select the region from that opening parenthesis to the > matching closing parenthesis) does not respect syntax-table text properties to > determine if the character at point is an opening parenthesis. Looking at the > code, it is at line 1941 in lisp/mouse.el (and there are more instances further > down in the same file) > (https://github.com/emacs-mirror/emacs/blob/eee0ed8442aa78320a3e578ab290df145fb49624/lisp/mouse.el#L1941): > > ((and (= mode 1) > (= start end) > (char-after start) > (= (char-syntax (char-after start)) ?\()) > > Note that the documentation of `char-syntax` says: > > > If you’re trying to determine the syntax of characters in the buffer, this is > > probably the wrong function to use, because it can’t take ‘syntax-table’ text > > properties into account. Consider using ‘syntax-after’ instead. > > The line just below does use `syntax-after`, but it looks like something that > was added later to work around a related bug. I think this function should be > refactored to only use `syntax-after` instead of `char-syntax`. > > For context, I'm writing my own Typescript major mode where the < and > symbols > are sometimes balanced delimiters, sometimes not (determined via Tree-sitter). I > could get most things working using syntax-table text properties, like > forward-sexp and show-paren-mode, but not double-click selection due to this > issue. > > Related: https://lists.gnu.org/archive/html/bug-gnu-emacs/2016-02/msg00988.html > In that issue, the opposite problem occurred, double clicking on an unmatched > open parenthesis did not take into account the "punctuation" text property. But > the fix only fixed one half of the issue (when a text property makes a > parenthesis into not a parenthesis) and I am facing the other half (a text > property makes a punctuation character into a parenthesis). Sounds reasonable. Stefan, is there any reason not to use syntax-after everywhere in mouse.el? From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 25 18:15:22 2024 Received: (at 74415) by debbugs.gnu.org; 25 Nov 2024 23:15:22 +0000 Received: from localhost ([127.0.0.1]:42803 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tFiIc-0002eN-CX for submit@debbugs.gnu.org; Mon, 25 Nov 2024 18:15:22 -0500 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:19504) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tFiIa-0002e6-Mn for 74415@debbugs.gnu.org; Mon, 25 Nov 2024 18:15:21 -0500 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id D8A164451AB; Mon, 25 Nov 2024 18:15:13 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1732576512; bh=7IHyIq8qD8DUpDqMGcdp+1CEwa4VttbX59KYPxtNGtY=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=Z8RS6AAG+p/3TblsRs89Ifbt7FqAMY2QTdwjP7Bdg+uqCL3vsR5fAF+szVFLb2dHK BBY4jUhQuf+d+pIg3Pbpat7Uzve7hUx2dHwup6Ch9wjH1u7ex1i3qJdVrNYLZTcJWS 1tdlg5Q5dq8I7NFC/kZivQReGnzYxirkOpsNKiJ1Hjj5bBxJEQr081EFhzYlQLzfJr iSQRJJZpAHAediPoMXu/stt7Gmt475dYsM/j5vBlr8qjTvwCk7LsuPiWdfFrVwbOvC Tryw60qHEjwCxgG6a6Zvvm6CZ/N+KeKNZ+rs5ajKQax1Lknf8dWWcTEGljmaHVZye4 P9Uc55fKCgPMw== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id DBEAE4451A6; Mon, 25 Nov 2024 18:15:12 -0500 (EST) Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id C56C712034F; Mon, 25 Nov 2024 18:15:12 -0500 (EST) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#74415: 29.4; mouse-start-end does not respect syntax-table text properties In-Reply-To: <86cyilj6ks.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 24 Nov 2024 11:59:15 +0200") Message-ID: References: <86cyilj6ks.fsf@gnu.org> Date: Mon, 25 Nov 2024 18:15:12 -0500 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.213 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 74415 Cc: Guillaume Brunerie , 74415@debbugs.gnu.org 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: -3.3 (---) > Stefan, is there any reason not to use syntax-after everywhere in > mouse.el? Not that I can think of, no. AFAIU, this code simply predates `syntax-after`. Stefan From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 28 11:02:23 2024 Received: (at 74415) by debbugs.gnu.org; 28 Nov 2024 16:02:23 +0000 Received: from localhost ([127.0.0.1]:39439 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tGgyE-0001Id-PU for submit@debbugs.gnu.org; Thu, 28 Nov 2024 11:02:23 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39516) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tGgyC-0001IF-7p for 74415@debbugs.gnu.org; Thu, 28 Nov 2024 11:02:21 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tGgy6-0007ZJ-J9; Thu, 28 Nov 2024 11:02:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=cDFcp5PNjUTBmgSVVl0c16YMB+niUFKWKBfgrCYLeqc=; b=AfcLvyFCKqt8 UE4JkrM28bXyt7jbi41qdxWbIKseVNtlRxTKzYQDOKoVvOne9juR46dc4ns9dqhf79asMnzYIte86 ngcd6MEpOhQrunha9dSmrHZWW+wl+fBMru3H06DMTgDFjuGQ5xdwO/ft8NifuqXyOlvLwM697+oiN 7ZteYSQvQAq2f/QBu9o8Rogli+kNlMhwxfz9MNaxNBHsJumz1JT0Fa9dB+ZvlpIMkwNIFC4qSLAg+ GiKjwecTtQlls2yQcSNKTa4kudJSX8aan2BUziVMn1QG0aeFbzli4BBl4ep4wkVqtqukKHYP4YtJL D67fq5APZkwwDzSclpQsog==; Date: Thu, 28 Nov 2024 18:02:10 +0200 Message-Id: <86mshjcpod.fsf@gnu.org> From: Eli Zaretskii To: guillaume.brunerie@gmail.com, Stefan Monnier In-Reply-To: (message from Stefan Monnier on Mon, 25 Nov 2024 18:15:12 -0500) Subject: Re: bug#74415: 29.4; mouse-start-end does not respect syntax-table text properties References: <86cyilj6ks.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 74415 Cc: 74415@debbugs.gnu.org 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: -3.3 (---) > From: Stefan Monnier > Cc: Guillaume Brunerie , 74415@debbugs.gnu.org > Date: Mon, 25 Nov 2024 18:15:12 -0500 > > > Stefan, is there any reason not to use syntax-after everywhere in > > mouse.el? > > Not that I can think of, no. > AFAIU, this code simply predates `syntax-after`. Thanks. Guillaume, does the patch below give good results? diff --git a/lisp/mouse.el b/lisp/mouse.el index 410e52b..766c4d8 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -632,7 +632,9 @@ context-menu-region (with-current-buffer (window-buffer (posn-window (event-end click))) (when (let* ((pos (posn-point (event-end click))) (char (when pos (char-after pos)))) - (or (and char (eq (char-syntax char) ?\")) + (or (and char (eq (syntax-class-to-char + (syntax-class (syntax-after pos))) + ?\")) (nth 3 (save-excursion (syntax-ppss pos))))) (define-key-after submenu [mark-string] `(menu-item "String" @@ -1890,7 +1892,8 @@ mouse-skip-word If `mouse-1-double-click-prefer-symbols' is non-nil, skip over symbol. If DIR is positive skip forward; if negative, skip backward." (let* ((char (following-char)) - (syntax (char-to-string (char-syntax char))) + (syntax (char-to-string + (syntax-class-to-char (syntax-class (syntax-after (point)))))) sym) (cond ((and mouse-1-double-click-prefer-symbols (setq sym (bounds-of-thing-at-point 'symbol))) @@ -1938,7 +1941,9 @@ mouse-start-end ((and (= mode 1) (= start end) (char-after start) - (= (char-syntax (char-after start)) ?\()) + (= (syntax-class-to-char + (syntax-class (syntax-after start))) + ?\()) (if (/= (syntax-class (syntax-after start)) 4) ; raw syntax code for ?\( ;; This happens in CC Mode when unbalanced parens in CPP ;; constructs are given punctuation syntax with @@ -1953,7 +1958,9 @@ mouse-start-end ((and (= mode 1) (= start end) (char-after start) - (= (char-syntax (char-after start)) ?\))) + (= (syntax-class-to-char + (syntax-class (syntax-after start))) + ?\))) (if (/= (syntax-class (syntax-after start)) 5) ; raw syntax code for ?\) ;; See above comment about CC Mode. (signal 'scan-error (list "Unbalanced parentheses" start start)) @@ -1965,7 +1972,9 @@ mouse-start-end ((and (= mode 1) (= start end) (char-after start) - (= (char-syntax (char-after start)) ?\")) + (= (syntax-class-to-char + (syntax-class (syntax-after start))) + ?\")) (let ((open (or (eq start (point-min)) (save-excursion (goto-char (- start 1)) From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 28 15:03:32 2024 Received: (at 74415) by debbugs.gnu.org; 28 Nov 2024 20:03:32 +0000 Received: from localhost ([127.0.0.1]:39829 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tGkjc-0006Gi-5G for submit@debbugs.gnu.org; Thu, 28 Nov 2024 15:03:32 -0500 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:55918) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tGkjZ-0006GO-Qr for 74415@debbugs.gnu.org; Thu, 28 Nov 2024 15:03:30 -0500 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 73E291000C3; Thu, 28 Nov 2024 15:03:23 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1732824202; bh=S3b0yZ6t8MxLPifVroBzI2Sa5imdkgZevtUWmi6z4Hk=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=dJpAxvuAPmAVIHjghaIO8fLLLKrGjUYdsU1sjgRDvrC9cNvREciyAp91cGAF6qRfs 4Vq0IW9lGCz/xg6G2V8TSMnRbi/AeSYtGLv4ckjkrZClnVtT2hQn4kvlJtUUt3T4Xg PGRFO27dEKCIUzRSAGEUwyW9B6LQhVZijb0rHslZAlyPult1SbpQ6UyWBfTO+6mMnE v0rOHcVZOKjLzSVowCotxrrqfIkZRBpokmHy+ctvt2O/4faJW1+pbeo2nz8rnFako0 9/ioMU6QC+wFKjwtWJSTbWJ4pALuvGjtn3sPxQbQwz5A3X+XU/bL8LiD27lj7cJJOI adasCM/TuHpiw== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id D408110004A; Thu, 28 Nov 2024 15:03:22 -0500 (EST) Received: from pastel (104-195-225-43.cpe.teksavvy.com [104.195.225.43]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id A401E1205A2; Thu, 28 Nov 2024 15:03:22 -0500 (EST) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#74415: 29.4; mouse-start-end does not respect syntax-table text properties In-Reply-To: <86mshjcpod.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 28 Nov 2024 18:02:10 +0200") Message-ID: References: <86cyilj6ks.fsf@gnu.org> <86mshjcpod.fsf@gnu.org> Date: Thu, 28 Nov 2024 15:03:21 -0500 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.001 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 74415 Cc: guillaume.brunerie@gmail.com, 74415@debbugs.gnu.org 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: -3.3 (---) > Thanks. Guillaume, does the patch below give good results? the latch LGTM, but it bought up the following side note: maybe we should add a `syntax-class-of-char` so we can replace (= (syntax-class-to-char FOO) BAR)) with (= FOO (syntax-class-of-char BAR)) where `syntax-class-of-char` can be pre-computed during compilation (when BAR is a constant, which would be always the case in your patch). Tho, maybe even better would be a `(syntax-class-p BAR FOO)`. Anyway, nothing urgent. Stefan From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 05 02:38:23 2024 Received: (at 74415) by debbugs.gnu.org; 5 Dec 2024 07:38:23 +0000 Received: from localhost ([127.0.0.1]:37994 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tJ6RK-0005Fx-U1 for submit@debbugs.gnu.org; Thu, 05 Dec 2024 02:38:23 -0500 Received: from mail-vk1-f169.google.com ([209.85.221.169]:61922) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tJ58H-00016G-3v for 74415@debbugs.gnu.org; Thu, 05 Dec 2024 01:14:37 -0500 Received: by mail-vk1-f169.google.com with SMTP id 71dfb90a1353d-515415386c0so159353e0c.3 for <74415@debbugs.gnu.org>; Wed, 04 Dec 2024 22:14:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733379211; x=1733984011; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=enj4Qtum/0gCYtMI+Ca9HIuUioQLd/RgmPej7kFFTSU=; b=Ix8PJbMEBmrQGEUnw5V5FTP+NCW9L4pErHCDRj7KwKl6zqF9AVkiLdVfRPME/2+MIZ mzV6v0ZhbFnAbqPqpPsWAPwgXcSJWxcbYCXkfMtG0YD2EeLqDemtfD0yeT8sTe2TTDhm tGn8/kugL1pK9odxsf4VLOmHoG58OJvnFtZLmE9YP7ZdeQFRi1E+Gzz0fjgKucMWJARl msVFAWoV1zPJ977Hx3D5f8J0cTaJ9dD9Cuz4lnY71WUlFhr5UpHLaJeyB9hGsXdpqiz9 1C0rLwXgxyKh/GqaqMhUk+FN/jhr/aQrquD1oIExldcFP0eLk41u2r9lMB8RfbxrPFUo WijA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733379211; x=1733984011; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=enj4Qtum/0gCYtMI+Ca9HIuUioQLd/RgmPej7kFFTSU=; b=nR3b2pkGDMwXGf+TK23I4aOjP2WOxHgbJ3S339rRfoGkiFjlb7OBHtbWLtO1Bz3mDW OLiF0SIjvj1b5c08lmFpqIuVWSTIwToQe94Jzki+ohC/HwsV3BpJS0mjSl+rtH4Xaeaw sjvecn+dweqjEQH1cwdTLdMhMygTLEyn12SvmOFydYWrRXQ7Lx3dqWKavrIcCax5rTLC Wr0VkD99QO+NINH50V2MmrtgXZijoVv0pflvi8Gn5DzK4OdkOIItRpPsjw/yz96M/GkG qHLmVv8UOeIxyDdYObmMYFaEdypknGvHlNPfE4p/VHIpo4nui7uy1g0mVLWgSrAsVNSP NyrQ== X-Forwarded-Encrypted: i=1; AJvYcCVJlYm4zFNANeaTW5wcby2BEQAK63mlPuRblUeSDhCzEvwRPvwT2C5Cppu+JxfKstRtMj1qKg==@debbugs.gnu.org X-Gm-Message-State: AOJu0YzCyd3Nw3R8PlJydxiFMzbvutHv6z9Sc5ZC2dlHIt2fbOR3sAZw TggX1hMMsf3vEd7VEvxtumzH+yDTptZY7/516ja7Hfx0+46HDxj5JwJEnP5MjOTrJ54jjDLT4fp eLuKCbY/lR88Y3YjguDWup9KUTw== X-Gm-Gg: ASbGncvvUprVsnCjfe59FDfz1vxabDWRAR5chRqNUJggmo8j6NHFXe+0dvBARzVBtLC LOxYj9hrUwsObX/LX5f+imqAAsgGUKg== X-Google-Smtp-Source: AGHT+IHhGQnKbJo8shwE4EfN2Pt4RjcR+wY56SXcTpEjnZ/wT3XHCXETiMu8a+cyoFRpsWL9Z0HApyTKEnCKwTiU7qA= X-Received: by 2002:a05:6102:5106:b0:4af:bae7:893b with SMTP id ada2fe7eead31-4afbae78afemr2112548137.15.1733379211331; Wed, 04 Dec 2024 22:13:31 -0800 (PST) MIME-Version: 1.0 References: <86cyilj6ks.fsf@gnu.org> <86mshjcpod.fsf@gnu.org> In-Reply-To: <86mshjcpod.fsf@gnu.org> From: Guillaume Brunerie Date: Thu, 5 Dec 2024 07:13:20 +0100 Message-ID: Subject: Re: bug#74415: 29.4; mouse-start-end does not respect syntax-table text properties To: Eli Zaretskii Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 74415 X-Mailman-Approved-At: Thu, 05 Dec 2024 02:38:21 -0500 Cc: Stefan Monnier , 74415@debbugs.gnu.org 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 (-) Den tors 28 nov. 2024 kl 17:02 skrev Eli Zaretskii : > Thanks. Guillaume, does the patch below give good results? Thank you, I haven=E2=80=99t managed to apply the patch locally yet but I think that would work (I=E2=80=99m on Emacs 29.4, but I guess I might need = to get the development version of Emacs? The patch seems to fail on my mouse.el). But one thing I want to point out is that the two `(signal 'scan-error [...])` seem to be dead code now, as they test the exact opposite of what the previous test now does. So I guess it should be implemented a bit differently if you want to preserve the current behavior (have a signal 'scan-error' when double clicking on unbalanced parentheses in CC mode). From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 07 07:33:13 2024 Received: (at 74415) by debbugs.gnu.org; 7 Dec 2024 12:33:14 +0000 Received: from localhost ([127.0.0.1]:45822 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tJtzl-0002Kb-Gh for submit@debbugs.gnu.org; Sat, 07 Dec 2024 07:33:13 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58984) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tJtzj-0002KI-VI for 74415@debbugs.gnu.org; Sat, 07 Dec 2024 07:33:12 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tJtzd-000326-0N; Sat, 07 Dec 2024 07:33:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=EMoNjeIX56F/kxeq60KRjcSp5KSkmkuYWMX83RYcV1E=; b=kQS3IsCLe1e4/mlCp3/g 5+2NqtkSo99/Oz4z17Bt6yTY4GXR684rp3SsTXrGije6LTqGeTEpwZ3shZK5jPOI+n3dpKMidDwMQ 9UImz3YiB+ItPqsOxJTbnrJlrXOFPMIDGuBr2SiXklD2G6SmFoltbff2fVtR0c+Nah5AfIHZxmpyE Tjo5sqaFglcAYlWNdUmhOLtAxy/Sk6Ss0VWmMwBzsD5oYnNqniGe7vIfE9u14LLPul/kmqVns8zFr NXBac53bxpBSOxiWiSDpJdN0P0lCnPcGhzRmzMLQWyLmqMth8bNH4s+NP47xCpwKzQObUlhEk6UOM caWA04DdEORWyw==; Date: Sat, 07 Dec 2024 14:33:01 +0200 Message-Id: <86seqzisg2.fsf@gnu.org> From: Eli Zaretskii To: Guillaume Brunerie In-Reply-To: (message from Guillaume Brunerie on Thu, 5 Dec 2024 07:13:20 +0100) Subject: Re: bug#74415: 29.4; mouse-start-end does not respect syntax-table text properties References: <86cyilj6ks.fsf@gnu.org> <86mshjcpod.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 74415 Cc: monnier@iro.umontreal.ca, 74415@debbugs.gnu.org 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: -3.3 (---) > From: Guillaume Brunerie > Date: Thu, 5 Dec 2024 07:13:20 +0100 > Cc: Stefan Monnier , 74415@debbugs.gnu.org > > Den tors 28 nov. 2024 kl 17:02 skrev Eli Zaretskii : > > Thanks. Guillaume, does the patch below give good results? > > Thank you, I haven’t managed to apply the patch locally yet but I > think that would work (I’m on Emacs 29.4, but I guess I might need to > get the development version of Emacs? The patch seems to fail on my > mouse.el). > But one thing I want to point out is that the two `(signal 'scan-error > [...])` seem to be dead code now, as they test the exact opposite of > what the previous test now does. Sorry, I don't understand. The changes I proposed didn't touch the lines that signals errors. Are you saying that those errors were dead code before these changes as well? If not, could you please elaborate on the issues you see with the changes I proposed? > So I guess it should be implemented a bit differently if you want to > preserve the current behavior (have a signal 'scan-error' when double > clicking on unbalanced parentheses in CC mode). From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 10 00:10:38 2024 Received: (at 74415) by debbugs.gnu.org; 10 Dec 2024 05:10:38 +0000 Received: from localhost ([127.0.0.1]:56547 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKsW3-0003gC-Rv for submit@debbugs.gnu.org; Tue, 10 Dec 2024 00:10:38 -0500 Received: from mail-qt1-f172.google.com ([209.85.160.172]:59552) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKjLW-0008FN-2Y for 74415@debbugs.gnu.org; Mon, 09 Dec 2024 14:23:07 -0500 Received: by mail-qt1-f172.google.com with SMTP id d75a77b69052e-467745731fdso2093251cf.2 for <74415@debbugs.gnu.org>; Mon, 09 Dec 2024 11:23:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733772120; x=1734376920; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ijo97RbjUEYCrgQw+V6KLzlFIzoUsj6M5sdttHSHmAg=; b=WlfrcH/Y8UIFU7DUtPBf7U/J8k8N0BtMyrq6ilKBLOdQ8zBqHQy/bPLDX8MEngJtyU oobRmz05CCdjZX9XREKCp4Cf/FXvohEX8e+cyt83jb7e56m97HzVNjOjRy2SxlZ8ofTQ 24LezerXpRhc2yHRbq0xau1+KYAUIfybBpWn1X2uPut9rU2IFZltRzHPjWQuf8Km/fu9 Aft7ZndQuu3NL67F+BCuZARw9UFsTEEhJ/rcPr6NbPoltmTl+IgeQQTl25SGsyunF4fh dD1wYuEGsNmqBgMCgpnXpuT8phdZXVHjhLvuF+hwq4GdD2yFsg0Y6zPowaSRR+EOi2CR 9eIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733772120; x=1734376920; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ijo97RbjUEYCrgQw+V6KLzlFIzoUsj6M5sdttHSHmAg=; b=f8/PyNTjkbrRQ/1No1ScxVnadtqMm1gVBYz7YL58kIEmskOgcoAwKjDjRqOHfoHsIl TlrR6SfxirO/i2BODyjGs452+2xKxnRCRRpx8KUD3JlM/Ntb/pI3OUU0oYrxBZiL186X pW0PI35LOy0Hh3tKg7wVrTGCq+w9P47P7ZaYIc/tPNXiAq1gIdwO22FcNx1Iszz3UVyW ZNHqygvNMiXrJT0Rq/qcjlFzfMiBT0u/3b8GtRGeEA+tIWrMqxFQeHT9E+3S0bMBWcXc t3CcvwTD6ASUyAuuBLyYu5G4oS5JuAz7JHiitmBAAI9o8RSNPTzuTtWlyaD1Ga2x+exn i3rw== X-Forwarded-Encrypted: i=1; AJvYcCWRSg54fNThBMpyl4XurDzqvM8b0J8cBRGzgDP9JXWN6J98RqHqrQpWayttaxJaXH8BgPAMIw==@debbugs.gnu.org X-Gm-Message-State: AOJu0YyW8iW5ZbOM4NiCWliB1McmjRu0XZSJSQ8Wmq4SxvqfdwC+QBkt kveu/kWfye+Ph1hOw6t3FNzca8W2UuHnYsF/961bPZl873ob/zha0xeqfQ3BYnA/Q7/Winwo3AC WB+DwglqbC8MBjKGnDpP1yNYoKg== X-Gm-Gg: ASbGncufYniIjbZ7Ku3eUDDrfZtzmA6eP876FPvWbyOPj4zb3DPzbF+cUngN8HUaGjn upNOycHPgkV7D+LMSd96EUtodi66sMw== X-Google-Smtp-Source: AGHT+IFovCZb44wwlfTFdJb1oGby7WeZZ/bO1HALp6GbFmZ2yFHza5WBGT3TTR2WhI0nsaOHTa2wHhVLSo5xSFq600E= X-Received: by 2002:ac8:5846:0:b0:466:ac4d:22a5 with SMTP id d75a77b69052e-46734c8a7dcmr187213911cf.11.1733772120333; Mon, 09 Dec 2024 11:22:00 -0800 (PST) MIME-Version: 1.0 References: <86cyilj6ks.fsf@gnu.org> <86mshjcpod.fsf@gnu.org> <86seqzisg2.fsf@gnu.org> In-Reply-To: <86seqzisg2.fsf@gnu.org> From: Guillaume Brunerie Date: Mon, 9 Dec 2024 20:21:49 +0100 Message-ID: Subject: Re: bug#74415: 29.4; mouse-start-end does not respect syntax-table text properties To: Eli Zaretskii Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 74415 X-Mailman-Approved-At: Tue, 10 Dec 2024 00:10:28 -0500 Cc: monnier@iro.umontreal.ca, 74415@debbugs.gnu.org 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 (-) Den l=C3=B6r 7 dec. 2024 kl 13:33 skrev Eli Zaretskii : > > > From: Guillaume Brunerie > > Date: Thu, 5 Dec 2024 07:13:20 +0100 > > Cc: Stefan Monnier , 74415@debbugs.gnu.org > > > > Den tors 28 nov. 2024 kl 17:02 skrev Eli Zaretskii : > > > Thanks. Guillaume, does the patch below give good results? > > > > Thank you, I haven=E2=80=99t managed to apply the patch locally yet but= I > > think that would work (I=E2=80=99m on Emacs 29.4, but I guess I might n= eed to > > get the development version of Emacs? The patch seems to fail on my > > mouse.el). > > But one thing I want to point out is that the two `(signal 'scan-error > > [...])` seem to be dead code now, as they test the exact opposite of > > what the previous test now does. > > Sorry, I don't understand. The changes I proposed didn't touch the > lines that signals errors. Are you saying that those errors were dead > code before these changes as well? If not, could you please elaborate > on the issues you see with the changes I proposed? No, it was not dead code before, but changing the outer condition makes it impossible for both the outer condition and the inner condition to be true at the same time. The current code is the following (inside a cond) ((and (=3D mode 1) (=3D start end) (char-after start) (=3D (char-syntax (char-after start)) ?\()) (if (/=3D (syntax-class (syntax-after start)) 4) ; raw syntax code for ?\( ;; This happens in CC Mode when unbalanced parens in CPP ;; constructs are given punctuation syntax with ;; syntax-table text properties. (2016-02-21). (signal 'scan-error (list "Containing expression ends prematurely" start start)) (list start (save-excursion (goto-char start) (forward-sexp 1) (point))))) So the 'scan-error happens when the character is a parenthesis character according to the syntax table (that's what is tested by (=3D (char-syntax (char-after start)) ?\()) but has a text property telling Emacs to treat it as something else than a parenthesis instead. Changing the "char-syntax" test to (=3D (syntax-class-to-char (syntax-class (syntax-after start))) ?\()) makes it so that the 'scan-error happens if the character is both a parenthesis and not a parenthesis according to text properties, which is not possible. In other words, it is not possible for both (=3D (syntax-class-to-char (syntax-class (syntax-after start))) ?\()) and (/=3D (syntax-class (syntax-after start)) 4) to be simultaneously true, as they are the exact opposite of each other, so when they are nested conditions, the inner one becomes dead code. That said, it only seems to happen in rare edge cases (as in https://lists.gnu.org/archive/html/bug-gnu-emacs/2016-02/msg00988.html), as regular unmatched parentheses do seem to still trigger a different "Unbalanced parentheses" scan error. Apart from that, I have now managed to test the patch, and I can confirm that it fixes my original issue From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 13 12:06:26 2024 Received: (at 74415) by debbugs.gnu.org; 13 Dec 2024 17:06:26 +0000 Received: from localhost ([127.0.0.1]:43981 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tM97S-0000ja-BA for submit@debbugs.gnu.org; Fri, 13 Dec 2024 12:06:26 -0500 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:64281) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tM97P-0000jG-NV for 74415@debbugs.gnu.org; Fri, 13 Dec 2024 12:06:25 -0500 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 121A010004A; Fri, 13 Dec 2024 12:05:57 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1734109556; bh=klf4xFIFk9YOs5bBLv9gqf0ai2VTMknsych7/ifKETs=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=XpBToSAGJ43yPeT/+h4jFELhoVnIZ6anQV4eMHBcQPz6CZcirNkDXYWq6tuudXY5y iDfbQsrqoRQugbXBAWL2ujIDWlrUetXN/zwzmoVI/ih2gX9yE7MtTvenNfa3zlUNxr LgINJtYZeh4l+jA3Ifzeam++kjMw8cRTanEuHpMocZO9w9DT5mSd8tu3WguUGJh9TQ vE5Hazpm0ASsEkmdZZ+SGsATF76RKoaI4K38jkHM19+8cI42N2Uj8bctUpusqkLCu9 ZH4JoTsDlYxtyrMm0HcQ9XfgW458uplsL6mHS1WBsST4AvNzxM8CfBwZHvX78Z9M0J NZ6I8bFfaLC/w== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 40D71100042; Fri, 13 Dec 2024 12:05:56 -0500 (EST) Received: from alfajor (unknown [23.233.149.155]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 26FF21204B0; Fri, 13 Dec 2024 12:05:56 -0500 (EST) From: Stefan Monnier To: Guillaume Brunerie Subject: Re: bug#74415: 29.4; mouse-start-end does not respect syntax-table text properties In-Reply-To: (Guillaume Brunerie's message of "Mon, 9 Dec 2024 20:21:49 +0100") Message-ID: References: <86cyilj6ks.fsf@gnu.org> <86mshjcpod.fsf@gnu.org> <86seqzisg2.fsf@gnu.org> Date: Fri, 13 Dec 2024 12:05:55 -0500 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.014 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 74415 Cc: Eli Zaretskii , 74415@debbugs.gnu.org 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: -3.3 (---) > No, it was not dead code before, but changing the outer condition > makes it impossible for both the outer condition and the inner > condition to be true at the same time. > The current code is the following (inside a cond) > > ((and (= mode 1) > (= start end) > (char-after start) > (= (char-syntax (char-after start)) ?\()) > (if (/= (syntax-class (syntax-after start)) 4) ; raw syntax code for ?\( > ;; This happens in CC Mode when unbalanced parens in CPP > ;; constructs are given punctuation syntax with > ;; syntax-table text properties. (2016-02-21). > (signal 'scan-error (list "Containing expression ends prematurely" > start start)) > (list start > (save-excursion > (goto-char start) > (forward-sexp 1) > (point))))) I have the strong impression that this reflects the fact that the if+signal was a workaround which we're now replacing with an actual fix. Stefan From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 04 05:54:33 2025 Received: (at 74415-done) by debbugs.gnu.org; 4 Jan 2025 10:54:34 +0000 Received: from localhost ([127.0.0.1]:53502 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tU1nd-0000lP-Id for submit@debbugs.gnu.org; Sat, 04 Jan 2025 05:54:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34444) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tU1nb-0000lB-LA for 74415-done@debbugs.gnu.org; Sat, 04 Jan 2025 05:54:32 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tU1nW-00081G-27; Sat, 04 Jan 2025 05:54:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=yuf2zNEpAP0LGSMzcgZPjbSazTYoyMqLS5pmtrFktGA=; b=g6Nv0OALpr79 JxVdHO9o4SirxsR4OZONeud0huCojnIxizFJgwjF8fNJbMBsxV0TdxdDpoJjqKJw6U8B3fxlr5oJ5 jg1Fgvs+KAA1l9tBcuZIa8hRgY09MQ6uq5P6peYhqFlGZHSXH2T4tPGwBn1pzWEgQb56nsKT5w/VI /JnStKkGYb5Kt8JUnxDRj8sgEe0AViMyIqeVv3oHYUQJa7NQKLYsY1rq+3VUgKY6eKpoeX3exEPMs bzhqLjaoBTan8Lh1G+EK5ZJVmzzn8YL0PVBrxQsJV75igvU8n+dQ2UNZQOcOphkNsgzeZOl7ytvy4 70p+IhWeMXGZqcyKZZQaTA==; Date: Sat, 04 Jan 2025 12:54:21 +0200 Message-Id: <86y0zqetnm.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-Reply-To: (message from Stefan Monnier on Fri, 13 Dec 2024 12:05:55 -0500) Subject: Re: bug#74415: 29.4; mouse-start-end does not respect syntax-table text properties References: <86cyilj6ks.fsf@gnu.org> <86mshjcpod.fsf@gnu.org> <86seqzisg2.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 74415-done Cc: guillaume.brunerie@gmail.com, 74415-done@debbugs.gnu.org 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: -3.3 (---) > From: Stefan Monnier > Cc: Eli Zaretskii , 74415@debbugs.gnu.org > Date: Fri, 13 Dec 2024 12:05:55 -0500 > > > No, it was not dead code before, but changing the outer condition > > makes it impossible for both the outer condition and the inner > > condition to be true at the same time. > > The current code is the following (inside a cond) > > > > ((and (= mode 1) > > (= start end) > > (char-after start) > > (= (char-syntax (char-after start)) ?\()) > > (if (/= (syntax-class (syntax-after start)) 4) ; raw syntax code for ?\( > > ;; This happens in CC Mode when unbalanced parens in CPP > > ;; constructs are given punctuation syntax with > > ;; syntax-table text properties. (2016-02-21). > > (signal 'scan-error (list "Containing expression ends prematurely" > > start start)) > > (list start > > (save-excursion > > (goto-char start) > > (forward-sexp 1) > > (point))))) > > I have the strong impression that this reflects the fact that the > if+signal was a workaround which we're now replacing with an actual fix. Evidently. So I've now installed my changes on the master branch, after removing the unneeded code which signals an error, and I'm therefore closing this bug. From unknown Wed Aug 20 01:18:21 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 01 Feb 2025 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