all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jonas Bernoulli via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: 73792@debbugs.gnu.org
Subject: bug#73792: 30; Confusion in loaddefs-generate--*-prefixes
Date: Sun, 13 Oct 2024 17:12:23 +0200	[thread overview]
Message-ID: <87ttdgavfs.fsf@bernoul.li> (raw)

Hello,

This comment confused me

,----
| (defun loaddefs-generate--make-prefixes (defs file)
|   ;; Remove the defs that obey the rule that file foo.el (or
|   ;; foo-mode.el) uses "foo-" as prefix.  Then compute a small set of
|   ;; prefixes that cover all the remaining definitions.
|   (let* ((tree (let ((tree radix-tree-empty))
|                  (dolist (def defs)
|                    (setq tree (radix-tree-insert tree def t)))
|                  tree))
|          (prefixes nil))
`----

as I could not see anything being removed here.

Digging through history I learned this comment was lifted from older
code shown below and removed in 1d4e90341782030cc7d8c29c639450b079587908,
where it was followed by commented code that would actually have done
that.

,----
| (defun autoload--make-defs-autoload (defs file)
| 
|   ;; Remove the defs that obey the rule that file foo.el (or
|   ;; foo-mode.el) uses "foo-" as prefix.
|   ;; FIXME: help--symbol-completion-table still doesn't know how to use
|   ;; the rule that file foo.el (or foo-mode.el) uses "foo-" as prefix.
|   ;;(let ((prefix
|   ;;       (concat (substring file 0 (string-match "-mode\\'" file)) "-")))
|   ;;  (dolist (def (prog1 defs (setq defs nil)))
|   ;;    (unless (string-prefix-p prefix def)
|   ;;      (push def defs))))
| 
|   ;; Then compute a small set of prefixes that cover all the
|   ;; remaining definitions.
`----

Thus, the first sentence (and the following "Then") should be removed
from the new comment.

----
And now for something completely different... (As in "here you might
want to *add* a comment" ;P )

loaddefs-generate--compute-prefixes ignores definitions with an
autoload cookie:

,----
|             (when (save-excursion
|                     (goto-char (match-beginning 0))
|                     (or (bobp)
|                         (progn
|                           (forward-line -1)
|                           (not (looking-at ";;;###autoload")))))
|               (push name prefs))))))
`----

Why?!

I might overlook something, but it seems that the old implementation
in pre-1d4e90341782030cc7d8c29c639450b079587908 autoloads.el didn't
do that.

     Cheers,
     Jonas





             reply	other threads:[~2024-10-13 15:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-13 15:12 Jonas Bernoulli via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-10-13 15:49 ` bug#73792: 30; Confusion in loaddefs-generate--*-prefixes Eli Zaretskii

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

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

  git send-email \
    --in-reply-to=87ttdgavfs.fsf@bernoul.li \
    --to=bug-gnu-emacs@gnu.org \
    --cc=73792@debbugs.gnu.org \
    --cc=jonas@bernoul.li \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.