all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Update `minibuffer-line' on buffer switches
@ 2015-06-27 14:22 Alexander Shukaev
  2015-06-27 15:43 ` Michael Heerdegen
  0 siblings, 1 reply; 12+ messages in thread
From: Alexander Shukaev @ 2015-06-27 14:22 UTC (permalink / raw)
  To: help-gnu-emacs

Hello,

Recently Stefan has introduced the `minibuffer-line' package.  I find it
very handy, especially for displaying the full path to either the
`default-directory' or `buffer-file-name'.  Previously, I used
`frame-title-format' for this like so:

(setq-default frame-title-format
              '((:eval
                 (list (user-login-name)
                       "@"
                       (system-name)
                       ":"
                       (abbreviate-file-name (or (buffer-file-name)
                                                 (file-name-as-directory
                                                  default-directory)))))))

and it behaved very well since when one switches buffers, the title is
automatically updated.  The same is true for `mode-line-format'.  Both
variables come from the C source code.  I'm not sure how automatic updating
is implemented for those, but obviously, to make this work with
`minibuffer-line', I'd have to attach `minibuffer-line--update' to some
hook which runs when buffers are switched.  Is there such a hook?  Are
there alternative implementations for this?  Thanks.

Kind regards,
Alexander


^ permalink raw reply	[flat|nested] 12+ messages in thread
* Re: Update `minibuffer-line' on buffer switches
@ 2015-06-29 17:15 martin rudalics
  2015-06-29 19:00 ` Alexander Shukaev
  0 siblings, 1 reply; 12+ messages in thread
From: martin rudalics @ 2015-06-29 17:15 UTC (permalink / raw)
  To: haroogan; +Cc: help-gnu-emacs

 > Would `window-configuration-change-hook' work in case when a buffer is
 > switched in-place (i.e. all windows stay intact and the selected window is
 > not changed but only the displayed buffer inside this window is switched)?

  -- Variable: window-configuration-change-hook
      A normal hook that is run every time you change the window
      configuration of an existing frame.  This includes splitting or
      deleting windows, changing the sizes of windows, or displaying a
                                                          ^^^^^^^^^^^^
      different buffer in a window.
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

 > ​To be honest it's not the first time that I find myself in a situation
 > when I simply need to hook the event of buffer (focus) switching and/or
 > window (focus) switching​, etc.

  -- Variable: buffer-list-update-hook
      This is a normal hook run whenever the buffer list changes.
      Functions (implicitly) running this hook are `get-buffer-create'
      (*note Creating Buffers::), `rename-buffer' (*note Buffer Names::),
      `kill-buffer' (*note Killing Buffers::), `bury-buffer' (see above)
      and `select-window' (*note Selecting Windows::).
           ^^^^^^^^^^^^^

martin




^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2015-06-29 19:50 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-27 14:22 Update `minibuffer-line' on buffer switches Alexander Shukaev
2015-06-27 15:43 ` Michael Heerdegen
2015-06-27 21:59   ` Stefan Monnier
2015-06-28 17:19     ` Alexander Shukaev
2015-06-28 17:38       ` Alexander Shukaev
     [not found]       ` <mailman.5854.1435513096.904.help-gnu-emacs@gnu.org>
2015-06-29  3:36         ` Stefan Monnier
2015-06-29 16:31           ` Alexander Shukaev
2015-06-29 17:00             ` Eli Zaretskii
2015-06-29 19:02               ` Alexander Shukaev
2015-06-29 19:50                 ` Alexander Shukaev
  -- strict thread matches above, loose matches on Subject: below --
2015-06-29 17:15 martin rudalics
2015-06-29 19:00 ` Alexander Shukaev

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.