emacs-diffs
[Top][All Lists]
Advanced

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

master ca023e6: Make Calc windows dedicated by default


From: Eli Zaretskii
Subject: master ca023e6: Make Calc windows dedicated by default
Date: Sat, 14 Nov 2020 08:04:24 -0500 (EST)

branch: master
commit ca023e69e2d9ea79814a6c5f92c6e31c8f1efa70
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>

    Make Calc windows dedicated by default
    
    * lisp/calc/calc.el (calc-make-windows-dedicated): New defcustom.
    (calc, calc-trail-display): Set Calc windows dedicated if
    calc-make-windows-dedicated is non-nil.  Patch by Boruch Baum
    <boruch_baum@gmx.com>.  (Bug#44108)
    
    * etc/NEWS (Calc): Announce the new behavior.
---
 etc/NEWS          |  5 +++++
 lisp/calc/calc.el | 12 +++++++++++-
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/etc/NEWS b/etc/NEWS
index f21c4cb..0f7b64d 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1250,6 +1250,11 @@ and the result is not truncated in any way.
 *** The '/' operator now has higher precedence in (La)TeX input mode.
 It no longer has lower precedence than '+' and '-'.
 
+---
+*** Calc now marks its windows dedicated.
+The new user option 'calc-make-windows-dedicated' controls this.  It
+is t by default; set to nil to get back the old behavior.
+
 ** term-mode
 
 ---
diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el
index bde7bd4..5716189 100644
--- a/lisp/calc/calc.el
+++ b/lisp/calc/calc.el
@@ -1435,6 +1435,12 @@ commands given here will actually operate on the 
*Calculator* stack."
     (require 'calc-ext)
     (calc-set-language calc-language calc-language-option t)))
 
+(defcustom calc-make-windows-dedicated t
+  "If non-nil, windows displaying Calc buffers will be marked dedicated.
+See `window-dedicated-p' for what that means."
+  :version "28.1"
+  :type 'boolean)
+
 ;;;###autoload
 (defun calc (&optional arg full-display interactive)
   "The Emacs Calculator.  Full documentation is listed under `calc-mode'."
@@ -1480,6 +1486,8 @@ commands given here will actually operate on the 
*Calculator* stack."
       (and (windowp full-display)
            (window-point full-display)
            (select-window full-display))
+      (and calc-make-windows-dedicated
+           (set-window-dedicated-p nil t))
       (calc-check-defines)
       (when (and calc-said-hello interactive)
         (sit-for 2)
@@ -2140,7 +2148,9 @@ the United States."
               (if calc-trail-window-hook
                   (run-hooks 'calc-trail-window-hook)
                 (let ((w (split-window nil (/ (* (window-width) 2) 3) t)))
-                  (set-window-buffer w calc-trail-buffer)))
+                  (set-window-buffer w calc-trail-buffer)
+                  (and calc-make-windows-dedicated
+                       (set-window-dedicated-p nil t))))
               (calc-wrapper
                (setq overlay-arrow-string calc-trail-overlay
                      overlay-arrow-position calc-trail-pointer)



reply via email to

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