From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.devel Subject: Re: question regarding my emacs package Date: Thu, 08 Jun 2023 07:26:37 +0000 Message-ID: <877csetnwy.fsf@posteo.net> References: <6cG8Tc55Zz8xk6rE6mJLfDxckAINPcYqp781yltsndzqq5146yw76EZ_2CoUtQT4P2j2afSx5VRD5G1-9qzFHWAW3LxYWwmxh87lvB2MgNE=@rj95.be> <873533mfq3.fsf@posteo.net> <87y1kvkv2f.fsf@posteo.net> <2pOYRsmOk_f2sx48BICCjf9r3Z5OviLDonOFi4dhWoSpd_dAWOXFSA3jO2YeyJ5FBf-Sydd0ZTzTOsAlIg8tc_eBqM9nzq2PW4q4usn4Nuo=@rj95.be> <87ilbzkq9y.fsf@posteo.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25962"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "emacs-devel@gnu.org" To: ram Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jun 08 09:27:09 2023 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 1q7A33-0006Zo-Fs for ged-emacs-devel@m.gmane-mx.org; Thu, 08 Jun 2023 09:27:09 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q7A2i-00066b-Ou; Thu, 08 Jun 2023 03:26:49 -0400 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 1q7A2d-0005xf-JN for emacs-devel@gnu.org; Thu, 08 Jun 2023 03:26:46 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q7A2a-0007KV-N3 for emacs-devel@gnu.org; Thu, 08 Jun 2023 03:26:42 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id CE226240103 for ; Thu, 8 Jun 2023 09:26:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1686209198; bh=vIYWIXX6NZJsi3UYVvIL3PfduOjfa7DgfwYeZg3oMSI=; h=From:To:Cc:Subject:Autocrypt:Date:Message-ID:MIME-Version:From; b=MAFXLTgVyIh9l7cK8/frx7qJ9j+WxUZ5vj5891NXtHlOXEZ6d2gR6W2qwdFvoEHUZ tLBVgsIj5Ly8WnafCmDfU/EwgPLTCOe9GBzSr62cYk93J+ZePjJ3zEzMkypnCAe4bq j2z5mKGdSUDT4PygvQjT2+w+zpoWj+0QsY5AAgVqlMmDdNyJQgrNf2SXKfklTuKeP1 oOEt34q4GQHWTZu1Yw0JbO7iU5A5osyW218Sr27zgLlZ0BnV+rPxjqaaDs2c67I8sH wr0/6flWdlaPOKjsaqfsGQ7Fjwqnh+oEbPPEhol30PALHmd4qX3CI7Obhww81nWNao 38ai+Uv5eEzIA== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4QcG3y2V5wz9rxN; Thu, 8 Jun 2023 09:26:38 +0200 (CEST) In-Reply-To: (ram's message of "Thu, 08 Jun 2023 07:13:41 +0000") Autocrypt: addr=philipk@posteo.net; keydata= mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof z4oM Received-SPF: pass client-ip=185.67.36.66; envelope-from=philipk@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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:306696 Archived-At: --=-=-= Content-Type: text/plain ram writes: > i believe i've incorporated your suggestions, fixed the bugs, and satisfied check doc. let me know what else i need to do, eg fsf copyright notice, etc Here are a few more things I noticed: --=-=-= Content-Type: text/plain Content-Disposition: inline diff -u /tmp/breadcrumbs.el.1 /tmp/breadcrumbs.el --- /tmp/breadcrumbs.el.1 2023-06-08 09:20:18.490560968 +0200 +++ /tmp/breadcrumbs.el 2023-06-08 09:23:13.217684032 +0200 @@ -35,9 +35,9 @@ ;; https://github.com/gitrj95/breadcrumbs.el ;; ;; In order to use breadcrumbs, `breadcrumbs-mode' must be enabled. -;; -;;; Interface: -;; + +;;;; Interface: + ;; `breadcrumbs-drop-breadcrumb' adds the current position in the ;; buffer to a ring. If point is at a known breadcrumb, the existing ;; breadcrumb will be moved to the head of the ring. Adding @@ -103,28 +103,26 @@ "Set up the state required to start using breadcrumbs." (unless breadcrumbs-ring (setq breadcrumbs-ring (make-ring breadcrumb-ring-max))) - (mapcar (lambda (fn) - (advice-add fn :around #'breadcrumbs--drop-around)) - breadcrumbs-drop-around-fn-list)) + (dolist (fn breadcrumbs-drop-around-fn-list) + (advice-add fn :around #'breadcrumbs--drop-around))) (defun breadcrumbs--teardown () "Tear down the state required for breadcrumbs." (setq breadcrumbs-ring nil breadcrumbs--neighbor nil) - (mapcar (lambda (fn) - (advice-remove fn #'breadcrumbs--drop-around)) - breadcrumbs-drop-around-fn-list)) + (dolist (fn breadcrumbs-drop-around-fn-list) + (advice-remove fn #'breadcrumbs--drop-around))) (defun breadcrumbs--switch-to-fileless-buffer (breadcrumb) - "Switch to BREADCRUMB's `fileless-buffer-name' if it is non-nil and optionally remove dead ones." + "Switch to BREADCRUMB's `fileless-buffer-name' if it is non-nil. +Optionally remove dead ones." (if-let* ((buffer-name (breadcrumbs--breadcrumb-fileless-buffer-name breadcrumb)) (buffer (get-buffer buffer-name))) (switch-to-buffer buffer) (when (yes-or-no-p (format "%s has been killed. Remove from all instances from `breadcrumbs-ring'? " buffer-name)) - (mapcar (lambda (breadcrumb-to-remove) - (when (equal buffer-name (breadcrumbs--breadcrumb-fileless-buffer-name breadcrumb-to-remove)) - (ring-remove breadcrumbs-ring (ring-member breadcrumbs-ring breadcrumb-to-remove)))) - (ring-elements breadcrumbs-ring)) + (dolist (breadcrumb-to-remove (ring-elements breadcrumbs-ring)) + (when (equal buffer-name (breadcrumbs--breadcrumb-fileless-buffer-name breadcrumb-to-remove)) + (ring-remove breadcrumbs-ring (ring-member breadcrumbs-ring breadcrumb-to-remove)))) (breadcrumbs-list--revert) nil))) @@ -170,7 +168,7 @@ ((eq direction 'previous) (ring-next breadcrumbs-ring jump-target))))) (breadcrumbs--neighbor (when (eq direction 'previous) - (breadcrumbs--jump breadcrumbs--neighbor)))))) + (breadcrumbs--jump breadcrumbs--neighbor)))))) ;;;###autoload (define-minor-mode breadcrumbs-mode @@ -195,9 +193,9 @@ (defun breadcrumbs--format-breadcrumb (breadcrumb) "Return BREADCRUMB's formatted slots as a vector." (let* ((buffer-file-name (breadcrumbs--breadcrumb-buffer-file-name breadcrumb)) - (buffer-position (breadcrumbs--breadcrumb-buffer-position breadcrumb)) - (buffer-name (breadcrumbs--breadcrumb-fileless-buffer-name breadcrumb)) - (breadcrumb-name (or buffer-file-name buffer-name))) + (buffer-position (breadcrumbs--breadcrumb-buffer-position breadcrumb)) + (buffer-name (breadcrumbs--breadcrumb-fileless-buffer-name breadcrumb)) + (breadcrumb-name (or buffer-file-name buffer-name))) (vector (breadcrumbs--format-slot breadcrumb-name 64) (breadcrumbs--format-slot buffer-position 16)))) @@ -207,7 +205,8 @@ (mapcar (lambda (breadcrumb) (list breadcrumb - (breadcrumbs--format-breadcrumb breadcrumb))) (ring-elements breadcrumbs-ring))) + (breadcrumbs--format-breadcrumb breadcrumb))) + (ring-elements breadcrumbs-ring))) (defun breadcrumbs-list--revert () "Reverts `breadcrumbs-list-buffer'." @@ -232,7 +231,7 @@ (ring-remove breadcrumbs-ring (ring-member breadcrumbs-ring (tabulated-list-get-id))) (when (ring-empty-p breadcrumbs-ring) - (setq breadcrumbs--neighbor nil)) + (setq breadcrumbs--neighbor nil)) (breadcrumbs-list--revert)) ;;;###autoload Diff finished. Thu Jun 8 09:24:02 2023 --=-=-= Content-Type: text/plain The main things were inconsistent indentation, using mapcar for side-effects (if anything mapc should be used in that case, but I think dolist is the best choice) and there still was one checkdoc complaint. On the topic of docstrings, I think you should invest some more time to make them understandable to someone who doesn't already know what the code is about. Have you signed the FSF copyright assignment? > ------- Original Message ------- > On Wednesday, June 7th, 2023 at 6:34 PM, ram wrote: > > >> >> >> just got back to this. calling find-file appears to not open the new >> file when called through the code. i'm not immediately sure what the >> problem is. any tips? i'll look more into this tonight >> >> >> >> >> ------- Original Message ------- >> On Wednesday, June 7th, 2023 at 3:50 PM, ram chat@rj95.be wrote: >> >> >> >> > yes i figured; i found other bugs as well, but i don't think this is a typo. i'll dig a bit more and see what i can find >> > >> > ------- Original Message ------- >> > On Wednesday, June 7th, 2023 at 3:48 PM, Philip Kaludercic philipk@posteo.net wrote: >> > >> > > ram chat@rj95.be writes: >> > > >> > > > changing the central type from defclass to cl-defstruct has appeared >> > > > to cause bugs? >> > > >> > > That might have been a typo on my end, I did not evaluate the code and >> > > was is a hurry to send you the diff. My point is that you don't need >> > > defclass, unless I am missing something in your code (and I don't think >> > > the minimal convenience of `with-slots' warrants classes here). >> > > >> > > > i am not sure what to make of this, but find-file and >> > > > its variants do not appear to work when changing only this. the file >> > > > is not opened; it is not that the file is opened but the active buffer >> > > > isn't switched >> > > > >> > > > ------- Original Message ------- >> > > > On Wednesday, June 7th, 2023 at 2:04 PM, Philip Kaludercic philipk@posteo.net wrote: >> > > > >> > > > > Philip Kaludercic philipk@posteo.net writes: >> > > > > >> > > > > > > here is the repo: https://github.com/gitrj95/breadcrumbs.el >> > > > > > >> > > > > > Here are a few suggestions: >> > > > > >> > > > > Oh, and can you address the issue raised by checkdoc? --=-=-=--