From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ivan Shmakov Newsgroups: gmane.emacs.bugs Subject: bug#18175: files.el: use mapc in (mapcar 'switch-to-buffer ...) Date: Sat, 02 Aug 2014 21:55:39 +0000 Message-ID: <87r40yftes.fsf@violet.siamics.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1407016588 7834 80.91.229.3 (2 Aug 2014 21:56:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 2 Aug 2014 21:56:28 +0000 (UTC) To: 18175@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Aug 02 23:56:21 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XDhHl-00037d-1C for geb-bug-gnu-emacs@m.gmane.org; Sat, 02 Aug 2014 23:56:17 +0200 Original-Received: from localhost ([::1]:45989 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XDhHk-0002wR-GP for geb-bug-gnu-emacs@m.gmane.org; Sat, 02 Aug 2014 17:56:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55528) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XDhHc-0002vS-H7 for bug-gnu-emacs@gnu.org; Sat, 02 Aug 2014 17:56:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XDhHX-0006po-PK for bug-gnu-emacs@gnu.org; Sat, 02 Aug 2014 17:56:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:48365) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XDhHX-0006pj-DQ for bug-gnu-emacs@gnu.org; Sat, 02 Aug 2014 17:56:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XDhHW-00023b-MZ for bug-gnu-emacs@gnu.org; Sat, 02 Aug 2014 17:56:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ivan Shmakov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 02 Aug 2014 21:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 18175 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: submit@debbugs.gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.14070165527883 (code B ref -1); Sat, 02 Aug 2014 21:56:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 2 Aug 2014 21:55:52 +0000 Original-Received: from localhost ([127.0.0.1]:55308 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XDhHL-000235-I9 for submit@debbugs.gnu.org; Sat, 02 Aug 2014 17:55:52 -0400 Original-Received: from fely.am-1.org ([78.47.74.50]:49178) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XDhHJ-00022w-IF for submit@debbugs.gnu.org; Sat, 02 Aug 2014 17:55:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=siamics.net; s=a2013295; h=Content-Type:MIME-Version:Message-ID:Date:Sender:Subject:To:From; bh=oo7W4moZG1wqjkUpxphnevepPikTvs7TtF20RaDwVzE=; b=j1PHQoJAMLWfRV8lz51Ocy+GiJGewj6lMm54u6889OsYKgPyYSheo+2zh/u3pW0v8udyZAuHlBJeSJGykup2ijLPjsRBhJBmSReKXzco/GY4W2YLJQ8r9BllNWoLOeSsKldMRUzt/fuZD1EUWSypryejQhv75zdYZJAA6c5l0ds=; Original-Received: from [2a02:2560:6d4:26ca::1:1d] (helo=violet.siamics.net) by fely.am-1.org with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1XDhHG-0006hs-Ok for submit@debbugs.gnu.org; Sat, 02 Aug 2014 21:55:47 +0000 Original-Received: from localhost ([::1] helo=violet.siamics.net) by violet.siamics.net with esmtps (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1XDhH9-0006IV-Qs for submit@debbugs.gnu.org; Sun, 03 Aug 2014 04:55:39 +0700 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:92061 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Package: emacs Severity: wishlist Given that switch-to-buffer returns its argument, /and/ given that mapc returns the sequence it=E2=80=99s given, I suggest that the (mapcar 'switch-to-buffer LIST) forms in lisp/files.el be replaced with (mapc 'switch-to-buffer LIST), =E2=80=93 if only to avoid the unnecessary consing when the list is effectively copied in the mapcar case. The lists mapcar is applied to in such cases are returned from find-file-noselect, and so, as it seems, are =E2=80=9Cfresh=E2=80=9D ones anyway. A possible patch is MIMEd. --=20 FSF associate member #7257 http://boycottsystemd.org/ =E2=80=A6 3013 B6A0= 230E 334A --=-=-= Content-Type: text/x-diff Content-Disposition: inline diff --git a/lisp/files.el b/lisp/files.el index 9272e98..e604ce7 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -1428,7 +1428,7 @@ automatically choosing a major mode, use \\[find-file-literally]." (confirm-nonexistent-file-or-buffer))) (let ((value (find-file-noselect filename nil nil wildcards))) (if (listp value) - (mapcar 'switch-to-buffer (nreverse value)) + (mapc 'switch-to-buffer (nreverse value)) (switch-to-buffer value)))) (defun find-file-other-window (filename &optional wildcards) @@ -1451,7 +1451,7 @@ expand wildcards (if any) and visit multiple files." (progn (setq value (nreverse value)) (cons (switch-to-buffer-other-window (car value)) - (mapcar 'switch-to-buffer (cdr value)))) + (mapc 'switch-to-buffer (cdr value)))) (switch-to-buffer-other-window value)))) (defun find-file-other-frame (filename &optional wildcards) @@ -1474,7 +1474,7 @@ expand wildcards (if any) and visit multiple files." (progn (setq value (nreverse value)) (cons (switch-to-buffer-other-frame (car value)) - (mapcar 'switch-to-buffer (cdr value)))) + (mapc 'switch-to-buffer (cdr value)))) (switch-to-buffer-other-frame value)))) (defun find-file-existing (filename) --=-=-=--