emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/compat 7e4533ab45 65/84: Add compatibility notices to t


From: ELPA Syncer
Subject: [elpa] externals/compat 7e4533ab45 65/84: Add compatibility notices to the end of the docstring
Date: Tue, 3 Jan 2023 08:57:36 -0500 (EST)

branch: externals/compat
commit 7e4533ab4558ee4417db44fa6bab868d61fffa92
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Philip Kaludercic <philipk@posteo.net>

    Add compatibility notices to the end of the docstring
    
    This is done to avoid hidden overlong documentation strings without
    folding the first line of the documentation string.
    
    In addition to that, references to the Compat manual are inserted if
    possible.
---
 .dir-locals.el |  1 -
 compat-macs.el | 25 ++++++++++++++++++-------
 2 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/.dir-locals.el b/.dir-locals.el
index 900dee5f90..6d22de33f5 100644
--- a/.dir-locals.el
+++ b/.dir-locals.el
@@ -2,6 +2,5 @@
 ;;; For more information see (info "(emacs) Directory Variables")
 
 ((emacs-lisp-mode
-  (byte-compile-docstring-max-column . 100)
   (show-trailing-whitespace . t)
   (indent-tabs-mode . nil)))
diff --git a/compat-macs.el b/compat-macs.el
index fa0f6ea74a..2e8b38e74e 100644
--- a/compat-macs.el
+++ b/compat-macs.el
@@ -193,13 +193,24 @@ attributes (see `compat-generate-common')."
                        ((eq type 'macro) "macro")
                        ((eq type 'advice) "advice")
                        ((error "Unknown type")))))
-            (if version
-                (format
-                 "[Compatibility %s for `%S', defined in Emacs %s]\n\n%s"
-                 type oldname version docstring)
-              (format
-               "[Compatibility %s for `%S']\n\n%s"
-               type oldname docstring)))
+            (with-temp-buffer
+              (insert docstring)
+              (newline 2)
+              (insert
+               "[Compatibility "
+               (if version
+                   (format
+                    "%s for `%S', defined in Emacs %s.  \
+If this is not documented on your system, you can check \
+`(compat) Emacs %s' for more details."
+                     type oldname version version)
+                 (format
+                  "code %s for `%S'"
+                  type oldname))
+               "]")
+              (let ((fill-column 80))
+                (fill-region (point-min) (point-max)))
+              (buffer-string)))
          ;; Advice may use the implicit variable `oldfun', but
          ;; to avoid triggering the byte compiler, we make
          ;; sure the argument is used at least once.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]