Skip to content
This repository has been archived by the owner on Feb 19, 2021. It is now read-only.

tomterl/fullframe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

94 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

Generalized automatic execution in a single frame

http://stable.melpa.org/packages/fullframe-badge.svg 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:

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

API

Fullframe exposes one function, fullframe

(fullframe enter-command
           exit-command
           &optional kill-buffer-after-exit-command 
                     after-command-on-func)
  • enter-command is the function you want to execute in a single window in the current frame.
  • exit-command is the symbol of a function – or a list of function symbols – which, when called, should restore the window configuration.
  • kill-buffer-after-exit-command can be set to true if exit-command does not kill the buffer enter-command created, and you want that buffer gone.
  • after-command-on-func will be called after command-on was called and the buffer generated by it is visible in the only window in the current frame

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.

(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)))))

Installation

fullframe is available on melpa and melpa-stable.

Add melpa to your package sources, then execute the following in emacs:

M-x package-install<CR> fullframe<CR>

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

(depends-on "fullframe")

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:

  • Pass a list of all possible exit-commands to fullframe
  • Revise the customization list fullframe/generic-quit-commands and set fullframe/advice-generic-quit-commands to t.
  • mix both

About

Advice commands to execute fullscreen, restoring the window setup when exiting.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published