From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: emacsclient's option decoding code Date: Sat, 01 Nov 2008 16:04:14 +0200 Message-ID: Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1225548351 652 80.91.229.12 (1 Nov 2008 14:05:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 1 Nov 2008 14:05:51 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Nov 01 15:06:53 2008 connect(): Connection refused 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 1KwH7o-0004Ir-Mw for ged-emacs-devel@m.gmane.org; Sat, 01 Nov 2008 15:06:48 +0100 Original-Received: from localhost ([127.0.0.1]:41236 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KwH6i-0001Hh-4j for ged-emacs-devel@m.gmane.org; Sat, 01 Nov 2008 10:05:40 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KwH5o-00012z-0W for emacs-devel@gnu.org; Sat, 01 Nov 2008 10:04:44 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KwH5n-00012j-84 for emacs-devel@gnu.org; Sat, 01 Nov 2008 10:04:43 -0400 Original-Received: from [199.232.76.173] (port=33262 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KwH5n-00012g-0v for emacs-devel@gnu.org; Sat, 01 Nov 2008 10:04:43 -0400 Original-Received: from mtaout4.012.net.il ([84.95.2.10]:37367) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KwH5m-0000da-P0 for emacs-devel@gnu.org; Sat, 01 Nov 2008 10:04:43 -0400 Original-Received: from HOME-C4E4A596F7 ([77.127.192.143]) by i_mtaout4.012.net.il (HyperSendmail v2004.12) with ESMTPA id <0K9N009OMR5R49G0@i_mtaout4.012.net.il> for emacs-devel@gnu.org; Sat, 01 Nov 2008 16:05:52 +0200 (IST) X-012-Sender: halo1@inter.net.il X-detected-operating-system: by monty-python.gnu.org: Solaris 9.1 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:105236 Archived-At: Please take a look at this fragment of emacsclient.c, which deals with various combinations of command-line options: if (!current_frame && !tty && !display) display = egetenv ("DISPLAY"); if (display && strlen (display) == 0) display = NULL; if (!tty && display) window_system = 1; else if (!current_frame) tty = 1; /* --no-wait implies --current-frame on ttys when there are file arguments or expressions given. */ if (nowait && tty && argc - optind > 0) current_frame = 1; if (current_frame) { tty = 0; window_system = 0; } if (tty) window_system = 0; I find this code highly confusing to the degree of being unmaintainable. Look, for example, how it sets `tty' to zero or non-zero, and how this is interleaved with testing whether it is zero or non-zero, completely obfuscating the semantics of the code and the meaning of each variable. I think this should be rewritten, but since I cannot make heads or tails out of it, I cannot do that myself without risking to break the code. Please someone make this code speak to a programmer.