From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: Problem understanding set-register syntax Date: Mon, 6 Dec 2010 14:23:26 -0800 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1291674329 1710 80.91.229.12 (6 Dec 2010 22:25:29 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 6 Dec 2010 22:25:29 +0000 (UTC) To: "=?iso-8859-1?Q?'Aur=E9lien_Bottazzini'?=" , Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Dec 06 23:25:25 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 1PPjUq-0003f1-Ko for geh-help-gnu-emacs@m.gmane.org; Mon, 06 Dec 2010 23:25:24 +0100 Original-Received: from localhost ([127.0.0.1]:43631 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PPjUp-0007Gc-R6 for geh-help-gnu-emacs@m.gmane.org; Mon, 06 Dec 2010 17:25:23 -0500 Original-Received: from [140.186.70.92] (port=55188 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PPjUB-0007Ce-RE for help-gnu-emacs@gnu.org; Mon, 06 Dec 2010 17:24:44 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PPjUA-00008N-Oo for help-gnu-emacs@gnu.org; Mon, 06 Dec 2010 17:24:43 -0500 Original-Received: from rcsinet10.oracle.com ([148.87.113.121]:43295) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PPjUA-00008A-HP for help-gnu-emacs@gnu.org; Mon, 06 Dec 2010 17:24:42 -0500 Original-Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id oB6MOcuo018500 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 6 Dec 2010 22:24:39 GMT Original-Received: from acsmt353.oracle.com (acsmt353.oracle.com [141.146.40.153]) by acsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id oB6H9wLP019446; Mon, 6 Dec 2010 22:24:35 GMT Original-Received: from abhmt014.oracle.com by acsmt353.oracle.com with ESMTP id 849416701291674207; Mon, 06 Dec 2010 14:23:27 -0800 Original-Received: from dradamslap1 (/130.35.178.194) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 06 Dec 2010 14:23:26 -0800 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: AcuVjuM1dgaGt1a5QruHqBKEZOSLgQAADCew X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5994 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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:75523 Archived-At: > in my init.el I have > (set-register ?i '(file . "~/.emacs.d/init.el")) > which allows me to quickly jump to my init file using C-x r j i > But I don't really understand the syntax. > Why do I have to use the exclamation mark when I set the register? You mean question mark, I think. > Why can't I just use: > (set-register i '(file . "~/.emacs.d/init.el")) > ; will say Symbol's value as variable is void:i Because the first argument to `set-register' is a register name, which is a character, and `?i' is the Lisp syntax for the character `i'. > I tried to search in the documentation for set-register and > variable definition but I did not find anything to really explain it. Please file a doc bug for `C-h f set-register'. The doc should say clearly what each parameter is. In this case it says nothing about the first parameter except that it is a register. It expects readers to somehow know that a register (its name, that is) is of type character. Relevant doc that will help you: 1. Elisp manual, node `Registers': "A register is a sort of variable used in Emacs editing that can hold a variety of different kinds of values. Each register is named by a single character." IOW, a register is like a variable in that it has a name and a value. The name is a character, however, not a symbol. 2. Emacs manual, node `Registers': "Emacs "registers" are compartments where you can save text, rectangles, positions, and other things for later use.... Each register has a name that consists of a single character, which we will denote by R; R can be a letter (such as `a') or a number (such as `1'); case matters, so register `a' is not the same as register `A'."