* 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
* bug#56260: 29.0.50; Provide a way to define shortdoc groups without loading shortdoc.el
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
0 siblings, 1 reply; 3+ messages in thread
From: Lars Ingebrigtsen @ 2022-06-28 12:42 UTC (permalink / raw)
To: daanturo; +Cc: 56260
daanturo <daanturo@gmail.com> writes:
> 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
I've now done this in Emacs 29. An alternative approach would be to
move all the definitions of groups out of shortdoc.el into a different
file so that loading shortdoc.el would be fast.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#56260: 29.0.50; Provide a way to define shortdoc groups without loading shortdoc.el
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
0 siblings, 0 replies; 3+ messages in thread
From: Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-06-28 13:20 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: 56260, daanturo
Lars Ingebrigtsen [2022-06-28 14:42 +0200] wrote:
> daanturo <daanturo@gmail.com> writes:
>
>> 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:
>
> I've now done this in Emacs 29. An alternative approach would be to
> move all the definitions of groups out of shortdoc.el into a different
> file so that loading shortdoc.el would be fast.
See also this thread that hypothesised about some alternative
approaches: https://lists.gnu.org/r/emacs-devel/2021-09/msg01719.html
Thanks,
--
Basil
^ 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.