aboutsummaryrefslogtreecommitdiffstats
path: root/admin
diff options
context:
space:
mode:
authorKenichi Handa2012-10-11 20:29:47 +0900
committerKenichi Handa2012-10-11 20:29:47 +0900
commitd3e4228575e9ba9e99dc4a7dae788280ffcc4566 (patch)
tree97d35f3c0766372c166a31f3c0f7aba791a38dde /admin
parentcde44a7728488ca6bc6a46c18d9c5e647b160547 (diff)
parentfd2f90cf5c6a15610aa1e17e73d6d8a5f8cb1999 (diff)
downloademacs-d3e4228575e9ba9e99dc4a7dae788280ffcc4566.tar.gz
emacs-d3e4228575e9ba9e99dc4a7dae788280ffcc4566.zip
merge trunk
Diffstat (limited to 'admin')
-rw-r--r--admin/ChangeLog5
-rw-r--r--admin/admin.el27
2 files changed, 25 insertions, 7 deletions
diff --git a/admin/ChangeLog b/admin/ChangeLog
index ef8ff5ce65c..ca2ebbdfa06 100644
--- a/admin/ChangeLog
+++ b/admin/ChangeLog
@@ -22,6 +22,11 @@
22 charsets/mapfiles/MULE-tibetan.map, 22 charsets/mapfiles/MULE-tibetan.map,
23 charsets/mapfiles/MULE-uviscii.map: Fix typo. 23 charsets/mapfiles/MULE-uviscii.map: Fix typo.
24 24
252012-10-09 Glenn Morris <rgm@gnu.org>
26
27 * admin.el (cusver-scan-cus-start): New function.
28 (cusver-check): Scan old cus-start.el.
29
252012-10-07 Glenn Morris <rgm@gnu.org> 302012-10-07 Glenn Morris <rgm@gnu.org>
26 31
27 * admin.el (cusver-new-version): Set default. 32 * admin.el (cusver-new-version): Set default.
diff --git a/admin/admin.el b/admin/admin.el
index 3e3fbba7202..59d085b6405 100644
--- a/admin/admin.el
+++ b/admin/admin.el
@@ -446,8 +446,6 @@ If optional OLD is non-nil, also include defvars."
446 (1+ emacs-minor-version)) 446 (1+ emacs-minor-version))
447 "Version number that new defcustoms should have.") 447 "Version number that new defcustoms should have.")
448 448
449;; TODO do something about renamed variables with aliases to the old name?
450;; Scan old cus-start.el to find variables moved from C to lisp?
451(defun cusver-scan (file &optional old) 449(defun cusver-scan (file &optional old)
452 "Scan FILE for `defcustom' calls. 450 "Scan FILE for `defcustom' calls.
453Return a list with elements of the form (VAR . VER), 451Return a list with elements of the form (VAR . VER),
@@ -486,6 +484,21 @@ If optional argument OLD is non-nil, also scan for defvars."
486 (message "%sdone" m) 484 (message "%sdone" m)
487 alist)) 485 alist))
488 486
487(defun cusver-scan-cus-start (file)
488 "Scan cus-start.el and return an alist with elements (VAR . VER)."
489 (if (file-readable-p file)
490 (with-temp-buffer
491 (insert-file-contents file)
492 (when (search-forward "(let ((all '(" nil t)
493 (backward-char 1)
494 (let (var ver alist)
495 (dolist (elem (ignore-errors (read (current-buffer))))
496 (when (symbolp (setq var (car-safe elem)))
497 (or (stringp (setq ver (nth 3 elem)))
498 (setq ver nil))
499 (setq alist (cons (cons var ver) alist))))
500 alist)))))
501
489(define-button-type 'cusver-xref 'action #'cusver-goto-xref) 502(define-button-type 'cusver-xref 'action #'cusver-goto-xref)
490 503
491(defun cusver-goto-xref (button) 504(defun cusver-goto-xref (button)
@@ -501,11 +514,9 @@ If optional argument OLD is non-nil, also scan for defvars."
501 (pop-to-buffer (current-buffer)))))) 514 (pop-to-buffer (current-buffer))))))
502 515
503;; You should probably at least do a grep over the old directory 516;; You should probably at least do a grep over the old directory
504;; to check the results of this look sensible. Eg cus-start if 517;; to check the results of this look sensible.
505;; something moved from C to Lisp. 518;; TODO Check cus-start if something moved from C to Lisp.
506;; TODO handle renamed things with aliases to the old names. 519;; TODO Handle renamed things with aliases to the old names.
507;; What to do about new files? Does everything in there need a :version,
508;; or eg just the defgroup?
509(defun cusver-check (newdir olddir version) 520(defun cusver-check (newdir olddir version)
510 "Check that defcustoms have :version tags where needed. 521 "Check that defcustoms have :version tags where needed.
511NEWDIR is the current lisp/ directory, OLDDIR is that from the previous 522NEWDIR is the current lisp/ directory, OLDDIR is that from the previous
@@ -537,6 +548,8 @@ changes (in a non-trivial way). This function does not check for that."
537 (message "Reading old defcustoms...") 548 (message "Reading old defcustoms...")
538 (dolist (file oldfiles) 549 (dolist (file oldfiles)
539 (setq oldcus (append oldcus (cusver-scan file t)))) 550 (setq oldcus (append oldcus (cusver-scan file t))))
551 (setq oldcus (append oldcus (cusver-scan-cus-start
552 (expand-file-name "cus-start.el" olddir))))
540 ;; newcus has elements (FILE (VAR VER) ... ). 553 ;; newcus has elements (FILE (VAR VER) ... ).
541 ;; oldcus just (VAR . VER). 554 ;; oldcus just (VAR . VER).
542 (message "Checking for version tags...") 555 (message "Checking for version tags...")