APPROVE COMMIT
NOTE: This patch has been committed.
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1299607968 0
# Node ID 311f6817efc24a2f7946186eaed71e20bc6ed5ab
# Parent 1cfe6b84efbf9690361027a8d37acd95a20f7cf7
Remove various redundant wrapper lambdas, core lisp.
2011-03-08 Aidan Kehoe <kehoea(a)parhasard.net>
* package-ui.el (pui-add-required-packages):
* packages.el (packages-handle-package-dumped-lisps):
* bytecomp-runtime.el (byte-compile-with-fboundp):
* bytecomp-runtime.el (globally-declare-fboundp):
* bytecomp-runtime.el
(byte-compile-with-byte-compiler-warnings-suppressed):
* mule/devan-util.el (devanagari-reorder-glyphs-for-composition):
* mule/devan-util.el (devanagari-compose-to-one-glyph):
* mule/japanese.el:
* mule/japanese.el ("Japanese"):
* mule/make-coding-system.el (fixed-width-generate-helper):
* mule/mule-category.el (defined-category-list):
* mule/mule-category.el (undefined-category-designator):
Style change: remove redundant lambdas, things like (mapcar
#'(lambda (pkg) (symbol-name pkg)) ...) => (mapcar #'symbol-name ...).
diff -r 1cfe6b84efbf -r 311f6817efc2 lisp/ChangeLog
--- a/lisp/ChangeLog Tue Mar 01 14:18:54 2011 +0000
+++ b/lisp/ChangeLog Tue Mar 08 18:12:48 2011 +0000
@@ -1,3 +1,21 @@
+2011-03-08 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * package-ui.el (pui-add-required-packages):
+ * packages.el (packages-handle-package-dumped-lisps):
+ * bytecomp-runtime.el (byte-compile-with-fboundp):
+ * bytecomp-runtime.el (globally-declare-fboundp):
+ * bytecomp-runtime.el
+ (byte-compile-with-byte-compiler-warnings-suppressed):
+ * mule/devan-util.el (devanagari-reorder-glyphs-for-composition):
+ * mule/devan-util.el (devanagari-compose-to-one-glyph):
+ * mule/japanese.el:
+ * mule/japanese.el ("Japanese"):
+ * mule/make-coding-system.el (fixed-width-generate-helper):
+ * mule/mule-category.el (defined-category-list):
+ * mule/mule-category.el (undefined-category-designator):
+ Style change: remove redundant lambdas, things like (mapcar
+ #'(lambda (pkg) (symbol-name pkg)) ...) => (mapcar #'symbol-name ...).
+
2011-02-16 Aidan Kehoe <kehoea(a)parhasard.net>
* bytecomp.el (byte-compile-normal-call):
diff -r 1cfe6b84efbf -r 311f6817efc2 lisp/bytecomp-runtime.el
--- a/lisp/bytecomp-runtime.el Tue Mar 01 14:18:54 2011 +0000
+++ b/lisp/bytecomp-runtime.el Tue Mar 08 18:12:48 2011 +0000
@@ -310,7 +310,7 @@
(let ((symbols (eval (car (cdr form)))))
(unless (consp symbols)
(setq symbols (list symbols)))
- (setq symbols (mapcar #'(lambda (sym) (cons sym nil)) symbols))
+ (setq symbols (mapcar #'list symbols))
(setq byte-compile-unresolved-functions
(set-difference byte-compile-unresolved-functions symbols
:key #'car))
@@ -427,7 +427,7 @@
;; have an autoload later in the file for any functions in FUNCTIONS.
;; This is not something that code should ever do, though.)
(setq byte-compile-autoload-environment
- (append (mapcar #'(lambda (sym) (cons sym nil)) functions)
+ (append (mapcar #'list functions)
byte-compile-autoload-environment)))
nil)
diff -r 1cfe6b84efbf -r 311f6817efc2 lisp/mule/devan-util.el
--- a/lisp/mule/devan-util.el Tue Mar 01 14:18:54 2011 +0000
+++ b/lisp/mule/devan-util.el Tue Mar 08 18:12:48 2011 +0000
@@ -1057,8 +1057,7 @@
(setq ordered-glyphs
(append ordered-glyphs
(list (assq glyph devanagari-composition-rules))))))
- (sort ordered-glyphs #'(lambda (x y) (< (car (cdr x)) (car (cdr y)))))))
-
+ (sort* ordered-glyphs '< :key 'cadr)))
;;(devanagari-compose-to-one-glyph "$(5"5!X![(B") =>
"4$(6!Xv#"5t%![0!X"5![1(B"
(defun devanagari-compose-to-one-glyph (devanagari-string)
diff -r 1cfe6b84efbf -r 311f6817efc2 lisp/mule/japanese.el
--- a/lisp/mule/japanese.el Tue Mar 01 14:18:54 2011 +0000
+++ b/lisp/mule/japanese.el Tue Mar 08 18:12:48 2011 +0000
@@ -444,44 +444,38 @@
;; little helps there.)
(set-language-info "Japanese"
'native-coding-system
- (list
- ;; first, see if an explicit encoding was given.
- (lambda (locale)
- (let ((case-fold-search t))
- (cond
- ;; many unix versions
- ((string-match "\\.euc" locale) 'euc-jp)
- ((string-match "\\.sjis" locale) 'shift-jis)
+ ;; first, see if an explicit encoding was given.
+ (lambda (locale)
+ (let ((case-fold-search t))
+ (cond
+ ;; many unix versions
+ ((string-match "\\.euc" locale) 'euc-jp)
+ ((string-match "\\.sjis" locale) 'shift-jis)
- ;; X11R6 (CJKV p. 471)
- ((string-match "\\.jis7" locale) 'jis7)
- ((string-match "\\.jis8" locale) 'jis8)
- ((string-match "\\.mscode" locale) 'shift-jis)
- ((string-match "\\.pjis" locale) 'iso-2022-jp)
- ((string-match "\\.ujis" locale) 'euc-jp)
+ ;; X11R6 (CJKV p. 471)
+ ((string-match "\\.jis7" locale) 'jis7)
+ ((string-match "\\.jis8" locale) 'jis8)
+ ((string-match "\\.mscode" locale) 'shift-jis)
+ ((string-match "\\.pjis" locale) 'iso-2022-jp)
+ ((string-match "\\.ujis" locale) 'euc-jp)
- ;; other names in X11R6 locale.alias
- ((string-match "\\.ajec" locale) 'euc-jp)
- ((string-match "-euc" locale) 'euc-jp)
- ((string-match "\\.iso-2022-jp" locale)
'iso-2022-jp)
- ((string-match "\\.jis" locale) 'jis7) ;; or just
jis?
- )))
+ ;; other names in X11R6 locale.alias
+ ((string-match "\\.ajec" locale) 'euc-jp)
+ ((string-match "-euc" locale) 'euc-jp)
+ ((string-match "\\.iso-2022-jp" locale)
'iso-2022-jp)
+ ((string-match "\\.jis" locale) 'jis7) ;; or just
jis?
- ;; aix (CJKV p. 465)
- (lambda (locale)
- (when (eq system-type 'aix)
- (cond
- ((string-match "^Ja_JP" locale) 'shift-jis)
- ((string-match "^ja_JP" locale) 'euc-jp))))
+ ;; aix (CJKV p. 465)
+ ((and (eq system-type 'aix)
+ (string-match "^Ja_JP" locale)) 'shift-jis)
+ ((and (eq system-type 'aix)
+ (string-match "^ja_JP" locale)) 'euc-jp)
- ;; other X11R6 locale.alias
- (lambda (locale)
- (cond
+ ;; other X11R6 locale.alias
((string-match "^Jp_JP" locale) 'euc-jp)
((and (eq system-type 'hpux) (eq locale
"japanese"))
- 'shift-jis)))
-
- ;; fallback
- 'euc-jp))
+ 'shift-jis)
+ ;; fallback
+ (t 'euc-jp)))))
;;; japanese.el ends here
diff -r 1cfe6b84efbf -r 311f6817efc2 lisp/mule/make-coding-system.el
--- a/lisp/mule/make-coding-system.el Tue Mar 01 14:18:54 2011 +0000
+++ b/lisp/mule/make-coding-system.el Tue Mar 08 18:12:48 2011 +0000
@@ -68,10 +68,7 @@
(repeat)))) nil))
(first-part compiled)
(last-part
- (member-if-not (lambda (entr) (eq #xBFFE entr))
- (member-if
- (lambda (entr) (eq #xBFFE entr))
- first-part))))
+ (member* #xBFFE (member* #xBFFE first-part) :test-not 'eql)))
(while compiled
(when (eq #xBFFE (cadr compiled))
(assert (= vec-len (search '(#xBFFE) (cdr compiled)
diff -r 1cfe6b84efbf -r 311f6817efc2 lisp/mule/mule-category.el
--- a/lisp/mule/mule-category.el Tue Mar 01 14:18:54 2011 +0000
+++ b/lisp/mule/mule-category.el Tue Mar 08 18:12:48 2011 +0000
@@ -64,11 +64,7 @@
(defun defined-category-list ()
"Return a list of the currently defined categories.
Categories are given by their designators."
- (let (list)
- (maphash #'(lambda (key value)
- (setq list (cons key list)))
- defined-category-hashtable)
- (nreverse list)))
+ (hash-table-key-list defined-category-hashtable))
(defun undefined-category-designator ()
"Return an undefined category designator, or nil if there are none."
diff -r 1cfe6b84efbf -r 311f6817efc2 lisp/package-ui.el
--- a/lisp/package-ui.el Tue Mar 01 14:18:54 2011 +0000
+++ b/lisp/package-ui.el Tue Mar 08 18:12:48 2011 +0000
@@ -435,9 +435,7 @@
(save-window-excursion
(with-output-to-temp-buffer tmpbuf
(display-completion-list (sort
- (mapcar #'(lambda (pkg)
- (symbol-name pkg))
- dependencies)
+ (mapcar #'symbol-name dependencies)
'string<)
:activate-callback nil
:help-string "Required packages:\n"
diff -r 1cfe6b84efbf -r 311f6817efc2 lisp/packages.el
--- a/lisp/packages.el Tue Mar 01 14:18:54 2011 +0000
+++ b/lisp/packages.el Tue Mar 08 18:12:48 2011 +0000
@@ -517,9 +517,7 @@
(load file-name)
;; dumped-lisp.el could have set this ...
(if package-lisp
- (mapcar #'(lambda (base)
- (funcall handle base))
- package-lisp))))))
+ (mapcar handle package-lisp))))))
package-load-path))
(defun packages-load-package-dumped-lisps (package-load-path)
--
“Apart from the nine-banded armadillo, man is the only natural host of
Mycobacterium leprae, although it can be grown in the footpads of mice.”
-- Kumar & Clark, Clinical Medicine, summarising improbable leprosy research
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches