Mercurial > hg > xemacs-beta
annotate lisp/package-info.el @ 5652:cc6f0266bc36
Avoid #'delq in core Lisp, for the sake of style, a very slightly smaller binary
lisp/ChangeLog addition:
2012-05-01 Aidan Kehoe <kehoea@parhasard.net>
Avoid #'delq in core code, for the sake of style and a (very
slightly) smaller binary.
* behavior.el (disable-behavior):
* behavior.el (compute-behavior-group-children):
* buff-menu.el (buffers-tab-items):
* byte-optimize.el (byte-optimize-delay-constants-math):
* byte-optimize.el (byte-optimize-logmumble):
* byte-optimize.el (byte-decompile-bytecode-1):
* byte-optimize.el (byte-optimize-lapcode):
* bytecomp.el:
* bytecomp.el (byte-compile-arglist-warn):
* bytecomp.el (byte-compile-warn-about-unresolved-functions):
* bytecomp.el (byte-compile-lambda):
* bytecomp.el (byte-compile-out-toplevel):
* bytecomp.el (byte-compile-insert):
* bytecomp.el (byte-compile-defalias-warn):
* cl-macs.el (cl-upcase-arg):
* cl-macs.el (cl-transform-lambda):
* cl-macs.el (cl-do-proclaim):
* cl-macs.el (defstruct):
* cl-macs.el (cl-make-type-test):
* cl-macs.el (define-compiler-macro):
* cl-macs.el (delete-duplicates):
* cus-edit.el (widget-face-value-delete):
* cus-edit.el (face-history):
* easymenu.el (easy-menu-remove):
* files.el (files-fetch-hook-value):
* files.el (file-expand-wildcards):
* font-lock.el (font-lock-update-removed-keyword-alist):
* font-lock.el (font-lock-remove-keywords):
* frame.el (frame-initialize):
* frame.el (frame-notice-user-settings):
* frame.el (set-frame-font):
* frame.el (delete-other-frames):
* frame.el (get-frame-for-buffer-noselect):
* gnuserv.el (gnuserv-kill-buffer-function):
* gnuserv.el (gnuserv-check-device):
* gnuserv.el (gnuserv-kill-client):
* gnuserv.el (gnuserv-buffer-done-1):
* gtk-font-menu.el (gtk-reset-device-font-menus):
* gutter-items.el (buffers-tab-items):
* gutter.el (set-gutter-element-visible-p):
* info.el (Info-find-file-node):
* info.el (Info-history-add):
* info.el (Info-build-annotation-completions):
* info.el (Info-index):
* info.el (Info-reannotate-node):
* itimer.el (delete-itimer):
* itimer.el (start-itimer):
* lib-complete.el (lib-complete:cache-completions):
* loadhist.el (unload-feature):
* menubar-items.el (build-buffers-menu-internal):
* menubar.el (delete-menu-item):
* menubar.el (relabel-menu-item):
* msw-font-menu.el (mswindows-reset-device-font-menus):
* mule/make-coding-system.el (fixed-width-generate-helper):
* next-error.el (next-error-find-buffer):
* obsolete.el:
* obsolete.el (find-non-ascii-charset-string):
* obsolete.el (find-non-ascii-charset-region):
* occur.el (multi-occur-by-filename-regexp):
* occur.el (occur-1):
* packages.el (packages-package-hierarchy-directory-names):
* packages.el (package-get-key-1):
* process.el (setenv):
* simple.el (undo):
* simple.el (handle-pre-motion-command-current-command-is-motion):
* sound.el (load-sound-file):
* wid-edit.el (widget-field-value-delete):
* wid-edit.el (widget-checklist-match-inline):
* wid-edit.el (widget-checklist-match-find):
* wid-edit.el (widget-editable-list-delete-at):
* wid-edit.el (widget-editable-list-entry-create):
* window.el (quit-window):
* x-font-menu.el (x-reset-device-font-menus-core):
1. Replace (delq nil (mapcar ....)) with analogous (mapcan ...)
forms; this is in non-dumped files, it was done previously in
dumped files.
2. Replace (delq FOO (copy-sequence BAR)) with (remove* FOO BAR),
where #'eq and #'eql are equivalent
3. Replace (delq FOO BAR) with (delete* FOO BAR), where FOO is not
a non-fixnum number. Saves a little space in the dumped file
(since the compiler macro adds :test #'eq to the delete* call if
it's not clear that FOO is not a non-fixnum number).
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Tue, 01 May 2012 16:17:42 +0100 |
parents | 308d34e9f07d |
children |
rev | line source |
---|---|
428 | 1 ;;; package-info.el --- Generate information about an XEmacs package |
2 | |
3 ;; Copyright (C) 1998 by Free Software Foundation, Inc. | |
4 | |
5 ;; Author: SL Baur <steve@xemacs.org> | |
6 ;; Keywords: internal | |
7 | |
8 ;; This file is part of XEmacs. | |
9 | |
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
1410
diff
changeset
|
10 ;; XEmacs is free software: you can redistribute it and/or modify it |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
1410
diff
changeset
|
11 ;; under the terms of the GNU General Public License as published by the |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
1410
diff
changeset
|
12 ;; Free Software Foundation, either version 3 of the License, or (at your |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
1410
diff
changeset
|
13 ;; option) any later version. |
428 | 14 |
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
1410
diff
changeset
|
15 ;; XEmacs is distributed in the hope that it will be useful, but WITHOUT |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
1410
diff
changeset
|
16 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
1410
diff
changeset
|
17 ;; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
1410
diff
changeset
|
18 ;; for more details. |
428 | 19 |
20 ;; You should have received a copy of the GNU General Public License | |
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
1410
diff
changeset
|
21 ;; along with XEmacs. If not, see <http://www.gnu.org/licenses/>. |
428 | 22 |
23 ;;; Synched up with: Not in FSF | |
24 | |
25 ;;; Commentary: | |
26 | |
27 ;; This file is used for building package distributions. | |
28 | |
29 ;;; Change Log: | |
30 | |
31 ;;; Code: | |
32 | |
33 (defvar package-info "package-info" | |
34 "File used to write out Package info") | |
35 | |
36 (defvar package-info-template "package-info.in" | |
37 "Template file for package-get info.") | |
38 | |
39 ;; Loses with Mule | |
40 ;(defun pi-md5sum (file) | |
41 ; (let (result) | |
42 ; (with-temp-buffer | |
43 ; (let ((buffer-file-coding-system-for-read 'binary)) | |
44 ; (insert-file-contents-literally file)) | |
45 ; ;; (write-file "/tmp/x.x") | |
46 ; (setq result (md5 (current-buffer)))) | |
47 ; result)) | |
48 | |
442 | 49 ;;; APA: Stolen from package-get in package-get.el |
428 | 50 (defun pi-md5sum (file) |
51 (with-temp-buffer | |
442 | 52 (insert-file-contents-literally file) |
53 (md5 (current-buffer)))) | |
428 | 54 |
55 (defun pi-update-key (key value) | |
56 (save-excursion | |
57 (goto-char (point-min)) | |
58 (let ((case-fold-search nil)) | |
59 (when (search-forward key) | |
60 (replace-match value t))))) | |
61 | |
62 (defun pi-author-version (author-version) | |
63 (if (> (length author-version) 0) | |
64 (format "\"%s\"" author-version) | |
65 (format "\"%d.%d%s\"" emacs-major-version emacs-minor-version | |
66 (if (and (boundp 'xemacs-betaname) xemacs-betaname) | |
67 (progn | |
68 (string-match "[0-9]+" xemacs-betaname) | |
69 (concat "b" (match-string 0 xemacs-betaname))) | |
70 "")))) | |
71 | |
72 (defun pi-last-mod-date () | |
73 (condition-case nil | |
74 (save-excursion | |
75 (with-temp-buffer | |
76 (insert-file-contents-literally "ChangeLog") | |
77 (goto-char (point-min)) | |
78 (looking-at "[-0-9]+") | |
79 (format "\"%s\"" | |
80 (buffer-substring (match-beginning 0) | |
81 (match-end 0))))) | |
82 ;; Fallback on current date if no valid ChangeLog entry | |
83 (t (format-time-string "\"%Y-%m-%d\"")))) | |
84 | |
85 (defun batch-update-package-info () | |
86 "Generate a package-info file for use by package-get.el. | |
87 Parameters are: | |
88 version -- Package version number | |
89 filename -- Filename of tarball to generate info for. | |
90 requires -- Packages necessary for bytecompiling. | |
91 author-version -- The original Author's version #. | |
92 maintainer -- The package maintainer. | |
93 category -- The build category." | |
94 (unless noninteractive | |
1410 | 95 (error 'invalid-operation |
96 "`batch-update-package-info' is to be used only with -batch")) | |
428 | 97 (let ((version (nth 0 command-line-args-left)) |
98 (filename (nth 1 command-line-args-left)) | |
99 (requires (nth 2 command-line-args-left)) | |
100 (author-version (nth 3 command-line-args-left)) | |
101 (maintainer (nth 4 command-line-args-left)) | |
102 (category (nth 5 command-line-args-left))) | |
103 (unless requires | |
104 (setq requires "")) | |
105 (find-file package-info) | |
106 (erase-buffer) | |
107 (insert-file-contents-literally package-info-template) | |
108 (goto-char (point-min)) | |
109 (pi-update-key "VERSION" (format "\"%s\"" version)) | |
110 (pi-update-key "MD5SUM" (format "\"%s\"" | |
111 (pi-md5sum filename))) | |
112 (pi-update-key "FILENAME" (format "\"%s\"" | |
113 (file-name-nondirectory filename))) | |
114 (pi-update-key "SIZE" (format "%d" | |
115 (nth 7 (file-attributes filename)))) | |
116 (pi-update-key "REQUIRES" requires) | |
117 (pi-update-key "AUTHOR_VERSION" (pi-author-version author-version)) | |
118 (pi-update-key "MAINTAINER" (format "\"%s\"" maintainer)) | |
119 (pi-update-key "CATEGORY" (format "\"%s\"" category)) | |
120 (pi-update-key "BUILD_DATE" (format-time-string "\"%Y-%m-%d\"")) | |
121 (pi-update-key "DATE" (pi-last-mod-date)) | |
122 (save-buffers-kill-emacs 0))) | |
123 | |
124 (provide 'package-info) | |
125 | |
126 ;;; package-info.el ends here |