unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: daanturo <daanturo@gmail.com>
To: 56260@debbugs.gnu.org
Subject: bug#56260: 29.0.50; Provide a way to define shortdoc groups without loading shortdoc.el
Date: Mon, 27 Jun 2022 22:06:29 +0700	[thread overview]
Message-ID: <13719b8d-abd9-810b-6e72-f95bc2288498@gmail.com> (raw)

Currently to use `define-short-documentation-group`, we must first load
`shortdoc.el`, but loading it isn't exactly a cheap task: my startup is
slowed down by ~0.0186s.

We can achieve this with an autoloaded progn:

```elisp

;; Allow registering shortdoc groups without loading this file

;;;###autoload
(progn
  (defvar shortdoc--groups nil)

  (defmacro define-short-documentation-group (group &rest functions)
    ;; docstring
    (declare (indent defun))
    `(progn
       (setq shortdoc--groups (delq (assq ',group shortdoc--groups)
                                    shortdoc--groups))
       (push (cons ',group ',functions) shortdoc--groups))))

```

-- 
Daanturo.






             reply	other threads:[~2022-06-27 15:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-27 15:06 daanturo [this message]
2022-06-28 12:42 ` bug#56260: 29.0.50; Provide a way to define shortdoc groups without loading shortdoc.el Lars Ingebrigtsen
2022-06-28 13:20   ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors

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=13719b8d-abd9-810b-6e72-f95bc2288498@gmail.com \
    --to=daanturo@gmail.com \
    --cc=56260@debbugs.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).