From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Konrad Podczeck Newsgroups: gmane.emacs.bugs Subject: bug#37840: Missing in the Emacs manuals: Date: Wed, 23 Oct 2019 09:25:00 +0200 Message-ID: <81790531-20E9-4919-A485-0D8FE6F60CE1@univie.ac.at> References: <5440997d-8f3f-12f9-ae9e-c0caadde4a01@gmx.at> Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3594.4.19\)) Content-Type: multipart/alternative; boundary="Apple-Mail=_7B210E48-6D56-4EBE-BC06-C79349C6ABD5" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="178267"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 37840@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Oct 23 09:34:51 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iNBAP-000kFe-Tv for geb-bug-gnu-emacs@m.gmane.org; Wed, 23 Oct 2019 09:34:50 +0200 Original-Received: from localhost ([::1]:56244 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNBAO-0004eL-6z for geb-bug-gnu-emacs@m.gmane.org; Wed, 23 Oct 2019 03:34:48 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41776) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNB1z-0004UL-Mn for bug-gnu-emacs@gnu.org; Wed, 23 Oct 2019 03:26:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNB1w-0007XM-2y for bug-gnu-emacs@gnu.org; Wed, 23 Oct 2019 03:26:07 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51956) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNB1u-0007W6-8m for bug-gnu-emacs@gnu.org; Wed, 23 Oct 2019 03:26:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iNB1u-0002Mh-30 for bug-gnu-emacs@gnu.org; Wed, 23 Oct 2019 03:26:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Konrad Podczeck Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 23 Oct 2019 07:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37840 X-GNU-PR-Package: emacs Original-Received: via spool by 37840-submit@debbugs.gnu.org id=B37840.15718155079019 (code B ref 37840); Wed, 23 Oct 2019 07:26:02 +0000 Original-Received: (at 37840) by debbugs.gnu.org; 23 Oct 2019 07:25:07 +0000 Original-Received: from localhost ([127.0.0.1]:60777 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iNB10-0002LL-Rg for submit@debbugs.gnu.org; Wed, 23 Oct 2019 03:25:07 -0400 Original-Received: from grace.univie.ac.at ([131.130.3.115]:35408) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iNB0x-0002L8-Qi for 37840@debbugs.gnu.org; Wed, 23 Oct 2019 03:25:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=univie.ac.at; s=rev2; h=To:References:Message-Id:Cc:Date:In-Reply-To:From: Subject:Mime-Version:Content-Type:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=mTBjriHiyNfXtsfTI7lGGho/po7m7YQt5LJ9sujBhq8=; b=T8rw2betE0ksecOJxrlVOkzVFw 6O0fijko2MVXM0sFi0tdRWNpJIQdxxxHbTBUt7JjdNipux64SAut9gNcqDyz+qnTlYdvlDl+Qj7ws towDT0TWSULMbWQzeSIraEys9G4gzb8xUSQFbfFBgqr95iQlatRE05JKxHS9SW5arJhQ=; Original-Received: from justin.univie.ac.at ([131.130.3.111] helo=justin.univie.ac.at) by grace.univie.ac.at with esmtps (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92.2) (envelope-from ) id 1iNB0v-0006Fq-IV; Wed, 23 Oct 2019 09:25:01 +0200 Original-Received: from 80-109-8-38.cable.dynamic.surfer.at ([80.109.8.38] helo=[192.168.0.234]) by justin.univie.ac.at with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) (envelope-from ) id 1iNB0v-00057d-5J; Wed, 23 Oct 2019 09:25:01 +0200 In-Reply-To: <5440997d-8f3f-12f9-ae9e-c0caadde4a01@gmx.at> X-Mailer: Apple Mail (2.3594.4.19) X-Univie-Virus-Scan: scanned by ClamAV on justin.univie.ac.at X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.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" Xref: news.gmane.org gmane.emacs.bugs:170029 Archived-At: --Apple-Mail=_7B210E48-6D56-4EBE-BC06-C79349C6ABD5 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Thanks for your reply. Working on the stuff, I encountered the following = problem: If, in =E2=80=9C display-buffer-alist=E2=80=9D, I have the = entry: ("[ ]?Packages[ ]?" (display-buffer-reuse-window = display-buffer-pop-up-frame) (pop-up-frame-parameters (tool-bar-lines . 1) (left . 1) (left-fringe . 2) (top . 0) (height . 65) (width . 149) (font . "SF MONO-18") (line-spacing . 3) )) then, contrary to what is promised, this does not pop up a new frame. I = figured out that the problem goes away if, in =E2=80=9Cpackages.el=E2=80=9D= , I replace in the defun =E2=80=9Clist-packages=E2=80=9D the code = (switch-to-buffer buf) by (pop-to-buffer buf). My question is how to do = this on the level of customizing =E2=80=9Cdisplay-buffer-alist=E2=80=9D. = I didn=E2=80=99t find anything in this regard in the manuals. > Am 22.10.2019 um 10:43 schrieb martin rudalics : >=20 > > There is no detailed example in the emacs manuals on how to migrate > > from using "special-display-frame-alist" and > > "special-display-regexps" to "display-buffer-alist." >=20 > I'm not sure whether I'll be able to come up with something reasonable > in this regard, mainly because I've never been able to understand the > special display function mechanism. >=20 > > E.g., how to migrate from > > > > (setq special-display-frame-alist > > (quote > > ((height . 42) > > (width . 83) > > (left . 770) > > (unsplittable) > > (tool-bar-lines . 0) > > (left-fringe . 0) > > (right-fringe . 0) > > (line-spacing . 0) > > (font . "Monaco-12") > > (top . 110)))) > > > > and > > > > (setq special-display-regexps '((".*output*" (right-fringe . 0) = (left-fringe . 0) (top . 330) (left . 152) > > (width . 86) (height . 32) > > (tool-bar-lines . 0) (font . "Menlo-10") (menu-bar-lines . 0))) >=20 > You can try the following untested snippet (your regxp looks a bit > odd, BTW): >=20 > (setq my-special-display-frame-alist > (quote > ((height . 42) > (width . 83) > (left . 770) > (unsplittable) > (tool-bar-lines . 0) > (left-fringe . 0) > (right-fringe . 0) > (line-spacing . 0) > (font . "Monaco-12") > (top . 110)))) >=20 > (setq my-special-display-regexps > '((".*output*" > (right-fringe . 0) > (left-fringe . 0) > (top . 330) > (left . 152) > (width . 86) > (height . 32) > (tool-bar-lines . 0) > (font . "Menlo-10") > (menu-bar-lines . 0)))) >=20 > (setq display-buffer-alist > `((".*output*" > (display-buffer-reuse-window > ; display-buffer-same-window > ; display-buffer-pop-up-window > display-buffer-pop-up-frame) > (reusable-frames . 0) (inhibit-switch-frame . nil) > (pop-up-frame-parameters . ,(append (cdr = my-special-display-regexps) > = special-display-frame-alist))))) >=20 > where you have to comment-in the respective alist functions when you > use 'same-window' or 'same-frame' in your 'special-display-regexps' > settings (apparently you don't). >=20 > I can put a similar example into the Elisp manual (Eli would have to > figure out the details to omit or add) but note the following two not > entirely negligible differences: >=20 > 'special-display-popup-frame' (the default for > 'special-display-function') uses >=20 > (when (cdr (assq 'same-window args)) > (condition-case nil > (progn (switch-to-buffer buffer nil t) (selected-window)) > (error nil))) >=20 > which has no direct equivalent in the 'display-buffer-alist' > ecosystem. I used 'display-buffer-same-window' instead but that does > not obey options like 'switch-to-buffer-in-dedicated-window' or > 'switch-to-buffer-preserve-window-point'. Which means that for a > faithful migration you would have to write your own action function > here. >=20 > The second difference derives from the fact that > 'special-display-popup-frame' marks the window on a new frame as > dedicated to its buffer. This is no more needed in the > 'display-buffer-alist' world because there the 'quit-restore' window > parameter takes care of the problem the former tries to solve. Still > this means a behavioral difference that should be mentioned. I > _cannot_ add a non-nil 'dedicated' alist entry because that would be > applied by any other action function ('display-buffer-pop-up-window' > foremost) too. >=20 > Also I have left out details like the function to be called when the > car of the ARGS argument of 'special-display-popup-frame' is a symbol > or how to treat 'special-display-buffer-names' ... >=20 > martin --Apple-Mail=_7B210E48-6D56-4EBE-BC06-C79349C6ABD5 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Thanks for your reply. Working on the stuff, I encountered = the following problem: If, in =E2=80=9C display-buffer-alist=E2=80=9D, I = have the entry:

      ("[ ]?Packages[ ]?" = (display-buffer-reuse-window display-buffer-pop-up-frame)
       (pop-up-frame-parameters
        (tool-bar-lines . 1)
= (left . 1)
(left-fringe . 2)
        (top . 0)
= (height . 65)
(width . 149)
= (font . "SF MONO-18")
      =   (line-spacing . 3)
= ))

