Skip to content

Commit

Permalink
Fix linting errors
Browse files Browse the repository at this point in the history
Making these happy:

    M-x package-lint-current-buffer~
    M-x checkdoc-current-buffer
  • Loading branch information
FrostyX committed Dec 14, 2024
1 parent 07418fe commit 9f49b87
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions current-window-only.el
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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)
Expand All @@ -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
Expand Down Expand Up @@ -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)))

Expand All @@ -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))

Expand Down

0 comments on commit 9f49b87

Please sign in to comment.