From: Christopher Dimech <dimech@gmx.com>
To: Jamie Beardslee <jdb@jamzattack.xyz>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Scratch buffer on either side of current buffer
Date: Sat, 21 Nov 2020 15:09:11 +0100 [thread overview]
Message-ID: <trinity-3eb7085d-0577-4eca-8bdd-0b5707c1f2e7-1605967751449@3c-app-mailcom-bs01> (raw)
In-Reply-To: <87a6vbz4i3.fsf@jamzattack.xyz>
Have modified it like below, but is not weird enough yet.
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.
(defun gungadin-buffer (&optional width)
(interactive
(list (when current-prefix-arg
(prefix-numeric-value current-prefix-arg))) )
(let ((buffer (current-buffer))
;; ----- body of let -----
(scratch (get-buffer-create "*scratch*"))
(width (or width 8)))
(delete-other-windows)
(with-selected-window
(split-window nil (- width) 'left)
(switch-to-buffer scratch))
(with-selected-window
(split-window nil width 'right)
(switch-to-buffer scratch)) ))
> Sent: Saturday, November 21, 2020 at 6:02 AM
> From: "Jamie Beardslee" <jdb@jamzattack.xyz>
> To: help-gnu-emacs@gnu.org
> Subject: Re: Scratch buffer on either side of current buffer
>
> Christopher Dimech <dimech@gmx.com> writes:
>
> > I want to have a window-buffer (containing *scratch*) on each side of
> > my current buffer.
>
> Here, try this:
>
> (defun weird-window-configuration-please (&optional width)
> "Split the frame into three windows.
> The current buffer is placed in the middle, and the \"*scratch\"
> buffer is placed on either side, with WIDTH columns. WIDTH is 80
> by default, and can be specified by a prefix argument (C-u)."
> (interactive (list (when current-prefix-arg
> (prefix-numeric-value current-prefix-arg))))
> (let ((buffer (current-buffer))
> (scratch (get-buffer-create "*scratch*"))
> (width (or width 80)))
> (delete-other-windows)
> (with-selected-window (split-window nil (- width) 'left)
> (switch-to-buffer scratch))
> (with-selected-window (split-window nil width 'right)
> (switch-to-buffer scratch))))
>
> --
> Jamie
>
>
>
next prev parent reply other threads:[~2020-11-21 14:09 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 [this message]
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
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-3eb7085d-0577-4eca-8bdd-0b5707c1f2e7-1605967751449@3c-app-mailcom-bs01 \
--to=dimech@gmx.com \
--cc=help-gnu-emacs@gnu.org \
--cc=jdb@jamzattack.xyz \
/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).