djcb / sauron

emacs event log (WIP)
226 stars 26 forks source link

sauron as a "side window" #59

Open jave opened 6 years ago

jave commented 6 years ago

The following code makes Sauron be an emacs "side window" see https://www.gnu.org/software/emacs/draft/manual/html_node/elisp/Frame-Layouts-with-Side-Windows.html

Basically it works like the sauron embedded window is supposed to, but is more robust in some ways. The code is just POC.

(defvar parameters
'(window-parameters . ((no-other-window . t) (no-delete-other-windows . t))))

(setq fit-window-to-buffer-horizontally t)
(setq window-resize-pixelwise t)

(setq
display-buffer-alist
`(("\Sauron\" display-buffer-in-side-window
(side . top) (slot . 0) (window-height . fit-window-to-buffer)
(preserve-size . (nil . t)) ,parameters)))

kchanqvq commented 4 years ago

Any update on this? Is the compatibility concern that prevents this to be added to Sauron? This function is introduced in probably emacs 26 (we can always make a switch anyway).

I'm able to hack sr-show-embedded to make it basically work. The only issue is that it seemly does not respect window-height -- it tries to display all lines even if I say 8. Not sure if I'm doing anything wrong.

Also, it turns out that you cannot C-x o to a side-window, this maybe another concern.

One nice thing is now you can specify the *Sauron* to be displayed anywhere, bottom or left or right or top. Displaying it on right side, for example, enable user to see more logs and have more notification-center feel. (which is what I want it to do for me, since I don't want a notification system outside emacs)