Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZXrEY-0005qp-0G for pgsql-hackers@arkaria.postgresql.org; Fri, 04 Sep 2015 13:40:50 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZXrEX-0004ql-FR for pgsql-hackers@arkaria.postgresql.org; Fri, 04 Sep 2015 13:40:49 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZXrEW-0004pU-8K for pgsql-hackers@postgresql.org; Fri, 04 Sep 2015 13:40:48 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZXrEU-00073G-0J for pgsql-hackers@postgresql.org; Fri, 04 Sep 2015 13:40:47 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id t84DehMw017082; Fri, 4 Sep 2015 09:40:43 -0400 From: Tom Lane To: Thomas Munro cc: Pg Hackers Subject: Re: Making tab-complete.c easier to maintain In-reply-to: References: Comments: In-reply-to Thomas Munro message dated "Sat, 05 Sep 2015 01:21:17 +1200" Date: Fri, 04 Sep 2015 09:40:43 -0400 Message-ID: <17081.1441374043@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Thomas Munro writes: > See attached a proof-of-concept patch. It reduces the size of > tab-complete.c by a bit over a thousand lines. I realise that changing so > many lines just to refactor code may may be a difficult sell! But I think > this would make it easier to improve the tab completion code in future, and > although it's large it's a superficial and mechanical change. I really dislike the magical "<" business. Maybe you could use NULL instead of having to reserve a class of real strings as placeholders. (That would require finding another way to denote the end of the list, but a separate count argument seems like a possible answer.) Or perhaps use empty strings as placeholders? regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers