unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Heerdegen via "Emacs development discussions." <emacs-devel@gnu.org>
To: emacs-devel@gnu.org
Subject: Re: emacs-30 73c1252bb6b: Fix link to major mode variable in docstring
Date: Tue, 09 Jul 2024 02:37:47 +0200	[thread overview]
Message-ID: <87ikxfv1r8.fsf@web.de> (raw)
In-Reply-To: 87cynnihys.fsf@web.de

[-- Attachment #1: Type: text/plain, Size: 404 bytes --]

Michael Heerdegen via "Emacs development discussions."
<emacs-devel@gnu.org> writes:

> What we could do is maybe: generate different text in the two cases
> (expression is the mode variable vs. it is different), or even better,
> add the text only in the "special" case where the mode variable is not
> the thing to eval.

How 'bout this? (based on master where the last fix had not yet been
reverted)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-WIP-Minor-improvement-in-easy-mmode-mode-docstring.patch --]
[-- Type: text/x-diff, Size: 1526 bytes --]

From 701068acd90e5d5cd9b12cb7541a9020568a9893 Mon Sep 17 00:00:00 2001
From: Michael Heerdegen <michael_heerdegen@web.de>
Date: Tue, 9 Jul 2024 02:32:54 +0200
Subject: [PATCH] WIP: Minor improvement in easy-mmode--mode-docstring

---
 lisp/emacs-lisp/easy-mmode.el | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el
index 2c12454af5c..2d6333f146f 100644
--- a/lisp/emacs-lisp/easy-mmode.el
+++ b/lisp/emacs-lisp/easy-mmode.el
@@ -91,7 +91,7 @@ easy-mmode--arg-docstring
 Disable the mode if ARG is a negative number.
 
 To check whether the minor mode is enabled in the current buffer,
-evaluate the variable `%s'.
+evaluate %s.
 
 The mode's hook is called both when the mode is enabled and when
 it is disabled.")
@@ -128,8 +128,9 @@ easy-mmode--mode-docstring
                         easy-mmode--arg-docstring
                         (if global "global " "")
                         mode-pretty-name
-                        ;; Avoid having quotes turn into pretty quotes.
-                        (string-replace "'" "\\='" (format "%S" getter)))))
+                        (format (if (symbolp getter) "the variable `%s'" "%s")
+                                ;; Avoid having quotes turn into pretty quotes.
+                                (help--docstring-quote (format "%S" getter))))))
           (let ((start (point)))
             (insert argdoc)
             (when (fboundp 'fill-region) ;Don't break bootstrap!
-- 
2.39.2


[-- Attachment #3: Type: text/plain, Size: 111 bytes --]


I took the chance and replaced the manual quoting treatment with a call
to `help--docstring-quote'.

Michael.

  reply	other threads:[~2024-07-09  0:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <171956993509.30805.5525504753117432129@vcs2.savannah.gnu.org>
     [not found] ` <20240628101855.7E69DC2BC60@vcs2.savannah.gnu.org>
2024-07-08  9:34   ` emacs-30 73c1252bb6b: Fix link to major mode variable in docstring Eshel Yaron
2024-07-08 11:48     ` Stefan Kangas
2024-07-08 15:58       ` Thierry Volpiatto
2024-07-08 23:26         ` Michael Heerdegen via Emacs development discussions.
2024-07-09  0:37           ` Michael Heerdegen via Emacs development discussions. [this message]
2024-07-09  4:22         ` Thierry Volpiatto
2024-07-09  5:01           ` Michael Heerdegen via Emacs development discussions.
     [not found]             ` <87y16b3zhk.fsf@posteo.net>
     [not found]               ` <87r0c3f1a4.fsf@web.de>
2024-07-09 10:06                 ` Thierry Volpiatto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ikxfv1r8.fsf@web.de \
    --to=emacs-devel@gnu.org \
    --cc=michael_heerdegen@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).