emacs: define prot-simple-other-window

This commit is contained in:
Protesilaos Stavrou 2024-03-03 08:58:33 +02:00
parent c5c2068b7b
commit df9834d8db
No known key found for this signature in database
GPG key ID: 99BD6459CD5CA3EA
3 changed files with 28 additions and 0 deletions

View file

@ -102,6 +102,7 @@
;; Commands for paragraphs
"M-Q" #'prot-simple-unfill-region-or-paragraph
;; Commands for windows and pages
"C-x o" #'prot-simple-other-window
"C-x n k" #'prot-simple-delete-page-delimiters
"C-x M-r" #'prot-simple-swap-window-buffers
;; Commands for buffers

View file

@ -2680,6 +2680,7 @@ keys.
;; Commands for paragraphs
"M-Q" #'prot-simple-unfill-region-or-paragraph
;; Commands for windows and pages
"C-x o" #'prot-simple-other-window
"C-x n k" #'prot-simple-delete-page-delimiters
"C-x M-r" #'prot-simple-swap-window-buffers
;; Commands for buffers
@ -16580,6 +16581,19 @@ paragraph. The idea is to produce the opposite effect of both
;;;; Commands for windows and pages
;;;###autoload
(defun prot-simple-other-window ()
"Wrapper for `other-window' and `next-multiframe-window'.
If there is only one window and multiple frames, call
`next-multiframe-window'. Otherwise, call `other-window'."
(interactive)
(if (and (one-window-p) (length> (frame-list) 1))
(progn
(call-interactively #'next-multiframe-window)
(setq this-command #'next-multiframe-window))
(call-interactively #'other-window)
(setq this-command #'other-window)))
;;;###autoload
(defun prot-simple-narrow-visible-window ()
"Narrow buffer to wisible window area.

View file

@ -587,6 +587,19 @@ paragraph. The idea is to produce the opposite effect of both
;;;; Commands for windows and pages
;;;###autoload
(defun prot-simple-other-window ()
"Wrapper for `other-window' and `next-multiframe-window'.
If there is only one window and multiple frames, call
`next-multiframe-window'. Otherwise, call `other-window'."
(interactive)
(if (and (one-window-p) (length> (frame-list) 1))
(progn
(call-interactively #'next-multiframe-window)
(setq this-command #'next-multiframe-window))
(call-interactively #'other-window)
(setq this-command #'other-window)))
;;;###autoload
(defun prot-simple-narrow-visible-window ()
"Narrow buffer to wisible window area.