then, = contrary to what is promised, this does not pop up a new frame. I = figured out that the problem goes away if, in =E2=80=9Cpackages.el=E2=80=9D= , I replace in the defun =E2=80=9Clist-packages=E2=80=9D the  code = (switch-to-buffer buf) by (pop-to-buffer buf). My question is how to do = this on the level of customizing =E2=80=9Cdisplay-buffer-alist=E2=80=9D. = I didn=E2=80=99t find anything in this regard in the manuals.




Am 22.10.2019 um 10:43 schrieb martin = rudalics <rudalics@gmx.at>:

> There is no detailed = example in the emacs manuals on how to migrate
> from using = "special-display-frame-alist" and
> "special-display-regexps" to = "display-buffer-alist."

I'm not sure whether I'll be able to come up with something = reasonable
in this = regard, mainly because I've never been able to understand the
special display function = mechanism.

> E.g., = how to migrate from
>
> (setq special-display-frame-alist
> =     (quote
>      ((height . 42)
> =      (width . 83)
>      (left . 770)
> =      (unsplittable)
> =      (tool-bar-lines . 0)
> =      (left-fringe . 0)
> =      (right-fringe . 0)
> =      (line-spacing . 0)
> =      (font . "Monaco-12")
> =      (top . 110))))
>
>   and
>
> (setq = special-display-regexps '((".*output*" (right-fringe . 0) (left-fringe . = 0) (top . 330) (left . 152)
>    (width . 86) (height . 32)
> =    (tool-bar-lines . 0) (font . "Menlo-10") = (menu-bar-lines . 0)))

