>From d07ad110053dc7193440f53317195bfdb5ecdfaa Mon Sep 17 00:00:00 2001 From: Timo Savola Date: Tue, 23 Jan 2007 11:55:02 +0200 Subject: [PATCH] parent-id The --parent-id command-line option sets the parent window ID of the initial frame. --- lisp/startup.el | 3 ++- lisp/term/x-win.el | 9 +++++++++ src/emacs.c | 2 ++ 3 files changed, 13 insertions(+), 1 deletions(-) diff --git a/lisp/startup.el b/lisp/startup.el index f57bf66..09cd77e 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -151,7 +151,8 @@ This is normally copied from `default-directory' when Emacs starts.") ("--vertical-scroll-bars" 0 x-handle-switch vertical-scroll-bars t) ("--line-spacing" 1 x-handle-numeric-switch line-spacing) ("--border-color" 1 x-handle-switch border-color) - ("--smid" 1 x-handle-smid)) + ("--smid" 1 x-handle-smid) + ("--parent-id" 1 x-handle-parent-id)) "Alist of X Windows options. Each element has the form (NAME NUMARGS HANDLER FRAME-PARAM VALUE) diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el index e48d97d..390c671 100644 --- a/lisp/term/x-win.el +++ b/lisp/term/x-win.el @@ -181,6 +181,15 @@ (setq initial-frame-alist (cons (cons 'name x-resource-name) initial-frame-alist))) +;; Handle the --parent-id option. +(defun x-handle-parent-id (switch) + (or (consp x-invocation-args) + (error "%s: missing argument to `%s' option" (invocation-name) switch)) + (setq parent-id (string-to-number (car x-invocation-args)) + x-invocation-args (cdr x-invocation-args)) + (setq initial-frame-alist (cons (cons 'parent-id parent-id) + initial-frame-alist))) + (defvar x-display-name nil "The name of the X display on which Emacs was started. diff --git a/src/emacs.c b/src/emacs.c index 62b14a5..7f42411 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -325,6 +325,7 @@ Display options:\n\ --title, -T TITLE title for initial Emacs frame\n\ --vertical-scroll-bars, -vb enable vertical scroll bars\n\ --xrm XRESOURCES set additional X resources\n\ +--parent-id XID set parent window\n\ --help display this help and exit\n\ --version output version information and exit\n\ \n" @@ -1835,6 +1836,7 @@ struct standard_args standard_args[] = { "-title", 0, 10, 1 }, { "-name", "--name", 10, 1 }, { "-xrm", "--xrm", 10, 1 }, + { "-parent-id", "--parent-id", 10, 1 }, { "-r", "--reverse-video", 5, 0 }, { "-rv", 0, 5, 0 }, { "-reverse", 0, 5, 0 }, -- 1.5.2