[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: HowTo: Run a hook when a buffer becomes "current"

From: Richard Stallman
Subject: Re: HowTo: Run a hook when a buffer becomes "current"
Date: Wed, 16 Dec 2015 23:58:37 -0500

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > I was looking for a way of running a function  when a buffer becomes
  > "current". I cant find any hooks in Emacs -- the closest is
  > buffer-list-update-hook -- but that gets called way too often including
  > when a buffer is buried, is visited transiently from within lisp code
  > etc.

This is one of the hooks I decided we should not have.  If changing
the current buffer, with set-buffer for instance, can affect execution
of code, you'll never be able to debug code when that hook is in use.

Dr Richard Stallman
President, Free Software Foundation (gnu.org, fsf.org)
Internet Hall-of-Famer (internethalloffame.org)
Skype: No way! See stallman.org/skype.html.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]