]> git.eshelyaron.com Git - emacs.git/commitdiff
Issue a message on `C-x o' and there's no other window
authorLars Ingebrigtsen <larsi@gnus.org>
Sat, 17 Aug 2019 23:35:54 +0000 (16:35 -0700)
committerLars Ingebrigtsen <larsi@gnus.org>
Sat, 17 Aug 2019 23:36:00 +0000 (16:36 -0700)
* lisp/window.el (other-window): Issue a message when the user
types `C-x o' and there's no other window to select (bug#10999).

lisp/window.el

index 2345f398e7240d06f63b3a9eaf1f5e80b60effec..723671efa57c0d3ed2a988fce4c633ec8598aea8 100644 (file)
@@ -3926,6 +3926,7 @@ select.  The argument ALL-FRAMES has the same meaning as in
 always effectively nil."
   (interactive "p")
   (let* ((window (selected-window))
+         (original-window window)
         (function (and (not ignore-window-parameters)
                        (window-parameter window 'other-window)))
         old-window old-count)
@@ -3968,6 +3969,10 @@ always effectively nil."
           (t
            (setq count (1+ count)))))
 
+        (when (and (eq window original-window)
+                   (called-interactively-p 'interactive))
+          (message "No other window to select"))
+
        (select-window window)
        ;; Always return nil.
        nil))))