emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r104704: Allow emacsclient to set par


From: Glenn Morris
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r104704: Allow emacsclient to set parameters of new graphical frames (bug#5864)
Date: Sat, 25 Jun 2011 11:05:48 -0700
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 104704
fixes bug(s): http://debbugs.gnu.org/5864
author: Andreas Rottmann <address@hidden>
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Sat 2011-06-25 11:05:48 -0700
message:
  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.
modified:
  doc/emacs/ChangeLog
  doc/emacs/misc.texi
  doc/man/ChangeLog
  doc/man/emacsclient.1
  etc/NEWS
  lib-src/ChangeLog
  lib-src/emacsclient.c
  lisp/ChangeLog
  lisp/server.el
=== modified file 'doc/emacs/ChangeLog'
--- a/doc/emacs/ChangeLog       2011-06-09 20:22:06 +0000
+++ b/doc/emacs/ChangeLog       2011-06-25 18:05:48 +0000
@@ -1,3 +1,7 @@
+2011-06-25  Andreas Rottmann  <address@hidden>
+
+       * misc.texi (emacsclient Options): Mention --frame-parameters.
+
 2011-06-09  Glenn Morris  <address@hidden>
 
        * custom.texi (Specifying File Variables):

=== modified file 'doc/emacs/misc.texi'
--- a/doc/emacs/misc.texi       2011-05-17 02:26:56 +0000
+++ b/doc/emacs/misc.texi       2011-06-25 18:05:48 +0000
@@ -1623,6 +1623,11 @@
 argument while supplying the @samp{-c} option, the new frame displays
 the @samp{*scratch*} buffer (@pxref{Buffers}).
 
address@hidden -F
address@hidden address@hidden
+Set the parameters for a newly-created graphical frame
+(@pxref{Frame Parameters}).
+
 @item -d @var{display}
 @itemx address@hidden
 Tell Emacs to open the given files on the X display @var{display}

=== modified file 'doc/man/ChangeLog'
--- a/doc/man/ChangeLog 2011-04-06 12:18:10 +0000
+++ b/doc/man/ChangeLog 2011-06-25 18:05:48 +0000
@@ -1,3 +1,7 @@
+2011-06-25  Andreas Rottmann  <address@hidden>
+
+       * emacsclient.1: Mention --frame-parameters.
+
 2011-03-07  Chong Yidong  <address@hidden>
 
        * Version 23.3 released.

=== modified file 'doc/man/emacsclient.1'
--- a/doc/man/emacsclient.1     2011-01-15 23:16:57 +0000
+++ b/doc/man/emacsclient.1     2011-06-25 18:05:48 +0000
@@ -58,6 +58,9 @@
 .B -c, \-\-create-frame
 create a new frame instead of trying to use the current Emacs frame
 .TP
+.B \-F, \-\-frame-parameters=ALIST
+set the parameters of a newly-created frame.
+.TP
 .B \-d, \-\-display=DISPLAY
 tell the server to display the files on the given display.
 .TP

=== modified file 'etc/NEWS'
--- a/etc/NEWS  2011-06-21 21:10:52 +0000
+++ b/etc/NEWS  2011-06-25 18:05:48 +0000
@@ -84,6 +84,10 @@
 +++
 *** New emacsclient argument -q/--quiet suppresses some status messages.
 
++++
+*** New emacsclient argument --frame-parameters can be used to set the
+frame parameters of a newly-created graphical frame.
+
 *** If emacsclient shuts down as a result of Emacs signalling an
 error, its exit status is 1.
 

=== modified file 'lib-src/ChangeLog'
--- a/lib-src/ChangeLog 2011-06-10 17:50:07 +0000
+++ b/lib-src/ChangeLog 2011-06-25 18:05:48 +0000
@@ -1,3 +1,7 @@
+2011-06-25  Andreas Rottmann  <address@hidden>
+
+       * emacsclient.c (longopts, decode_options, main): Add frame-parameters.
+
 2011-06-10  Paul Eggert  <address@hidden>
 
        * movemail.c: Fix race condition and related bugs (Bug#8836).

=== modified file 'lib-src/emacsclient.c'
--- a/lib-src/emacsclient.c     2011-06-01 17:15:27 +0000
+++ b/lib-src/emacsclient.c     2011-06-25 18:05:48 +0000
@@ -160,6 +160,10 @@
 /* PID of the Emacs server process.  */
 int emacs_pid = 0;
 
+/* If non-NULL, a string that should form a frame parameter alist to
+   be used for the new frame */
+const char *frame_parameters = NULL;
+
 static void print_help_and_exit (void) NO_RETURN;
 static void fail (void) NO_RETURN;
 
@@ -175,6 +179,7 @@
   { "nw",      no_argument,       NULL, 't' },
   { "create-frame", no_argument,   NULL, 'c' },
   { "alternate-editor", required_argument, NULL, 'a' },
+  { "frame-parameters", required_argument, NULL, 'F' },
 #ifndef NO_SOCKETS_IN_FILE_SYSTEM
   { "socket-name",     required_argument, NULL, 's' },
 #endif
@@ -599,6 +604,10 @@
          print_help_and_exit ();
          break;
 
+        case 'F':
+          frame_parameters = optarg;
+          break;
+
        default:
          message (TRUE, "Try `%s --help' for more information\n", progname);
          exit (EXIT_FAILURE);
@@ -1630,6 +1639,13 @@
       send_to_emacs (emacs_socket, " ");
     }
 
+  if (frame_parameters && !current_frame)
+    {
+      send_to_emacs (emacs_socket, "-frame-parameters ");
+      quote_argument (emacs_socket, frame_parameters);
+      send_to_emacs (emacs_socket, " ");
+    }
+
   /* If using the current frame, send tty information to Emacs anyway.
      In daemon mode, Emacs may need to occupy this tty if no other
      frame is available.  */

=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-06-25 17:42:18 +0000
+++ b/lisp/ChangeLog    2011-06-25 18:05:48 +0000
@@ -1,3 +1,8 @@
+2011-06-25  Andreas Rottmann  <address@hidden>
+
+       * server.el (server-create-window-system-frame): Add parameters arg.
+       (server-process-filter): Doc fix.  Handle frame-parameters.
+
 2011-06-25  Juanma Barranquero  <address@hidden>
 
        Fix bug#8730, bug#8781.

=== modified file 'lisp/server.el'
--- a/lisp/server.el    2011-06-01 19:32:04 +0000
+++ b/lisp/server.el    2011-06-25 18:05:48 +0000
@@ -736,7 +736,8 @@
 
     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 @@
     ;; 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 @@
 `-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 @@
                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 @@
                 ;; -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 @@
                    (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))))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]