From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 1504 invoked from network); 8 Sep 2020 16:59:26 -0000 Received: from lists1.math.uh.edu (129.7.128.208) by inbox.vuxu.org with ESMTPUTF8; 8 Sep 2020 16:59:26 -0000 Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by lists1.math.uh.edu with smtp (Exim 4.94) (envelope-from ) id 1kFgxK-00CjTj-7t; Tue, 08 Sep 2020 11:58:54 -0500 Received: from mx2.math.uh.edu ([129.7.128.33]) by lists1.math.uh.edu with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1kFgxF-00CjRo-EE for ding@lists.math.uh.edu; Tue, 08 Sep 2020 11:58:49 -0500 Received: from quimby.gnus.org ([95.216.78.240]) by mx2.math.uh.edu with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1kFgxD-0085RN-HE for ding@lists.math.uh.edu; Tue, 08 Sep 2020 11:58:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Transfer-Encoding:Content-Type:Mime-Version:References :Message-ID:Date:Subject:From:To:Sender:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=jYDcjT/O3m5RVEK0EhGwc6xZvTRcjDCpHIPlospJ/IM=; b=DWiSFUDL0InQgBkxeLVVKgS0Oh QsJy6g+E/PyzR889Jqya2jawzkceg78FlTj1f0Z6kURMHT4dvx3mmYfyw891hoBlC2kcbn4uxYi1+ +C4VRyW2lkDNlXg1EJZkpGxNOeCxkIY8AHXCmORW1cvjtVMvKnOsWiEuW+o3L7mfqTrM=; Received: from static.214.254.202.116.clients.your-server.de ([116.202.254.214] helo=ciao.gmane.io) by quimby with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kFgx4-0005gh-ST for ding@gnus.org; Tue, 08 Sep 2020 18:58:43 +0200 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1kFgx2-00036I-Oy for ding@gnus.org; Tue, 08 Sep 2020 18:58:36 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: ding@gnus.org From: Eric Abrahamsen Subject: Re: GitLab integration take two, light edition Date: Tue, 08 Sep 2020 09:58:28 -0700 Message-ID: <871rjc6w97.fsf@ericabrahamsen.net> References: <87k0xi79qt.fsf@tullinup.koldfront.dk> <87wo1hffz0.fsf@ericabrahamsen.net> <87d02yss6h.fsf@tullinup.koldfront.dk> <87tuwashjf.fsf@ericabrahamsen.net> <87sgbtzec4.fsf@tullinup.koldfront.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cancel-Lock: sha1:iKXNB317Ljo2doqvA6hhSFm8va4= List-ID: Precedence: bulk Adam Sjøgren writes: [...] > (let ((milestone (cdr (or (assoc "milestone" issue) '("default" . nil)))) > (state (cdr (or (assoc-string "state" issue) '("default" . "unknown")))) > (labels (cdr (or (assoc-string "labels" issue) '("default" . nil))))) > (widen) > (message-goto-eoh) > (when milestone > (insert "GitLab-Milestone: " (cdr (or (assoc-string > "title" milestone) '("default". "unknown"))) "\n")) This is all looking good, though there's some refactoring you could do here (there's always refactoring that could be done) -- you've already guarded against no milestone in the let, then you're checking "(when milestone", which will always be true now, and then you do the guard all over again in the body. I'm know you're still in the middle of whacking this all together, but I thought it might be worth mentioning. In general, the repetition of the (cdr (or (assoc-string ..) '("default" . nil))) pattern all over the place is a good indication that there's a cleaner approach. [...] >>> No, I just don't know (e)lisp, neither the vocabulary of functions nor >>> the idioms :-) >> >> Could have fooled me, you do pretty well with bug-hunting on this list! > > That's just experience, which is much easier than knowledge. Hmm, that's debatable! But I take your point.