emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/visual-fill-column 4c86aebd2b 097/137: Make the argument o


From: ELPA Syncer
Subject: [nongnu] elpa/visual-fill-column 4c86aebd2b 097/137: Make the argument of visual-fill-column--adjust-window optional.
Date: Sun, 2 Jan 2022 22:59:14 -0500 (EST)

branch: elpa/visual-fill-column
commit 4c86aebd2ba9b50af7defa4aab55be1b6e650741
Author: Joost Kremers <joostkremers@fastmail.fm>
Commit: Joost Kremers <joostkremers@fastmail.fm>

    Make the argument of visual-fill-column--adjust-window optional.
    
    `visual-fill-column--adjust-window' is used in 
`window-size-change-functions'
    and must therefore take an argument. `writeroom-mode' calls
    `visual-fill-column--adjust-functions' without argument. To make sure
    `writeroom-mode' doesn't break, it's better to make the argument optional.
---
 visual-fill-column.el | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/visual-fill-column.el b/visual-fill-column.el
index de3df7b74e..9e0261f1ef 100644
--- a/visual-fill-column.el
+++ b/visual-fill-column.el
@@ -171,11 +171,12 @@ windows with wide margins."
   (set-window-parameter window 'min-margins nil)
   (set-window-margins window nil))
 
-(defun visual-fill-column--adjust-window (window)
+(defun visual-fill-column--adjust-window (&optional window)
   "Adjust the margins and fringes of WINDOW.
-This function only adjusts the margins and fringes if the buffer
-displayed in the selected window has `visual-fill-column-mode'
-enabled."
+WINDOW defaults to the selected window.  This function only
+adjusts the margins and fringes if the buffer displayed in the
+selected window has `visual-fill-column-mode' enabled."
+  (or window (setq window (selected-window)))
   (with-selected-window window
     (visual-fill-column--reset-window window)
     (when visual-fill-column-mode



reply via email to

[Prev in Thread] Current Thread [Next in Thread]