changeset 5363:311f6817efc2

Remove various redundant wrapper lambdas, core lisp. 2011-03-08 Aidan Kehoe <kehoea@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 ...).
author Aidan Kehoe <kehoea@parhasard.net>
date Tue, 08 Mar 2011 18:12:48 +0000
parents 1cfe6b84efbf
children 0f9aa4eb4bec
files lisp/ChangeLog lisp/bytecomp-runtime.el lisp/mule/devan-util.el lisp/mule/japanese.el lisp/mule/make-coding-system.el lisp/mule/mule-category.el lisp/package-ui.el lisp/packages.el
diffstat 8 files changed, 53 insertions(+), 53 deletions(-) [+]
line wrap: on
line diff
--- 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@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@parhasard.net>
 
 	* bytecomp.el (byte-compile-normal-call):
--- 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)
 
--- 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)
--- 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)
-
-                         ;; 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)
+                   ;; 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)
 
-                         ;; 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?
-                         )))
+                        ;; 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)
 
-                    ;; 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))))
+                        ;; 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 X11R6 locale.alias
-                    (lambda (locale)
-                      (cond
+                        ;; 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
                        ((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
--- 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)
--- 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."
--- 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"
--- 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)