emacs-devel
[Top][All Lists]
Advanced

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

extra-interactive functions (was: ERT indentation testing)


From: Ted Zlatanov
Subject: extra-interactive functions (was: ERT indentation testing)
Date: Fri, 03 Jun 2011 10:06:42 -0500
User-agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.50 (gnu/linux)

On Fri, 03 Jun 2011 14:12:24 +0200 martin rudalics <address@hidden> wrote: 

>> Using `find-file-noselect' will just make me select the buffer in ELisp
>> instead of expecting it to become current.  Is there any real reason to
>> avoid `find-file'?  Because of the prompts?  I ask because I'm curious;
>> I've already changed my patch to use (set-buffer (find-file-noselect...))
>> but can't commit because the Bazaar repo is down.

mr> `find-file' uses `switch-to-buffer' and `switch-to-buffer' should be
mr> avoided in Elisp code.

The docstring for `switch-to-buffer' says not to use it to avoid
"messing with the window-buffer correspondences" which is good enough
for me (though I'm still curious what that really means).

>> Also, if `find-file' should be avoided in ELisp generally, the docstring
>> should say so, like it does for many other functions.

mr> Indeed.

But that's tedious to do by hand.  If we tag the function symbol
(e.g. `switch-to-buffer') with some extra-interactive property, we can
tag all the functions that call it as well at compile time.  Wouldn't
that be nicer?  The docstring can then automatically say "unsafe to call
because it calls `switch-to-buffer'" which is nice and more helpful.

Ted




reply via email to

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