[Top][All Lists]

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

Re: How to change overlay arrow position silently?

From: Juri Linkov
Subject: Re: How to change overlay arrow position silently?
Date: Mon, 10 Aug 2009 01:55:33 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (x86_64-pc-linux-gnu)

>> Its docstring says it can be used non-interactively:
>>   When called from Lisp code, the optional argument BUFFER
>>   ==========================
>>   specifies a buffer to switch to.
> It seems like even this `buffer' argument is very much an "interactive"
> feature since it causes the buffer to be displayed, which may cause new
> windows/frames to be created.
> Makes me wonder: does any code use this `buffer' argument?  My guess is
> that it's only used by things like the command-line-arg processing
> (and/or the emacs-server).  We had better make it more clear: do not use
> it from Elisp unless you know what you're doing (i.e. add it to
> byte-compile-interactive-only-functions).

I can't find any code that uses this `buffer' argument, but there are
more than 150 places in Emacs that call this `goto-line' function.
So we can't easily prohibit using it non-interactively.  But I think
there is no harm when using non-interactively.  A similar function
"goto-char" has interactive/non-interactive duality with no problem.

The only problem with "goto-line" is that it sets the mark and prints
the message "Mark set".  Using a new argument `interactivep' will allow
the programmer to decide where to do this.  When a command is just
a wrapper around the `goto-line' (like the command `View-goto-line')
then it should call `goto-line' with interactivep=t.

Juri Linkov

reply via email to

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