alphapapa / org-sidebar

A helpful sidebar for Org mode
GNU General Public License v3.0
527 stars 16 forks source link

Add more configurable parameters? #2

Closed JSDurand closed 4 years ago

JSDurand commented 5 years ago

Thanks for this good package. I find it quite enlightening!

I would like to suggest an addition: perhaps add one parameter size in org-sidebar and use it as follows?

(display-buffer-in-side-window (current-buffer)
                                         (list (cons 'side org-sidebar-side)
                                               (cons 'slot slot)
                                               (cons 'window-parameters (list (cons 'no-delete-other-windows t)))
                                               (cons 'window-height size)
                           (cons 'window-width size)))

Also, maybe make the header argument in org-sidebar-ql configurable as well? I know this is still experimental, so this is just a suggestion, as it is simple to implement these changes. Thanks again for this great package. :-)

alphapapa commented 5 years ago

Hi,

This is a good idea. It would probably be even better to accept an arbitrary alist of additional window parameters.

I looked at the docs again, and I think it has to be done like this:

(display-buffer-in-side-window (current-buffer)
                               (list (cons 'side org-sidebar-side)
                                     (cons 'slot slot)
                                     (cons 'window-parameters (list (cons 'no-delete-other-windows t)
                                                                    (cons 'window-height size)
                                                    (cons 'window-width size)))))

I haven't tested it. What do you think?

Also, maybe make the header argument in org-sidebar-ql configurable as well?

Sure, for non-interactive use, that would be fine. For interactive use, I think I'd prefer to not add an additional prompt. Does that make sense?

By the way, I guess you got lucky with your GitHub identicon, it looks like a (grumpy) face! :)

JSDurand commented 5 years ago

Indeed from the documentation I think your way of passing window-width and window-height is more plausible, but strangely if I pass that way it does not work. (The previous version I tested and it did successfully modify the window width, contradictory to the docs). I think more tests are necessary though.

I agree that in interactive use it is redundant to set the header every time. Maybe add one more variable like sidebar-ql-header-prefix or something similar? I was thinking of this because I define a custom function using org-sidebar-ql and would like to set a custom header.

Thanks for the quick reply. :-)

I did not notice my identicon's look before. That is funny. :-D

alphapapa commented 5 years ago

Thanks, when I work on this feature, I'll figure out the window params.

I define a custom function using org-sidebar-ql and would like to set a custom header.

Ah, I hadn't thought of using org-sidebar-ql to define a custom function. Maybe I need to enhance the org-sidebar-defsidebar macro instead.

JSDurand commented 5 years ago

I forgot this org-sidebar-defsidebar when I want to define the custom function. And indeed org-sidebar-defsidebar did satisfy my needs. So this is not strictly necessary. XD

So maybe just enhance the macro then, as that is intended for these purposes. :)

alphapapa commented 4 years ago

@JSDurand The package has seen several changes since we last talked about this. What do you think now?

JSDurand commented 4 years ago

Ah. I haven't use this package for some time. I still find this package interesting. I will find some time to test it out and see. Thanks for the good package. :)