From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#18175: files.el: use mapc in (mapcar 'switch-to-buffer ...) Date: Wed, 06 Aug 2014 13:26:22 -0400 Message-ID: References: <87r40yftes.fsf@violet.siamics.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1407346055 6321 80.91.229.3 (6 Aug 2014 17:27:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 6 Aug 2014 17:27:35 +0000 (UTC) Cc: 18175@debbugs.gnu.org To: Ivan Shmakov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Aug 06 19:27:27 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 1XF4zk-0001ny-6f for geb-bug-gnu-emacs@m.gmane.org; Wed, 06 Aug 2014 19:27:24 +0200 Original-Received: from localhost ([::1]:40274 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XF4zj-0003fR-Ps for geb-bug-gnu-emacs@m.gmane.org; Wed, 06 Aug 2014 13:27:23 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47015) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XF4zY-0003XS-Ij for bug-gnu-emacs@gnu.org; Wed, 06 Aug 2014 13:27:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XF4zO-0003eA-Qr for bug-gnu-emacs@gnu.org; Wed, 06 Aug 2014 13:27:12 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:53665) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XF4zO-0003dx-OP for bug-gnu-emacs@gnu.org; Wed, 06 Aug 2014 13:27:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XF4zO-0005F1-Bi for bug-gnu-emacs@gnu.org; Wed, 06 Aug 2014 13:27:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 06 Aug 2014 17:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18175 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 18175-submit@debbugs.gnu.org id=B18175.140734601120131 (code B ref 18175); Wed, 06 Aug 2014 17:27:02 +0000 Original-Received: (at 18175) by debbugs.gnu.org; 6 Aug 2014 17:26:51 +0000 Original-Received: from localhost ([127.0.0.1]:60608 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XF4zD-0005Ec-0R for submit@debbugs.gnu.org; Wed, 06 Aug 2014 13:26:51 -0400 Original-Received: from mercure.iro.umontreal.ca ([132.204.24.67]:41638) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XF4zA-0005ES-Mn for 18175@debbugs.gnu.org; Wed, 06 Aug 2014 13:26:49 -0400 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id 4403C84EE0; Wed, 6 Aug 2014 13:26:48 -0400 (EDT) Original-Received: from lechon.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id 3B41D1E5B74; Wed, 6 Aug 2014 13:26:23 -0400 (EDT) Original-Received: by lechon.iro.umontreal.ca (Postfix, from userid 20848) id 12C3BB40CD; Wed, 6 Aug 2014 13:26:23 -0400 (EDT) In-Reply-To: <87r40yftes.fsf@violet.siamics.net> (Ivan Shmakov's message of "Sat, 02 Aug 2014 21:55:39 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-2.82, requis 5, autolearn=not spam, ALL_TRUSTED -2.82, MC_TSTLAST 0.00) X-DIRO-MailScanner-From: monnier@iro.umontreal.ca 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:92196 Archived-At: > 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. Thanks, I think it's indeed a valid/correct optimization, but I really dislike relying on mapc's return value (it really should not return any value at all). In this case, the optimization doesn't seem worth the inconvenient of having a very unusual code (relying on mapc's return value), since those few cons cells we save are drowned in the noise of all the code run by switch-to-buffer. Stefan