From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.bugs Subject: desktop.el calls mapcar instead of mapc for side-effect only Date: Wed, 10 Nov 2004 15:01:51 -0700 Message-ID: <2vfhejF2kss5nU1@uni-berlin.de> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1100172290 28236 80.91.229.6 (11 Nov 2004 11:24:50 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 11 Nov 2004 11:24:50 +0000 (UTC) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Nov 10 23:05:06 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CS0aP-0005w5-00 for ; Wed, 10 Nov 2004 23:05:05 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CS0is-0006Ih-KP for geb-bug-gnu-emacs@m.gmane.org; Wed, 10 Nov 2004 17:13:50 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CS0iV-0006CN-60 for bug-gnu-emacs@gnu.org; Wed, 10 Nov 2004 17:13:27 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CS0iT-0006B9-4G for bug-gnu-emacs@gnu.org; Wed, 10 Nov 2004 17:13:25 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CS0iS-0006B6-DQ for bug-gnu-emacs@gnu.org; Wed, 10 Nov 2004 17:13:25 -0500 Original-Received: from [193.4.58.12] (helo=horus.isnic.is) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1CS0Zg-0001aq-2e for bug-gnu-emacs@gnu.org; Wed, 10 Nov 2004 17:04:20 -0500 Original-Received: from Mail.FU-Berlin.DE (mail.fu-berlin.de [130.133.1.2]) by horus.isnic.is (8.12.9p2/8.12.9/isnic) with ESMTP id iAAM4HuC032141 for ; Wed, 10 Nov 2004 22:04:17 GMT (envelope-from mod-submit@uni-berlin.de) Original-Received: by Mail.FU-Berlin.DE (Exim 4.42) from curry.zedat.fu-berlin.de ([160.45.10.36]) for gnu-emacs-bug@moderators.isc.org with esmtp id <1CS0XN-000Kyx-0u>; Wed, 10 Nov 2004 23:01:57 +0100 Original-Received: by Curry.ZEDAT.FU-Berlin.DE (Smail3.2.0.98) from news.uni-berlin.de with bsmtp id ; Wed, 10 Nov 2004 23:01:56 +0100 (MET) Original-To: gnu-emacs-bug@moderators.isc.org Original-Path: not-for-mail Original-Newsgroups: gnu.emacs.bug Original-Lines: 120 X-Orig-X-Trace: news.uni-berlin.de gK8y/jsxlDF/G+Lv7sM9WQE0lCDKDOj2NcQB354FaWSMfi25c= User-Agent: Mozilla Thunderbird 0.9 (X11/20041105) X-Accept-Language: en-us, en X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.bugs:9662 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:9662 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