emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r115766: * admin/admin.el: Minor cleanups.


From: Xue Fuqiao
Subject: [Emacs-diffs] trunk r115766: * admin/admin.el: Minor cleanups.
Date: Fri, 27 Dec 2013 10:21:54 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 115766
revision-id: address@hidden
parent: address@hidden
committer: Xue Fuqiao <address@hidden>
branch nick: trunk
timestamp: Fri 2013-12-27 18:21:47 +0800
message:
  * admin/admin.el: Minor cleanups.
  
  * admin/admin.el (manual-misc-manuals, make-manuals):
  (manual-pdf, cusver-find-files):
  (cusver-new-version, cusver-scan, cusver-goto-xref):
  (cusver-check): Doc fix.
  (manual-html-node, cusver-check): Use `user-error'.
modified:
  admin/ChangeLog                changelog-20091113204419-o5vbwnq5f7feedwu-2226
  admin/admin.el                 admin.el-20091113204419-o5vbwnq5f7feedwu-2254
=== modified file 'admin/ChangeLog'
--- a/admin/ChangeLog   2013-12-24 18:27:53 +0000
+++ b/admin/ChangeLog   2013-12-27 10:21:47 +0000
@@ -1,3 +1,11 @@
+2013-12-27  Xue Fuqiao  <address@hidden>
+
+       * admin.el (manual-misc-manuals, make-manuals):
+       (manual-pdf, cusver-find-files):
+       (cusver-new-version, cusver-scan, cusver-goto-xref):
+       (cusver-check): Doc fix.
+       (manual-html-node, cusver-check): Use `user-error'.
+
 2013-12-24  Paul Eggert  <address@hidden>
 
        Automate the procedure for updating copyright year.

=== modified file 'admin/admin.el'
--- a/admin/admin.el    2013-12-25 02:18:43 +0000
+++ b/admin/admin.el    2013-12-27 10:21:47 +0000
@@ -108,7 +108,7 @@
   ;; 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) ","
@@ -198,7 +198,8 @@
 ;;; 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
@@ -217,6 +218,7 @@
 
 (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: "
@@ -332,7 +334,7 @@
 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"
@@ -369,7 +371,7 @@
          (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
@@ -381,6 +383,7 @@
   (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)
@@ -497,12 +500,12 @@
       (forward-line 1))))
 
 
-;; 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
@@ -514,14 +517,14 @@
 
 (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\\)")))
@@ -530,7 +533,7 @@
     (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)))
@@ -572,7 +575,7 @@
 (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))
@@ -588,11 +591,13 @@
 ;; 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."
@@ -602,20 +607,20 @@
                      (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
@@ -640,7 +645,7 @@
        (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)))


reply via email to

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