aboutsummaryrefslogtreecommitdiffstats
path: root/admin
diff options
context:
space:
mode:
authorPo Lu2022-12-11 09:34:02 +0800
committerPo Lu2022-12-11 09:34:02 +0800
commit13310643cd642bb1403bb2f8a5c27d1929725897 (patch)
treedafc767117c64ade8ce5b53487a4874450fb5d9b /admin
parent0878279809c8acc8de703ae9774e89695b4ffc37 (diff)
parent5fbd12ff49410bbc150e677b527ca4939ffcaf5f (diff)
downloademacs-13310643cd642bb1403bb2f8a5c27d1929725897.tar.gz
emacs-13310643cd642bb1403bb2f8a5c27d1929725897.zip
Merge from origin/emacs-29
5fbd12ff494 Adapt manual names in emacs-news-mode b36bc692671 ; * etc/NEWS: Fix typos. f626b9f3856 ; * doc/misc/use-package.texi: Fix indexing. 56a6712bd6f ; * lisp/erc/erc.el (erc-default-target): Fix comment. dcf69a1da4a Respect some spaces in auth-source-pass--match-regexp acd462b0306 ; Improve the use-package manual 801c1c22de8 ; Prefer HTTPS to HTTP in some URLs 74a009dd96a Eglot: Handle LSP progress with Emacs progress reporters ... 0cfeb1c2bc9 Eglot: cleanup whitespace and indentation 465a9e78b96 Better test-custom-opts diagnostics bdbb7099784 ; Fix groff warnings in man pages d3d9676bf88 New script admin/check-man-pages c2aea9d1323 ; Mention flush-lines in kill-matching-lines docstring f5c3585e4dd ; Fix typos 58a483960dd ; Improve use-package-autoload-keymap docstring # Conflicts: # etc/NEWS
Diffstat (limited to 'admin')
-rwxr-xr-xadmin/check-man-pages56
-rw-r--r--admin/cus-test.el32
-rw-r--r--admin/make-tarball.txt6
3 files changed, 83 insertions, 11 deletions
diff --git a/admin/check-man-pages b/admin/check-man-pages
new file mode 100755
index 00000000000..c7d781ba3d2
--- /dev/null
+++ b/admin/check-man-pages
@@ -0,0 +1,56 @@
1#!/bin/bash
2### check-man-pages - check man pages for errors
3
4## Copyright (C) 2022 Free Software Foundation, Inc.
5
6## Author: Stefan Kangas <stefankangas@gmail.com>
7
8## This file is part of GNU Emacs.
9
10## GNU Emacs is free software: you can redistribute it and/or modify
11## it under the terms of the GNU General Public License as published by
12## the Free Software Foundation, either version 3 of the License, or
13## (at your option) any later version.
14
15## GNU Emacs is distributed in the hope that it will be useful,
16## but WITHOUT ANY WARRANTY; without even the implied warranty of
17## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18## GNU General Public License for more details.
19
20## You should have received a copy of the GNU General Public License
21## along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
22
23### Commentary:
24
25## Check Emacs man pages for errors using `man'.
26
27### Code:
28
29source "${0%/*}/emacs-shell-lib"
30
31exit_status=0
32
33cd "$PD"/../doc/man
34for page in *.1; do
35 # ctags.1 just includes the man page etags.1, which AFAICT will
36 # default to the one installed on the system (!), instead of the
37 # one in the repository. So checking it is pointless, and we will
38 # in any case already check etags.1 separately.
39 if [ "$page" == "ctags.1" ]; then
40 continue
41 fi
42 log=$(emacs_mktemp)
43 LC_ALL=C.UTF-8 MANROFFSEQ='' MANWIDTH=80 \
44 man --warnings=all,mac -E UTF-8 -l -Tutf8 -Z "$page" >/dev/null 2> "$log"
45 log_size=$(stat --format=%s "$log")
46 if [ "$log_size" -ne 0 ]; then
47 echo "doc/man/$page:"
48 # Point to the correct file for *compilation* buffers.
49 cat "$log" \
50 | sed 's/troff: man1\/\([^ ]\+\)\.1/troff: doc\/man\/\1.1/' \
51 | sed "s/<standard input>/doc\/man\/$page/"
52 exit_status=1
53 fi
54done
55
56exit $exit_status
diff --git a/admin/cus-test.el b/admin/cus-test.el
index 7e73f2e44aa..44897cd1060 100644
--- a/admin/cus-test.el
+++ b/admin/cus-test.el
@@ -145,7 +145,8 @@ Names should be as they appear in loaddefs.el.")
145(require 'cus-load) 145(require 'cus-load)
146 146
147(defvar cus-test-errors nil 147(defvar cus-test-errors nil
148 "List of problematic variables found by `cus-test-apropos'.") 148 "List of problematic variables found by `cus-test-apropos'.
149Each element is (VARIABLE . PROBLEM); see `cus-test--format-problem'.")
149 150
150(defvar cus-test-tested-variables nil 151(defvar cus-test-tested-variables nil
151 "List of options tested by last call of `cus-test-apropos'.") 152 "List of options tested by last call of `cus-test-apropos'.")
@@ -181,6 +182,15 @@ Set by `cus-test-noloads'.")
181;; (defvar cus-test-vars-cus-loaded nil 182;; (defvar cus-test-vars-cus-loaded nil
182;; "A list of options loaded by `custom-load-symbol'.") 183;; "A list of options loaded by `custom-load-symbol'.")
183 184
185(defun cus-test--format-error (err)
186 "Format an element of `cus-test-errors'."
187 (pcase err
188 (`(,var :type-error ,value ,type)
189 (format "variable: %s\n value: %S\n type: %S" var value type))
190 (`(,var :other-error ,e)
191 (format "variable: %s\n error: %S" var e))
192 (_ (format "%S" err))))
193
184(defun cus-test-apropos (regexp) 194(defun cus-test-apropos (regexp)
185 "Check the options matching REGEXP. 195 "Check the options matching REGEXP.
186The detected problematic options are stored in `cus-test-errors'." 196The detected problematic options are stored in `cus-test-errors'."
@@ -200,8 +210,7 @@ The detected problematic options are stored in `cus-test-errors'."
200 (let* ((type (custom-variable-type symbol)) 210 (let* ((type (custom-variable-type symbol))
201 (conv (widget-convert type)) 211 (conv (widget-convert type))
202 (get (or (get symbol 'custom-get) 'default-value)) 212 (get (or (get symbol 'custom-get) 'default-value))
203 values 213 values)
204 mismatch)
205 (when (default-boundp symbol) 214 (when (default-boundp symbol)
206 (push (funcall get symbol) values) 215 (push (funcall get symbol) values)
207 (push (eval (car (get symbol 'standard-value)) t) values)) 216 (push (eval (car (get symbol 'standard-value)) t) values))
@@ -215,7 +224,9 @@ The detected problematic options are stored in `cus-test-errors'."
215 ;; TODO for booleans, check for values that can be 224 ;; TODO for booleans, check for values that can be
216 ;; evaluated and are not t or nil. Usually a bug. 225 ;; evaluated and are not t or nil. Usually a bug.
217 (unless (widget-apply conv :match value) 226 (unless (widget-apply conv :match value)
218 (setq mismatch 'mismatch))) 227 (let ((err (list symbol :type-error value type)))
228 (unless (member err cus-test-errors)
229 (push err cus-test-errors)))))
219 values) 230 values)
220 231
221 ;; Store symbols with a custom-get property. 232 ;; Store symbols with a custom-get property.
@@ -231,13 +242,12 @@ The detected problematic options are stored in `cus-test-errors'."
231 (and (consp c-value) 242 (and (consp c-value)
232 (boundp symbol) 243 (boundp symbol)
233 (not (equal (eval (car c-value) t) (symbol-value symbol))) 244 (not (equal (eval (car c-value) t) (symbol-value symbol)))
234 (add-to-list 'cus-test-vars-with-changed-state symbol))) 245 (add-to-list 'cus-test-vars-with-changed-state symbol))))
235
236 (if mismatch
237 (push symbol cus-test-errors)))
238 246
239 (error 247 (error
240 (push symbol cus-test-errors) 248 (let ((err (list symbol :other-error alpha)))
249 (unless (member err cus-test-errors)
250 (push err cus-test-errors)))
241 (message "Error for %s: %s" symbol alpha)))) 251 (message "Error for %s: %s" symbol alpha))))
242 (cus-test-get-options regexp)) 252 (cus-test-get-options regexp))
243 (message "%s options tested" 253 (message "%s options tested"
@@ -292,7 +302,7 @@ currently defined groups."
292 (insert "No errors found by cus-test.") 302 (insert "No errors found by cus-test.")
293 (insert "The following variables seem to have problems:\n\n") 303 (insert "The following variables seem to have problems:\n\n")
294 (dolist (e cus-test-errors) 304 (dolist (e cus-test-errors)
295 (insert (symbol-name e) "\n"))))) 305 (insert (cus-test--format-error e) "\n")))))
296 306
297(defun cus-test-load-custom-loads () 307(defun cus-test-load-custom-loads ()
298 "Call `custom-load-symbol' on all atoms." 308 "Call `custom-load-symbol' on all atoms."
@@ -399,7 +409,7 @@ Returns a list of variables with suspicious types."
399 (message "No problems found") 409 (message "No problems found")
400 nil) 410 nil)
401 (message "The following options might have problems:") 411 (message "The following options might have problems:")
402 (cus-test-message cus-test-errors) 412 (cus-test-message (mapcar #'cus-test--format-error cus-test-errors))
403 cus-test-errors)) 413 cus-test-errors))
404 414
405(defun cus-test-deps () 415(defun cus-test-deps ()
diff --git a/admin/make-tarball.txt b/admin/make-tarball.txt
index d881b816125..45da3ed6be5 100644
--- a/admin/make-tarball.txt
+++ b/admin/make-tarball.txt
@@ -150,6 +150,12 @@ General steps (for each step, check for possible errors):
1504. autoreconf -i -I m4 --force 1504. autoreconf -i -I m4 --force
151 make bootstrap 151 make bootstrap
152 152
153 ./admin/check-man-pages
154
155 The above script checks for any mistakes in the source text of
156 manual pages. Fix any errors and re-run the script to verify.
157 Then do this:
158
153 make -C etc/refcards 159 make -C etc/refcards
154 make -C etc/refcards clean 160 make -C etc/refcards clean
155 161