unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Philip Kaludercic <philipk@posteo.net>
To: ram <chat@rj95.be>
Cc: "emacs-devel@gnu.org" <emacs-devel@gnu.org>
Subject: Re: question regarding my emacs package
Date: Thu, 08 Jun 2023 07:26:37 +0000	[thread overview]
Message-ID: <877csetnwy.fsf@posteo.net> (raw)
In-Reply-To: <zAz6p8IPfgWH2iiN1XM02lN2EDmUyJ3TuBaypoXQBQWNLuz95NCLgL05ZSE8qXzXYjRlCe2bzRa37VXTp0jJYqfbRmxh0RRxwgsj3XR5bwk=@rj95.be> (ram's message of "Thu, 08 Jun 2023 07:13:41 +0000")

[-- Attachment #1: Type: text/plain, Size: 222 bytes --]

ram <chat@rj95.be> 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:


[-- Attachment #2: Type: text/plain, Size: 4356 bytes --]

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

[-- Attachment #3: Type: text/plain, Size: 2267 bytes --]


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 <chat@rj95.be> 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?

  reply	other threads:[~2023-06-08  7:26 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-07  3:18 question regarding my emacs package ram
2023-06-07 15:53 ` Philip Kaludercic
2023-06-07 18:04   ` Philip Kaludercic
2023-06-07 19:45     ` ram
2023-06-07 19:48       ` Philip Kaludercic
2023-06-07 19:50         ` ram
2023-06-07 22:34           ` ram
2023-06-08  7:13             ` ram
2023-06-08  7:26               ` Philip Kaludercic [this message]
2023-06-08 18:50                 ` ram
2023-09-08  7:40                   ` Philip Kaludercic
2023-06-11 11:41                 ` Madhu
2023-06-12 12:52                   ` Madhu
2023-06-12 16:40                     ` Andrea Corallo
2023-06-13  4:01                       ` Madhu
2023-06-13  8:55                         ` Andrea Corallo
2023-06-13  9:19                           ` Madhu
2023-06-13 23:55                             ` Michael Heerdegen
2023-06-14 16:10                               ` Mattias Engdegård
2023-06-16  3:53                                 ` Michael Heerdegen
2023-06-16  4:46                                   ` Madhu
2023-06-16 15:28                   ` Michael Heerdegen
2023-06-17  3:01                     ` ram via Emacs development discussions.
2023-06-18  0:40                       ` Michael Heerdegen
2023-06-29 19:28                       ` ram
2023-06-11 18:49 ` João Távora
2023-06-11 19:08   ` ram via Emacs development discussions.
2023-06-12  8:45     ` Philip Kaludercic
2023-06-12 10:23       ` João Távora
2023-06-12 10:54         ` Philip Kaludercic
2023-06-12 20:43           ` João Távora
2023-06-13  0:36             ` ram via Emacs development discussions.
2023-06-13 18:13               ` João Távora
2023-06-13 21:46                 ` ram

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877csetnwy.fsf@posteo.net \
    --to=philipk@posteo.net \
    --cc=chat@rj95.be \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).