From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Markus Triska Newsgroups: gmane.emacs.devel Subject: Re: weird desktop.el change Date: Sun, 15 Apr 2007 04:36:02 +0200 Message-ID: <87r6qm74a5.fsf@gmx.at> References: <87d52bbwro.fsf@catnip.gol.com> <878xcycx95.fsf@catnip.gol.com> <87wt0g2oog.fsf@gmx.at> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1176604585 17361 80.91.229.12 (15 Apr 2007 02:36:25 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 15 Apr 2007 02:36:25 +0000 (UTC) Cc: lekktu@gmail.com, miles@gnu.org, Stefan Monnier , emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Apr 15 04:36:18 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HcubA-00087j-H7 for ged-emacs-devel@m.gmane.org; Sun, 15 Apr 2007 04:36:16 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hcufc-000063-1A for ged-emacs-devel@m.gmane.org; Sat, 14 Apr 2007 22:40:52 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HcufZ-0008VJ-90 for emacs-devel@gnu.org; Sat, 14 Apr 2007 22:40:49 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HcufY-0008Ti-CY for emacs-devel@gnu.org; Sat, 14 Apr 2007 22:40:48 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HcufY-0008TQ-6k for emacs-devel@gnu.org; Sat, 14 Apr 2007 22:40:48 -0400 Original-Received: from mail.gmx.net ([213.165.64.20]) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1Hcub5-0006dV-AL for emacs-devel@gnu.org; Sat, 14 Apr 2007 22:36:11 -0400 Original-Received: (qmail invoked by alias); 15 Apr 2007 02:36:09 -0000 Original-Received: from chello062178240212.3.14.tuwien.teleweb.at (EHLO enterprise) [62.178.240.212] by mail.gmx.net (mp036) with SMTP; 15 Apr 2007 04:36:09 +0200 X-Authenticated: #4064391 X-Provags-ID: V01U2FsdGVkX1/oUwN2DAvof75HdIUchZVv4CAQP8QD839n97WsSr PTWRP8zH6thOxo X-Y-GMX-Trusted: 0 X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:69448 Archived-At: Richard Stallman writes: > I think it would be better to implement this warning in the code > generation stage so as to give the warning the correct line number. I will revisit this issue after the release. For now, I compiled a list of all opportunities for this optimisation in Emacs trunk, found with the following change to bytecomp.el. It only emits a warning and does not change the byte code. Most line numbers are accurate; in some cases they may point to the wrong `mapcar' call though. *** bytecomp.el 11 Apr 2007 12:56:05 +0200 2.198 --- bytecomp.el 15 Apr 2007 00:18:34 +0200 *************** *** 2831,2836 **** --- 2831,2839 ---- (defun byte-compile-normal-call (form) (if byte-compile-generate-call-tree (byte-compile-annotate-call-tree form)) + (when (and for-effect (eq (car form) 'mapcar)) + (byte-compile-set-symbol-position 'mapcar) + (byte-compile-warn "`mapcar' called for effect; use `mapc' instead")) (byte-compile-push-constant (car form)) (mapc 'byte-compile-form (cdr form)) ; wasteful, but faster. (byte-compile-out 'byte-call (length (cdr form)))) File Line(s) ================== ================== byte-opt.el 1999 bytecomp.el 4239 cc-mode.el 850,1439 allout.el 1133,5465 ansi-color.el 567,571,580 autoinsert.el 275 bookmark.el 1572,1789 desktop.el 871,1031 dired-aux.el 1335 dired.el 3326 ediff-diff.el 351,361,364 ediff-mult.el 639,924,1308,1369,1369 ediff-ptch.el 338,335 ediff-util.el 1320,1344,2442,2445,3746 emerge.el 1889 ffap.el 485 filecache.el 287,389,405,446,459,722,771 files.el 646 find-lisp.el 273 finder.el 137 follow.el 394,400 frame.el 453,832 help.el 335 hi-lock.el 490 ido.el 3357,3606,3654 jka-cmpr-hook.el 100 printing.el 5293,5323 ps-print.el 5020,5662,6435,6437,6436,6437 simple.el 5370 startup.el 977 tempo.el 318,463,559,578 tumme.el 825,902,2148 vc-hooks.el 354 vc.el 1599,1622,1666,2289,2622,2650 woman.el 1537 calc-ext.el 621,655,1280 calc-help.el 422,441 calc-misc.el 148 calc-store.el 175,178 calc-stuff.el 194 calc-units.el 673 calc.el 921,978,978,987,1012,1060,1082,1183,1187,1366 hilit19.el 668,978,1026 emacsbug.el 152 feedmail.el 1591,1838 reporter.el 255 rmail.el 1457 supercite.el 1046,1057,1067 authors.el 669 cl.el 596,641 cust-print.el 247,262,276 disass.el 253 easy-mmode.el 458 edebug.el 4424 elint.el 221,545,569,668,770 elp.el 618 generic.el 208 re-builder.el 518 regi.el 169 sregex.el 568 solitaire.el 403,449 zone.el 401 icalendar.el 1534,1640 gnus-agent.el 686,1004,1278,2038,2091,2096,3487 gnus-art.el 3753,7273 gnus-diary.el 311 gnus-group.el 1629,2204,2405,4107 gnus-int.el 169,199,229,285,292,299,306,316,334,344,404,513, 534,584,642,688 gnus-msg.el 1577,1578,1584 gnus-nocem.el 194 gnus-registry.el 352 gnus-spec.el 300 gnus-srvr.el 395,505,525,537,553,577,580,629,785,1006 gnus-start.el 968,1466,1475,1781,3026 gnus-sum.el 1482,1566,4132,5847,9275,10470,11286 gnus-topic.el 247,354,1300,1321 gnus.el 2740,3522 imap.el 1032,1031,2743 legacy-gnus-agent.el 114,130 message.el 7056 mm-util.el 33,983,1066 mml.el 157,652,813 nndiary.el 1699 nnfolder.el 1200 nnimap.el 823,1145,1210,1561,1565,1654 nnmail.el 1675 nnmaildir.el 242,710,740,760,759,824,821,860,928,936,1090,1147, 1540,1544,1548,1584,1593,1611 nnml.el 945 nnvirtual.el 342,679,738 nnweb.el 557 sieve-manage.el 375 webmail.el 199 artist.el 1565,1614,1703,1740,3163,3223,3225,3362,5364 flyspell.el 613,632 org.el 11856,17011,17071,17477 reftex-cite.el 712,957 reftex-ref.el 670 reftex-sel.el 424,646 reftex-toc.el 619 reftex.el 862,1344 table.el 1379,1412,1446,1472,1651,3144,3226,3923,3925,4095 ethio-util.el 1064 mule-diag.el 842 erc-backend.el 658 erc-track.el 672 url-dav.el 936 url-vars.el 65 cua-rect.el 734,840,1404 viper-keym.el 173,213 viper-macs.el 661,665,673,680 viper-util.el 1265 viper.el 795 sun-mouse.el 504 tvi970.el 40 w32-win.el 114 ange-ftp.el 4558,6033 eudc-hotlist.el 72,84 eudc.el 510,515,543,568,574,644,991,998 eudcb-bbdb.el 78,206 eudcb-ldap.el 133 tramp-vc.el 103 tramp.el 3976,4635,4747,5253 ada-mode.el 1434,1439 ada-prj.el 257,258 cc-styles.el 384,639 cperl-mode.el 1103,5533,7140,7264,7273,7273,7339,7345,7363,7353,7360 delphi.el 1689,1692,1724,1891,1912,1984 ebnf-yac.el 281,278 ebnf2ps.el 4654,5141 ebrowse.el 1151,1641,2259,4151,4166 f90.el 685 fortran.el 615 idlw-shell.el 3481,3481,4533 idlw-toolbar.el 914,945 idlwave.el 2828,2830,4243,5561,5605,6320,6336,6808,7552,8278,8438 sh-script.el 1892,1899 sql.el 866 vhdl-mode.el 2814,5299,7148 xscheme.el 104