From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Michalis V." Newsgroups: gmane.emacs.bugs Subject: bug#39134: 28.0.50; forward-sexp fails on curved singlequotes Date: Tue, 17 Aug 2021 12:58:46 +0300 Message-ID: <87sfz8wfxl.fsf@cnu407c2zx.nsn-intra.net> References: <7ba85204-6b66-40f6-350d-a81534c50c15@easy-emacs.de> <87h7fpap1p.fsf@cnu407c2zx.nsn-intra.net> <3acc81de-6603-1f73-5086-a2f9fcc0e874@easy-emacs.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2019"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: mvar , 39134@debbugs.gnu.org To: Andreas =?UTF-8?Q?R=C3=B6hler?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Aug 17 11:59:09 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mFvsD-0000J6-Cc for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 17 Aug 2021 11:59:09 +0200 Original-Received: from localhost ([::1]:42490 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mFvsC-00089b-5F for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 17 Aug 2021 05:59:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46280) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mFvs5-00089S-SP for bug-gnu-emacs@gnu.org; Tue, 17 Aug 2021 05:59:01 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40190) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mFvs5-0000NN-Ly for bug-gnu-emacs@gnu.org; Tue, 17 Aug 2021 05:59:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mFvs5-0003O5-In for bug-gnu-emacs@gnu.org; Tue, 17 Aug 2021 05:59:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Michalis V." Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 17 Aug 2021 09:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39134 X-GNU-PR-Package: emacs Original-Received: via spool by 39134-submit@debbugs.gnu.org id=B39134.162919433813012 (code B ref 39134); Tue, 17 Aug 2021 09:59:01 +0000 Original-Received: (at 39134) by debbugs.gnu.org; 17 Aug 2021 09:58:58 +0000 Original-Received: from localhost ([127.0.0.1]:51736 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFvs2-0003No-Ib for submit@debbugs.gnu.org; Tue, 17 Aug 2021 05:58:58 -0400 Original-Received: from mail-ed1-f53.google.com ([209.85.208.53]:38901) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFvs0-0003Na-02 for 39134@debbugs.gnu.org; Tue, 17 Aug 2021 05:58:57 -0400 Original-Received: by mail-ed1-f53.google.com with SMTP id q3so26663839edt.5 for <39134@debbugs.gnu.org>; Tue, 17 Aug 2021 02:58:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=30zsCKZ12NxE2YLbrrYkz8G/rNKyuG0YeRKocdvhOpA=; b=Oy1oRfLbpJ/Yc8UgR7TpjHsQxxRVUYFatUwlGsTQ1g8sqS5TpYJFZer3L1VBGB7IFK YKzHu+3nPIeClXR08BzOmV+Dv5pqdnDjjtYrtouTuZyrDWcDaH8HSRbrje1gyDXuvix+ 2RSBW8XWMLOwdAF1ibW9kwYVEGSFhcamJ+NB0N12fzpedlqyXRN48iPDocrX3gJTwiwm kszJISWhPDcR3F8tvUL7Mso94Ibib2K7WnazZX5hlSylTb4Kr+aCbrw8h7xWq25lyzti goaCPgKNswi93Gyl+y3E6mjlVwlgjSu4NkBEAH9i8DQMJXXqb+yySiWAln1jnfc5N9gM nkQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=30zsCKZ12NxE2YLbrrYkz8G/rNKyuG0YeRKocdvhOpA=; b=UKlupEUHLw36mJjYUzYO+nWssRgGiuTsrg7F3yg1Obv5SDCNaRkV9rEMBLooDJ5pXp DsOH5kUk+E4dP6MxipX4jJgE9SGfme3Z+DVR09/p8TxtpU9f6iPcG67gTXRdh9o8evll koh+btuIhjWki9ro7lR6aKxOlQ1K1UGE/ahi+X1dL/ngv7RinQS5YaMQOAs/JN2BryjP UZADg+TflxZQetK6pc73a/+27MNITQrV7FvouIVXVfVLVFhzSNUiaCcdOgnryEfkiMu9 hV0XzEated+LBhi7PXPqiyEHkJbja1AXAbdU6RAOv9JJb2bQJhSXD+4yxNvS9msj0GEG /SOQ== X-Gm-Message-State: AOAM533dtWLyuHGf4ka6If+q3AQ5i2UyoK3O4Nqa2Ez7lCjm+e08BcB2 Y0bsnTyE95J2pWsN/iOOVWqWm0uriDFGklbl X-Google-Smtp-Source: ABdhPJwVCxW9rfbzE7gl06qLWS41UjtKPaufoDB4DOEwhpw9fxeNzFusB+NdpAjTVJFJ7YzbBrrhrw== X-Received: by 2002:a05:6402:40c9:: with SMTP id z9mr3263702edb.159.1629194330123; Tue, 17 Aug 2021 02:58:50 -0700 (PDT) Original-Received: from cnu407c2zx.nsn-intra.net (212.251.115.128.dsl.dyn.forthnet.gr. [212.251.115.128]) by smtp.gmail.com with ESMTPSA id d23sm804654edt.39.2021.08.17.02.58.48 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Aug 2021 02:58:49 -0700 (PDT) X-Google-Original-From: "Michalis V." In-Reply-To: <3acc81de-6603-1f73-5086-a2f9fcc0e874@easy-emacs.de> ("Andreas =?UTF-8?Q?R=C3=B6hler?="'s message of "Mon, 16 Aug 2021 17:39:32 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:212074 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Andreas R=C3=B6hler writes: > Andreas R=C3=B6hler writes: > > Hi Michalis, > > don't have any idea WRT importance of this. > > Just thought it may work=C2=A0 - modifying the help-mode syntax-table sho= uld do it. > > Best, > > Andreas hi Andreas, Looking at the help-mode.el it wasn't very clear to me how the help-mode syntax-table variable was actually created - there wasn't any defvar defined but rather the syntax-table was applied inside two defuns. Despite that "C-h v help-mode-syntax-table" would redirect=20 to this line in help-mode.el (define-derived-mode help-mode special-mode "Help" for some cryptic reason. Anyway attached is a patch that introduces properly the help-mode-syntax-table var which derives from the elisp one and sets =E2=80=98=E2=80=99 as parens. Now forward-sexp jumps over the defi= nitions in the *Help* buffer as it should despite any punctuation they may contain.=20 cheers, Michalis --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: attachment; filename=help-mode.diff Content-Transfer-Encoding: quoted-printable diff --git a/lisp/help-mode.el b/lisp/help-mode.el index 2f82d83ceb..6280fad1c1 100644 --- a/lisp/help-mode.el +++ b/lisp/help-mode.el @@ -111,6 +111,15 @@ help-xref-stack-forward-item (setq-default help-xref-stack nil help-xref-stack-item nil) (setq-default help-xref-forward-stack nil help-xref-forward-stack-item nil) =20 +(defvar help-mode-syntax-table + (let ((table (make-syntax-table emacs-lisp-mode-syntax-table))) + ;; treat single quotes as parens so that forward-sexp does not + ;; break when quoted string contains punctuation + (modify-syntax-entry ?=E2=80=98 "(=E2=80=99 " table) + (modify-syntax-entry ?=E2=80=99 ")=E2=80=98 " table) + table) + "Syntax table used in `help-mode'.") + (defcustom help-mode-hook nil "Hook run by `help-mode'." :type 'hook @@ -490,7 +499,7 @@ help-make-xrefs (let ((stab (syntax-table)) (case-fold-search t) (inhibit-read-only t)) - (set-syntax-table emacs-lisp-mode-syntax-table) + (set-syntax-table help-mode-syntax-table) ;; The following should probably be abstracted out. (unwind-protect (progn @@ -643,7 +652,7 @@ help-insert-xref-button (defun help-xref-on-pp (from to) "Add xrefs for symbols in `pp's output between FROM and TO." (if (> (- to from) 5000) nil - (with-syntax-table emacs-lisp-mode-syntax-table + (with-syntax-table help-mode-syntax-table (save-excursion (save-restriction (narrow-to-region from to) --=-=-=--