From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Oleh Krehel Newsgroups: gmane.emacs.devel Subject: Re: giving `setq-local' the same signature as `setq' Date: Thu, 19 Mar 2015 16:55:39 +0100 Message-ID: <87vbhx2d8k.fsf@gmail.com> References: <0471cc2e-84d4-4a15-88b6-92a980e2949e@default> <87bnjp3tkv.fsf@gmail.com> <7455a7dd-8c32-4681-95a0-6d09f50ac169@default> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1426780924 10932 80.91.229.3 (19 Mar 2015 16:02:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 19 Mar 2015 16:02:04 +0000 (UTC) Cc: Jordon Biondo , rms@gnu.org, Stefan Monnier , emacs-devel@gnu.org To: Drew Adams Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Mar 19 17:01:59 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YYctS-0001wL-2P for ged-emacs-devel@m.gmane.org; Thu, 19 Mar 2015 17:01:58 +0100 Original-Received: from localhost ([::1]:39938 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYctR-0001VL-Au for ged-emacs-devel@m.gmane.org; Thu, 19 Mar 2015 12:01:57 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59769) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYcs1-0008OF-31 for emacs-devel@gnu.org; Thu, 19 Mar 2015 12:00:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YYcrt-0005ku-5F for emacs-devel@gnu.org; Thu, 19 Mar 2015 12:00:29 -0400 Original-Received: from mail-wg0-x229.google.com ([2a00:1450:400c:c00::229]:35320) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYcro-0005k4-GI; Thu, 19 Mar 2015 12:00:16 -0400 Original-Received: by wgdm6 with SMTP id m6so66423102wgd.2; Thu, 19 Mar 2015 09:00:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=w6W3W0vCYN3L6Jac7rH28vaLhqBNZXyiaS+8fFuiloU=; b=kETpB6vSnMbPlr73ZN6+JQgoijVlQHhQYTMXYeMs8vRC537xc6203VPU1yveqf6QPH fxEVATWgjCJaY3nDveixBOG8sjLrV+cq7wRVRR/+EjzvMbVTKKjc9aMKneiHH8qM4Cc7 RFhl7dFk/+01vE0/aJ4z9bypcAZSMzSpJh38fdQwlJf4ppyAZvR4E5yr05XMFsD2J4x4 REJ4KYk6bVg8+NkkepmujXslnmkk3DUfUP8wJ1gjopn7pGwfCXIzl2/Rb/8GK9o3rsLB fbuEi5Ek0ZcfqLuN7LXDD3ic/km3Fd5HaqK3MBsRx6wzEw18rRy4sC36ADzz5ByzrpJb 3ZTw== X-Received: by 10.194.80.193 with SMTP id t1mr156569714wjx.8.1426780815497; Thu, 19 Mar 2015 09:00:15 -0700 (PDT) Original-Received: from firefly (dyn069045.nbw.tue.nl. [131.155.69.45]) by mx.google.com with ESMTPSA id m4sm2499794wjb.25.2015.03.19.09.00.14 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 19 Mar 2015 09:00:14 -0700 (PDT) In-Reply-To: <7455a7dd-8c32-4681-95a0-6d09f50ac169@default> (Drew Adams's message of "Thu, 19 Mar 2015 08:39:39 -0700 (PDT)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.91 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c00::229 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:184021 Archived-At: Drew Adams writes: >> I very much prefer the only-one-variable-per-setq style. > > You're in luck then. You have the choice. ;-) What I meant to say that I very much prefer the only-one-variable-per-setq style when interacting with other people's code. Obviously, I don't use this notation in my own code. > > You can do the same for `let*', if you like: > > (let ((foo fooval)) > (let ((phlop phlopval)) > (let ((toto totoval)) > ...))) > Now you've just lead yourself into a trap. This is similar to one-var-per-setq: (let* ((foo fooval) (phlop phlopval) (toto totoval)) ...) This is similar to multi-var-per-setq: (let* (foo fooval phlop phlopval toto totoval) ...) It already looks bad for single symbol statements. Imagine how bad it would be if they were more complex. >> It shows much more clearly where the variable is. > > Where the variable is? How so? (Where is it? Where's Waldo?) Obviously, the variable is by the big fat left paren. >> It also gives an anchor to quickly navigate to the variable >> to get its value. > > How so? Please elaborate. With C-M-n and C-M-p you can navigate to the big fat paren by which the variable resides (after setq). >> In a setq list of 10 items, by item 5 it is already unclear which is the >> variable and which is the value. In my opinion, it's not worth >> complicating the code maintenance just to save a few chars. > > This is why it is good that you have the choice. You're wrong here. I don't have the choice. Just yesterday I was debugging my AUCTEX config. It wasn't pleasant to navigate 5-variable setq statements, some of which took the whole page. > I find it clearer to let `setq' do the grouping, instead of implicit or > explicit `progn'. But I put each var & value pair on a separate line: > > (setq foo fooval > phlop phlopval ; Maybe this one needs a comment. > toto totoval) > > I don't do this to save characters (e.g. for typing). I do it to make > the code clearer and maintenance less error prone and easier. For me, > at least. Imagine that you want to comment out `phlop phlopval', which is a multi-line statement. If it was bounded by parens, you could do it in an easy and error-free way. Otherwise, you have to manually select the region. Oleh