From: Lars Ingebrigtsen Date: Thu, 4 Aug 2022 09:02:49 +0000 (+0200) Subject: Fix up some prefix registration problems in doc strings X-Git-Tag: emacs-29.0.90~1447^2~477 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4c1bc8315d8e677e4eeb2760d7a5ab7b7553359b;p=emacs.git Fix up some prefix registration problems in doc strings * lisp/uniquify.el (uniquify-buffer-name-style): * lisp/org/ob-core.el (org-src-sha): * lisp/emacs-lisp/cl-macs.el (cl--optimize): * lisp/battery.el (battery-update-functions): Avoid triggering the `register-definition-prefixes' in doc strings (bug#56968). --- diff --git a/lisp/battery.el b/lisp/battery.el index 3cff3167a6c..93f4070e4bc 100644 --- a/lisp/battery.el +++ b/lisp/battery.el @@ -255,14 +255,14 @@ of the following information may or may not be available: For instance, to play an alarm when the battery power dips below 10%, you could use a function like the following: -(defvar my-prev-battery nil) -(defun my-battery-alarm (data) - (when (and my-prev-battery - (equal (alist-get ?L data) \"off-line\") - (< (string-to-number (alist-get ?p data)) 10) - (>= (string-to-number (alist-get ?p my-prev-battery)) 10)) - (play-sound-file \"~/alarm.wav\" 5)) - (setq my-prev-battery data))" + (defvar my-prev-battery nil) + (defun my-battery-alarm (data) + (when (and my-prev-battery + (equal (alist-get ?L data) \"off-line\") + (< (string-to-number (alist-get ?p data)) 10) + (>= (string-to-number (alist-get ?p my-prev-battery)) 10)) + (play-sound-file \"~/alarm.wav\" 5)) + (setq my-prev-battery data))" :version "29.1" :type '(repeat function)) diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 12917c99e10..eefaa36b911 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -2563,9 +2563,9 @@ values. For compatibility, (cl-values A B C) is a synonym for (list A B C). (defun cl--optimize (f _args &rest qualities) "Serve `cl-optimize' in function declarations. Example: -(defun foo (x) - (declare (cl-optimize (speed 3) (safety 0))) - x)" + (defun foo (x) + (declare (cl-optimize (speed 3) (safety 0))) + x)" ;; FIXME this should make use of `cl--declare-stack' but I suspect ;; this mechanism should be reviewed first. (cl-loop for (qly val) in qualities diff --git a/lisp/org/ob-core.el b/lisp/org/ob-core.el index 3d159ed38a9..3b114703cdc 100644 --- a/lisp/org/ob-core.el +++ b/lisp/org/ob-core.el @@ -488,13 +488,13 @@ arguments, imagine you'd like to set the file name output of a latex source block to a sha1 of its contents. We could achieve this with: -(defun org-src-sha () - (let ((elem (org-element-at-point))) - (concat (sha1 (org-element-property :value elem)) \".svg\"))) + (defun org-src-sha () + (let ((elem (org-element-at-point))) + (concat (sha1 (org-element-property :value elem)) \".svg\"))) -(setq org-babel-default-header-args:latex - `((:results . \"file link replace\") - (:file . (lambda () (org-src-sha))))) + (setq org-babel-default-header-args:latex + `((:results . \"file link replace\") + (:file . (lambda () (org-src-sha))))) Because the closure is evaluated with point at the source block, the call to `org-element-at-point' above will always retrieve diff --git a/lisp/uniquify.el b/lisp/uniquify.el index b75b47c03c5..74655e299a8 100644 --- a/lisp/uniquify.el +++ b/lisp/uniquify.el @@ -109,8 +109,8 @@ BASE and EXTRA-STRINGS where BASE is a string and EXTRA-STRINGS is a list of strings. For example the current implementation for post-forward-angle-brackets could be: -(defun my-post-forward-angle-brackets (base extra-string) - (concat base \"<\" (mapconcat #\\='identity extra-string \"/\") \">\")) + (defun my-post-forward-angle-brackets (base extra-string) + (concat base \"<\" (mapconcat #\\='identity extra-string \"/\") \">\")) The \"mumble\" part may be stripped as well, depending on the setting of `uniquify-strip-common-suffix'. For more options that