2020-08-31 15:39:44 +02:00
|
|
|
;;; window.el --- Working with windows -*- lexical-binding: t -*-
|
|
|
|
|
2019-10-09 13:13:56 +02:00
|
|
|
;; Author: William Carroll <wpcarro@gmail.com>
|
2020-08-31 15:39:44 +02:00
|
|
|
;; Version: 0.0.1
|
|
|
|
;; Package-Requires: ((emacs "25.1"))
|
2019-10-09 13:13:56 +02:00
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
;; Utilities to make CRUDing windows in Emacs easier.
|
|
|
|
|
|
|
|
;;; Code:
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
;; Dependencies
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
|
|
|
(require 'prelude)
|
|
|
|
(require 'macros)
|
|
|
|
(require 'maybe)
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
;; Library
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
2020-08-31 15:39:44 +02:00
|
|
|
(defun window-find (name)
|
2019-10-09 13:13:56 +02:00
|
|
|
"Find a window by the NAME of the buffer it's hosting."
|
|
|
|
(let ((buffer (get-buffer name)))
|
2020-08-31 15:59:48 +02:00
|
|
|
(if (maybe-some? buffer)
|
2019-10-09 13:13:56 +02:00
|
|
|
(get-buffer-window buffer)
|
|
|
|
nil)))
|
|
|
|
|
|
|
|
;; TODO: Find a way to incorporate these into function documentation.
|
2020-09-01 00:28:47 +02:00
|
|
|
(macros-comment
|
2020-08-31 15:39:44 +02:00
|
|
|
(window-find "*scratch*"))
|
2019-10-09 13:13:56 +02:00
|
|
|
|
2020-08-31 15:39:44 +02:00
|
|
|
(defun window-delete (window)
|
2019-10-09 13:13:56 +02:00
|
|
|
"Delete the WINDOW reference."
|
|
|
|
(delete-window window))
|
|
|
|
|
|
|
|
(provide 'window)
|
|
|
|
;;; window.el ends here
|