From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Akib Azmain Turja Newsgroups: gmane.emacs.devel Subject: Re: [NonGNU ELPA] 11 new packages! Date: Fri, 25 Nov 2022 19:07:03 +0600 Message-ID: <87fse79o94.fsf@disroot.org> References: <87r0y6ug9z.fsf@disroot.org> <87y1sct2hp.fsf@posteo.net> <87k03vf5m8.fsf@disroot.org> <87edu2narn.fsf@posteo.net> <8735aieqtr.fsf@disroot.org> <87cz9mlq3o.fsf@posteo.net> <875yfdd5ad.fsf@disroot.org> <87tu2n1p5v.fsf@posteo.net> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38039"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Emacs Developer List To: Philip Kaludercic Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Nov 25 18:17:50 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oycKj-0009et-1C for ged-emacs-devel@m.gmane-mx.org; Fri, 25 Nov 2022 18:17:49 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oycKN-00049a-R5; Fri, 25 Nov 2022 12:17:27 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oycKL-00048e-1h for emacs-devel@gnu.org; Fri, 25 Nov 2022 12:17:25 -0500 Original-Received: from knopi.disroot.org ([178.21.23.139]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oycKI-0007CZ-U7 for emacs-devel@gnu.org; Fri, 25 Nov 2022 12:17:24 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 5A7164092B; Fri, 25 Nov 2022 18:17:20 +0100 (CET) X-Virus-Scanned: SPAM Filter at disroot.org Original-Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qM77-OLm1BRi; Fri, 25 Nov 2022 18:17:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1669396639; bh=ESyaU+5kML2utjf2+iuy55E4LRLqoonymHUURUqQXuY=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=htETrBBGmIkFdO4IDch5ksfJgVm38zIPboNXSq/XQzoKaSwVHBU+1pJ9C+mOyFMTN xIuolZA0oX6mADmvmFGkjGsKKrrmustFUG4YIEYBRbUzRmX4uGZThE+TLIh5PL7axU t26zMQsJEg/U3fSySCejBCym0buirwDG53HQWTJiWzCrXIb++3ZKWzJSJgn8HBbgm+ 5EwmbCqitqP+CXo2c8GdByrIy6VjMbAC5wQTrmq95cJsuEC04LUgJMjqfUMPeb+9zT 8bxCF/x+wltGL7Pc8m1bn9Sx8gnsu5fRALAGVAp34hUr+k28kF3XLaoReOqw9f+Nad rzqvBRvdAMWFw== In-Reply-To: <87tu2n1p5v.fsf@posteo.net> (Philip Kaludercic's message of "Fri, 25 Nov 2022 07:14:36 +0000") Received-SPF: pass client-ip=178.21.23.139; envelope-from=akib@disroot.org; helo=knopi.disroot.org X-Spam_score_int: -4 X-Spam_score: -0.5 X-Spam_bar: / X-Spam_report: (-0.5 / 5.0 requ) BAYES_00=-1.9, DATE_IN_PAST_03_06=1.592, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:300500 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Philip Kaludercic writes: > > iwindow: > > diff --git a/iwindow.el b/iwindow.el > index c808bd26f9..eab2c3084b 100644 > --- a/iwindow.el > +++ b/iwindow.el > @@ -46,6 +46,8 @@ > ;;; Code: >=20=20 > (require 'cl-lib) > +;; By adding `seq' as a dependency you could lower the dependency on > +;; the minimum version of Emacs. >=20=20 Thanks. But then I would need to do the following: + cl-mapcar -> seq-mapn + cl-labels -> named-let (right?) + cl-letf* -> What? unwind-protect? Suggestions appreciated. > (defgroup iwindow nil > "Interactively manipulate windows." > @@ -54,7 +56,7 @@ > :prefix "iwindow-") >=20=20 > (defcustom iwindow-selection-keys > - '(?0 ?1 ?2 ?3 ?4 ?5 ?6 ?7 ?8 ?9) > + (number-sequence ?0 ?9) > "List of keys to use to select window. >=20=20 > Each element should be a key that `read-key' can return." Done. > @@ -141,8 +143,7 @@ list of form (OPTION...), whose length of no more tha= n the length of > (walk tree nil)) > (run-hook-wrapped 'iwindow-decoration-functions > (lambda (fn) (ignore (push fn decorators)))) > - (cl-labels ((call-decorators > - (fns) > + (cl-labels ((call-decorators (fns) > (with-selected-window current-window > (if fns > (funcall (car fns) windows Done. IIRC, Emacs indented the code as the following when I wrote it: =2D-8<---------------cut here---------------start------------->8--- (cl-labels ((call-decorators (fns) (with-selected-window current-window (if fns (funcall (car fns) windows =2D-8<---------------cut here---------------end--------------->8--- So I placed the argument list on its own line. > @@ -157,6 +158,7 @@ list of form (OPTION...), whose length of no more tha= n the length of > Return the window chosen." > (if (windowp tree) > (prog1 > + ;; Is there really a point to using `prog1' here? > tree > (redraw-display)) > (let ((option nil) I don't think so. I don't know why I wrote that, but looks like the code is same as (progn (redraw-display) tree). Changed. > @@ -192,7 +194,7 @@ WINDOW and ignore WINDOW when PREDICATE returns nil." > (seq-filter predicate windows) > windows))) > (when candidates > - (if (cdr candidates) ; (> (length candidates) 1) > + (if (cdr candidates) ;(length> candidates 1) > (iwindow--ask (iwindow--make-decision-tree > (vconcat windows) 0 (length windows) > predicate)) I was using Emacs 27 back then, hence that comment. Now I changed that. Anyway, is there any benefit that new primitive? > @@ -215,7 +217,7 @@ WINDOWS and CALLBACK is described in the docstring of > (alist-get (selected-window) > ',windows))) > (mapconcat > - (apply-partially #'string ? ) > + (apply-partially #'string ?\s) > keys "") > ',(alist-get (current-buffer) > original-mode-lines))))) Nice idea. Done. > @@ -261,6 +263,7 @@ WINDOWS and CALLBACK is described in the docstring of >=20=20 > WINDOWS and CALLBACK is described in the docstring of > `iwindow-decoration-functions', which see." > + ;; Again, recommending Compat you could make use of `named-let' here > (cl-labels ((setup-windows (window-list) > (with-selected-window (caar window-list) > (let ((ov nil)) Hmm, tail call optimization, interesting. =2D-=20 Akib Azmain Turja, GPG key: 70018CE5819F17A3BBA666AFE74F0EFA922AE7F5 Fediverse: akib@hostux.social Codeberg: akib emailselfdefense.fsf.org | "Nothing can be secure without encryption." --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEyVTKmrtL6kNBe3FRVTX89U2IYWsFAmOAvfcACgkQVTX89U2I YWvvsQ/9HfvLodOJFmFFYL4r36ippEZ/sWVLO224n2FJLfkBo48SrF6PPJPBdR/a 8Plg77DWudrC7ZpELHFKlyHXHV8+n6Oi4+Wkv1Rs9GD9rDCNr4NBv2AJOAj6N8Nv RTxTEotA0URDSWi8Fz3tSanSfqMeOuUxlENgcFYOFTIDokx4khWi00P94H1gUVL5 XYlGeo5a2rVZyB8F3tM4bEivdTH+fCoY0wLXGM8sT9xN+3BfX+tKI1W5TRJe4Nkr 7mvpYaKhhUwN51NuQ8eJAM2a4H22VvX7gAXorDAKVjOSF145uwp4aJwGLW389xgR fMBozSVHPwn2u1znpNU+VXk3DePNZpp1V0Hc9WQkiL9pl6NT7p0NjiKLIKKRoA9g 6XG6NQSNjPbGSKl1wtK9Ni+iQXt5tVr5ATkT4ZQrFr6M3fXnwHmclJXYk0FcOEiq UNWVU/anKMR7cOhTYg7SBBapBsWS6+viKDYHDKmsuxDOYiwhxp5jra393ctFQdXQ z499cHZe7tcUcSqy5WDBnAPMa6GfY2xfyBgVoaDGyrcMVArpOgp5mD0I2ybHvpyf zNUtef+w8pLCacaw9RLSZf7g/tDYPPAw8hspL+v/7wXjO7MNDJ0AiKR+x1UkyPG5 h7010LlJvDGux5JssZHrIOwyxv0eMizljItM87VbzhKP99ytciI= =GCQn -----END PGP SIGNATURE----- --=-=-=--