GNU bug report logs -
#35592
Use display-buffer-in-direction for completion-like windows
Previous Next
To reply to this bug, email your comments to 35592 AT debbugs.gnu.org.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#35592
; Package
emacs
.
(Sun, 05 May 2019 20:43:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Juri Linkov <juri <at> linkov.net>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Sun, 05 May 2019 20:43:04 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Proced has dired-like UI. Dired smoothly displays a completion-like
confirmation window with filenames. ‘proced-with-processes-buffer’
even has a comment proudly declaring its compatibility with dired:
;; Analogous to `dired-pop-to-buffer'
;; Don't split window horizontally. (Bug#1806)
But in fact currently Proced can't handle more than 1 window on the same frame.
For example, compare these cases:
When there is only 1 window:
0. emacs -Q
1. M-x proced
2. C-x 1
3. d d x
then a list of *Marked Processes* is displayed in the bottom window
nicely like in Dired.
But when windows are split vertically:
0. emacs -Q
1. M-x proced
2. d d x
then a list of *Marked Processes* is displayed in the top window.
When windows are split horizontally:
0. emacs -Q
1. C-x 3
2. M-x proced
3. d d x
then the buffer *Marked Processes* is displayed in the left window.
Splitting to more windows cause it to display this buffer in random places.
This could be fixed by using something like:
(display-buffer "*Marked Processes*"
'((display-buffer-in-direction)
(direction . bottom)
(window . main)
(window-height . fit-window-to-buffer)))
The same would be useful also for Widget using e.g.
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el
index b9f98cdc4c..b077299c0e 100644
--- a/lisp/wid-edit.el
+++ b/lisp/wid-edit.el
@@ -252,7 +252,11 @@ widget-choose
(define-key map [?\M--] 'negative-argument)
(save-window-excursion
(let ((buf (get-buffer " widget-choose")))
- (fit-window-to-buffer (display-buffer buf))
+ (display-buffer
+ buf
+ '(display-buffer-in-direction
+ (direction main bottom)
+ (window-height . fit-window-to-buffer)))
(let ((cursor-in-echo-area t)
(arg 1))
(while (not value)
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#35592
; Package
emacs
.
(Tue, 07 May 2019 08:15:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 35592 <at> debbugs.gnu.org (full text, mbox):
> This could be fixed by using something like:
>
> (display-buffer "*Marked Processes*"
> '((display-buffer-in-direction)
> (direction . bottom)
> (window . main)
> (window-height . fit-window-to-buffer)))
>
> The same would be useful also for Widget using e.g.
>
> diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el
> index b9f98cdc4c..b077299c0e 100644
> --- a/lisp/wid-edit.el
> +++ b/lisp/wid-edit.el
> @@ -252,7 +252,11 @@ widget-choose
> (define-key map [?\M--] 'negative-argument)
> (save-window-excursion
> (let ((buf (get-buffer " widget-choose")))
> - (fit-window-to-buffer (display-buffer buf))
> + (display-buffer
> + buf
> + '(display-buffer-in-direction
> + (direction main bottom)
> + (window-height . fit-window-to-buffer)))
> (let ((cursor-in-echo-area t)
> (arg 1))
> (while (not value)
Would these work despite of the 'fit-window-to-buffer' problem you
reported earlier?
martin
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#35592
; Package
emacs
.
(Tue, 07 May 2019 22:02:03 GMT)
Full text and
rfc822 format available.
Message #11 received at 35592 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
> Would these work despite of the 'fit-window-to-buffer' problem you
> reported earlier?
Actually I see no problem anymore with using display-buffer-in-direction
in the following patch.
Only a small plea: could you please add an alias ‘(direction . bottom)’
as a shorthand for ‘(direction . below) (window . main)’
Similarly:
top = (direction . above) (window . main)
bottom = (direction . below) (window . main)
leftmost = (direction . left) (window . main)
rightmost = (direction . right) (window . main)
[use-display-buffer-in-direction.patch (text/x-diff, inline)]
diff --git a/lisp/proced.el b/lisp/proced.el
index ce379a7c6a..5e026aa386 100644
--- a/lisp/proced.el
+++ b/lisp/proced.el
@@ -1744,9 +1744,11 @@ proced-with-processes-buffer
(save-window-excursion
;; Analogous to `dired-pop-to-buffer'
;; Don't split window horizontally. (Bug#1806)
- (let (split-width-threshold)
- (pop-to-buffer (current-buffer)))
- (fit-window-to-buffer (get-buffer-window) nil 1)
+ (display-buffer (current-buffer)
+ '((display-buffer-in-direction)
+ (direction . bottom)
+ (window . main)
+ (window-height . fit-window-to-buffer)))
,@body))))
(defun proced-send-signal (&optional signal process-alist)
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el
index b9f98cdc4c..edf92ba94e 100644
--- a/lisp/wid-edit.el
+++ b/lisp/wid-edit.el
@@ -252,7 +252,11 @@ widget-choose
(define-key map [?\M--] 'negative-argument)
(save-window-excursion
(let ((buf (get-buffer " widget-choose")))
- (fit-window-to-buffer (display-buffer buf))
+ (display-buffer buf
+ '((display-buffer-in-direction)
+ (direction . bottom)
+ (window . main)
+ (window-height . fit-window-to-buffer)))
(let ((cursor-in-echo-area t)
(arg 1))
(while (not value)
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#35592
; Package
emacs
.
(Wed, 08 May 2019 09:10:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 35592 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
> Only a small plea: could you please add an alias ‘(direction . bottom)’
> as a shorthand for ‘(direction . below) (window . main)’
>
> Similarly:
> top = (direction . above) (window . main)
> bottom = (direction . below) (window . main)
> leftmost = (direction . left) (window . main)
> rightmost = (direction . right) (window . main)
Patch attached. But notice that these semantically clash with what you
earlier wanted for 'split-window':
((eq side 'above) 'top)
((eq side 'below) 'bottom)
martin
[display-buffer-in-direction.diff (text/plain, attachment)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#35592
; Package
emacs
.
(Wed, 08 May 2019 19:55:02 GMT)
Full text and
rfc822 format available.
Message #17 received at 35592 <at> debbugs.gnu.org (full text, mbox):
>> Only a small plea: could you please add an alias ‘(direction . bottom)’
>> as a shorthand for ‘(direction . below) (window . main)’
>>
>> Similarly:
>> top = (direction . above) (window . main)
>> bottom = (direction . below) (window . main)
>> leftmost = (direction . left) (window . main)
>> rightmost = (direction . right) (window . main)
>
> Patch attached.
Thanks! I tested it, and it works nicely.
> But notice that these semantically clash with what you
> earlier wanted for 'split-window':
>
> ((eq side 'above) 'top)
> ((eq side 'below) 'bottom)
I remember that recently you added these aliases:
up -> above
down -> below
that fits well into this scheme.
But I don't know about
above -> top
below -> bottom
These are some earlier additions. Is there a problem with these aliases?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#35592
; Package
emacs
.
(Thu, 09 May 2019 08:13:02 GMT)
Full text and
rfc822 format available.
Message #20 received at 35592 <at> debbugs.gnu.org (full text, mbox):
>> But notice that these semantically clash with what you
>> earlier wanted for 'split-window':
>>
>> ((eq side 'above) 'top)
>> ((eq side 'below) 'bottom)
>
> I remember that recently you added these aliases:
>
> up -> above
> down -> below
>
> that fits well into this scheme.
>
> But I don't know about
>
> above -> top
> below -> bottom
>
> These are some earlier additions. Is there a problem with these aliases?
I misremembered things. They affect side windows only. But how about
using 'topmost' and 'bottommost' instead of 'top' and 'bottom'? These
would fit more nicely into the 'leftmost' and 'rightmost' scheme.
martin
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#35592
; Package
emacs
.
(Thu, 09 May 2019 19:52:01 GMT)
Full text and
rfc822 format available.
Message #23 received at 35592 <at> debbugs.gnu.org (full text, mbox):
>>> But notice that these semantically clash with what you
>>> earlier wanted for 'split-window':
>>>
>>> ((eq side 'above) 'top)
>>> ((eq side 'below) 'bottom)
>>
>> I remember that recently you added these aliases:
>>
>> up -> above
>> down -> below
>>
>> that fits well into this scheme.
>>
>> But I don't know about
>>
>> above -> top
>> below -> bottom
>>
>> These are some earlier additions. Is there a problem with these aliases?
>
> I misremembered things. They affect side windows only. But how about
> using 'topmost' and 'bottommost' instead of 'top' and 'bottom'? These
> would fit more nicely into the 'leftmost' and 'rightmost' scheme.
'bottommost' is too ugly word ;)
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#35592
; Package
emacs
.
(Fri, 10 May 2019 05:35:02 GMT)
Full text and
rfc822 format available.
Message #26 received at 35592 <at> debbugs.gnu.org (full text, mbox):
> From: Juri Linkov <juri <at> linkov.net>
> Date: Thu, 09 May 2019 22:50:41 +0300
> Cc: 35592 <at> debbugs.gnu.org
>
> 'bottommost' is too ugly word ;)
There's nothing ugly about it, IMO. We already use it in a few places
in the manuals.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#35592
; Package
emacs
.
(Sat, 11 May 2019 21:13:02 GMT)
Full text and
rfc822 format available.
Message #29 received at 35592 <at> debbugs.gnu.org (full text, mbox):
>> 'bottommost' is too ugly word ;)
>
> There's nothing ugly about it, IMO. We already use it in a few places
> in the manuals.
Using bottommost as superlative of bottom sounds as weird as using
bestest instead of best.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#35592
; Package
emacs
.
(Sun, 12 May 2019 02:32:01 GMT)
Full text and
rfc822 format available.
Message #32 received at 35592 <at> debbugs.gnu.org (full text, mbox):
> From: Juri Linkov <juri <at> linkov.net>
> Cc: rudalics <at> gmx.at, 35592 <at> debbugs.gnu.org
> Date: Sat, 11 May 2019 23:48:41 +0300
>
> >> 'bottommost' is too ugly word ;)
> >
> > There's nothing ugly about it, IMO. We already use it in a few places
> > in the manuals.
>
> Using bottommost as superlative of bottom sounds as weird as using
> bestest instead of best.
You can use "bottom" if that fits.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#35592
; Package
emacs
.
(Sun, 12 May 2019 19:29:02 GMT)
Full text and
rfc822 format available.
Message #35 received at 35592 <at> debbugs.gnu.org (full text, mbox):
>> >> 'bottommost' is too ugly word ;)
>> >
>> > There's nothing ugly about it, IMO. We already use it in a few places
>> > in the manuals.
>>
>> Using bottommost as superlative of bottom sounds as weird as using
>> bestest instead of best.
>
> You can use "bottom" if that fits.
Currently the 'side' arg of display-buffer-in-side-window
uses such repertoire of possible values:
left, right, top, bottom
whereas the proposed display-buffer-in-direction
for relative window positioning:
left, right, above/up, below/down
Since 'top' and 'bottom' are precluded for relative positioning anyway,
'top' and 'bottom' are free to be used for absolute positioning:
leftmost, rightmost, top, bottom
If the goal is to try to achieve consistency with
display-buffer-in-side-window, then it makes more sense
to think about using 'leftmost' and 'rightmost' in
display-buffer-in-side-window, but maybe there is no need
for such consistency.
Using 'bottom' and 'below' will also provide backward-compatibility of
names with display-buffer-at-bottom and display-buffer-below-selected.
There is also display-buffer--maybe-at-bottom, but I need help
from Martin because I don't understand how to replace
display-buffer--maybe-at-bottom using display-buffer-in-direction.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#35592
; Package
emacs
.
(Sun, 19 May 2019 09:18:02 GMT)
Full text and
rfc822 format available.
Message #38 received at 35592 <at> debbugs.gnu.org (full text, mbox):
>>> 'bottommost' is too ugly word ;)
>>
>> There's nothing ugly about it, IMO. We already use it in a few places
>> in the manuals.
>
> Using bottommost as superlative of bottom sounds as weird as using
> bestest instead of best.
I pushed to master the version you preferred. Please have a look (in
particular at the documentation).
Thanks, martin
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#35592
; Package
emacs
.
(Sun, 19 May 2019 09:18:02 GMT)
Full text and
rfc822 format available.
Message #41 received at 35592 <at> debbugs.gnu.org (full text, mbox):
> There is also display-buffer--maybe-at-bottom, but I need help
> from Martin because I don't understand how to replace
> display-buffer--maybe-at-bottom using display-buffer-in-direction.
What are you missing? I suppose you'd just have to prepend an
additional alist entry like (direction . bottom).
martin
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#35592
; Package
emacs
.
(Sun, 19 May 2019 20:08:02 GMT)
Full text and
rfc822 format available.
Message #44 received at 35592 <at> debbugs.gnu.org (full text, mbox):
> I pushed to master the version you preferred. Please have a look (in
> particular at the documentation).
Thanks! It seems everything is fine.
>> There is also display-buffer--maybe-at-bottom, but I need help
>> from Martin because I don't understand how to replace
>> display-buffer--maybe-at-bottom using display-buffer-in-direction.
>
> What are you missing? I suppose you'd just have to prepend an
> additional alist entry like (direction . bottom).
Do you mean that display-buffer--maybe-at-bottom should not be
obsoleted? I.e. just to replace the call to display-buffer-at-bottom
in it with display-buffer-in-direction and that's all?
Also I noticed your comments about rewriting display-buffer-at-bottom.
Do you mean just to replace its body with the call to
display-buffer-in-direction, or obsolete it altogether and
replace all its uses with display-buffer-in-direction?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#35592
; Package
emacs
.
(Mon, 20 May 2019 08:26:02 GMT)
Full text and
rfc822 format available.
Message #47 received at 35592 <at> debbugs.gnu.org (full text, mbox):
> Do you mean that display-buffer--maybe-at-bottom should not be
> obsoleted? I.e. just to replace the call to display-buffer-at-bottom
> in it with display-buffer-in-direction and that's all?
I think 'display-buffer-at-bottom' should be still available via
'display-buffer--action-function-custom-type' so I think we cannot
make it obsolete. Also I didn't add 'display-buffer-in-direction'
there because we should decide first on how to proceed with it.
> Also I noticed your comments about rewriting display-buffer-at-bottom.
> Do you mean just to replace its body with the call to
> display-buffer-in-direction, or obsolete it altogether and
> replace all its uses with display-buffer-in-direction?
The former (it's a three liner). But maybe some work remains wrt
action arguments like 'window-min-height', 'window-height' and
friends. I doubt that you have already exhausted all possibilities.
martin
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#35592
; Package
emacs
.
(Mon, 20 May 2019 20:44:02 GMT)
Full text and
rfc822 format available.
Message #50 received at 35592 <at> debbugs.gnu.org (full text, mbox):
>> Also I noticed your comments about rewriting display-buffer-at-bottom.
>> Do you mean just to replace its body with the call to
>> display-buffer-in-direction, or obsolete it altogether and
>> replace all its uses with display-buffer-in-direction?
>
> The former (it's a three liner). But maybe some work remains wrt
> action arguments like 'window-min-height', 'window-height' and
> friends. I doubt that you have already exhausted all possibilities.
Why three-liner? I see one-liners in your comments. I tried to
replace the whole display-buffer-below-selected with your one-liner
(display-buffer-in-direction buffer (cons '(direction . below) alist))
and also the whole display-buffer-at-bottom with your one-liner
(display-buffer-in-direction buffer (cons '(direction . bottom) alist))
and everything works fine, I see no problems.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#35592
; Package
emacs
.
(Tue, 21 May 2019 07:33:02 GMT)
Full text and
rfc822 format available.
Message #53 received at 35592 <at> debbugs.gnu.org (full text, mbox):
>> The former (it's a three liner). But maybe some work remains wrt
>> action arguments like 'window-min-height', 'window-height' and
>> friends. I doubt that you have already exhausted all possibilities.
>
> Why three-liner? I see one-liners in your comments.
I meant the defun, the doc-string and the body.
> I tried to
> replace the whole display-buffer-below-selected with your one-liner
> (display-buffer-in-direction buffer (cons '(direction . below) alist))
> and also the whole display-buffer-at-bottom with your one-liner
> (display-buffer-in-direction buffer (cons '(direction . bottom) alist))
> and everything works fine, I see no problems.
'display-buffer-in-direction' doesn't yet process 'window-min-height'
(and 'window-min-width') entries correctly. I still have to set up
semantics for these ...
martin
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#35592
; Package
emacs
.
(Tue, 21 May 2019 20:21:02 GMT)
Full text and
rfc822 format available.
Message #56 received at 35592 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
> 'display-buffer-in-direction' doesn't yet process 'window-min-height'
> (and 'window-min-width') entries correctly. I still have to set up
> semantics for these ...
Meanwhile I'm trying to use the new function and it works fine:
[display-buffer-in-direction-use.patch (text/x-diff, inline)]
diff --git a/lisp/proced.el b/lisp/proced.el
index ce379a7c6a..b05046bfbd 100644
--- a/lisp/proced.el
+++ b/lisp/proced.el
@@ -1744,9 +1744,10 @@ proced-with-processes-buffer
(save-window-excursion
;; Analogous to `dired-pop-to-buffer'
;; Don't split window horizontally. (Bug#1806)
- (let (split-width-threshold)
- (pop-to-buffer (current-buffer)))
- (fit-window-to-buffer (get-buffer-window) nil 1)
+ (display-buffer (current-buffer)
+ '(display-buffer-in-direction
+ (direction . bottom)
+ (window-height . fit-window-to-buffer)))
,@body))))
(defun proced-send-signal (&optional signal process-alist)
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el
index 713c8575c7..a6420c42c0 100644
--- a/lisp/wid-edit.el
+++ b/lisp/wid-edit.el
@@ -251,7 +251,10 @@ widget-choose
(define-key map [?\M--] 'negative-argument)
(save-window-excursion
(let ((buf (get-buffer " widget-choose")))
- (fit-window-to-buffer (display-buffer buf))
+ (display-buffer buf
+ '(display-buffer-in-direction
+ (direction . bottom)
+ (window-height . fit-window-to-buffer)))
(let ((cursor-in-echo-area t)
(arg 1))
(while (not value)
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#35592
; Package
emacs
.
(Wed, 22 May 2019 08:32:02 GMT)
Full text and
rfc822 format available.
Message #59 received at 35592 <at> debbugs.gnu.org (full text, mbox):
> Meanwhile I'm trying to use the new function and it works fine:
Fell free to install - we'll notice any bugs soon enough.
martin
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#35592
; Package
emacs
.
(Wed, 05 Jun 2019 20:59:01 GMT)
Full text and
rfc822 format available.
Message #62 received at 35592 <at> debbugs.gnu.org (full text, mbox):
>> Meanwhile I'm trying to use the new function and it works fine:
>
> Fell free to install - we'll notice any bugs soon enough.
Installed. Before closing this request we also need to replace
display-buffer-below-selected and display-buffer-at-bottom with
three liner.
This bug report was last modified 6 years and 11 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.