help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Passing arguments to Elisp function


From: Jean Louis
Subject: Re: Passing arguments to Elisp function
Date: Sun, 1 Nov 2020 20:44:47 +0300
User-agent: Mutt/+ (1036f0e) (2020-10-18)

* jai-bholeki via Users list for the GNU Emacs text editor 
<help-gnu-emacs@gnu.org> [2020-11-01 19:56]:
> I have a function gets the beginning and end of a region.
> 
> Is is possible to pass another argument to the function that is a character 
> 'ch'?
> 
> (defun pengo (beg end)
> (interactive "r") ; Specifies Mark and Point, smallest first
> (goto-char beg)
> )

Make the function ask user for additional character before goto-char
probably.

(read-char-from-minibuffer "Char: ")

If you need more than char read-from-minibuffer

You may explore which read functions exist by:

C-h f read-TAB and you may see various, not all are useful for that
case. You get information about the function with C-h f

-- 
There are 50 messages yet in my incoming mailbox.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]