diff options
| author | Andreas Rottmann | 2011-06-25 11:05:48 -0700 |
|---|---|---|
| committer | Glenn Morris | 2011-06-25 11:05:48 -0700 |
| commit | 18a4ce5ea1b06bd077e87fd1ac8966b19b10ee8c (patch) | |
| tree | 3a84ffb4fba8030f72c58f07dbbabe1d3eb67a36 /lisp | |
| parent | 919bbce05b7757431247a771efd3943eab251eb2 (diff) | |
| download | emacs-18a4ce5ea1b06bd077e87fd1ac8966b19b10ee8c.tar.gz 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')
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/server.el | 20 |
2 files changed, 22 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4fec617954a..bccbe9340b1 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2011-06-25 Andreas Rottmann <a.rottmann@gmx.at> | ||
| 2 | |||
| 3 | * server.el (server-create-window-system-frame): Add parameters arg. | ||
| 4 | (server-process-filter): Doc fix. Handle frame-parameters. | ||
| 5 | |||
| 1 | 2011-06-25 Juanma Barranquero <lekktu@gmail.com> | 6 | 2011-06-25 Juanma Barranquero <lekktu@gmail.com> |
| 2 | 7 | ||
| 3 | Fix bug#8730, bug#8781. | 8 | Fix bug#8730, bug#8781. |
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 | |||
| 736 | 736 | ||
| 737 | frame)) | 737 | frame)) |
| 738 | 738 | ||
| 739 | (defun server-create-window-system-frame (display nowait proc parent-id) | 739 | (defun server-create-window-system-frame (display nowait proc parent-id |
| 740 | &optional parameters) | ||
| 740 | (add-to-list 'frame-inherited-parameters 'client) | 741 | (add-to-list 'frame-inherited-parameters 'client) |
| 741 | (if (not (fboundp 'make-frame-on-display)) | 742 | (if (not (fboundp 'make-frame-on-display)) |
| 742 | (progn | 743 | (progn |
| @@ -751,7 +752,8 @@ Server mode runs a process that accepts commands from the | |||
| 751 | ;; killing emacs on that frame. | 752 | ;; killing emacs on that frame. |
| 752 | (let* ((params `((client . ,(if nowait 'nowait proc)) | 753 | (let* ((params `((client . ,(if nowait 'nowait proc)) |
| 753 | ;; This is a leftover, see above. | 754 | ;; This is a leftover, see above. |
| 754 | (environment . ,(process-get proc 'env)))) | 755 | (environment . ,(process-get proc 'env)) |
| 756 | ,@parameters)) | ||
| 755 | (display (or display | 757 | (display (or display |
| 756 | (frame-parameter nil 'display) | 758 | (frame-parameter nil 'display) |
| 757 | (getenv "DISPLAY") | 759 | (getenv "DISPLAY") |
| @@ -832,6 +834,9 @@ The following commands are accepted by the server: | |||
| 832 | `-current-frame' | 834 | `-current-frame' |
| 833 | Forbid the creation of new frames. | 835 | Forbid the creation of new frames. |
| 834 | 836 | ||
| 837 | `-frame-parameters ALIST' | ||
| 838 | Set the parameters of the created frame. | ||
| 839 | |||
| 835 | `-nowait' | 840 | `-nowait' |
| 836 | Request that the next frame created should not be | 841 | Request that the next frame created should not be |
| 837 | associated with this client. | 842 | associated with this client. |
| @@ -940,6 +945,7 @@ The following commands are accepted by the client: | |||
| 940 | commands | 945 | commands |
| 941 | dir | 946 | dir |
| 942 | use-current-frame | 947 | use-current-frame |
| 948 | frame-parameters ;parameters for newly created frame | ||
| 943 | tty-name ; nil, `window-system', or the tty name. | 949 | tty-name ; nil, `window-system', or the tty name. |
| 944 | tty-type ; string. | 950 | tty-type ; string. |
| 945 | files | 951 | files |
| @@ -960,6 +966,13 @@ The following commands are accepted by the client: | |||
| 960 | ;; -current-frame: Don't create frames. | 966 | ;; -current-frame: Don't create frames. |
| 961 | (`"-current-frame" (setq use-current-frame t)) | 967 | (`"-current-frame" (setq use-current-frame t)) |
| 962 | 968 | ||
| 969 | ;; -frame-parameters: Set frame parameters | ||
| 970 | (`"-frame-parameters" | ||
| 971 | (let ((alist (pop args-left))) | ||
| 972 | (if coding-system | ||
| 973 | (setq alist (decode-coding-string alist coding-system))) | ||
| 974 | (setq frame-parameters (car (read-from-string alist))))) | ||
| 975 | |||
| 963 | ;; -display DISPLAY: | 976 | ;; -display DISPLAY: |
| 964 | ;; Open X frames on the given display instead of the default. | 977 | ;; Open X frames on the given display instead of the default. |
| 965 | (`"-display" | 978 | (`"-display" |
| @@ -1075,7 +1088,8 @@ The following commands are accepted by the client: | |||
| 1075 | (if display (server-select-display display))) | 1088 | (if display (server-select-display display))) |
| 1076 | ((eq tty-name 'window-system) | 1089 | ((eq tty-name 'window-system) |
| 1077 | (server-create-window-system-frame display nowait proc | 1090 | (server-create-window-system-frame display nowait proc |
| 1078 | parent-id)) | 1091 | parent-id |
| 1092 | frame-parameters)) | ||
| 1079 | ;; When resuming on a tty, tty-name is nil. | 1093 | ;; When resuming on a tty, tty-name is nil. |
| 1080 | (tty-name | 1094 | (tty-name |
| 1081 | (server-create-tty-frame tty-name tty-type proc)))) | 1095 | (server-create-tty-frame tty-name tty-type proc)))) |