Emacs Lisp Buffer out of focus function?

后端 未结 3 700
说谎
说谎 2021-01-25 03:18

Is there an emacs lisp function that will allow me to tell if a buffer is out of focus?

I am trying to write a hook that will get rid of the semantics *possible co

3条回答
  •  灰色年华
    2021-01-25 04:01

    You can test if a buffer is the buffer that currently has focus with current-buffer. For example, to test if *scratch* has the focus,

    (eq 
     (current-buffer) 
     (get-buffer "*scratch*"))
    

    The *Messages* buffer is an important part of emacs. It's the implicit target of the message function that is used to log various bits of information from all over. You can kill *Messages* like any other buffer, but it will just get recreated the next time something calls message. You could probably silence it by redefining the message function, but I'd question the point of doing so.

提交回复
热议问题