From: Juri Linkov Date: Wed, 27 Mar 2019 21:46:39 +0000 (+0200) Subject: * lisp/frame.el (make-frame-on-monitor): Add default value. (Bug#34516) X-Git-Tag: emacs-27.0.90~3311 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4da44cdaaf792c96164ba60076866a9df4d76002;p=emacs.git * lisp/frame.el (make-frame-on-monitor): Add default value. (Bug#34516) --- diff --git a/lisp/frame.el b/lisp/frame.el index 7cfe546ca6a..6cb12473725 100644 --- a/lisp/frame.el +++ b/lisp/frame.el @@ -676,12 +676,16 @@ The optional argument PARAMETERS specifies additional frame parameters." "Make a frame on monitor MONITOR. The optional argument DISPLAY can be a display name, and the optional argument PARAMETERS specifies additional frame parameters." - (interactive (list (completing-read - (format "Make frame on monitor: ") - (or (delq nil (mapcar (lambda (a) - (cdr (assq 'name a))) - (display-monitor-attributes-list))) - '(""))))) + (interactive + (list + (let* ((default (cdr (assq 'name (frame-monitor-attributes))))) + (completing-read + (format "Make frame on monitor (default %s): " default) + (or (delq nil (mapcar (lambda (a) + (cdr (assq 'name a))) + (display-monitor-attributes-list))) + '("")) + nil nil nil nil default)))) (let* ((monitor-workarea (catch 'done (dolist (a (display-monitor-attributes-list display))