unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* obsolete variable, use 2nd arg of `display-buffer' instead
@ 2011-06-21 22:14 Sam Steingold
  2011-06-22 12:33 ` martin rudalics
  0 siblings, 1 reply; 3+ messages in thread
From: Sam Steingold @ 2011-06-21 22:14 UTC (permalink / raw)
  To: emacs-devel

Hi,
variables special-display-buffer-names, special-display-regexps et al
are now obsolete and replaced with display-buffer-alist.
alas, I cannot figure out how to replace my settings.

E.g., I used to do
 (custom-set-variables
 '(special-display-buffer-names ("*info*" ...))
 '(special-display-regexps '("^*Customize " "^*Shell " "^*WoMan "))
 '(same-window-buffer-names '("*Diff*"))
 ...)
 what do I replace them with?
I tried this:

(custom-set-variables
 '(Man-frame-parameters
   `((height . ,(min 70 sds-frame-height)) (width . 80)
     (top . 35) (left . 0) (font . ,sds-small-font)) t)
 '(display-buffer-alist
      (cons
       `(((label . special) (regexp . "List\\*$")
          (regexp . "Help\\*$") (regexp . "Apropos") (regexp . "^*WoMan ")
          (regexp . "^*Customize ") (regexp . "^*Shell ")
          (name . "*info*"))
         pop-up-frame
         (pop-up-frame-alist . ,Man-frame-parameters))
       display-buffer-alist)))

this does not work for *info* (C-h i does not create a new frame).
this does not even attempt to handle "*Diff*" (how do I do that?)

So, what am I doing wrong?

PS  is there a way to tell custom-set-variables to push something on top
of the existing value instead of replacing it (like I do with cons above)?

-- 
Sam Steingold (http://sds.podval.org/) on CentOS release 5.6 (Final) X 11.0.60900031
http://openvotingconsortium.org http://ffii.org http://palestinefacts.org
http://pmw.org.il http://camera.org http://jihadwatch.org http://dhimmi.com
Modern man is the missing link between apes and human beings.




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: obsolete variable, use 2nd arg of `display-buffer' instead
  2011-06-21 22:14 obsolete variable, use 2nd arg of `display-buffer' instead Sam Steingold
@ 2011-06-22 12:33 ` martin rudalics
  2011-06-22 16:09   ` Sam Steingold
  0 siblings, 1 reply; 3+ messages in thread
From: martin rudalics @ 2011-06-22 12:33 UTC (permalink / raw)
  To: emacs-devel

 > variables special-display-buffer-names, special-display-regexps et al
 > are now obsolete and replaced with display-buffer-alist.
 > alas, I cannot figure out how to replace my settings.
 >
 > E.g., I used to do
 >  (custom-set-variables
 >  '(special-display-buffer-names ("*info*" ...))
 >  '(special-display-regexps '("^*Customize " "^*Shell " "^*WoMan "))
 >  '(same-window-buffer-names '("*Diff*"))
 >  ...)
 >  what do I replace them with?

At this very moment please don't replace them but try with the old
settings (and bear with the warnings).  The new code should respect the
old settings but it doesn't do so always.  So any feedback on this is
welcome.

 > I tried this:
 >
 > (custom-set-variables
 >  '(Man-frame-parameters
 >    `((height . ,(min 70 sds-frame-height)) (width . 80)
 >      (top . 35) (left . 0) (font . ,sds-small-font)) t)
 >  '(display-buffer-alist
 >       (cons
 >        `(((label . special) (regexp . "List\\*$")
 >           (regexp . "Help\\*$") (regexp . "Apropos") (regexp . "^*WoMan ")
 >           (regexp . "^*Customize ") (regexp . "^*Shell ")
 >           (name . "*info*"))
 >          pop-up-frame
 >          (pop-up-frame-alist . ,Man-frame-parameters))

"label" hardly works at the moment.  It will work as soon as calling
functions set this.  For the rest you've been lumping together all
regexps and names under one big specifier that will pop up a frame with
Man-frame-parameters.  Is is that what you see?  Where is your entry for
*Diff*?

 >        display-buffer-alist)))
 >
 > this does not work for *info* (C-h i does not create a new frame).
 > this does not even attempt to handle "*Diff*" (how do I do that?)
 >
 > So, what am I doing wrong?

Please try using the customization interface (personally, I've never set
this variable by hand) starting from scratch.  I spent some time writing
it just in order to remove combinations that are inherently not useful.

