[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: all I wanted to do was make the compilation-mode-hook the sole visib
Re: all I wanted to do was make the compilation-mode-hook the sole visible buffer
Wed, 30 Nov 2011 11:03:06 +0200
On Wed, Nov 30, 2011 at 5:46 AM, <address@hidden>
It turns out that is not what I want. I want it to be the sole window visible.
>>>>> "TN" == Thien-Thi Nguyen <address@hidden
TN> (add-to-list 'same-window-buffer-names "*compilation*")
OK, I can use
(switch-to-buffer "*compilation*");alas, forget using any personal compilation-buffer-name-function
I believe that the hook function will be executed in the context of the compilation buffer so you may not need to call 'switch-to-buffer. Also, the 'function' form is unnecessary (in general, not just in this particular example). You could reduce your code to:
(add-hook 'compilation-mode-hook 'delete-other-windows)
Now you can use the 'remove-hook function if you decide you no longer need the hook; approach which does not work when you add anonymous functions as hook functions.