From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dan Nicolaescu Newsgroups: gmane.emacs.devel Subject: implement "emacsclient -nw" Date: Sun, 07 Sep 2008 03:55:48 -0700 Message-ID: <200809071055.m87AtmMr016726@sallyv1.ics.uci.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1220785003 16676 80.91.229.12 (7 Sep 2008 10:56:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 7 Sep 2008 10:56:43 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Sep 07 12:57:38 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KcHxY-00028w-22 for ged-emacs-devel@m.gmane.org; Sun, 07 Sep 2008 12:57:36 +0200 Original-Received: from localhost ([127.0.0.1]:54443 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KcHwY-0005R8-Fy for ged-emacs-devel@m.gmane.org; Sun, 07 Sep 2008 06:56:34 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KcHwR-0005ME-Jb for emacs-devel@gnu.org; Sun, 07 Sep 2008 06:56:27 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KcHwP-0005Ks-EZ for emacs-devel@gnu.org; Sun, 07 Sep 2008 06:56:26 -0400 Original-Received: from [199.232.76.173] (port=43845 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KcHwP-0005Ki-A3 for emacs-devel@gnu.org; Sun, 07 Sep 2008 06:56:25 -0400 Original-Received: from sallyv1.ics.uci.edu ([128.195.1.109]:50618) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA1:24) (Exim 4.60) (envelope-from ) id 1KcHwO-0007ac-Qk for emacs-devel@gnu.org; Sun, 07 Sep 2008 06:56:25 -0400 X-ICS-MailScanner-Watermark: 1221389748.96068@Yw8mhdS2HQobGrEwW9Gmjw Original-Received: from mothra.ics.uci.edu (mothra.ics.uci.edu [128.195.6.93]) by sallyv1.ics.uci.edu (8.13.7+Sun/8.13.7) with ESMTP id m87AtmMr016726 for ; Sun, 7 Sep 2008 03:55:48 -0700 (PDT) Original-Lines: 38 X-ICS-MailScanner: Found to be clean X-ICS-MailScanner-SpamCheck: not spam, SpamAssassin (score=-1.44, required 5, autolearn=disabled, ALL_TRUSTED -1.44) X-ICS-MailScanner-From: dann@mothra.ics.uci.edu X-detected-kernel: by monty-python.gnu.org: Solaris 10 (beta) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:103629 Archived-At: One of the TODO items for emacsclient is to accept `-nw' as a synonym to `-t' for consistency with emacs, which uses `-nw'. The patch below does that. It has the drawback that it also accepts `--nw', but that does not seem to be a big deal. Can someone that is familiar with getopt say if this patch is an acceptable solution? I'll update the docs if this patch gets checked in. --- emacsclient.c.~1.130.~ 2008-07-31 00:46:04.000000000 -0700 +++ emacsclient.c 2008-09-07 03:35:36.000000000 -0700 @@ -156,6 +156,7 @@ struct option longopts[] = { "help", no_argument, NULL, 'H' }, { "version", no_argument, NULL, 'V' }, { "tty", no_argument, NULL, 't' }, + { "nw", no_argument, NULL, 't' }, { "create-frame", no_argument, NULL, 'c' }, { "alternate-editor", required_argument, NULL, 'a' }, #ifndef NO_SOCKETS_IN_FILE_SYSTEM @@ -474,7 +475,7 @@ decode_options (argc, argv) while (1) { - int opt = getopt_long (argc, argv, + int opt = getopt_long_only (argc, argv, #ifndef NO_SOCKETS_IN_FILE_SYSTEM "VHnea:s:f:d:tc", #else @@ -601,7 +602,7 @@ Every FILE can be either just a FILENAME The following OPTIONS are accepted:\n\ -V, --version Just print version info and return\n\ -H, --help Print this usage information message\n\ --t, --tty Open a new Emacs frame on the current terminal\n\ +-nw, -t, --tty Open a new Emacs frame on the current terminal\n\ -c, --create-frame Create a new frame instead of trying to\n\ use the current Emacs frame\n\ -e, --eval Evaluate the FILE arguments as ELisp expressions\n\