For example to handle:

*Diff* use a Name as identifier and as Method

"Reuse window" "Selected only" "Any buffer" "Selected frame only"


To handle "*^WoMan " use a Regexp as identifier and as Method

"Pop-up frame" with the corresponding paramter / value pairs.


It would be very important if you gave me some feedback on how this is
written.  So far only Drew Adams has tried to delve deeper into this but
I haven't had time yet to read his criticism.

 > PS  is there a way to tell custom-set-variables to push something on top
 > of the existing value instead of replacing it (like I do with cons above)?

The function `display-buffer-alist-set' should automatically convert
your Emacs 23 settings of all involved options to the according
`display-buffer-alist' settings.  However, due to some recent changes
I'm not sure whether it gets them right.  If you gave it a try, that
would be great!

martin



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: obsolete variable, use 2nd arg of `display-buffer' instead
  2011-06-22 12:33 ` martin rudalics
@ 2011-06-22 16:09   ` Sam Steingold
  0 siblings, 0 replies; 3+ messages in thread
From: Sam Steingold @ 2011-06-22 16:09 UTC (permalink / raw)
  To: emacs-devel

> * martin rudalics <ehqnyvpf@tzk.ng> [2011-06-22 14:33:35 +0200]:
>
>> I tried this:
>>
>> (custom-set-variables
>>  '(Man-frame-parameters
>>    `((height . ,(min 70 sds-frame-height)) (width . 80)
>>      (top . 35) (left . 0) (font . ,sds-small-font)) t)
>>  '(display-buffer-alist
>>       (cons
>>        `(((label . special) (regexp . "List\\*$")
>>           (regexp . "Help\\*$") (regexp . "Apropos") (regexp . "^*WoMan ")
>>           (regexp . "^*Customize ") (regexp . "^*Shell ")
>>           (name . "*info*"))
>>          pop-up-frame
>>          (pop-up-frame-alist . ,Man-frame-parameters))
>
> "label" hardly works at the moment.  It will work as soon as calling
> functions set this.  For the rest you've been lumping together all
> regexps and names under one big specifier that will pop up a frame with
> Man-frame-parameters.

that's exactly what I want.

>>        display-buffer-alist)))
>>
>> this does not work for *info* (C-h i does not create a new frame).
>> this does not even attempt to handle "*Diff*" (how do I do that?)
>>
>> So, what am I doing wrong?
>
> Please try using the customization interface (personally, I've never set
> this variable by hand) starting from scratch.  I spent some time writing
> it just in order to remove combinations that are inherently not useful.

I do not and will not use the customization ui.
I want my settings where I can read and modify them.

> The function `display-buffer-alist-set' should automatically convert
> your Emacs 23 settings of all involved options to the according
> `display-buffer-alist' settings.  However, due to some recent changes
> I'm not sure whether it gets them right.  If you gave it a try, that
> would be great!

it produces a lot of separate entries like
 (((name . "*acl-listener*"))
  fun-with-args
  (fun-with-args special-display-popup-frame #1#))
 (((name . "*scheme*"))
  fun-with-args
  (fun-with-args special-display-popup-frame #1#))
 (((name . "*allegro*"))
  fun-with-args
  (fun-with-args special-display-popup-frame #1#))
 (((name . "*cmu*"))
  fun-with-args
  (fun-with-args special-display-popup-frame #1#))

I think it would be better to group them together like I do above.

also, it converts same-window-buffer-names into 
 (((name . "*Diff*")) reuse-window (reuse-window same))
how is this different from
 (((regexp . ".*")) reuse-window (reuse-window nil same 0))
  
also, special-display-popup-frame is marked as obsolete, so
display-buffer-alist-set should not be producing it.

also, how is
 (.... fun-with-args (fun-with-args special-display-popup-frame #1#))
different from
 (.... pop-up-frame (pop-up-frame-alist ....))


-- 
Sam Steingold (http://sds.podval.org/) on CentOS release 5.6 (Final) X 11.0.60900031
http://dhimmi.com http://camera.org http://honestreporting.com
http://openvotingconsortium.org http://memri.org http://iris.org.il
Kleptomania: the ability to find stuff even before its owner loses it.




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-06-22 16:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-21 22:14 obsolete variable, use 2nd arg of `display-buffer' instead Sam Steingold
2011-06-22 12:33 ` martin rudalics
2011-06-22 16:09   ` Sam Steingold

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).