From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: bolega Newsgroups: gmane.emacs.help Subject: Re: identity function with an echo side effect Date: Tue, 10 Aug 2010 22:01:03 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <324e9d4c-b083-42a3-aa88-4e7b918042e3@h32g2000yqm.googlegroups.com> <87eie6ax5b.fsf@kuiper.lan.informatimago.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1291881492 22060 80.91.229.12 (9 Dec 2010 07:58:12 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 9 Dec 2010 07:58:12 +0000 (UTC) Cc: bolega To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 09 08:58:08 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PQbOB-0007Tx-Ej for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Dec 2010 08:58:07 +0100 Original-Received: from localhost ([127.0.0.1]:35087 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQVxn-00009F-Py for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Dec 2010 21:10:31 -0500 Original-Path: usenet.stanford.edu!postnews.google.com!c10g2000yqi.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help, comp.emacs, comp.emacs.xemacs, gnu.emacs, comp.lang.lisp Original-Lines: 83 Original-NNTP-Posting-Host: 75.28.152.222 Original-X-Trace: posting.google.com 1281502863 771 127.0.0.1 (11 Aug 2010 05:01:03 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Wed, 11 Aug 2010 05:01:03 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: c10g2000yqi.googlegroups.com; posting-host=75.28.152.222; posting-account=REkl4woAAABFXaU7nL79XtGpnmNCQ415 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6,gzip(gfe) Original-Xref: usenet.stanford.edu gnu.emacs.help:180563 comp.emacs:100332 comp.emacs.xemacs:82487 comp.lang.lisp:291096 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:76851 Archived-At: On Aug 10, 4:03=A0pm, p...@informatimago.com (Pascal J. Bourguignon) wrote: > bolega writes: > > After searching google groups and emacs apropos extensively, I could > > not find a function, perhaps I am missing one that can return > > identically return its argument and has a small side effect of echoing > > the argument in some place such as for example > > > the mini buffer or the point at which C-x C-e is typed. > > > For example, calling this function "echo" , usage would look like > > this : > > > (cdr ( echo (cdr (echo (cdr (echo '(a b c d))))))) > > > echo: > > '(a b c d) or (a b c d) =A0(I am not sure which would be appropriate) > > (b c d) > > (c d) > > > result: > > (d) > > > Is there a need for quotes to prevent evaluation of alphabets at any > > phase ? > > In Common Lisp, you can use PRINT for this. > > CL-USER> (cdr (print (cdr (print (cdr (print '(a b c d))))))) > > (A B C D) > (B C D) > (C D) > (D) > CL-USER> > > In emacs lisp too, but the output of print goes to the *Message* buffer. > > M-x ielm RET > ELISP> (cdr (print (cdr (print (cdr (print '(a b c d))))))) > (d) > > and you get: > > (a b c d) > > (b c d) > > (c d) > > in the minibuffer and in *Message*. > > Or, in an emacs lisp buffer: > > (cdr (print (cdr (print (cdr (print '(a b c d))))))) C-u C-x C-e > > inserts: > > (a b c d) > > (b c d) > > (c d) > (d) > > -- > __Pascal Bourguignon__ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0http://www.= informatimago.com/ THANKS A LOT !!! If you dont mind, how many years have you spent on learning emacs/ lisp ? Can you kindly give a reading syllabus, books list and possibly time for completion from your perspective and what to get out of each book since they have some common repetition. Are there any implicit quotations taking place in the above sequence of cdr, print ... ? Bolega