emacs-diffs
[Top][All Lists]
Advanced

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

emacs-29 43c7e05a2a: Fix misspelled functions in shortdoc groups


From: Stefan Kangas
Subject: emacs-29 43c7e05a2a: Fix misspelled functions in shortdoc groups
Date: Sat, 31 Dec 2022 06:40:57 -0500 (EST)

branch: emacs-29
commit 43c7e05a2acadf1ba3ff24fba1706317e347a2ac
Author: Stefan Kangas <stefankangas@gmail.com>
Commit: Stefan Kangas <stefankangas@gmail.com>

    Fix misspelled functions in shortdoc groups
    
    * lisp/emacs-lisp/shortdoc.el (file, list): Fix misspelled function
    names: 'file-writable-p' and 'seq-reduce'.
    * test/lisp/emacs-lisp/shortdoc-tests.el (subr-x): Require.
    (shortdoc-all-functions-fboundp): New test.
---
 lisp/emacs-lisp/shortdoc.el            | 8 ++++----
 test/lisp/emacs-lisp/shortdoc-tests.el | 9 +++++++++
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/lisp/emacs-lisp/shortdoc.el b/lisp/emacs-lisp/shortdoc.el
index 90f81d740f..86baca54e9 100644
--- a/lisp/emacs-lisp/shortdoc.el
+++ b/lisp/emacs-lisp/shortdoc.el
@@ -421,8 +421,8 @@ A FUNC form can have any number of `:no-eval' (or 
`:no-value'),
   (file-readable-p
    :no-eval (file-readable-p "/tmp/foo")
    :eg-result t)
-  (file-writeable-p
-   :no-eval (file-writeable-p "/tmp/foo")
+  (file-writable-p
+   :no-eval (file-writable-p "/tmp/foo")
    :eg-result t)
   (file-accessible-directory-p
    :no-eval (file-accessible-directory-p "/tmp")
@@ -652,8 +652,8 @@ A FUNC form can have any number of `:no-eval' (or 
`:no-value'),
    :eval (mapcan #'list '(1 2 3)))
   (mapc
    :eval (mapc #'insert '("1" "2" "3")))
-  (reduce
-   :eval (reduce #'+ '(1 2 3)))
+  (seq-reduce
+   :eval (seq-reduce #'+ '(1 2 3) 0))
   (mapconcat
    :eval (mapconcat #'identity '("foo" "bar") "|"))
   "Predicates"
diff --git a/test/lisp/emacs-lisp/shortdoc-tests.el 
b/test/lisp/emacs-lisp/shortdoc-tests.el
index 8515b9fdfb..3938902fa7 100644
--- a/test/lisp/emacs-lisp/shortdoc-tests.el
+++ b/test/lisp/emacs-lisp/shortdoc-tests.el
@@ -21,6 +21,7 @@
 
 (require 'ert)
 (require 'shortdoc)
+(require 'subr-x) ; `string-pad' in shortdoc group needed at run time
 
 (defun shortdoc-tests--tree-contains (tree fun)
   "Whether TREE contains a call to FUN."
@@ -44,6 +45,14 @@
                 (should (shortdoc-tests--tree-contains expr fun))))
             (setq props (cddr props))))))))
 
+(ert-deftest shortdoc-all-functions-fboundp ()
+  "Check that all functions listed in shortdoc groups are `fboundp'."
+  (dolist (group shortdoc--groups)
+    (dolist (item group)
+      (when (consp item)
+        (let ((fun (car item)))
+          (should (fboundp fun)))))))
+
 (ert-deftest shortdoc-all-groups-work ()
   "Test that all defined shortdoc groups display correctly."
   (dolist (group (mapcar (lambda (x) (car x)) shortdoc--groups))



reply via email to

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