;; in two places those commas are followed by space, in two other
;; places they are not.
(let* ((version-components (append (split-string version "\\.")
- '("0" "0")))
+ '("0" "0")))
(comma-version
(concat (car version-components) ","
(cadr version-components) ","
;;; Various bits of magic for generating the web manuals
(defun manual-misc-manuals (root)
- "Return doc/misc manuals as list of strings."
+ "Return doc/misc manuals as list of strings.
+ROOT should be the root of an Emacs source tree."
;; Similar to `make -C doc/misc echo-info', but works if unconfigured,
;; and for INFO_TARGETS rather than INFO_INSTALL.
(with-temp-buffer
(defun make-manuals (root &optional type)
"Generate the web manuals for the Emacs webpage.
+ROOT should be the root of an Emacs source tree.
Interactively with a prefix argument, prompt for TYPE.
Optional argument TYPE is type of output (nil means all)."
(interactive (let ((root (read-directory-name "Emacs root directory: "
HTML 4.01 Transitional, and pulls in the gnu.org stylesheet using
the @import directive."
(unless (file-exists-p texi-file)
- (error "Manual file %s not found" texi-file))
+ (user-error "Manual file %s not found" texi-file))
(make-directory dir t)
(call-process "makeinfo" nil nil nil
"-D" "WWW_GNU_ORG"
(save-buffer))))))
(defun manual-pdf (texi-file dest)
- "Run texi2pdf on TEXI-FILE, emitting pdf output to DEST."
+ "Run texi2pdf on TEXI-FILE, emitting PDF output to DEST."
(make-directory (or (file-name-directory dest) ".") t)
(let ((default-directory (file-name-directory texi-file)))
(call-process "texi2pdf" nil nil nil
(make-directory (or (file-name-directory dest) ".") t)
(let ((dvi-dest (concat (file-name-sans-extension dest) ".dvi"))
(default-directory (file-name-directory texi-file)))
+ ;; FIXME: Use `texi2dvi --ps'? --xfq
(call-process "texi2dvi" nil nil nil
"-I" "../emacs" "-I" "../misc"
texi-file "-o" dvi-dest)
(forward-line 1))))
\f
-;; Stuff to check new defcustoms got :version tags.
+;; Stuff to check new `defcustom's got :version tags.
;; Adapted from check-declare.el.
(defun cusver-find-files (root &optional old)
- "Find .el files beneath directory ROOT that contain defcustoms.
-If optional OLD is non-nil, also include defvars."
+ "Find .el files beneath directory ROOT that contain `defcustom's.
+If optional OLD is non-nil, also include `defvar's."
(process-lines find-program root
"-name" "*.el"
"-exec" grep-program
(defvar cusver-new-version (format "%s.%s" emacs-major-version
(1+ emacs-minor-version))
- "Version number that new defcustoms should have.")
+ "Version number that new `defcustom's should have.")
(defun cusver-scan (file &optional old)
"Scan FILE for `defcustom' calls.
Return a list with elements of the form (VAR . VER),
This means that FILE contains a defcustom for variable VAR, with
a :version tag having value VER (may be nil).
-If optional argument OLD is non-nil, also scan for defvars."
+If optional argument OLD is non-nil, also scan for `defvar's."
(let ((m (format "Scanning %s..." file))
(re (format "^[ \t]*\\((def%s\\)[ \t\n]"
(if old "\\(custom\\|var\\)" "\\(custom\\|group\\)")))
(with-temp-buffer
(insert-file-contents file)
;; FIXME we could theoretically be inside a string.
- (while (re-search-forward re nil t)
+ (while (re-search-forward re nil :noerror)
(goto-char (match-beginning 1))
(if (and (setq form (ignore-errors (read (current-buffer))))
(setq var (car-safe (cdr-safe form)))
(define-button-type 'cusver-xref 'action #'cusver-goto-xref)
(defun cusver-goto-xref (button)
- "Jump to a lisp file for the BUTTON at point."
+ "Jump to a Lisp file for the BUTTON at point."
(let ((file (button-get button 'file))
(var (button-get button 'var)))
(if (not (file-readable-p file))
;; TODO Check cus-start if something moved from C to Lisp.
;; TODO Handle renamed things with aliases to the old names.
(defun cusver-check (newdir olddir version)
- "Check that defcustoms have :version tags where needed.
-NEWDIR is the current lisp/ directory, OLDDIR is that from the previous
-release. A defcustom that is only in NEWDIR should have a :version
-tag. We exclude cases where a defvar exists in OLDDIR, since
-just converting a defvar to a defcustom does not require a :version bump.
+ "Check that `defcustom's have :version tags where needed.
+NEWDIR is the current lisp/ directory, OLDDIR is that from the
+previous release, VERSION is the new version number. A
+`defcustom' that is only in NEWDIR should have a :version tag.
+We exclude cases where a `defvar' exists in OLDDIR, since just
+converting a `defvar' to a `defcustom' does not require
+a :version bump.
Note that a :version tag should also be added if the value of a defcustom
changes (in a non-trivial way). This function does not check for that."
(read-number "New version number: "
(string-to-number cusver-new-version)))))
(or (file-directory-p (setq newdir (expand-file-name newdir)))
- (error "Directory `%s' not found" newdir))
+ (user-error "Directory `%s' not found" newdir))
(or (file-directory-p (setq olddir (expand-file-name olddir)))
- (error "Directory `%s' not found" olddir))
+ (user-error "Directory `%s' not found" olddir))
(setq cusver-new-version version)
- (let* ((newfiles (progn (message "Finding new files with defcustoms...")
+ (let* ((newfiles (progn (message "Finding new files with `defcustom's...")
(cusver-find-files newdir)))
- (oldfiles (progn (message "Finding old files with defcustoms...")
+ (oldfiles (progn (message "Finding old files with `defcustom's...")
(cusver-find-files olddir t)))
- (newcus (progn (message "Reading new defcustoms...")
+ (newcus (progn (message "Reading new `defcustom's...")
(mapcar
(lambda (file)
(cons file (cusver-scan file))) newfiles)))
oldcus result thisfile file)
- (message "Reading old defcustoms...")
+ (message "Reading old `defcustom's...")
(dolist (file oldfiles)
(setq oldcus (append oldcus (cusver-scan file t))))
(setq oldcus (append oldcus (cusver-scan-cus-start
(message "No missing :version tags")
(pop-to-buffer "*cusver*")
(erase-buffer)
- (insert "These defcustoms might be missing :version tags:\n\n")
+ (insert "These `defcustom's might be missing :version tags:\n\n")
(dolist (elem result)
(let* ((str (file-relative-name (car elem) newdir))
(strlen (length str)))