From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.help Subject: Re: What is the :eval form ? Date: Fri, 08 Jun 2012 20:02:38 +0200 Message-ID: <87d35965s1.fsf@thinkpad.tsdh.de> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1339178587 11686 80.91.229.3 (8 Jun 2012 18:03:07 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 8 Jun 2012 18:03:07 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jun 08 20:03:06 2012 Return-path: Envelope-to: geh-help-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 1Sd3WZ-0005ia-Pm for geh-help-gnu-emacs@m.gmane.org; Fri, 08 Jun 2012 20:03:03 +0200 Original-Received: from localhost ([::1]:51804 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sd3WZ-0004vj-KF for geh-help-gnu-emacs@m.gmane.org; Fri, 08 Jun 2012 14:03:03 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:38668) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sd3WU-0004ve-9u for help-gnu-emacs@gnu.org; Fri, 08 Jun 2012 14:02:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sd3WS-0005eY-Je for help-gnu-emacs@gnu.org; Fri, 08 Jun 2012 14:02:57 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:37013) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sd3WS-0005eN-CV for help-gnu-emacs@gnu.org; Fri, 08 Jun 2012 14:02:56 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Sd3WO-0005OI-QW for help-gnu-emacs@gnu.org; Fri, 08 Jun 2012 20:02:52 +0200 Original-Received: from 91-67-9-216-dynip.superkabel.de ([91.67.9.216]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 08 Jun 2012 20:02:52 +0200 Original-Received: from tassilo by 91-67-9-216-dynip.superkabel.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 08 Jun 2012 20:02:52 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 73 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 91-67-9-216-dynip.superkabel.de User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.0.97 (gnu/linux) Cancel-Lock: sha1:eXlr5yi0MzSQy/OpnvgDS6JaA3M= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:85162 Archived-At: Philippe M. Coatmeur writes: Hi Philippe, > How can I find information about this special form ? When I ask emacs > using C-h f with point over it, it acts like google and shows me the > "plain eval" info page... :( :eval is neither a function nor a special form, it is a keyword. ,----[ (info "(elisp)Symbol Type") ] | A symbol whose name starts with a colon (`:') is called a "keyword | symbol". These symbols automatically act as constants, and are | normally used only by comparing an unknown symbol with a few specific | alternatives. `---- Some keywords have a special meaning for some variables such as `global-mode-string', so let's check its docs instead of googling. ,----[ C-h v global-mode-string RET ] | global-mode-string is a variable defined in `C source code'. | Its value is ("" appt-mode-string) | | This variable is potentially risky when used as a file local variable. | | Documentation: | String (or mode line construct) included (normally) in `mode-line-format'. `---- Ah, so I might want to check out `mode-line-format'. ,----[ C-h v mode-line-format RET ] | mode-line-format is a variable defined in `C source code'. | Its value is shown below. | | Automatically becomes buffer-local when set in any fashion. | This variable is potentially risky when used as a file local variable. | | Documentation: | [...] | For a list of the form `(:eval FORM)', FORM is evaluated and the result | is used as a mode line element. Be careful--FORM should not load any files, | because that can cause an infinite recursion. | [...] `---- So there's your :eval. Another way to find out about the meaning of eval was to use the emacs info docs. C-h i m elisp RET C-s :eval C-s [maybe repeatedly] leads to: ,----[ (info "(elisp)Mode Line Data") ] | A mode line construct may be as simple as a fixed string of text, | but it usually specifies how to combine fixed strings with variables' | values to construct the text. Many of these variables are themselves | defined to have mode line constructs as their values. | | Here are the meanings of various data types as mode line constructs: | | [...] | | `(:eval FORM)' | A list whose first element is the symbol `:eval' says to evaluate | FORM, and use the result as a string to display. Make sure this | evaluation cannot load any files, as doing so could cause infinite | recursion. `---- Bye, Tassilo