org-print-speed-command: Rename and mark for internal use

* etc/ORG-NEWS (~org-print-speed-command~ is now an internal
function): Announce the change.
* lisp/org-compat.el (org-print-speed-command): Mark obsolete.
* lisp/org-keys.el (org--print-speed-command): Rename as internal
function.  Add docstring.  Rename the argument to be more clear.
(org-speed-command-help): Use the new function name.
This commit is contained in:
Ihor Radchenko 2023-12-05 14:30:55 +01:00
parent a0ee5d4c33
commit 5e946d3673
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
3 changed files with 24 additions and 9 deletions

View File

@ -13,6 +13,14 @@ Please send Org bug reports to mailto:emacs-orgmode@gnu.org.
* Version 9.7 (not released yet)
** Important announcements and breaking changes
*** ~org-print-speed-command~ is now an internal function
The old name is marked obsolete and the new name is
~org--print-speed-command~.
This function was always aimed for internal use when building speed
command help buffer. Now, it is stated explicitly.
*** Babel references =FILE:REFERENCE= now search current buffer when =FILE= does not exist
When =FILE= does not exist, the reference is searched in the current

View File

@ -1197,6 +1197,10 @@ context. See the individual commands for more information."
(define-obsolete-function-alias 'org-export-get-parent-element
'org-element-parent-element "9.7")
(define-obsolete-function-alias 'org-print-speed-command
'org--print-speed-command "9.7"
"Internal function. Subject of unannounced changes.")
;;;; Obsolete link types
(eval-after-load 'ol

View File

@ -789,19 +789,22 @@ command."
(function)
(sexp))))))
(defun org-print-speed-command (e)
(if (> (length (car e)) 1)
(defun org--print-speed-command (speed-command)
"Print information about SPEED-COMMAND in help buffer.
SPEED-COMMAND is an element of `org-speed-commands' or
`org-speed-commands-user'."
(if (> (length (car speed-command)) 1)
(progn
(princ "\n")
(princ (car e))
(princ (car speed-command))
(princ "\n")
(princ (make-string (length (car e)) ?-))
(princ (make-string (length (car speed-command)) ?-))
(princ "\n"))
(princ (car e))
(princ (car speed-command))
(princ " ")
(if (symbolp (cdr e))
(princ (symbol-name (cdr e)))
(prin1 (cdr e)))
(if (symbolp (cdr speed-command))
(princ (symbol-name (cdr speed-command)))
(prin1 (cdr speed-command)))
(princ "\n")))
(defun org-speed-command-help ()
@ -811,7 +814,7 @@ command."
(user-error "Speed commands are not activated, customize `org-use-speed-commands'"))
(with-output-to-temp-buffer "*Help*"
(princ "Speed commands\n==============\n")
(mapc #'org-print-speed-command
(mapc #'org--print-speed-command
;; FIXME: don't check `org-speed-commands-user' past 9.6
(if (boundp 'org-speed-commands-user)
(append org-speed-commands