Mercurial > hg > xemacs-beta
changeset 5267:668c73e222fd
Change forms like (delq nil (mapcar ...)) to (mapcan ...).
lisp/ChangeLog addition:
2010-09-16 Aidan Kehoe <kehoea@parhasard.net>
* x-faces.el (x-available-font-sizes):
* specifier.el (let-specifier):
* package-ui.el (pui-add-required-packages):
* msw-faces.el (mswindows-available-font-sizes):
* modeline.el (modeline-minor-mode-menu):
* minibuf.el (minibuf-directory-files):
Replace the O2N (delq nil (mapcar (lambda (W) (and X Y)) Z)) with
the ON (mapcan (lambda (W) (and X (list Y))) Z) in these files.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Thu, 16 Sep 2010 15:06:38 +0100 |
parents | f9ec07abdbf9 |
children | 09f8ed0933c7 |
files | lisp/ChangeLog lisp/minibuf.el lisp/modeline.el lisp/msw-faces.el lisp/package-ui.el lisp/specifier.el lisp/x-faces.el |
diffstat | 7 files changed, 81 insertions(+), 76 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/ChangeLog Thu Sep 16 14:31:40 2010 +0100 +++ b/lisp/ChangeLog Thu Sep 16 15:06:38 2010 +0100 @@ -1,3 +1,14 @@ +2010-09-16 Aidan Kehoe <kehoea@parhasard.net> + + * x-faces.el (x-available-font-sizes): + * specifier.el (let-specifier): + * package-ui.el (pui-add-required-packages): + * msw-faces.el (mswindows-available-font-sizes): + * modeline.el (modeline-minor-mode-menu): + * minibuf.el (minibuf-directory-files): + Replace the O2N (delq nil (mapcar (lambda (W) (and X Y)) Z)) with + the ON (mapcan (lambda (W) (and X (list Y))) Z) in these files. + 2010-09-16 Aidan Kehoe <kehoea@parhasard.net> * cl-macs.el (= < > <= >=):
--- a/lisp/minibuf.el Thu Sep 16 14:31:40 2010 +0100 +++ b/lisp/minibuf.el Thu Sep 16 15:06:38 2010 +0100 @@ -1569,12 +1569,13 @@ (defun minibuf-directory-files (dir &optional match-regexp files-only) (let ((want-file (or (eq files-only nil) (eq files-only t))) (want-dirs (or (eq files-only nil) (not (eq files-only t))))) - (delete nil - (mapcar (function (lambda (f) - (if (file-directory-p (expand-file-name f dir)) - (and want-dirs (file-name-as-directory f)) - (and want-file f)))) - (delete "." (directory-files dir nil match-regexp)))))) + (mapcan + #'(lambda (f) + (and (not (equal "." f)) + (if (file-directory-p (expand-file-name f dir)) + (and want-dirs (list (file-name-as-directory f))) + (and want-file (list f))))) + (directory-files dir nil match-regexp)))) (defun read-file-name-2 (history prompt dir default
--- a/lisp/modeline.el Thu Sep 16 14:31:40 2010 +0100 +++ b/lisp/modeline.el Thu Sep 16 15:06:38 2010 +0100 @@ -524,35 +524,31 @@ (cons "Minor Mode Toggles" (sort - (delq nil (mapcar - #'(lambda (x) - (let* ((toggle-sym (car x)) - (toggle-fun (or (get toggle-sym - 'modeline-toggle-function) - (and (commandp toggle-sym) - toggle-sym))) - (menu-tag (symbol-name (if (symbolp toggle-fun) - toggle-fun - toggle-sym)) - ;; Here a function should - ;; maybe be invoked to - ;; beautify the symbol's - ;; menu appearance. - )) - (and toggle-fun - (vector menu-tag - toggle-fun - ;; The following two are wrong - ;; because of possible name - ;; clashes. - ;:active (get toggle-sym :active t) - ;:included (get toggle-sym :included t) - :style 'toggle - :selected (and (boundp toggle-sym) - toggle-sym))))) - minor-mode-alist)) - (lambda (e1 e2) - (string< (aref e1 0) (aref e2 0))))) + (mapcan + #'(lambda (x) + (let* ((toggle-sym (car x)) + (toggle-fun (or (get toggle-sym + 'modeline-toggle-function) + (and (commandp toggle-sym) + toggle-sym))) + (menu-tag (symbol-name (if (symbolp toggle-fun) + toggle-fun + toggle-sym)) + ;; Here a function should maybe be invoked to + ;; beautify the symbol's menu appearance. + )) + (and toggle-fun + (list (vector menu-tag + toggle-fun + ;; The following two are wrong because of + ;; possible name clashes. + ;:active (get toggle-sym :active t) + ;:included (get toggle-sym :included t) + :style 'toggle + :selected (and (boundp toggle-sym) + toggle-sym)))))) + minor-mode-alist) + (lambda (e1 e2) (string< (aref e1 0) (aref e2 0))))) event))) (defvar modeline-minor-mode-map (make-sparse-keymap 'modeline-minor-mode-map)
--- a/lisp/msw-faces.el Thu Sep 16 14:31:40 2010 +0100 +++ b/lisp/msw-faces.el Thu Sep 16 15:06:38 2010 +0100 @@ -268,12 +268,11 @@ (concat (substring font 0 (match-beginning 3)) (substring font (match-end 3) (match-end 0)))) (sort - (delq nil - (mapcar #'(lambda (name) - (and (string-match mswindows-font-regexp name) - (string-to-int (substring name (match-beginning 3) - (match-end 3))))) - (font-list font device))) + (mapcan #'(lambda (name) + (and (string-match mswindows-font-regexp name) + (list (string-to-int (substring name (match-beginning 3) + (match-end 3)))))) + (font-list font device)) #'<)) (defun mswindows-frob-font-size (font up-p device)
--- a/lisp/package-ui.el Thu Sep 16 14:31:40 2010 +0100 +++ b/lisp/package-ui.el Thu Sep 16 15:06:38 2010 +0100 @@ -408,26 +408,25 @@ (let ((tmpbuf "*Required-Packages*") do-select) (if pui-selected-packages (let ((dependencies - (delq nil (mapcar - (lambda (pkg) - (let ((installed - (package-get-key pkg :version)) - (current - (package-get-info-prop - (package-get-info-version - (package-get-info-find-package - package-get-base pkg) nil) - 'version))) - (if (or (null installed) - (< (if (stringp installed) - (string-to-number installed) - installed) - (if (stringp current) - (string-to-number current) - current))) - pkg - nil))) - (package-get-dependencies pui-selected-packages))))) + (mapcan + (lambda (pkg) + (let ((installed + (package-get-key pkg :version)) + (current + (package-get-info-prop + (package-get-info-version + (package-get-info-find-package + package-get-base pkg) nil) + 'version))) + (if (or (null installed) + (< (if (stringp installed) + (string-to-number installed) + installed) + (if (stringp current) + (string-to-number current) + current))) + (list pkg)))) + (package-get-dependencies pui-selected-packages)))) ;; Don't change window config when asking the user if he really ;; wants to add the packages. We do this to avoid messing up ;; the window configuration if errors occur (we don't want to
--- a/lisp/specifier.el Thu Sep 16 14:31:40 2010 +0100 +++ b/lisp/specifier.el Thu Sep 16 15:06:38 2010 +0100 @@ -521,10 +521,9 @@ varlist))) ;; Bind the appropriate variables. `(let* (,@(mapcan #'(lambda (varel) - (delq nil (mapcar - #'(lambda (varcons) - (and (cdr varcons) varcons)) - varel))) + (mapcan #'(lambda (varcons) + (and (cdr varcons) (list varcons))) + varel)) varlist) ,@oldvallist) (unwind-protect
--- a/lisp/x-faces.el Thu Sep 16 14:31:40 2010 +0100 +++ b/lisp/x-faces.el Thu Sep 16 15:06:38 2010 +0100 @@ -434,17 +434,17 @@ (concat (substring font 0 (match-beginning 1)) "*" (substring font (match-end 1) (match-end 0)))))) (sort - (delq nil - (mapcar (function - (lambda (name) - (and (string-match x-font-regexp name) - (list - (string-to-int (substring name (match-beginning 5) - (match-end 5))) - (string-to-int (substring name (match-beginning 6) - (match-end 6))) - name)))) - (font-list font device))) + (mapcan (function + (lambda (name) + (and (string-match x-font-regexp name) + (list + (list + (string-to-int (substring name (match-beginning 5) + (match-end 5))) + (string-to-int (substring name (match-beginning 6) + (match-end 6))) + name))))) + (font-list font device)) (function (lambda (x y) (if (= (nth 1 x) (nth 1 y)) (< (nth 0 x) (nth 0 y)) (< (nth 1 x) (nth 1 y)))))))