all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#56260: 29.0.50; Provide a way to define shortdoc groups without loading shortdoc.el
@ 2022-06-27 15:06 daanturo
  2022-06-28 12:42 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: daanturo @ 2022-06-27 15:06 UTC (permalink / raw)
  To: 56260

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.






^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-06-28 13:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-27 15:06 bug#56260: 29.0.50; Provide a way to define shortdoc groups without loading shortdoc.el daanturo
2022-06-28 12:42 ` Lars Ingebrigtsen
2022-06-28 13:20   ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors

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.