tomterl / fullframe

Advice commands to execute fullscreen, restoring the window setup when exiting.
46 stars 4 forks source link
emacs emacs-lisp

Development takes now place at sourcehut: https://sr.ht/~tomterl/tomtel/ .

[[https://stable.melpa.org/#/fullframe][file:http://stable.melpa.org/packages/fullframe-badge.svg]] [[https://melpa.org/#/fullframe][file:http://melpa.org/packages/fullframe-badge.svg]]

This is a library that package developers can use to provide user friendly single window per frame execution of buffer exposing commands, as well as to use in personal emacs configurations to attain the same goal for packages that don't use =fullframe= or the likes of it themselves.

Example: Setup =magit-status= to open in one window in the current frame when called:

+BEGIN_SRC emacs-lisp

(require 'fullframe) (fullframe magit-status magit-mode-quit-window)

+END_SRC

** API

Fullframe exposes one function, =fullframe=

+BEGIN_SRC emacs-lisp

(fullframe enter-command
           exit-command
           &optional kill-buffer-after-exit-command 
                     after-command-on-func)

+END_SRC

*** =after-command-on-func= example

This call will show the current buffer and the =rgrep= result only; if the =rgrep= result buffer is closed (with =q=), the previous window configuration is restored.

+BEGIN_SRC emacs-lisp

(fullframe rgrep quit-window nil (lambda () (let ((wconf (fullframe/current-buffer-window-config)) (new-window (split-window-below))) (set-window-buffer new-window "grep") (fullframe/erase-current-buffer-window-config) (with-current-buffer "grep" (fullframe/set-current-buffer-window-config wconf)))))

+END_SRC

** Installation

=fullframe= is available on [[http://melpa.org/#/fullframe][melpa]] and [[http://stable.melpa.org][melpa-stable]].

[[http://melpa.org/#/getting-started][Add melpa to your package sources]], then execute the following in emacs:

+BEGIN_SRC emacs-lisp

M-x package-install fullframe

+END_SRC

If you use =cask= for your package-management, make sure you have =(source 'melpa)= in your =Cask= file and add

+BEGIN_SRC emacs-lisp

(depends-on "fullframe")

+END_SRC

to it. ** Configuration

The simple usage does not need configuration.

If you want to fullframe functions, but your workflow makes you use multiple commands to exit the buffer in question, you don't have to use multiple calls to ~fullframe~.

You have two possibilities: