unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Josh <josh@foxtail.org>
Cc: Brian Jenkins <brian@brianjenkins.org>,
	emacs-devel <emacs-devel@gnu.org>,
	Stefan Monnier <monnier@iro.umontreal.ca>,
	Bozhidar Batsov <bozhidar@batsov.com>,
	rms@gnu.org
Subject: Re: [PATCH] frame.c: focus hooks
Date: Tue, 14 Jan 2014 19:10:07 +0100	[thread overview]
Message-ID: <52D57D7F.3040607@gmx.at> (raw)
In-Reply-To: <CANdFEAFDLv7Vh48586XKvZr7QSbGjCTbhX41PF4zXeUxGzdrrQ@mail.gmail.com>

 >> (1) The first interpretation means (implicitly) that we could replace
 >>     the call to `buffer-list-update-hook' by calling instead something
 >>     we could name `record-buffer-hook'.
 >
 > I'm not sure I understand.  I see that near the end of select_window
 > we now call record_buffer, which in turn runs `buffer-list-update-hook';
 > are you suggesting that if we went down this path then record_buffer
 > would run a new `record-buffer-hook' (and no longer run
 > `buffer-list-update-hook')?

Yes.  All callers of `buffer-list-update-hook' would then have to call
`record-buffer-hook' too.

 >> You didn't explain _what_ you want to solve.  Adding the name of the
 >> current buffer whenever a hook is run doesn't sound very reasonable to
 >> me.
 >
 > Sure, it was just an experiment intended to help me understand how
 > often that hook is run and under what conditions.

Aha.  You now know that it's run too often for your needs.  But doesn't
`select-window' also run too often for you, for example, when selecting
the minibuffer window?

 > Thanks for explanation and suggestion.  I'll experiment some more
 > to see if there's a reasonable way to obtain the desired behavior
 > with the existing machinery, which I agree would be better than
 > introducing a new hook.

If you told me a bit what you the "desired behavior" is, I might provide
suggestions.

 > Incidentally, I just noticed that though record_buffer runs
 > `buffer-list-update-hook' it's not mentioned in the docstring:
 >
 >     Functions running this hook are `get-buffer-create',
 >     `make-indirect-buffer', `rename-buffer', `kill-buffer',
 >     and `bury-buffer-internal'.
 >
 > Perhaps this is intentional because record_buffer is not exposed at
 > the Lisp level, though?

Hmm...  Actually it's not there because I have added it only recently.
Stefan soon detected some bug in the initial change so it's not safe yet
either.  That is, if you do something silly there, you might easily
infloop or crash Emacs.  But the same would obviously hold for a
`select-window-hook'.

martin



  reply	other threads:[~2014-01-14 18:10 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-17 17:50 [PATCH] frame.c: focus hooks Brian Jenkins
2013-11-17 18:29 ` Bozhidar Batsov
2013-11-17 22:25   ` Brian Jenkins
2013-11-17 22:33     ` Drew Adams
2013-11-18 13:24       ` Brian Jenkins
2013-11-18 14:53         ` Drew Adams
2013-11-19  0:19         ` Stefan Monnier
2013-11-19  8:26         ` Stephen J. Turnbull
2013-11-19 14:10           ` Bozhidar Batsov
2013-11-20  3:10             ` Brian Jenkins
2013-11-18  8:20     ` Bozhidar Batsov
2013-11-18 13:32   ` Stefan Monnier
     [not found]     ` <CAM9Zgm18uL7+PJ+60NjZqtjZJ6tUV77xUbFhXh7UPwqs==1=hg@mail.gmail.com>
2013-11-18 14:20       ` Fwd: " Bozhidar Batsov
2013-11-18 14:23     ` Brian Jenkins
2013-11-18 18:44   ` Richard Stallman
2013-11-18 19:49     ` Brian Jenkins
2013-11-19  6:02       ` Richard Stallman
2013-11-19 18:14         ` Brian Jenkins
2013-11-19 18:53           ` Drew Adams
2013-11-20  0:52             ` Brian Jenkins
2013-11-19 23:42           ` Richard Stallman
2013-11-20  0:52             ` Josh
2013-11-20  3:16               ` Stefan Monnier
2013-11-20  3:36                 ` Josh
2013-11-20  7:34                   ` martin rudalics
2014-01-09 17:01                     ` Josh
2014-01-11 10:25                       ` martin rudalics
2014-01-11 19:05                         ` Josh
2014-01-12  9:54                           ` martin rudalics
2014-01-14 17:30                             ` Josh
2014-01-14 18:10                               ` martin rudalics [this message]
2014-01-10 17:31                   ` Stefan Monnier
2014-01-11 19:06                     ` Josh
2013-11-20  0:53             ` Brian Jenkins
2013-11-20  7:46               ` Jarek Czekalski
2013-11-17 19:28 ` Glenn Morris
2013-11-17 21:19 ` Stefan Monnier
2013-11-18  4:11 ` Leo Liu
     [not found]   ` <CADTx1Oy5pUmb9sPU6jm0yt1hJtvgJmfDtZQpeFakmHknhEXE=A@mail.gmail.com>
2013-11-18 13:33     ` Fwd: " Brian Jenkins

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=52D57D7F.3040607@gmx.at \
    --to=rudalics@gmx.at \
    --cc=bozhidar@batsov.com \
    --cc=brian@brianjenkins.org \
    --cc=emacs-devel@gnu.org \
    --cc=josh@foxtail.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=rms@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 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).