You can try the following untested snippet (your regxp looks = a bit
odd, = BTW):

(setq = my-special-display-frame-alist
     (quote
      ((height . 42)
(width . = 83)
(left . 770)
= (unsplittable)
= (tool-bar-lines= . 0)
(left-fringe . 0)
= (right-fringe = . 0)
(line-spacing . 0)
= (font . = "Monaco-12")
(top . 110))))

(setq my-special-display-regexps
     '((".*output*"
 (right-fringe . = 0)
 (left-fringe= . 0)
 (top . = 330)
 (left . = 152)
 (width . = 86)
 (height . = 32)
 (tool-bar-lines . = 0)
 (font . = "Menlo-10")
 (menu-bar-lines . = 0))))

(setq = display-buffer-alist
     `((".*output*"
 (display-buffer-reuse-window<= /span>
  ; = display-buffer-same-window
=   ; = display-buffer-pop-up-window
=   display-buffer-pop-up-f= rame)
 (reusable-frames . 0) = (inhibit-switch-frame . nil)
=  (pop-up-frame-parameters . = ,(append (cdr my-special-display-regexps)
= =       = ; special-display-frame-alist)))))

where you have to comment-in the respective alist functions = when you
use = 'same-window' or 'same-frame' in your = 'special-display-regexps'
settings (apparently you don't).

I can put a similar example into = the Elisp manual (Eli would have to
figure out the details to omit or add) but note the following = two not
entirely = negligible differences:

'special-display-popup-frame' (the default for
'special-display-function') = uses

      (when (cdr (assq = 'same-window args))
=  (condition-case = nil
     (prog= n (switch-to-buffer buffer nil t) (selected-window))
   (error = nil)))

which has no = direct equivalent in the 'display-buffer-alist'
ecosystem.  I used = 'display-buffer-same-window' instead but that does
not obey options like = 'switch-to-buffer-in-dedicated-window' or
'switch-to-buffer-preserve-window-point'.  Which means = that for a
faithful = migration you would have to write your own action function
here.

The second difference derives = from the fact that
'special-display-popup-frame' marks the window on a new frame = as
dedicated to = its buffer.  This is no more needed in the
'display-buffer-alist' world = because there the 'quit-restore' window
parameter takes care of the problem the former tries to = solve.  Still
this means a behavioral difference that should be mentioned. =  I
_cannot_ add = a non-nil 'dedicated' alist entry because that would be
applied by any other action = function ('display-buffer-pop-up-window'
foremost) too.

Also I have left out details like the function to be called = when the
car of the = ARGS argument of 'special-display-popup-frame' is a symbol
or how to treat = 'special-display-buffer-names' ...

martin

= --Apple-Mail=_7B210E48-6D56-4EBE-BC06-C79349C6ABD5--