[திங்கள் அக்டோபர் 07, 2024] Visuwesh wrote: >>> [...] >>> - (nreverse outline))))) >>> + (search-forward "BEGIN") >> >> If the script fails for some reason, there will be no BEGIN and we let a >> search-failed error bubble up. So I'd put it in the condition-case and >> handle it like the end-of-file error. Or simply provide the NOERROR >> search-forward arg. > > Ahh, the intention of the condition-case below was to handle this case. > Thanks for catching my mistake, it is a common error of mine to forget > the NOERROR argument. > >>> + (condition-case nil >>> + (read (current-buffer)) >>> + (end-of-file nil))))))) >> >> Maybe it would also a good idea to use a :stderr buffer with >> make-process and put its contents into the imenu-unavailable-error. >> That way, chances are better we get the reason for failure delivered in >> bug reports. > > I do not think it is worth the trouble since only syntax errors are > likely to surface up in stderr which would be very unlikely. If the PDF > file does not have an outline, there would be nothing printed by our > script so end-of-file error should catch that case. Actually, this wasn't quite correct I think. We would have stray > in the buffer and read would return the symbol >. I corrected that in the attached.