unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Carlos Konstanski <ckonstanski@pippiandcarlos.com>
To: help-gnu-emacs@gnu.org
Subject: list-buffers behavior customization
Date: Thu, 5 May 2016 14:47:07 -0600	[thread overview]
Message-ID: <0a105aa5-9ad2-354b-d113-9df6b6561834@pippiandcarlos.com> (raw)

I quite often have 3 or 4 emacs frames open. Whenever I do a
list-buffers, it opens in whatever frame it appeared last. This is
usually not what I want. I want it to open in the frame that is
currently in focus.

The implementation looks like the following:

(defun list-buffers-noselect (&optional files-only buffer-list)
  (let ((old-buffer (current-buffer))
	(buffer (get-buffer-create "*Buffer List*")))
    (with-current-buffer buffer
      (Buffer-menu-mode)
      (setq Buffer-menu-files-only
	    (and files-only (>= (prefix-numeric-value files-only) 0)))
      (list-buffers--refresh buffer-list old-buffer)
      (tabulated-list-print))
    buffer))

The sexp (get-buffer-create "*Buffer List*") is where this behavior is
coming from.

Before I try to find some way to hack this function so that it deletes
the pre-existing buffer first, is there a hook where I can do this?

Thank you,
Carlos Konstanski



             reply	other threads:[~2016-05-05 20:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-05 20:47 Carlos Konstanski [this message]
2016-05-05 22:46 ` list-buffers behavior customization Michael Heerdegen
2016-05-06 13:03   ` Carlos Konstanski
2016-05-06 19:18     ` Stefan Monnier
2016-05-06 19:29       ` Carlos Konstanski
2016-05-06 19:36         ` Stefan Monnier
2016-05-07  0:55 ` Bernardo

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=0a105aa5-9ad2-354b-d113-9df6b6561834@pippiandcarlos.com \
    --to=ckonstanski@pippiandcarlos.com \
    --cc=help-gnu-emacs@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.
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).