GNU bug report logs - #35592
Use display-buffer-in-direction for completion-like windows

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Sun, 5 May 2019 20:43:01 UTC

Severity: normal

To reply to this bug, email your comments to 35592 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


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):

From: Juri Linkov <juri <at> linkov.net>
To: bug-gnu-emacs <at> gnu.org
Subject: Use display-buffer-in-direction for completion-like windows
Date: Sun, 05 May 2019 23:40:10 +0300
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):

From: martin rudalics <rudalics <at> gmx.at>
To: Juri Linkov <juri <at> linkov.net>, 35592 <at> debbugs.gnu.org
Subject: Re: bug#35592: Use display-buffer-in-direction for completion-like
 windows
Date: Tue, 7 May 2019 10:14:31 +0200
> 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):

From: Juri Linkov <juri <at> linkov.net>
To: martin rudalics <rudalics <at> gmx.at>
Cc: 35592 <at> debbugs.gnu.org
Subject: Re: bug#35592: Use display-buffer-in-direction for completion-like
 windows
Date: Wed, 08 May 2019 00:30:24 +0300
[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):

From: martin rudalics <rudalics <at> gmx.at>
To: Juri Linkov <juri <at> linkov.net>
Cc: 35592 <at> debbugs.gnu.org
Subject: Re: bug#35592: Use display-buffer-in-direction for completion-like
 windows
Date: Wed, 8 May 2019 11:09:50 +0200
[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):

From: Juri Linkov <juri <at> linkov.net>
To: martin rudalics <rudalics <at> gmx.at>
Cc: 35592 <at> debbugs.gnu.org
Subject: Re: bug#35592: Use display-buffer-in-direction for completion-like
 windows
Date: Wed, 08 May 2019 22:32:10 +0300
>> 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):

From: martin rudalics <rudalics <at> gmx.at>
To: Juri Linkov <juri <at> linkov.net>
Cc: 35592 <at> debbugs.gnu.org
Subject: Re: bug#35592: Use display-buffer-in-direction for completion-like
 windows
Date: Thu, 9 May 2019 10:12:12 +0200
>> 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):

From: Juri Linkov <juri <at> linkov.net>
To: martin rudalics <rudalics <at> gmx.at>
Cc: 35592 <at> debbugs.gnu.org
Subject: Re: bug#35592: Use display-buffer-in-direction for completion-like
 windows
Date: Thu, 09 May 2019 22:50:41 +0300
>>> 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: Eli Zaretskii <eliz <at> gnu.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: rudalics <at> gmx.at, 35592 <at> debbugs.gnu.org
Subject: Re: bug#35592: Use display-buffer-in-direction for completion-like
 windows
Date: Fri, 10 May 2019 08:34:27 +0300
> 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):

From: Juri Linkov <juri <at> linkov.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: rudalics <at> gmx.at, 35592 <at> debbugs.gnu.org
Subject: Re: bug#35592: Use display-buffer-in-direction for completion-like
 windows
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.




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: Eli Zaretskii <eliz <at> gnu.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: rudalics <at> gmx.at, 35592 <at> debbugs.gnu.org
Subject: Re: bug#35592: Use display-buffer-in-direction for completion-like
 windows
Date: Sun, 12 May 2019 05:31:11 +0300
> 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):

From: Juri Linkov <juri <at> linkov.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: rudalics <at> gmx.at, 35592 <at> debbugs.gnu.org
Subject: Re: bug#35592: Use display-buffer-in-direction for completion-like
 windows
Date: Sun, 12 May 2019 22:17:16 +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.

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):

From: martin rudalics <rudalics <at> gmx.at>
To: Juri Linkov <juri <at> linkov.net>, Eli Zaretskii <eliz <at> gnu.org>
Cc: 35592 <at> debbugs.gnu.org
Subject: Re: bug#35592: Use display-buffer-in-direction for completion-like
 windows
Date: Sun, 19 May 2019 11:17:20 +0200
>>> '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):

From: martin rudalics <rudalics <at> gmx.at>
To: Juri Linkov <juri <at> linkov.net>, Eli Zaretskii <eliz <at> gnu.org>
Cc: 35592 <at> debbugs.gnu.org
Subject: Re: bug#35592: Use display-buffer-in-direction for completion-like
 windows
Date: Sun, 19 May 2019 11:17:31 +0200
> 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):

From: Juri Linkov <juri <at> linkov.net>
To: martin rudalics <rudalics <at> gmx.at>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 35592 <at> debbugs.gnu.org
Subject: Re: bug#35592: Use display-buffer-in-direction for completion-like
 windows
Date: Sun, 19 May 2019 22:54:47 +0300
> 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):

From: martin rudalics <rudalics <at> gmx.at>
To: Juri Linkov <juri <at> linkov.net>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 35592 <at> debbugs.gnu.org
Subject: Re: bug#35592: Use display-buffer-in-direction for completion-like
 windows
Date: Mon, 20 May 2019 10:25:31 +0200
> 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):

From: Juri Linkov <juri <at> linkov.net>
To: martin rudalics <rudalics <at> gmx.at>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 35592 <at> debbugs.gnu.org
Subject: Re: bug#35592: Use display-buffer-in-direction for completion-like
 windows
Date: Mon, 20 May 2019 23:36:33 +0300
>> 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):

From: martin rudalics <rudalics <at> gmx.at>
To: Juri Linkov <juri <at> linkov.net>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 35592 <at> debbugs.gnu.org
Subject: Re: bug#35592: Use display-buffer-in-direction for completion-like
 windows
Date: Tue, 21 May 2019 09:32:43 +0200
>> 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):

From: Juri Linkov <juri <at> linkov.net>
To: martin rudalics <rudalics <at> gmx.at>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 35592 <at> debbugs.gnu.org
Subject: Re: bug#35592: Use display-buffer-in-direction for completion-like
 windows
Date: Tue, 21 May 2019 23:18:30 +0300
[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):

From: martin rudalics <rudalics <at> gmx.at>
To: Juri Linkov <juri <at> linkov.net>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 35592 <at> debbugs.gnu.org
Subject: Re: bug#35592: Use display-buffer-in-direction for completion-like
 windows
Date: Wed, 22 May 2019 10:31:13 +0200
> 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):

From: Juri Linkov <juri <at> linkov.net>
To: martin rudalics <rudalics <at> gmx.at>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 35592 <at> debbugs.gnu.org
Subject: Re: bug#35592: Use display-buffer-in-direction for completion-like
 windows
Date: Wed, 05 Jun 2019 23:57:20 +0300
>> 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.