From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#1806: dired-pop-to-buffer in wrong place Date: Wed, 26 Sep 2012 09:24:00 +0300 Organization: JURTA Message-ID: <87pq59z3nr.fsf@mail.jurta.org> References: <87r63gzcap.fsf@jurta.org> <505DBC23.5040907@gmx.at> <87y5k1lhn6.fsf@mail.jurta.org> <505ED4BB.3030103@gmx.at> <87txunj0ej.fsf@mail.jurta.org> <50602A8D.6010203@gmx.at> <8739261q8h.fsf@mail.jurta.org> <5061807D.1010401@gmx.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1348642146 30284 80.91.229.3 (26 Sep 2012 06:49:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 26 Sep 2012 06:49:06 +0000 (UTC) Cc: 1806@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Sep 26 08:49:09 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TGlQj-0005rA-7A for geb-bug-gnu-emacs@m.gmane.org; Wed, 26 Sep 2012 08:49:09 +0200 Original-Received: from localhost ([::1]:41649 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGlQe-0008TC-9R for geb-bug-gnu-emacs@m.gmane.org; Wed, 26 Sep 2012 02:49:04 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:57143) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGlQb-0008S3-2y for bug-gnu-emacs@gnu.org; Wed, 26 Sep 2012 02:49:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TGlQZ-0007xm-An for bug-gnu-emacs@gnu.org; Wed, 26 Sep 2012 02:49:00 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:46653) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGlQZ-0007xi-7V for bug-gnu-emacs@gnu.org; Wed, 26 Sep 2012 02:48:59 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TGlSY-0005vX-GX for bug-gnu-emacs@gnu.org; Wed, 26 Sep 2012 02:51:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 26 Sep 2012 06:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 1806 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 1806-submit@debbugs.gnu.org id=B1806.134864222822743 (code B ref 1806); Wed, 26 Sep 2012 06:51:02 +0000 Original-Received: (at 1806) by debbugs.gnu.org; 26 Sep 2012 06:50:28 +0000 Original-Received: from localhost ([127.0.0.1]:56199 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TGlRz-0005ul-QH for submit@debbugs.gnu.org; Wed, 26 Sep 2012 02:50:28 -0400 Original-Received: from ps18281.dreamhost.com ([69.163.218.105]:45761 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TGlRw-0005uc-7K for 1806@debbugs.gnu.org; Wed, 26 Sep 2012 02:50:26 -0400 Original-Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 8C327451CD0D; Tue, 25 Sep 2012 23:48:16 -0700 (PDT) In-Reply-To: <5061807D.1010401@gmx.at> (martin rudalics's message of "Tue, 25 Sep 2012 11:59:25 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (x86_64-pc-linux-gnu) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:64904 Archived-At: > Just that splitting the root will resize all windows proportionally and > I just have another thread were people don't like that (recall that you > want to do that for a large number of files). Yes, there are more problems with `display-buffer-at-bottom' that could be fixed later. This is why I don't propose to make it default now. But still we should fix the problems with the current default action `display-buffer-below-selected' because they are regressions. >> Then a new function with a name like `with-temp-buffer-window-pop-up' >> might be necessary to use it in Dired, Proced, VC > > VC currently doesn't use `temp-buffer-resize-mode' and I'm not sure > whether we should use `with-temp-buffer-window' for it. Like Dired and Proced, VC shrinks the window to fit the buffer in `log-edit-show-files', so it could use `with-temp-buffer-window' too if it will retain the original behavior in the affected commands. > It was earlier via `special-display-buffer-names' and > `special-display-regexps' and is now via `display-buffer-alist'. You > just have to write the corresponding buffer display function. The > problem is that nobody liked my earlier approach to combine specifiers. > So you now have to code within these functions how you want to display > the buffer and possibly resize its window. There is no need to combine specifiers and no need to add `temp-buffer-resize-regexps'. In your current implementation it's perfectly possible to use the following call in `dired-mark-pop-up': (with-temp-buffer-window buffer (cons 'display-buffer-below-selected '((fit-window-to-buffer . t))) ... and to add the following code to `display-buffer-below-selected' (copied and adapted from `dired-pop-to-buffer'): (defun display-buffer-below-selected (buffer alist) "Try displaying BUFFER in a window below the selected window. This either splits the selected window or reuses the window below the selected one." (let (window) (or (and (not (frame-parameter nil 'unsplittable)) (setq window (window--try-to-split-window (selected-window))) (window--display-buffer buffer window 'window display-buffer-mark-dedicated)) (and (setq window (window-in-direction 'below)) (not (window-dedicated-p window)) (window--display-buffer buffer window 'reuse display-buffer-mark-dedicated))) ;; See Bug#12281. (set-window-start window (point-min)) ;; If fit-window-to-buffer is t, make its window fit its contents. (when (cdr (assq 'fit-window-to-buffer alist)) ;; Try to not delete window when we want to display less than ;; `window-min-height' lines. (fit-window-to-buffer window nil 1)) window)) > Too many people don't like to automatically fit windows to > their buffers. They must be able to turn that off. With the fixes above, users will be able to turn that off by customizing `display-buffer-alist' to the following value (this should be done via the Customization UI, but `setq' is used below for testing purposes): (setq display-buffer-alist '(("Marked Files" . (display-buffer-below-selected (fit-window-to-buffer . nil)))))