aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2020-11-14 15:02:13 +0200
committerEli Zaretskii2020-11-14 15:02:13 +0200
commitca023e69e2d9ea79814a6c5f92c6e31c8f1efa70 (patch)
tree5cbf2fa86319116a1f431fbdcd0e4fa09fd9b74e
parent29a59aad1c0a48a47bc340d75d82fcf118a7793f (diff)
downloademacs-ca023e69e2d9ea79814a6c5f92c6e31c8f1efa70.tar.gz
emacs-ca023e69e2d9ea79814a6c5f92c6e31c8f1efa70.zip
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.
-rw-r--r--etc/NEWS5
-rw-r--r--lisp/calc/calc.el12
2 files changed, 16 insertions, 1 deletions
diff --git a/etc/NEWS b/etc/NEWS
index f21c4cb02cf..0f7b64ddd16 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1250,6 +1250,11 @@ and the result is not truncated in any way.
1250*** The '/' operator now has higher precedence in (La)TeX input mode. 1250*** The '/' operator now has higher precedence in (La)TeX input mode.
1251It no longer has lower precedence than '+' and '-'. 1251It no longer has lower precedence than '+' and '-'.
1252 1252
1253---
1254*** Calc now marks its windows dedicated.
1255The new user option 'calc-make-windows-dedicated' controls this. It
1256is t by default; set to nil to get back the old behavior.
1257
1253** term-mode 1258** term-mode
1254 1259
1255--- 1260---
diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el
index bde7bd4e2bd..5716189b342 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."
1435 (require 'calc-ext) 1435 (require 'calc-ext)
1436 (calc-set-language calc-language calc-language-option t))) 1436 (calc-set-language calc-language calc-language-option t)))
1437 1437
1438(defcustom calc-make-windows-dedicated t
1439 "If non-nil, windows displaying Calc buffers will be marked dedicated.
1440See `window-dedicated-p' for what that means."
1441 :version "28.1"
1442 :type 'boolean)
1443
1438;;;###autoload 1444;;;###autoload
1439(defun calc (&optional arg full-display interactive) 1445(defun calc (&optional arg full-display interactive)
1440 "The Emacs Calculator. Full documentation is listed under `calc-mode'." 1446 "The Emacs Calculator. Full documentation is listed under `calc-mode'."
@@ -1480,6 +1486,8 @@ commands given here will actually operate on the *Calculator* stack."
1480 (and (windowp full-display) 1486 (and (windowp full-display)
1481 (window-point full-display) 1487 (window-point full-display)
1482 (select-window full-display)) 1488 (select-window full-display))
1489 (and calc-make-windows-dedicated
1490 (set-window-dedicated-p nil t))
1483 (calc-check-defines) 1491 (calc-check-defines)
1484 (when (and calc-said-hello interactive) 1492 (when (and calc-said-hello interactive)
1485 (sit-for 2) 1493 (sit-for 2)
@@ -2140,7 +2148,9 @@ the United States."
2140 (if calc-trail-window-hook 2148 (if calc-trail-window-hook
2141 (run-hooks 'calc-trail-window-hook) 2149 (run-hooks 'calc-trail-window-hook)
2142 (let ((w (split-window nil (/ (* (window-width) 2) 3) t))) 2150 (let ((w (split-window nil (/ (* (window-width) 2) 3) t)))
2143 (set-window-buffer w calc-trail-buffer))) 2151 (set-window-buffer w calc-trail-buffer)
2152 (and calc-make-windows-dedicated
2153 (set-window-dedicated-p nil t))))
2144 (calc-wrapper 2154 (calc-wrapper
2145 (setq overlay-arrow-string calc-trail-overlay 2155 (setq overlay-arrow-string calc-trail-overlay
2146 overlay-arrow-position calc-trail-pointer) 2156 overlay-arrow-position calc-trail-pointer)