rougier / nano-sidebar

Emacs package to have configurable sidebars on a per frame basis.
GNU General Public License v3.0
128 stars 6 forks source link

the side-bar takes a whole buffer #2

Open kebairia opened 3 years ago

kebairia commented 3 years ago

when i use the nano-sidebar-toggle, it takes a whole buffer instead of just the "side" is there a way so i can configure it on a specific width?

2021-08-31-1630385433_990x644

rougier commented 3 years ago

Well, it's not supposed to do that! What is your system?

kebairia commented 3 years ago

Well, it's not supposed to do that! What is your system?

OS: Gnu/Linux -- Artix (Arch based distro) Emacs: GNU Emacs 27.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.27, cairo version 1.17.4) of 2021-03-26

rougier commented 3 years ago

Thanks. Can you check if a frame is actually created (and cover the initial frame) or if there's an error during the creation?

kebairia commented 3 years ago

no, actually , when i activate the nano-side-bar, the screen blink with the nano-side-bar frame (the frame appear and immediately disappear). these are the messages i get 2021-08-31-1630401702_715x103

After that, I can use ibuffer to locate the frame. 2021-08-31-1630401777_840x418

rougier commented 3 years ago

Ok. Can you try to add a message here to check if the make-frame-visible function is called?

kebairia commented 3 years ago

alright, i've added this message like that

    (when (not visible)
;;;;;;;;;;;;;;;;;the message;;;;;;;;;;;;;;;;;;;
      (message "Hello there")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
      (make-frame-visible sidebar)
      (modify-frame-parameters sidebar `((top    . 0)
                                         (height . 1.0)
                                         (width  . ,sidebar-width)
                                         (left   . ,(* -1 width))))
      (select-frame-set-input-focus selected-frame))

These are the messages I got

t
nano-sidebar
Hello there
dark
rougier commented 3 years ago

Ok. Do you know if there are actually two frames or only one after toggling the sidebar? For example, is one covering the other?

kebairia commented 3 years ago

no, only one frame! i toggled the sidebar from the scratch buffer

(nano-sidebar-toggle) ;; Using C-x C-e

2021-08-31-1630414414_791x327

rougier commented 3 years ago

Can you try:

(make-frame `((parent-frame . ,(window-frame))
              (undecorated .  nil)
              (user-position . nil)
              (user-size . nil)
              (background-color . "black")
              (height . 12)
              (width  . 72)))
kebairia commented 3 years ago

where should i put that i use it as a configuration, and a black box appeared at the top left of the buffer. 2021-08-31-1630419395_1086x520

kebairia commented 3 years ago

PS: when i execute (nano-sidebar-toggle), i loose my cursor, it seems that the focus goes to the new sidebar. I can restore my cursor by clicking again.

rougier commented 3 years ago

The command was a test to chekc whether you can create a child frame and apparently you can. By the way, are you using a tiloing window manager or emacs in full screen (that won't play well with the sidebar)?

kebairia commented 3 years ago

yes, i'm using dwm

rougier commented 3 years ago

That might be the reason. Can you try with a floating emacs window?

kebairia commented 3 years ago

i tried with a floating mode in dwm... same problem 🤔

rougier commented 3 years ago

What about the minimal example I posted above? I suspect that the new frame might be identified as new window by your wm and put somewhere else. Since this new frame is a child frame, I'm not sure how dwm would handle it. Can you try with a non-tiling window manager (if possible, don't break your configuration for the test)?

DivineDominion commented 2 years ago

Can you try:

(make-frame `((parent-frame . ,(window-frame))
              (undecorated .  nil)
              (user-position . nil)
              (user-size . nil)
              (background-color . "black")
              (height . 12)
              (width  . 72)))

@rougier I tried on macOS Monterey with Emacs 28 today, and this spawns a sub-window that is attached to the main one, much like macOS sheets used to maintain relative position.

image

Thing is, the sidebar also is a floating window. Much like old Mac OS X GUIs, or GIMP:

Screen Shot 2022-01-19 at 19 36 47

Is there anything else you do to customize the display of Emacs frames on your Mac?

rougier commented 2 years ago

@DivineDominion Sorry for late answer. I think this the expected behavior. In my case (OSX Monterrey EmacsMac 27.1), I removed the title bar.