From unknown Sun Jun 22 17:10:43 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#3862 <3862@debbugs.gnu.org> To: bug#3862 <3862@debbugs.gnu.org> Subject: Status: 23.1.50; error calling `documentation' on calendar-mode Reply-To: bug#3862 <3862@debbugs.gnu.org> Date: Mon, 23 Jun 2025 00:10:43 +0000 retitle 3862 23.1.50; error calling `documentation' on calendar-mode reassign 3862 emacs submitter 3862 Kevin Ryde severity 3862 normal thanks From gg@zip.com.au Wed Jul 15 16:51:12 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 15 Jul 2009 23:51:12 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-1.6 required=4.0 tests=AWL,FOURLA autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n6FNp63F000949 for ; Wed, 15 Jul 2009 16:51:08 -0700 Received: from mail.gnu.org ([199.232.76.166]:37865 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1MREFd-0006K7-I2 for emacs-pretest-bug@gnu.org; Wed, 15 Jul 2009 19:51:05 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1MREFZ-00049J-QH for emacs-pretest-bug@gnu.org; Wed, 15 Jul 2009 19:51:03 -0400 Received: from mailout1-1.pacific.net.au ([61.8.2.208]:45010 helo=mailout1.pacific.net.au) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MREFZ-00048D-2m for emacs-pretest-bug@gnu.org; Wed, 15 Jul 2009 19:51:01 -0400 Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.2.162]) by mailout1.pacific.net.au (Postfix) with ESMTP id EA9CA4FD1D4 for ; Thu, 16 Jul 2009 09:50:54 +1000 (EST) Received: from blah.blah (ppp29B9.dyn.pacific.net.au [61.8.41.185]) by mailproxy1.pacific.net.au (Postfix) with ESMTP id 623E88C3F for ; Thu, 16 Jul 2009 09:50:53 +1000 (EST) Received: from gg by blah.blah with local (Exim 4.69) (envelope-from ) id 1MREFC-0002Ik-Ow for emacs-pretest-bug@gnu.org; Thu, 16 Jul 2009 09:50:38 +1000 From: Kevin Ryde To: emacs-pretest-bug@gnu.org Subject: 23.1.50; error calling `documentation' on calendar-mode Date: Thu, 16 Jul 2009 09:50:38 +1000 Message-ID: <87tz1da4kx.fsf@blah.blah> User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) In a recent cvs starting "emacs -Q" and evaluating (progn (require 'calendar) (documentation 'calendar-mode)) gets the error and backtrace below. 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. 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. Debugger entered--Lisp error: (void-variable displayed-month) calendar-cursor-to-date(t 24) cal-menu-set-date-title(("--" ["Holidays" calendar-cursor-holidays] ["Mar= k date" calendar-set-mark] ["Sunrise/sunset" calendar-sunrise-sunset] ["Oth= er calendars" calendar-print-other-dates] ("Prepare LaTeX buffer" ["Daily (= 1 page)" cal-tex-cursor-day] ["Weekly (1 page)" cal-tex-cursor-week] ["Week= ly (2 pages)" cal-tex-cursor-week2] ["Weekly (other style; 1 page)" cal-tex= -cursor-week-iso] ["Weekly (yet another style; 1 page)" cal-tex-cursor-week= -monday] ["Monthly" cal-tex-cursor-month] ["Monthly (landscape)" cal-tex-cu= rsor-month-landscape] ["Yearly" cal-tex-cursor-year] ["Yearly (landscape)" = cal-tex-cursor-year-landscape] ("Filofax styles" ["Filofax Daily (one-day-p= er-page)" cal-tex-cursor-filofax-daily] ["Filofax Weekly (2-weeks-at-a-glan= ce)" cal-tex-cursor-filofax-2week] ["Filofax Weekly (week-at-a-glance)" cal= -tex-cursor-filofax-week] ["Filofax Yearly" cal-tex-cursor-filofax-year])) = ("Write HTML calendar" ["For selected month" cal-html-cursor-month] ["For s= elected year" cal-html-cursor-year]) ["Diary entries" calendar-mouse-view-d= iary-entries :keys "d"] ["Insert diary entry" diary-insert-entry] ["Other d= iary file entries" calendar-mouse-view-other-diary-entries :keys "D"])) (easy-menu-filter-return (cal-menu-set-date-title menu) "cal-menu-mouse2") (lambda (menu) (easy-menu-filter-return (cal-menu-set-date-title menu) "c= al-menu-mouse2"))(("--" ["Holidays" calendar-cursor-holidays] ["Mark date" = calendar-set-mark] ["Sunrise/sunset" calendar-sunrise-sunset] ["Other calen= dars" calendar-print-other-dates] ("Prepare LaTeX buffer" ["Daily (1 page)"= cal-tex-cursor-day] ["Weekly (1 page)" cal-tex-cursor-week] ["Weekly (2 pa= ges)" cal-tex-cursor-week2] ["Weekly (other style; 1 page)" cal-tex-cursor-= week-iso] ["Weekly (yet another style; 1 page)" cal-tex-cursor-week-monday]= ["Monthly" cal-tex-cursor-month] ["Monthly (landscape)" cal-tex-cursor-mon= th-landscape] ["Yearly" cal-tex-cursor-year] ["Yearly (landscape)" cal-tex-= cursor-year-landscape] ("Filofax styles" ["Filofax Daily (one-day-per-page)= " cal-tex-cursor-filofax-daily] ["Filofax Weekly (2-weeks-at-a-glance)" cal= -tex-cursor-filofax-2week] ["Filofax Weekly (week-at-a-glance)" cal-tex-cur= sor-filofax-week] ["Filofax Yearly" cal-tex-cursor-filofax-year])) ("Write = HTML calendar" ["For selected month" cal-html-cursor-month] ["For selected = year" cal-html-cursor-year]) ["Diary entries" calendar-mouse-view-diary-ent= ries :keys "d"] ["Insert diary entry" diary-insert-entry] ["Other diary fil= e entries" calendar-mouse-view-other-diary-entries :keys "D"])) documentation(calendar-mode) (progn (require (quote calendar)) (documentation (quote calendar-mode))) eval-region(1 63 t (lambda (ignore) (goto-char 63) (quote (progn ... ...)= ))) ; Reading at buffer position 8 apply(eval-region (1 63 t (lambda (ignore) (goto-char 63) (quote ...)))) eval-defun-2() eval-defun(nil) call-interactively(eval-defun nil nil) In GNU Emacs 23.1.50.1 (i586-pc-linux-gnu, GTK+ Version 2.16.4) of 2009-07-12 on blah.blah configured using `configure 'CFLAGS=3D-O -g' '--prefix=3D/down/emacs/b/ins= t' '--with-x-toolkit=3Dgtk'' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_AU value of $XMODIFIERS: nil locale-coding-system: iso-latin-1-unix default-enable-multibyte-characters: t From monnier@iro.umontreal.ca Wed Jul 15 18:40:30 2009 Received: (at 3862) by emacsbugs.donarmstrong.com; 16 Jul 2009 01:40:31 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.6 required=4.0 tests=AWL,HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from ironport2-out.teksavvy.com (ironport2-out.teksavvy.com [206.248.154.182]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n6G1eO7U019504 for <3862@emacsbugs.donarmstrong.com>; Wed, 15 Jul 2009 18:40:26 -0700 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AlwFAM8hXkrO+KNz/2dsb2JhbACBUdBIhAsFgh2EVw X-IronPort-AV: E=Sophos;i="4.42,408,1243828800"; d="scan'208";a="41702465" Received: from 206-248-163-115.dsl.teksavvy.com (HELO pastel.home) ([206.248.163.115]) by ironport2-out.teksavvy.com with ESMTP; 15 Jul 2009 21:40:18 -0400 Received: by pastel.home (Postfix, from userid 20848) id 5A14380B0; Wed, 15 Jul 2009 21:40:18 -0400 (EDT) From: Stefan Monnier To: Kevin Ryde Cc: 3862@debbugs.gnu.org Subject: Re: bug#3862: 23.1.50; error calling `documentation' on calendar-mode Message-ID: References: <87tz1da4kx.fsf@blah.blah> Date: Wed, 15 Jul 2009 21:40:18 -0400 In-Reply-To: <87tz1da4kx.fsf@blah.blah> (Kevin Ryde's message of "Thu, 16 Jul 2009 09:50:38 +1000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.94 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii > (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 From rgm@gnu.org Thu Jul 16 18:02:47 2009 Received: (at 3862) by emacsbugs.donarmstrong.com; 17 Jul 2009 01:02:47 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-8.0 required=4.0 tests=AWL,HAS_BUG_NUMBER, X_DEBBUGS_NO_ACK autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n6H12hnP031343 for <3862@emacsbugs.donarmstrong.com>; Thu, 16 Jul 2009 18:02:45 -0700 Received: from rgm by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1MRbqR-000782-MA; Thu, 16 Jul 2009 21:02:39 -0400 From: Glenn Morris To: Stefan Monnier Cc: 3862@debbugs.gnu.org, Kevin Ryde Subject: Re: bug#3862: 23.1.50; error calling `documentation' on calendar-mode References: <87tz1da4kx.fsf@blah.blah> X-Spook: Rubin Putin national information infrastructure 9/11 X-Ran: P/13}=52"ZRnmc'A:XNNyM%?yHctR\x0O]TKv\W"v}b.LmiXf8Ci[6CdbtVZlIGp9JkvZZ X-Hue: blue X-Debbugs-No-Ack: yes X-Attribution: GM Date: Thu, 16 Jul 2009 21:02:39 -0400 Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Stefan Monnier wrote: > 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). Could you explain what the bug is? The error is coming from cal-menu-set-date-title in a mouse-binding, which calls calendar-cursor-to-date. This has always assumed it is called from a calendar buffer, which seems reasonable, and gives an error if it is not. Also, why does C-h f calendar-mode work fine? On a related note, I notice that the Emacs 22 behaviour, where it displays an explicit error message "Not on a date" if called in the calendar with point not a date, has been lost - now it is just silent. I would like to get this back, but I can't figure out the Easymenu-Way to do it. Anyway, the following hack will suppress the original issue. *** calendar.el 8 Jul 2009 02:48:13 -0000 1.283 --- calendar.el 17 Jul 2009 00:53:33 -0000 *************** *** 1811,1816 **** --- 1811,1817 ---- (with-current-buffer (if event (window-buffer (posn-window (event-start event))) (current-buffer)) + (or (boundp 'displayed-month) (error "Not on a date!")) (save-excursion (and event (setq event (event-start event)) (goto-char (posn-point event))) From rgm@gnu.org Thu Jul 16 22:12:38 2009 Received: (at 3862) by emacsbugs.donarmstrong.com; 17 Jul 2009 05:12:38 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-8.0 required=4.0 tests=AWL,FOURLA,HAS_BUG_NUMBER, X_DEBBUGS_NO_ACK autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n6H5CYIu007053 for <3862@emacsbugs.donarmstrong.com>; Thu, 16 Jul 2009 22:12:36 -0700 Received: from rgm by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1MRfkD-0001Uo-9z; Fri, 17 Jul 2009 01:12:29 -0400 From: Glenn Morris To: 3862@debbugs.gnu.org Cc: Stefan Monnier , Kevin Ryde Subject: Re: bug#3862: 23.1.50; error calling `documentation' on calendar-mode References: <87tz1da4kx.fsf@blah.blah> X-Spook: electronic surveillance anthrax ASPIC 22nd SAS csim Waco, X-Ran: 9H"`~svZ4C1mk8_4EsWeV7$an*l)B|O{l=E{]J&w1syW>?da+v"L'A#"<1rS=|.U]hA?,T X-Hue: white X-Debbugs-No-Ack: yes X-Attribution: GM Date: Fri, 17 Jul 2009 01:12:29 -0400 In-Reply-To: (Glenn Morris's message of "Thu, 16 Jul 2009 21:02:39 -0400") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Perhaps something like this is better: *** cal-menu.el.~1.114.~ 2009-01-07 20:13:09.000000000 -0800 --- cal-menu.el 2009-07-16 22:08:54.000000000 -0700 *************** *** 202,210 **** (defun cal-menu-set-date-title (menu) "Convert date of last event to title suitable for MENU." ! (easy-menu-filter-return ! menu (calendar-date-string (calendar-cursor-to-date t last-input-event) ! t nil))) (easy-menu-define cal-menu-context-mouse-menu nil "Pop up menu for Mouse-2 for selected date in the calendar window." --- 202,212 ---- (defun cal-menu-set-date-title (menu) "Convert date of last event to title suitable for MENU." ! (let ((date (ignore-errors (calendar-cursor-to-date nil last-input-event)))) ! (if date ! (easy-menu-filter-return menu (calendar-date-string date t nil)) ! (message "Not on a date!") ! nil))) (easy-menu-define cal-menu-context-mouse-menu nil "Pop up menu for Mouse-2 for selected date in the calendar window." From monnier@IRO.UMontreal.CA Fri Jul 17 08:58:17 2009 Received: (at 3862) by emacsbugs.donarmstrong.com; 17 Jul 2009 15:58:17 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-4.4 required=4.0 tests=AWL,HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from chene.dit.umontreal.ca (chene.dit.umontreal.ca [132.204.246.20]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n6HFwCVu018817 for <3862@emacsbugs.donarmstrong.com>; Fri, 17 Jul 2009 08:58:14 -0700 Received: from faina.iro.umontreal.ca (faina.iro.umontreal.ca [132.204.26.177]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id n6HFwAKS005812; Fri, 17 Jul 2009 11:58:10 -0400 Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id A73F13A39C; Fri, 17 Jul 2009 11:58:10 -0400 (EDT) From: Stefan Monnier To: Glenn Morris Cc: 3862@debbugs.gnu.org, Kevin Ryde Subject: Re: bug#3862: 23.1.50; error calling `documentation' on calendar-mode Message-ID: References: <87tz1da4kx.fsf@blah.blah> Date: Fri, 17 Jul 2009 11:58:10 -0400 In-Reply-To: (Glenn Morris's message of "Fri, 17 Jul 2009 01:12:29 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.94 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3320=0 > Perhaps something like this is better: That seems OK, tho I'd rather return the menu in either case and use some default string (e.g. "today") for the date when calendar-cursor-to-date signals an error. Stefan From rgm@gnu.org Sat Jul 18 17:37:13 2009 Received: (at 3862-done) by emacsbugs.donarmstrong.com; 19 Jul 2009 00:37:13 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-8.0 required=4.0 tests=AWL,HAS_BUG_NUMBER, X_DEBBUGS_NO_ACK autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n6J0b9wS025627 for <3862-done@emacsbugs.donarmstrong.com>; Sat, 18 Jul 2009 17:37:10 -0700 Received: from rgm by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1MSKOm-0004Ry-70; Sat, 18 Jul 2009 20:37:04 -0400 From: Glenn Morris To: 3862-done@debbugs.gnu.org Subject: Re: bug#3862: 23.1.50; error calling `documentation' on calendar-mode References: <87tz1da4kx.fsf@blah.blah> X-Spook: Vince Foster Roswell Aladdin Ansar al-Islam embassy X-Ran: (DgZvy3"c!}hMy.fZGa>iM'~7UnbOr}rez<"R#|D"J8-hDY@PfUr7`vI}h!|tPXn-u?h_j X-Hue: yellow X-Debbugs-No-Ack: yes X-Attribution: GM Date: Sat, 18 Jul 2009 20:37:04 -0400 In-Reply-To: (Glenn Morris's message of "Fri, 17 Jul 2009 01:12:29 -0400") Message-ID: <6dfxct1pan.fsf@fencepost.gnu.org> User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii * calendar/cal-menu.el (cal-menu-set-date-title): Handle calls from non-calendar buffers (Bug#3862). From unknown Sun Jun 22 17:10:43 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: $requester Subject: Internal Control Message-Id: bug archived. Date: Sun, 16 Aug 2009 14:24:19 +0000 User-Agent: Fakemail v42.6.9 # A New Hope # A log time ago, in a galaxy far, far away # something happened. # # Magically this resulted in the following # action being taken, but this fake control # message doesn't tell you why it happened # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator