From: Christopher Dimech <dimech@gmx.com>
To: Christopher Dimech <dimech@gmx.com>
Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>,
Jamie Beardslee <jdb@jamzattack.xyz>,
Yuri Khan <yuri.v.khan@gmail.com>
Subject: Re: Scratch buffer on either side of current buffer
Date: Sat, 21 Nov 2020 17:43:56 +0100 [thread overview]
Message-ID: <trinity-0c1d56f2-2223-4b77-920a-c8ac68ae8278-1605977036523@3c-app-mailcom-bs01> (raw)
In-Reply-To: <trinity-d88e787d-b04f-41eb-befb-bb7532108003-1605975178652@3c-app-mailcom-bs01>
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) )
>
>
>
>
>
next prev parent reply other threads:[~2020-11-21 16:43 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-21 1:41 Scratch buffer on either side of current buffer Christopher Dimech
2020-11-21 5:02 ` Jamie Beardslee
2020-11-21 14:09 ` Christopher Dimech
2020-11-21 14:52 ` Yuri Khan
2020-11-21 15:43 ` Christopher Dimech
2020-11-21 16:03 ` Yuri Khan
2020-11-21 16:12 ` Christopher Dimech
2020-11-21 16:43 ` Christopher Dimech [this message]
2020-11-21 19:50 ` Drew Adams
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=trinity-0c1d56f2-2223-4b77-920a-c8ac68ae8278-1605977036523@3c-app-mailcom-bs01 \
--to=dimech@gmx.com \
--cc=help-gnu-emacs@gnu.org \
--cc=jdb@jamzattack.xyz \
--cc=yuri.v.khan@gmail.com \
/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.
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).