Emacs Lisp Buffer out of focus function?

后端 未结 3 667
说谎
说谎 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 03:50

    You can try PopWin, It lets you specify buffers that will open in a special window. This window closes when the frame gets out of focus or when you press C-g

    0 讨论(0)
  • 2021-01-25 03:55

    Related to your second question, Also is it possible to get rid of the Messages Buffer as well. If you're using ido-mode (and everyone should be using it!), you can hide the *Messages* buffer from the buffer listing with the following elisp:

    (require 'ido)
    (setq ido-ignore-buffers '("^\*Messages\*"))
    
    0 讨论(0)
  • 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.

    0 讨论(0)
提交回复
热议问题