diff options
author | Andreas Rottmann <a.rottmann@gmx.at> | 2011-06-25 11:05:48 -0700 |
---|---|---|
committer | Glenn Morris <rgm@gnu.org> | 2011-06-25 11:05:48 -0700 |
commit | 18a4ce5ea1b06bd077e87fd1ac8966b19b10ee8c (patch) | |
tree | 3a84ffb4fba8030f72c58f07dbbabe1d3eb67a36 /lisp/server.el | |
parent | 919bbce05b7757431247a771efd3943eab251eb2 (diff) | |
download | emacs-18a4ce5ea1b06bd077e87fd1ac8966b19b10ee8c.tar.gz emacs-18a4ce5ea1b06bd077e87fd1ac8966b19b10ee8c.tar.bz2 emacs-18a4ce5ea1b06bd077e87fd1ac8966b19b10ee8c.zip |
Allow emacsclient to set parameters of new graphical frames (bug#5864)
* lib-src/emacsclient.c (longopts, decode_options, main): Add frame-parameters.
* lisp/server.el (server-create-window-system-frame): Add parameters arg.
(server-process-filter): Doc fix. Handle frame-parameters.
* doc/emacs/misc.texi (emacsclient Options): Mention --frame-parameters.
* doc/man/emacsclient.1: Mention --frame-parameters.
* etc/NEWS: Mention this.
Diffstat (limited to 'lisp/server.el')
-rw-r--r-- | lisp/server.el | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/lisp/server.el b/lisp/server.el index 04d35695c57..42da7a210c5 100644 --- a/lisp/server.el +++ b/lisp/server.el @@ -736,7 +736,8 @@ Server mode runs a process that accepts commands from the frame)) -(defun server-create-window-system-frame (display nowait proc parent-id) +(defun server-create-window-system-frame (display nowait proc parent-id + &optional parameters) (add-to-list 'frame-inherited-parameters 'client) (if (not (fboundp 'make-frame-on-display)) (progn @@ -751,7 +752,8 @@ Server mode runs a process that accepts commands from the ;; killing emacs on that frame. (let* ((params `((client . ,(if nowait 'nowait proc)) ;; This is a leftover, see above. - (environment . ,(process-get proc 'env)))) + (environment . ,(process-get proc 'env)) + ,@parameters)) (display (or display (frame-parameter nil 'display) (getenv "DISPLAY") @@ -832,6 +834,9 @@ The following commands are accepted by the server: `-current-frame' Forbid the creation of new frames. +`-frame-parameters ALIST' + Set the parameters of the created frame. + `-nowait' Request that the next frame created should not be associated with this client. @@ -940,6 +945,7 @@ The following commands are accepted by the client: commands dir use-current-frame + frame-parameters ;parameters for newly created frame tty-name ; nil, `window-system', or the tty name. tty-type ; string. files @@ -960,6 +966,13 @@ The following commands are accepted by the client: ;; -current-frame: Don't create frames. (`"-current-frame" (setq use-current-frame t)) + ;; -frame-parameters: Set frame parameters + (`"-frame-parameters" + (let ((alist (pop args-left))) + (if coding-system + (setq alist (decode-coding-string alist coding-system))) + (setq frame-parameters (car (read-from-string alist))))) + ;; -display DISPLAY: ;; Open X frames on the given display instead of the default. (`"-display" @@ -1075,7 +1088,8 @@ The following commands are accepted by the client: (if display (server-select-display display))) ((eq tty-name 'window-system) (server-create-window-system-frame display nowait proc - parent-id)) + parent-id + frame-parameters)) ;; When resuming on a tty, tty-name is nil. (tty-name (server-create-tty-frame tty-name tty-type proc)))) |