all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: martin rudalics <rudalics@gmx.at>
Cc: 35592@debbugs.gnu.org
Subject: bug#35592: Use display-buffer-in-direction for completion-like windows
Date: Wed, 08 May 2019 00:30:24 +0300	[thread overview]
Message-ID: <8736lq54wf.fsf@mail.linkov.net> (raw)
In-Reply-To: <6d8899a4-18be-56cb-d820-7906d7ed0ee9@gmx.at> (martin rudalics's message of "Tue, 7 May 2019 10:14:31 +0200")

[-- Attachment #1: Type: text/plain, Size: 534 bytes --]

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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: use-display-buffer-in-direction.patch --]
[-- Type: text/x-diff, Size: 1409 bytes --]

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)

  reply	other threads:[~2019-05-07 21:30 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-05 20:40 bug#35592: Use display-buffer-in-direction for completion-like windows Juri Linkov
2019-05-07  8:14 ` martin rudalics
2019-05-07 21:30   ` Juri Linkov [this message]
2019-05-08  9:09     ` martin rudalics
2019-05-08 19:32       ` Juri Linkov
2019-05-09  8:12         ` martin rudalics
2019-05-09 19:50           ` Juri Linkov
2019-05-10  5:34             ` Eli Zaretskii
2019-05-11 20:48               ` Juri Linkov
2019-05-12  2:31                 ` Eli Zaretskii
2019-05-12 19:17                   ` Juri Linkov
2019-05-19  9:17                     ` martin rudalics
2019-05-19 19:54                       ` Juri Linkov
2019-05-20  8:25                         ` martin rudalics
2019-05-20 20:36                           ` Juri Linkov
2019-05-21  7:32                             ` martin rudalics
2019-05-21 20:18                               ` Juri Linkov
2019-05-22  8:31                                 ` martin rudalics
2019-06-05 20:57                                   ` Juri Linkov
2019-05-19  9:17                 ` martin rudalics

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8736lq54wf.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=35592@debbugs.gnu.org \
    --cc=rudalics@gmx.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.