unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Emanuel Berg <incal@dataswamp.org>
To: help-gnu-emacs@gnu.org
Subject: Re: Sensible values for `display-buffer-base-action'
Date: Tue, 07 Jun 2022 10:41:02 +0200	[thread overview]
Message-ID: <87zgiorhlt.fsf@dataswamp.org> (raw)
In-Reply-To: 87bkv498z4.fsf@posteo.net

Philip Kaludercic wrote:

> I am wondering if anyone has a clever
> `display-buffer-base-action' (or `display-buffer-alist')
> customisation they could share?

`display-buffer-alist' is nil (the default) and ...

;;; -*- lexical-binding: t -*-
;;
;; this file:
;;   https://dataswamp.org/~incal/emacs-init/window-incal.el

(setq display-buffer-base-action '((display-buffer-reuse-window
                                    display-buffer-same-window) ))

(defun beginning-of-line-at-top ()
  (beginning-of-line)
  (recenter 0) )

;; the two-window solution

(defun other-window-or-split ()
  (interactive)
  (when (one-window-p)
    (split-window-below) )
  (other-window 1) )

(defun swap-windows ()
  (interactive)
  (let ((buffer (current-buffer)))
    (other-window 1)
    (switch-to-buffer-other-window (current-buffer))
    (other-window 1)
    (switch-to-buffer buffer) ))

;; window size shorthands

(defun window-increase-size (lines)
  (interactive "p")
  (window-resize nil lines) ) ; the current WINDOW

(defun window-decrease-size (lines)
  (interactive "p")
  (window-resize nil (* -1 lines) ))

(provide 'window-incal)

-- 
underground experts united
https://dataswamp.org/~incal




  reply	other threads:[~2022-06-07  8:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-07  8:24 Sensible values for `display-buffer-base-action' Philip Kaludercic
2022-06-07  8:41 ` Emanuel Berg [this message]
2022-06-07  9:26   ` Philip Kaludercic
2022-06-07  9:45     ` Emanuel Berg
2022-06-07 10:27       ` Philip Kaludercic
2022-06-07 13:21         ` Emanuel Berg

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=87zgiorhlt.fsf@dataswamp.org \
    --to=incal@dataswamp.org \
    --cc=help-gnu-emacs@gnu.org \
    /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).