unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Stephen Berman <stephen.berman@gmx.net>
Cc: Nicolas Richard <nrichard@members.fsf.org>, 20832@debbugs.gnu.org
Subject: bug#20832: 25.0.50; todo-show accidentally deleted my todo file.
Date: Fri, 19 Jun 2015 17:39:49 +0200	[thread overview]
Message-ID: <558437C5.7060207@gmx.at> (raw)
In-Reply-To: <87egl7ivaf.fsf@gmx.net>

 >>       When writing an application, you should normally use the
 >>       higher-level functions described in *Note Switching Buffers::,
 >>       instead of calling `set-window-buffer' directly.
 >
 > Is this a change from previous policy?  In earlier versions of
 > todo-mode.el I had several instances of switch-to-buffer, but some time
 > ago replaced them with set-window-buffer and I'm pretty sure I did that
 > because I was given to understand that programmatic use of
 > switch-to-buffer was discouraged.  If this is no longer the case (or if
 > I was mistaken back then), I'll have check (when I have time) all of the
 > uses of set-window-buffer in todo-mode.el for unanticipated side
 > effects.

Nothing has changed.  The term "normally" stands more or less for "when
you use ‘set-window-buffer’ you are supposed to know what you do".  This
is a low level function and should be allowed to set the buffer of any
window (like the minibuffer or a tooltip window) just as ‘window-buffer’
returns the buffer shown in any live window.

OTOH I don't recall any restrictions on using ‘switch-to-buffer’
programmatically.  Just that you should _not_ expect it to always use
the selected window.

martin






  reply	other threads:[~2015-06-19 15:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-17  5:39 bug#20832: 25.0.50; todo-show accidentally deleted my todo file Nicolas Richard
2015-06-18 10:15 ` Stephen Berman
2015-06-18 11:52   ` Nicolas Richard
2015-06-19  6:43     ` martin rudalics
2015-06-19 15:15       ` Stephen Berman
2015-06-19 15:39         ` martin rudalics [this message]
2015-06-19 15:14     ` Stephen Berman

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=558437C5.7060207@gmx.at \
    --to=rudalics@gmx.at \
    --cc=20832@debbugs.gnu.org \
    --cc=nrichard@members.fsf.org \
    --cc=stephen.berman@gmx.net \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).