Open oatmealm opened 2 months ago
Should be fixed in 0.1.3
@oatmealm have you tried it?
a quick check shows it doesn't... it seems like ...get-builtin
can't find anything in the path it's searching... I understand info files are kept with the source when installed via straight or something similar?
Builtin info manuals are installed with emacs itself.
Hello @s-kostyaev , I would recommend utilizing the variable Info-directory-list
[1], or, for a more straightforward solution, consider using the info--manual-names
function, although I am unsure if it is considered bad style to use this function from outside of info.el. And please keep in mind, that the info files might have an .info.gz
suffix, so filtering for *.info
might also result in missed info manuals.
If you go for the info--manual-names
approach it might be as easy as the below change:
(defun elisa-parse-builtin-manuals ()
"Parse builtin manuals."
(mapc (lambda (s)
(ignore-errors (elisa-parse-info-manual s)))
- (elisa-get-builtin-manuals)))
+ (info--manual-names nil)))
(defun elisa-parse-builtin-manuals () "Parse builtin manuals." (mapc (lambda (s) (ignore-errors (elisa-parse-info-manual s))) - (elisa-get-builtin-manuals))) + (info--manual-names nil)))
Be careful, that seems not to work as expected. Most likely because async-start
starts the subordinate Emacs process with -Q
(minimum customization).
@s-kostyaev , have you thought about using make-thread
instead of async-start
? Something like the following seems to work with the info--manual-names
change from above. You might want to put a with-mutex
around the body of the thread.
(defun elisa-async-parse-builtin-manuals ()
"Parse builtin manuals asyncronously."
(interactive)
(message "Begin parsing builtin manuals.")
- (elisa--async-do-parse 'elisa-parse-builtin-manuals))
+ (make-thread (lambda ()
+ (elisa-parse-builtin-manuals)
+ (message "elisa-parse-builtin-manuals done."))
+ "elisa-parse-thread"))
The below change seems to be also necessary:
(defun elisa-parse-info-manual (name)
"Parse info manual with NAME and save index to database."
(with-temp-buffer
- (info name (current-buffer))
+ (info-setup name (current-buffer))
(let ((continue t))
@oatmealm please check if version 0.1.4 works for you.
@KaiHa Thank you. I think the main issue is that I filter out gzipped manuals. Let's check step by step.
About make-thread
: I prefer async-start
because I don't want to block emacs. With cooperative multithreading it's hard.
@oatmealm waiting your reply here. I can't reproduce error, so wait for you to check if it's fixed.
@s-kostyaev I ran into another pitfall. On my system the info page info-stnd
contains an endless loop, after the Appendix it jumps back to chapter 12 when using Info-forward-node
. I don't know if you want to cater for such broken info documents, otherwise if you don't do, some might experience that elisa-parse-*-manuals
simply does not return.
@oatmealm waiting your reply here. I can't reproduce error, so wait for you to check if it's fixed.
It seems to be indexing, but emacs crashes again when starting a chat. I'll reproduce and send more info asap.
I think
default-directory
points to default directory of current buffer, rather than the real location of info manuals? In doom at least it's not picking any manuals, though I can manually parse themelisa-parse.... (elisp)
etc.https://github.com/s-kostyaev/elisa/blob/de9fa3c1a432482622e7a1aa2c02578099d10ba6/elisa.el#L235