GNU bug report logs -
#3862
23.1.50; error calling `documentation' on calendar-mode
Previous Next
Reported by: Kevin Ryde <user42 <at> zip.com.au>
Date: Thu, 16 Jul 2009 00:00:04 UTC
Severity: normal
Done: Glenn Morris <rgm <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> (progn
> (require 'calendar)
> (documentation 'calendar-mode))
> gets the error and backtrace below.
The docstring gets passed through substitute-command-keys which can run
arbitrary code via menu-item :filters (as well as via autoloaded
keymaps, actually).
> For what it's worth it works fine from the actual calendar buffer, but I
> was trying in some program code where that wasn't the case. I hoped I
> could generally get the docs for any function from anywhere.
In the present case, there's a subtle bug in the :filter of the
calendar-mode-map (more specially in the menu-bar part of the map).
> Also incidentally I tried a condition-case around it like
> (condition-case nil
> (documentation 'calendar-mode)
> (error nil))
> and was surprised it still went to the debugger. But maybe that's a
> separate problem.
Indeed it's a separate problem: when the filter is run, it is presumed
it is "at top level" and so the error gets turned into a backtrace
without paying attention to surrounding condition-cases. It's clearly
a bug, but it might be delicate to fix without introducing risks of
nasty crashes.
Stefan
This bug report was last modified 15 years and 314 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.