refuse to truly honor the request if it does not increase/decrease the
frame height to a multiple of its character height.
-When used interactively, this command will set the height of the
-currently selected frame to the number of lines specified by the
-numeric prefix.
+When used interactively, this command will ask the user for the number
+of lines to set the height of the currently selected frame. You can
+also provide this value with a numeric prefix.
@end defun
@defun set-frame-width frame width &optional pretend pixelwise
refuse to fully honor the request if it does not increase/decrease the
frame width to a multiple of its character width.
-When used interactively, this command will set the width of the
-currently selected frame to the number of columns specified by the
-numeric prefix.
+When used interactively, this command will ask the user for the number
+of columns to set the width of the currently selected frame. You can
+also provide this value with a numeric prefix.
@end defun
None of these three functions will make a frame smaller than needed to
('clone-buffer'), 'C-x x i' ('insert-buffer') and 'C-x x t'
('toggle-truncate-lines').
+---
+** Commands 'set-frame-width' and 'set-frame-height' can now get their
+input using the minibuffer.
+
\f
* Editing Changes in Emacs 28.1
(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,
}
DEFUN ("set-frame-height", Fset_frame_height, Sset_frame_height, 2, 4,
- "(list (selected-frame) (prefix-numeric-value current-prefix-arg))",
+ "(set-frame-property--interactive \"Frame height: \" (frame-height))",
doc: /* Set text height of frame FRAME to HEIGHT lines.
Optional third arg PRETEND non-nil means that redisplay should use
HEIGHT lines but that the idea of the actual height of the frame should
}
DEFUN ("set-frame-width", Fset_frame_width, Sset_frame_width, 2, 4,
- "(list (selected-frame) (prefix-numeric-value current-prefix-arg))",
+ "(set-frame-property--interactive \"Frame width: \" (frame-width))",
doc: /* Set text width of frame FRAME to WIDTH columns.
Optional third arg PRETEND non-nil means that redisplay should use WIDTH
columns but that the idea of the actual width of the frame should not