* desktop.el calls mapcar instead of mapc for side-effect only
@ 2004-11-10 22:01 Kevin Rodgers
0 siblings, 0 replies; only message in thread
From: Kevin Rodgers @ 2004-11-10 22:01 UTC (permalink / raw)
This patch avoids a little unnecessary cons'ing:
*** emacs-21.3/lisp/desktop.el.orig Tue Oct 23 07:54:11 2001
--- emacs-21.3/lisp/desktop.el Wed Nov 10 14:57:57 2004
***************
*** 107,113 ****
(eval-when-compile
;; We use functions from these modules
;; We can't (require 'mh-e) since that wants to load something.
! (mapcar 'require '(info dired reporter)))
;;
----------------------------------------------------------------------------
;; USER OPTIONS -- settings you might want to play with.
;;
----------------------------------------------------------------------------
--- 107,113 ----
(eval-when-compile
;; We use functions from these modules
;; We can't (require 'mh-e) since that wants to load something.
! (mapc 'require '(info dired reporter)))
;;
----------------------------------------------------------------------------
;; USER OPTIONS -- settings you might want to play with.
;;
----------------------------------------------------------------------------
***************
*** 526,532 ****
";; Created " (current-time-string) "\n"
";; Emacs version " emacs-version "\n\n"
";; Global section:\n")
! (mapcar (function desktop-outvar) desktop-globals-to-save)
(if (memq 'kill-ring desktop-globals-to-save)
(insert "(setq kill-ring-yank-pointer (nthcdr "
(int-to-string
--- 526,532 ----
";; Created " (current-time-string) "\n"
";; Emacs version " emacs-version "\n\n"
";; Global section:\n")
! (mapc (function desktop-outvar) desktop-globals-to-save)
(if (memq 'kill-ring desktop-globals-to-save)
(insert "(setq kill-ring-yank-pointer (nthcdr "
(int-to-string
***************
*** 534,545 ****
" kill-ring))\n"))
(insert "\n;; Buffer section:\n")
! (mapcar
(function (lambda (l)
(if (apply 'desktop-save-buffer-p l)
(progn
(insert desktop-create-buffer-form)
! (mapcar
(function (lambda (e)
(insert "\n "
(desktop-value-to-string e))))
--- 534,545 ----
" kill-ring))\n"))
(insert "\n;; Buffer section:\n")
! (mapc
(function (lambda (l)
(if (apply 'desktop-save-buffer-p l)
(progn
(insert desktop-create-buffer-form)
! (mapc
(function (lambda (e)
(insert "\n "
(desktop-value-to-string e))))
***************
*** 653,659 ****
(if (file-directory-p (file-name-directory (car
desktop-buffer-misc)))
(progn
(dired (car desktop-buffer-misc))
! (mapcar 'dired-maybe-insert-subdir (cdr desktop-buffer-misc))
(current-buffer))
(message "Directory %s no longer exists." (car desktop-buffer-misc))
(sit-for 1)
--- 653,659 ----
(if (file-directory-p (file-name-directory (car
desktop-buffer-misc)))
(progn
(dired (car desktop-buffer-misc))
! (mapc 'dired-maybe-insert-subdir (cdr desktop-buffer-misc))
(current-buffer))
(message "Directory %s no longer exists." (car desktop-buffer-misc))
(sit-for 1)
***************
*** 697,707 ****
;; minor modes
(cond ((equal '(t) mim) (auto-fill-mode 1)) ; backwards
compatible
((equal '(nil) mim) (auto-fill-mode 0))
! (t (mapcar #'(lambda (minor-mode)
! (unless (or (eq minor-mode t) (eq minor-mode nil))
! (if (and minor-mode (fboundp minor-mode))
! (funcall minor-mode 1))))
! mim)))
(goto-char pt)
(if (consp mk)
(progn
--- 697,707 ----
;; minor modes
(cond ((equal '(t) mim) (auto-fill-mode 1)) ; backwards
compatible
((equal '(nil) mim) (auto-fill-mode 0))
! (t (mapc #'(lambda (minor-mode)
! (unless (or (eq minor-mode t) (eq minor-mode
nil))
! (if (and minor-mode (fboundp minor-mode))
! (funcall minor-mode 1))))
! mim)))
(goto-char pt)
(if (consp mk)
(progn
--
Kevin Rodgers
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-11-10 22:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-10 22:01 desktop.el calls mapcar instead of mapc for side-effect only Kevin Rodgers
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).