From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Dave Love Newsgroups: gmane.emacs.bugs Subject: fix for calendar mode-line mouse bindings Date: 06 Sep 2002 18:34:31 +0100 Sender: bug-gnu-emacs-admin@gnu.org Message-ID: NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1031333605 13264 127.0.0.1 (6 Sep 2002 17:33:25 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 6 Sep 2002 17:33:25 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17nMyy-0003Ro-00 for ; Fri, 06 Sep 2002 19:33:24 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17nN0e-00055t-00; Fri, 06 Sep 2002 13:35:08 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 17nN07-00054M-00 for bug-gnu-emacs@gnu.org; Fri, 06 Sep 2002 13:34:35 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 17nN04-00053Z-00 for bug-gnu-emacs@gnu.org; Fri, 06 Sep 2002 13:34:34 -0400 Original-Received: from albion.dl.ac.uk ([148.79.80.39]) by monty-python.gnu.org with esmtp (Exim 4.10) id 17nN04-00053L-00 for bug-gnu-emacs@gnu.org; Fri, 06 Sep 2002 13:34:32 -0400 Original-Received: from fx by albion.dl.ac.uk with local (Exim 3.35 #1 (Debian)) id 17nN03-0001L4-00 for ; Fri, 06 Sep 2002 18:34:31 +0100 Original-To: bug-gnu-emacs@gnu.org Original-Lines: 92 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Errors-To: bug-gnu-emacs-admin@gnu.org X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.bugs:3445 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:3445 This fixes the case where the calendar window isn't selected when those bindings are invoked. Arguably the relevant Calendar commands should initially make sure the Calendar buffer is selected (since they use local variables). 2002-09-06 Dave Love * calendar/calendar.el (calendar-mode-line-format): Select the right window for mouse events. *** calendar.el.~1.131.4.1.~ Wed Jan 16 20:35:46 2002 --- calendar.el Fri Sep 6 16:46:44 2002 *************** *** 2037,2047 **** (defvar calendar-mode-line-format (list ! (propertize (substitute-command-keys ! "\\\\[scroll-calendar-left]") ! 'help-echo "mouse-2: scroll left" ! 'keymap (make-mode-line-mouse-map 'mouse-2 ! #'scroll-calendar-left)) "Calendar" (concat (propertize --- 2037,2054 ---- (defvar calendar-mode-line-format (list ! (propertize ! (substitute-command-keys ! "\\\\[scroll-calendar-left]") ! 'help-echo "mouse-2: scroll left" ! 'keymap (make-mode-line-mouse-map ! 'mouse-2 ! '(lambda () ! (interactive) ! (save-selected-window ! (select-window (posn-window (event-start ! last-command-event)))) ! (scroll-calendar-left)))) "Calendar" (concat (propertize *************** *** 2056,2065 **** 'help-echo "mouse-2: choose another month" 'keymap (make-mode-line-mouse-map 'mouse-2 ! (lambda () ! (interactive) ! (call-interactively ! 'calendar-other-month)))) "/" (propertize (substitute-command-keys --- 2063,2074 ---- 'help-echo "mouse-2: choose another month" 'keymap (make-mode-line-mouse-map 'mouse-2 ! '(lambda () ! (interactive) ! (save-selected-window ! (select-window (posn-window (event-start ! last-command-event))) ! (call-interactively 'calendar-other-month))))) "/" (propertize (substitute-command-keys *************** *** 2071,2077 **** "\\\\[scroll-calendar-right]") 'help-echo "mouse-2: scroll right" 'keymap (make-mode-line-mouse-map ! 'mouse-2 #'scroll-calendar-right))) "The mode line of the calendar buffer.") (defun calendar-goto-info-node () --- 2080,2092 ---- "\\\\[scroll-calendar-right]") 'help-echo "mouse-2: scroll right" 'keymap (make-mode-line-mouse-map ! 'mouse-2 ! '(lambda () ! (interactive) ! (save-selected-window ! (select-window (posn-window (event-start ! last-command-event))) ! (scroll-calendar-left)))))) "The mode line of the calendar buffer.") (defun calendar-goto-info-node ()