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

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

[elpa] master 08e7be7 02/26: fix: DARKROOM-CONFIRM-FILL-PARAGRAPH -> DAR


From: João Távora
Subject: [elpa] master 08e7be7 02/26: fix: DARKROOM-CONFIRM-FILL-PARAGRAPH -> DARKROOM-FILL-PARAGRAPH-MAYBE
Date: Fri, 19 Dec 2014 19:07:23 +0000

branch: master
commit 08e7be7c6f24cb21c06f0adab93c92a0819af874
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>

    fix: DARKROOM-CONFIRM-FILL-PARAGRAPH -> DARKROOM-FILL-PARAGRAPH-MAYBE
---
 darkroom.el |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/darkroom.el b/darkroom.el
index e1c59c0..3a3a4c3 100644
--- a/darkroom.el
+++ b/darkroom.el
@@ -56,15 +56,20 @@ changing window or by calling `darkroom-set-margins'")
     (setq darkroom-margins (- darkroom-margins 0.05))
     (darkroom-set-margins)))
 
-(defun darkroom-confirm-fill-paragraph ()
-  (interactive)
-  (when (yes-or-no-p "Really fill paragraph?")
-    (call-interactively 'fill-paragraph)))
+(defun darkroom-fill-paragraph-maybe (really)
+  (interactive "P")
+  (cond (visual-line-mode
+         (if (not really)
+             (message "not filling paragraph")
+           (call-interactively 'fill-paragraph)
+           (message "filled paragraph even in visual-line-mode")))
+        (t
+         (call-interactively 'fill-paragraph))))
 
 (defvar darkroom-minor-mode-map (let ((map (make-sparse-keymap)))
                                   (define-key map (kbd "C-M-+") 
'darkroom-increase-margins)
                                   (define-key map (kbd "C-M--") 
'darkroom-decrease-margins)
-                                  (define-key map (kbd "M-q") 
'darkroom-confirm-fill-paragraph)
+                                  (define-key map (kbd "M-q") 
'darkroom-fill-paragraph-maybe)
                                   map))
 
 (defvar darkroom-saved-mode-line-format nil)



reply via email to

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