From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Greg Hill Newsgroups: gmane.emacs.help Subject: Re: register use Date: Thu, 12 Sep 2002 12:03:24 -0700 Sender: help-gnu-emacs-admin@gnu.org Message-ID: References: NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="============_-1180265089==_ma============" X-Trace: main.gmane.org 1031857446 22445 127.0.0.1 (12 Sep 2002 19:04:06 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 12 Sep 2002 19:04:06 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17pZG0-0005pt-00 for ; Thu, 12 Sep 2002 21:04:04 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17pZG7-0000UC-00; Thu, 12 Sep 2002 15:04:11 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 17pZFT-0000Mi-00 for help-gnu-emacs@gnu.org; Thu, 12 Sep 2002 15:03:31 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 17pZFR-0000MT-00 for help-gnu-emacs@gnu.org; Thu, 12 Sep 2002 15:03:31 -0400 Original-Received: from renfield.synergymicro.com ([153.105.4.30] helo=synergymicro.com) by monty-python.gnu.org with esmtp (Exim 4.10) id 17pZFQ-0000Lv-00 for help-gnu-emacs@gnu.org; Thu, 12 Sep 2002 15:03:29 -0400 Original-Received: from synergy.synergy.encinitas.ca.us ([153.105.4.29]) by synergymicro.com (8.9.3/8.9.3) with ESMTP id MAA09491; Thu, 12 Sep 2002 12:05:08 -0700 Original-Received: from [198.17.100.22] (G_Hill_Mac [198.17.100.22]) by synergy.synergy.encinitas.ca.us (8.9.3/8.8.7) with ESMTP id MAA21868; Thu, 12 Sep 2002 12:07:01 -0700 In-Reply-To: Original-To: lawrence mitchell , help-gnu-emacs@gnu.org Errors-To: help-gnu-emacs-admin@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.help:1400 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:1400 --============_-1180265089==_ma============ Content-Type: text/plain; charset="us-ascii" ; format="flowed" Richard, In general, whenever apropos identifies a routine as a "Command" that means you can execute it from the minibuffer using M-x When apropos identifies a routine as a "Function," M-x does not work; but you can still execute it from the minibuffer as a typed-in lisp function call using M-: For example, you could set register 'a' to the string "hello" by typing M-: Eval: (set-register ?a "hello") You could make your own interactive M-x command called set-reg-string to prompt you in the minibuffer for a register name and a string to be stored in that register by adding this to your .emacs file: (defun set-reg-string (reg string) (interactive "cRegister: \nsString: ") (set-register reg string)) If you try this, you will find that as soon as you type a character in response to the "Register: " prompt it advances immediately to the "String: " prompt without giving you a chance to see or edit the register name. You could fix this by changing your command definition to: (defun set-reg-string (reg string) (interactive "sRegister: \nsString: ") (set-register (elt reg 0) string)) To learn more about creating your own interactive commands, consult the "Command Loop" chapter in the GNU Emacs Lisp Reference Manual, available for download in many formats at: http://www.sunsite.ualberta.ca/Documentation/Gnu/emacs-lisp-ref-21-2.7/emacs-lisp-ref.html --Greg At 5:57 PM +0100 9/12/02, lawrence mitchell wrote: >Richard White wrote: > >> I'm trying to make use of the registers in GNU Emacs but when I run >> the command set-register the minibuffer says there is no match >> (Despite apropos listing it). I'm using version 20.2.1; does this >> version have register use enabled and if so how do I get it to work >> (please)? > >set-register isn't an interactive function, i.e. you can't call >it via M-x or through a keybinding. The Emacs manual describes >how to use registers in far more detail than I ever could, see >the Info node "(emacs)Registers", you can get there by evaluating >(Info-goto-node "(emacs)Registers") in Emacs. > >-- >lawrence mitchell --============_-1180265089==_ma============ Content-Type: text/html; charset="us-ascii" Re: register use
Richard,

In general, whenever apropos identifies a routine as a "Command" that means you can execute it from the minibuffer using M-x

When apropos identifies a routine as a "Function," M-x does not work; but you can still execute it from the minibuffer as a typed-in lisp function call using M-:

For example, you could set register 'a' to the string "hello" by typing
M-:
Eval: (set-register ?a "hello")

You could make your own interactive M-x command called set-reg-string to prompt you in the minibuffer for a register name and a string to be stored in that register by adding this to your .emacs file:

  (defun set-reg-string (reg string)
    (interactive "cRegister: \nsString: ")
    (set-register reg string))

If you try this, you will find that as soon as you type a character in response to the "Register: " prompt it advances immediately to the "String: " prompt without giving you a chance to see or edit the register name.  You could fix this by changing your command definition to:

  (defun set-reg-string (reg string)
    (interactive "sRegister: \nsString: ")
    (set-register (elt reg 0) string))

To learn more about creating your own interactive commands, consult the "Command Loop" chapter in the GNU Emacs Lisp Reference Manual, available for download in many formats at:

http://www.sunsite.ualberta.ca/Documentation/Gnu/emacs-lisp-ref-21-2.7/emacs-lisp-ref.html

--Greg


At 5:57 PM +0100 9/12/02, lawrence mitchell wrote:
Richard White wrote:

> I'm trying to make use of the registers in GNU Emacs but when I run
> the command set-register the minibuffer says there is no match
> (Despite apropos listing it).  I'm using version 20.2.1; does this
> version have register use enabled and if so how do I get it to work
> (please)?

set-register isn't an interactive function, i.e. you can't call
it via M-x or through a keybinding.  The Emacs manual describes
how to use registers in far more detail than I ever could, see
the Info node "(emacs)Registers", you can get there by evaluating
(Info-goto-node "(emacs)Registers") in Emacs.

--
lawrence mitchell <wence@gmx.li>
--============_-1180265089==_ma============--