From e97677e6b1b925f863b8b69c0362a90961f74651 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 29 May 2024 00:34:37 +0200 Subject: [PATCH] Mention direction when resizing a window fails * lisp/window.el (enlarge-window, shrink-window): When an attempt to resize a window fails, also mention the direction of the operation (i.e., horizontally or vertically). (cherry picked from commit 0ae66c1917609832f2456b8207743468439926ae) --- lisp/window.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lisp/window.el b/lisp/window.el index 0da64bb5d7f..6a97cdec118 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -3687,7 +3687,9 @@ negative, shrink selected window by -DELTA lines or columns." (if horizontal 'enlarge-window-horizontally 'enlarge-window)) ;; For backward compatibility don't signal an error unless this ;; command is `enlarge-window(-horizontally)'. - (user-error "Cannot enlarge selected window")) + (if horizontal + (user-error "Cannot enlarge selected window horizontally") + (user-error "Cannot enlarge selected window vertically"))) (t (window-resize nil (if (> delta 0) @@ -3730,7 +3732,9 @@ negative, enlarge selected window by -DELTA lines or columns." (if horizontal 'shrink-window-horizontally 'shrink-window)) ;; For backward compatibility don't signal an error unless this ;; command is `shrink-window(-horizontally)'. - (user-error "Cannot shrink selected window")) + (if horizontal + (user-error "Cannot shrink selected window horizontally") + (user-error "Cannot shrink selected window vertically"))) (t (window-resize nil (if (> delta 0) -- 2.39.2