From: martin rudalics <rudalics@gmx.at>
To: emacs-devel@gnu.org
Subject: Re: extra-interactive functions
Date: Fri, 03 Jun 2011 17:27:45 +0200 [thread overview]
Message-ID: <4DE8FD71.1000004@gmx.at> (raw)
In-Reply-To: <87vcwneyyl.fsf_-_@lifelogs.com>
> 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).
A user might want to display that file visting buffer in a certain way
and has customized options like `special-display-buffer-names' or
`special-display-regexps' for that purpose. If you call
`switch-to-buffer', the user cannot control the placement of the buffer
in the window or frame of her choice.
>>> 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.
There are only very few interactive functions that should be allowed to
call `switch-to-buffer'. `find-file' may fit into this category because
that's what users traditionally expect it to do (although I plan to have
it call a function `pop-to-buffer-same-window' sooner or later). In the
distant future there should be no function calling `switch-to-buffer' at
all.
martin
next prev parent reply other threads:[~2011-06-03 15:27 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-17 23:21 [RFC PATCH] setting indentation styles via `c-file-style' fails to actually change indentation Nix
2011-05-18 0:17 ` Stefan Monnier
2011-05-18 20:28 ` Nix
2011-05-18 21:08 ` ERT indentation testing (was: [RFC PATCH] setting indentation styles via `c-file-style' fails to actually change indentation) Ted Zlatanov
2011-05-18 22:19 ` ERT indentation testing Stefan Monnier
2011-05-19 10:33 ` Ted Zlatanov
2011-05-19 11:56 ` Stefan Monnier
2011-06-01 21:30 ` Ted Zlatanov
2011-06-02 18:43 ` Ted Zlatanov
2011-06-03 0:04 ` Stefan Monnier
2011-06-03 11:33 ` Ted Zlatanov
2011-06-03 12:12 ` martin rudalics
2011-06-03 15:06 ` extra-interactive functions (was: ERT indentation testing) Ted Zlatanov
2011-06-03 15:27 ` martin rudalics [this message]
2011-06-03 16:11 ` extra-interactive functions Ted Zlatanov
2011-06-03 18:59 ` martin rudalics
2011-06-03 19:10 ` Ted Zlatanov
2011-06-03 20:54 ` martin rudalics
2011-06-08 10:44 ` ERT indentation testing Ted Zlatanov
2011-06-08 15:24 ` Stefan Monnier
2011-06-09 16:05 ` Ted Zlatanov
2011-06-10 20:41 ` Stefan Monnier
2011-06-01 14:31 ` [RFC PATCH] setting indentation styles via `c-file-style' fails to actually change indentation Nix
2011-06-02 12:24 ` Alan Mackenzie
2011-06-02 13:35 ` Stefan Monnier
2011-06-02 16:47 ` Nix
2011-06-02 21:15 ` Alan Mackenzie
2011-06-02 21:43 ` Nix
2011-06-05 15:06 ` Alan Mackenzie
2011-07-24 10:07 ` bug#7570: " Kan-Ru Chen
2011-07-24 10:07 ` Kan-Ru Chen
2011-08-05 14:14 ` Nix
2011-05-18 3:27 ` Glenn Morris
2011-05-18 11:02 ` Juanma Barranquero
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4DE8FD71.1000004@gmx.at \
--to=rudalics@gmx.at \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.