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: Tue, 22 Nov 2022 23:42:10 +0600 Message-ID: <87cz9ex4wd.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> <87wn7o9n0i.fsf@posteo.net> <87cz9fyq1g.fsf@disroot.org> <87r0xuapfv.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="30758"; 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 Tue Nov 22 18:54:13 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 1oxXTJ-0007kc-Ln for ged-emacs-devel@m.gmane-mx.org; Tue, 22 Nov 2022 18:54:13 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oxXSk-0002sk-Sw; Tue, 22 Nov 2022 12:53:38 -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 1oxXSj-0002sZ-S8 for emacs-devel@gnu.org; Tue, 22 Nov 2022 12:53:37 -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 1oxXSi-0001lT-07 for emacs-devel@gnu.org; Tue, 22 Nov 2022 12:53:37 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id C36EE4138C; Tue, 22 Nov 2022 18:53:34 +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 Fy-FXNucW5tB; Tue, 22 Nov 2022 18:53:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1669139613; bh=8ND7f9ot/J2f0AUCh+CBJi/X7xSuieuRmjbPSTK14S4=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=IRm9gw00hxkP28Xopu5zDKM3gp8eIzGWSBYcder7REHjqdX5A5K7N1bbmlOusXrIJ 07207yd0BMWtg3QNHiIKHQbUKrqVl1LhR7TRoCPZq/5sN0rWhLbDrzd2YxJIRWBlgt JUe1WvdsvMuqRPax+eRJHJEBIEzWSCmF8GxlraabNipXDOwxCT8BPyJjRjZCLa2tBl Si+QJmHIfy18yQcqIULdiXlj/vN0vBVypzrUU7oFoGz0LbPMr7M7xWcccW7mQPBTEA r7EB+PXR7pDqAlDkz6rW6ou/UTvS9SGggHWEC1Gut/uyKtaOp5cuxHGEhvVMtoxzPA BUzZpJOPn67JA== In-Reply-To: <87r0xuapfv.fsf@posteo.net> (Philip Kaludercic's message of "Tue, 22 Nov 2022 17:07:00 +0000") Received-SPF: pass client-ip=178.21.23.139; envelope-from=akib@disroot.org; helo=knopi.disroot.org X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, 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=ham 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:300341 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Philip Kaludercic writes: >>> I've managed to skim through workroom.el. The code looks great, so I >>> just have a non-comprehensive list of comments and ideas: >> >> Really? It was one of my worst packages until I almost rewrote it over >> the last few weeks. > > The coding style was clean and the documentation went into details. > That is good stuff in my book :) I can't remember writing any comments, and the docstring are just the result of checkdoc, which always teases me as I program. > >>> (defun workroom-rebind-command-map-prefix () >>> "Rebind command prefix key sequence `workroom-command-map-prefix'." >>> (substitute-key-definition >>> @@ -234,6 +235,7 @@ The value is a mode line terminal like `mode-line-f= ormat'." >>> ;;;; Workroom and View Manipulation. >>>=20=20 >>> (cl-defstruct (workroom--room >>> + (:predicate workroomp) >>> (:constructor workroom--make-room) >>> (:copier workroom--copy-room)) >>> "Structure for workroom." >>> @@ -253,6 +255,7 @@ The value is a mode line terminal like `mode-line-f= ormat'." >>> :documentation "`completing-read' history of view names.")) >>>=20=20 >>> (cl-defstruct (workroom--view >>> + (:predicate workroom-view-p) >>> (:constructor workroom--make-view) >>> (:copier workroom--copy-view)) >>> "Structure for view of workroom." >>> @@ -268,7 +271,7 @@ The value is a mode line terminal like `mode-line-f= ormat'." >>> (defvar workroom--dont-clear-new-view nil >>> "Non-nil mean don't clear empty new views.") >> >> They don't get a docstring on my machine. :( > > That might be the case. In that case you can keep the previous code, > and perhaps define the prettier variants using `defalias`, or by > manually annotating a function symbol. I think I'll keep the code. > >>>=20=20 >>> -(defvar workroom--rooms nil >>> +(defvar workroom--rooms nil ;maybe some comments on the structure >>> "List of currently live workrooms.") >> >> As the docstring describes, it's a list, and all elements satisfies >> `workroomp'. > > Hmm, I guess that is self-descriptive enough. I was wondering if this > was a alist or something else. > >>> @@ -558,7 +552,7 @@ Return DEF when input is empty, where DEF is either= a string or nil. >>>=20=20 >>> REQUIRE-MATCH and PREDICATE is same as in `completing-read'." >>> (completing-read >>> - (concat prompt (when def (format " (default %s)" def)) ": ") >>> + (concat prompt (and def (format " (default %s)" def)) ": ") ;Compat= has `format-prompt' >>> (mapcar #'workroom-name workroom--rooms) predicate require-match >>> nil 'workroom-room-history def)) >> >> I don't have much idea about Compat, how does it work? > > Compat is provided on ELPA. If you add it as a dependency and load it, > it will define missing functionality on older systems. > > The documentation goes into greater detail: > https://elpa.gnu.org/packages/doc/compat.html#Usage. > > But as everything else, this is just a "fun fact", nothing critical. OK, I've change the code to use format-prompt, just only because it's customizable with the user option minibuffer-default-prompt-format. > >>> @@ -1254,7 +1248,7 @@ ACTION and ARGS are also described there." >>> (setf (workroom-buffer-manager-data room) >>> (cl-delete-if-not #'buffer-live-p >>> (workroom-buffer-manager-data room))) >>> - (pcase action >>> + (pcase action ;perhaps match on (cons action args)? >>> (:initialize >>> (cl-destructuring-bind () args >>> (setf (workroom-buffer-manager-data room) >> >> I wonder why I used cl-destructuring-bind when there isn't any keyword >> arguments. >> >> Fixing... >> Fixing...done > > I assumed this was just for the sake of consistency? After all, my > suggestion does do one unnecessary `cons' for the sake of convenience. =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----- iQIzBAEBCAAdFiEEyVTKmrtL6kNBe3FRVTX89U2IYWsFAmN9CfIACgkQVTX89U2I YWuDixAAwjn7Dq8sKGUP48W0O0wMAFHiHpqTXOqM7MSnDJU7TbxxMDOIWUa7GU0p l/8cn1H+3ldxMLQrCPdUSK/etbnFu8G+tJk0uXy3beFkZybgqMnkK5w0CsshgLtK 5P4vBhVGVambR/rK0bLuk3bRYlrwhyMxDEY0lDil4Oh/fZTdU3qPoF+ckohJTJ/2 UGDUguaDMWvHGrTMQjYLSAD7AIKKnkC9s7fpLAILdzPV7fpcN74fqQSgNxr62gZb ikMDXA6WkLkME8Vbpb8ybJiiQIw3Lg26YLHHsafCglACZHZDnQ0SyheAm+4OHVeG h82NRG6Ueh4zw34PpXTrE317eEkipsFxIkuM6uITCYmYeixLrDXW86AaDXEkGaaA gpNt9WrNEOyRm3E/4cvvFF1CQ3UlQBIQZeWP3T8r4E9j/vyE7wDuG4+5gg3QUpC+ ZKh9cZMDMGZcRleojlNn0fleLIyQ5MW+DJe0DkOECJ1VQ3IBUYXVGIJ9eqaGnh+0 h1Lm53p6yAoyFjbiNBISTbETQV6lbzG6SwHa3rgOBJQvp1I8U0kBUNRcDY3GOjoV HmKFsYkTo+qwXdLC3wG6BZsP7VXbEV9IDLmdkVwHZzT4H+C4ZwXYZyDUB0+2ahlT uZuP+GZi0ypFFJR0n5Yuwne3zKyFqxJDG5XAtrcI4OTAz6a+OVs= =xIMx -----END PGP SIGNATURE----- --=-=-=--