0

Despite respectable variety of display-buffer-* functions some of them stand out with lack of flexibility, such as display-buffer-at-bottom or display-buffer-below-selected that exist in absence of reverse variant.

Assuming that decision was intentional, I would like to know what limitations are stopping these procedures from following the suit, or if there exists an easy way to create opposite implementation on the spot using existing inventory.

To make it more clear, here's my own attempt at making display-buffer-above-selected which only exposes the duplication that lays burden on those that seek to replace missing functionality.

  • Here is a left and right example, which should be sufficient for you to see how to create your own function for above and/or below: stackoverflow.com/a/21544307/2112489 When using window-in-direction it is either 'above, 'below, 'left, or 'right. – lawlist Apr 1 '15 at 16:36
  • Here is my own above example: (defun lawlist-display-buffer-above (buffer alist) (let ((window (cond ((get-buffer-window buffer (selected-frame)) (get-buffer-window buffer (selected-frame))) ((window-in-direction 'above) (window-in-direction 'above)) ((window-in-direction 'left) (window-in-direction 'left)) (t (selected-window))))) (window--display-buffer buffer window 'window alist display-buffer-mark-dedicated) (select-window (get-buffer-window (buffer-name buffer))) )) You will need to adjust the conditions to suit your needs. – lawlist Apr 1 '15 at 16:40
  • Please consider sending your info about shortcomings, possible improvements, and suggestions for improvement (bug fixes or enhancement requests) to Emacs Dev, by using M-x report-emacs-bug. – Drew Apr 1 '15 at 16:40
  • lawlist, can't help but point out, in case you find it useful, that (cond (x x) (y y) (z z)) is the same as (cond (x) (y) (z)) and also (or x y z). Thanks for the advice, I will make use of it. – mpontus Apr 1 '15 at 16:58
  • Drew, thanks for encouragement, I will make it so. – mpontus Apr 1 '15 at 16:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.