From: Kevin Rodgers <ihs_4664@yahoo.com>
Subject: desktop.el calls mapcar instead of mapc for side-effect only
Date: Wed, 10 Nov 2004 15:01:51 -0700 [thread overview]
Message-ID: <2vfhejF2kss5nU1@uni-berlin.de> (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
reply other threads:[~2004-11-10 22:01 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2vfhejF2kss5nU1@uni-berlin.de \
--to=ihs_4664@yahoo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).