summaryrefslogtreecommitdiff
path: root/lisp/frame.el
diff options
context:
space:
mode:
authorDaniel Martín <mardani29@yahoo.es>2021-03-16 01:29:28 +0100
committerLars Ingebrigtsen <larsi@gnus.org>2021-03-16 01:29:28 +0100
commitef122bf45d8ab7f8ec31612ac39fc521039ae19a (patch)
tree27759da1a8186f644edd2d88199df8b43007935c /lisp/frame.el
parentc4549d3b37f7f3b9a9b5376eebb39b1929c48bd1 (diff)
downloademacs-ef122bf45d8ab7f8ec31612ac39fc521039ae19a.tar.gz
emacs-ef122bf45d8ab7f8ec31612ac39fc521039ae19a.tar.bz2
emacs-ef122bf45d8ab7f8ec31612ac39fc521039ae19a.zip
Add minibuffer input support to commands that set the frame size
* lisp/frame.el (set-frame-property--interactive): Internal function to produce the interactive form of `set-frame-width' and `set-frame-height'. Offer the current size as default. (Bug#9970) * src/frame.c (Fset_frame_height): Modify to call `set-frame-property--interactive'. (Fset_frame_width): Modify to call `set-frame-property--interactive'. * doc/lispref/frames.texi (Frame Size): Update the manuals. * etc/NEWS: Advertise the change (bug#9970).
Diffstat (limited to 'lisp/frame.el')
-rw-r--r--lisp/frame.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/lisp/frame.el b/lisp/frame.el
index ce4de83b8c5..409ce0563b5 100644
--- a/lisp/frame.el
+++ b/lisp/frame.el
@@ -2733,6 +2733,14 @@ See also `toggle-frame-maximized'."
(make-obsolete-variable
'window-system-version "it does not give useful information." "24.3")
+(defun set-frame-property--interactive (prompt number)
+ "Get a value for `set-frame-width' or `set-frame-height', prompting with PROMPT.
+Offer NUMBER as default value, if it is a natural number."
+ (if (and current-prefix-arg (not (consp current-prefix-arg)))
+ (list (selected-frame) (prefix-numeric-value current-prefix-arg))
+ (let ((default (and (natnump number) number)))
+ (list (selected-frame) (read-number prompt (list default (point)))))))
+
;; Variables whose change of value should trigger redisplay of the
;; current buffer.
;; To test whether a given variable needs to be added to this list,