From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Thien-Thi Nguyen Newsgroups: gmane.emacs.help Subject: Re: How do i say it in emacs lisp Date: Wed, 21 Dec 2016 19:19:41 +0100 Message-ID: <8760mdta9u.fsf@zigzag.favinet> References: <20161128092100.GA23484@tuxteam.de> Reply-To: help-gnu-emacs@gnu.org NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Trace: blaine.gmane.org 1482352292 30026 195.159.176.226 (21 Dec 2016 20:31:32 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 21 Dec 2016 20:31:32 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) Cc: "help-gnu-emacs@gnu.org" To: Matthias Pfeifer Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Dec 21 21:31:29 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cJnXn-0006a7-LR for geh-help-gnu-emacs@m.gmane.org; Wed, 21 Dec 2016 21:31:23 +0100 Original-Received: from localhost ([::1]:58881 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cJnXs-0001rD-1S for geh-help-gnu-emacs@m.gmane.org; Wed, 21 Dec 2016 15:31:28 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56155) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cJnXA-0001qo-Ns for help-gnu-emacs@gnu.org; Wed, 21 Dec 2016 15:30:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cJnX7-0007OL-Bp for help-gnu-emacs@gnu.org; Wed, 21 Dec 2016 15:30:44 -0500 Original-Received: from mail.agora-net.com ([67.59.132.6]:40457) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cJnX7-0007MV-5f for help-gnu-emacs@gnu.org; Wed, 21 Dec 2016 15:30:41 -0500 Original-Received: from ttn by mail.agora-net.com with local (Exim 4.82) (envelope-from ) id 1cJnX4-0000Ug-SG; Wed, 21 Dec 2016 15:30:38 -0500 Original-Received: from ttn by zigzag.favinet with local (Exim 4.80) (envelope-from ) id 1cJlUW-0005tc-OZ; Wed, 21 Dec 2016 19:19:52 +0100 Mail-Followup-To: help-gnu-emacs@gnu.org In-Reply-To: (Matthias Pfeifer's message of "Mon, 28 Nov 2016 11:50:32 +0000") X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: ttn@gnuvola.org X-SA-Exim-Scanned: No (on mail.agora-net.com); SAEximRunCond expanded to false X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 67.59.132.6 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:111992 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable () Matthias Pfeifer () Mon, 28 Nov 2016 11:50:32 +0000 Second opinion is welcome :-) Cool. (let* (... (neo-buf nil) (other-buf nil) (neo-wnd nil) (other-wnd nil) (filename nil) ...) You can write these w/o the =E2=80=98nil=E2=80=99 and even w/o the per-var parens. Conventionally, such vars are grouped at the end of the =E2=80=98let=E2=80=99 VARLIST block, e.g.: (let* ((v1 1) (v2 2) v3 v4 v5) .= ..). (when (and neo-buffer (or (eq buf-0 neo-buffer) (eq buf-1 neo-buffer))) presuming =E2=80=98buf-0=E2=80=99 and =E2=80=98buf-1=E2=80=99 are never nil= , you can use =E2=80=98memq=E2=80=99: (when (memq neo-buffer (list buf-0 buf-1))=20 This constructs a list and discards it after the =E2=80=98memq=E2=80=99 so = maybe not too indicated if gratuitous garbage goes against your grain. (progn This is superfluous; (when (progn ...)) =E2=89=A1 (when ...) in meaning. Same goes for the other =E2=80=98progn=E2=80=99. =2D-=20 Thien-Thi Nguyen ----------------------------------------------- (defun responsep (type via) (case type (technical (eq 'mailing-list via)) ...)) 748E A0E8 1CB8 A748 9BFA =2D-------------------------------------- 6CE4 6703 2224 4C80 7502 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlhax8AACgkQZwMiJEyAdQIwFwCdGwan5NTBRECGOZ53MukV0QoR UeUAn3bK9NE23HfDQR7Yy4bXB77JN786 =LMl5 -----END PGP SIGNATURE----- --=-=-=--