help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Scratch buffer on either side of current buffer


From: Christopher Dimech
Subject: Re: Scratch buffer on either side of current buffer
Date: Sat, 21 Nov 2020 17:43:56 +0100

For default I have done it this way

(defun abuffer (&optional width)
   "Accomodates window margins with WIDTH columns.
WIDTH is 5 by default, and can be set using the Universal Prefix
Argument \"C-u N M-x abuffer\"."
   (interactive)
   (unless width (setq width 3)) ; Defaults width
   (set-window-margins nil width width) )



> Sent: Saturday, November 21, 2020 at 5:12 PM
> From: "Christopher Dimech" <dimech@gmx.com>
> To: "Yuri Khan" <yuri.v.khan@gmail.com>
> Cc: "help-gnu-emacs" <help-gnu-emacs@gnu.org>, "Jamie Beardslee" 
> <jdb@jamzattack.xyz>
> Subject: Re: Scratch buffer on either side of current buffer
>
> 
> > Sent: Saturday, November 21, 2020 at 5:03 PM
> > From: "Yuri Khan" <yuri.v.khan@gmail.com>
> > To: "Christopher Dimech" <dimech@gmx.com>
> > Cc: "help-gnu-emacs" <help-gnu-emacs@gnu.org>, "Jamie Beardslee" 
> > <jdb@jamzattack.xyz>
> > Subject: Re: Scratch buffer on either side of current buffer
> >
> > On Sat, 21 Nov 2020 at 22:43, Christopher Dimech <dimech@gmx.com> wrote:
> > 
> > > > > I would like only to set the size of the two scratch buffers to
> > > > > be small by default (e.ge size 8), and my working buffer to stay
> > > > > in as my working buffer and take the remaining space in the middle
> > > > > of the screen.
> > > >
> > > > You’re sure you want what you asked for, and not something like
> > > > (set-window-margins nil 8 8)?
> > >
> > > That was my hack.  The plan was that the result would be your one
> > > liner.  Astonishing!
> > 
> > My point is that you should ask for the thing you need or want, not
> > for the approach that first comes into your head. Inferring the want
> > from the ask is not always easy.
> 
> You got that right!  Ok, so now I have got the new code below.
> How can I set a default for optional WIDTH?
> 
> (defun abuffer (&optional width)
>    "Accomodates window margins with WIDTH columns.
> WIDTH is 5 by default, and can be set using the Universal Prefix
> Argument \"C-u N M-x gungadin-buffer\"."
>    (interactive)
>    (set-window-margins nil width width) )
> 
> 
> 
> 
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]