From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Vinicius Jose Latorre Newsgroups: gmane.emacs.devel Subject: Re: printing.el again Date: Mon, 15 Nov 2004 22:55:23 -0200 Message-ID: <41994FFB.2060308@ig.com.br> References: <419779C4.50909@ig.com.br> <871xew44v1.fsf-monnier+emacs@gnu.org> <41990B75.1080603@ig.com.br> 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 1100566676 27178 80.91.229.6 (16 Nov 2004 00:57:56 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 16 Nov 2004 00:57:56 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Nov 16 01:57:47 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 1CTrfG-0008CH-00 for ; Tue, 16 Nov 2004 01:57:46 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CTrnz-0006kX-7y for ged-emacs-devel@m.gmane.org; Mon, 15 Nov 2004 20:06:47 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CTrnl-0006j2-Fz for emacs-devel@gnu.org; Mon, 15 Nov 2004 20:06:33 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CTrnk-0006hl-C4 for emacs-devel@gnu.org; Mon, 15 Nov 2004 20:06:32 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CTrnj-0006gr-T5 for emacs-devel@gnu.org; Mon, 15 Nov 2004 20:06:32 -0500 Original-Received: from [200.221.11.55] (helo=smtp.uol.com.br) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CTrej-0000Os-IE for emacs-devel@gnu.org; Mon, 15 Nov 2004 19:57:13 -0500 Original-Received: from [200.183.90.28] (unknown [200.183.90.28]) by scorpion2.uol.com.br (Postfix) with ESMTP id 25F7AAB63; Mon, 15 Nov 2004 22:57:09 -0200 (BRST) User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8a4) Gecko/20040927 X-Accept-Language: en-us, en Original-To: Stefan Monnier In-Reply-To: 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: main.gmane.org gmane.emacs.devel:29898 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:29898 > > Ok, but a very long time ago there was a recommendation to do not use cl > > package when writing code in Emacs Lisp. > > Is that recommendation no more valid? > > CL functions should indeed not be used by packages distributed with Emacs. > OTOH, CL macros (such as `push', `flet', ...) can be used just fine (just > don't forget to put a (eval-when-compile (require 'cl)) at the top of your > file). Ok. > > > BTW, if you use (featurep 'xemacs) for the test, Emacs-21 will optimize > > > the test away (since the resulting elc file can't be run on XEmacs > > > anyway). Here it doesn't really matter, but it is sometimes very handy > > > since it ends up getting rid of spurious warnings about > > > XEmacs-specific code. > > > > Well, so: > > > > A) (cond ((eq ps-print-emacs-type 'xemacs) ...) > > (t ...)) > > > > B) (cond ((featurep 'xemacs) ...) > > (t ...)) > > > > Are you saying that A and B above are treated differently by the > > byte-compiler?? > > Yes. > > The byte-compiler will not optimize away the `eq' test because it considers > that the user might change ps-print-emacs-type at any time. OTOH the > byte-compiler knows that since the code it generates doesn't work under > XEmacs, (featurep 'xemacs) will always return nil. So, I'll modify to use (featurep 'xemacs). Does the byte-compiler do constant folding optimization or it is an ad hoc optimization? Maybe this should be documented in Emacs Lisp Reference or in other suitable info, probably Byte Compiler Users Guide. Also other byte-compiler optimizations should be documented. Vinicius