-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Making these happy: M-x package-lint-current-buffer~ M-x checkdoc-current-buffer
- Loading branch information
Showing
1 changed file
with
11 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
;; Author: Jakub Kadlčík <[email protected]> | ||
;; URL: https://github.com/FrostyX/current-window-only | ||
;; Version: 1.0 | ||
;; Package-Requires: ((emacs "24.4")) | ||
;; Package-Requires: ((emacs "25.1")) | ||
;; Keywords: frames | ||
|
||
;;; License: | ||
|
@@ -25,23 +25,23 @@ | |
|
||
;;; Commentary: | ||
|
||
;; Open things only in the current window. No other windows, no splits. | ||
;; Open things only in the current window. No other windows, no splits. | ||
|
||
|
||
;;; Code: | ||
|
||
;;;; Customization | ||
|
||
(defgroup current-window-only nil | ||
"Open things only in the current window. No other windows, no splits." | ||
"Open things only in the current window. No other windows, no splits." | ||
:prefix "current-window-only-" | ||
:group 'frames) | ||
|
||
;;;; Modes | ||
|
||
;;;###autoload | ||
(define-minor-mode current-window-only-mode | ||
"Open things only in the current window. No other windows, no splits." | ||
"Open things only in the current window. No other windows, no splits." | ||
:global t | ||
(if current-window-only-mode | ||
(current-window-only--on) | ||
|
@@ -66,6 +66,7 @@ | |
;;;;; Private | ||
|
||
(defun current-window-only--on () | ||
"Enable the `current-window-only-mode'." | ||
;; Remember the user configuration in case we need to restore it | ||
(dolist (var '(display-buffer-alist | ||
Man-notify-method | ||
|
@@ -103,6 +104,7 @@ | |
:override #'current-window-only--delete-other-windows)) | ||
|
||
(defun current-window-only--off () | ||
"Disable the `current-window-only-mode'." | ||
(dolist (item current-window-only--old-config) | ||
(set (car item) (cdr item))) | ||
|
||
|
@@ -116,10 +118,15 @@ | |
|
||
(defun current-window-only--switch-to-buffer-other-window | ||
(buffer-or-name &optional norecord) | ||
"Override for the `switch-to-buffer-other-window' function. | ||
It uses the BUFFER-OR-NAME and NORECORD parameters and passes them to a | ||
`switch-to-buffer'." | ||
(switch-to-buffer buffer-or-name norecord t)) | ||
|
||
(defun current-window-only--delete-other-windows | ||
(&optional window interactive) | ||
"Override for the `delete-other-windows' function. | ||
Do nothing and simply ignore the WINDOW and INTERACTIVE arguments." | ||
(ignore window) | ||
(ignore interactive)) | ||
|
||
|