From e519449d335f50d4ac81279fe0ece79fb5ab31d5 Mon Sep 17 00:00:00 2001 From: "Edward M. Reingold" Date: Thu, 12 Oct 1995 15:28:06 +0000 Subject: [PATCH] Added menu items for cal-tex.el (a new file). --- lisp/calendar/cal-menu.el | 139 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 139 insertions(+) diff --git a/lisp/calendar/cal-menu.el b/lisp/calendar/cal-menu.el index 7a60d558d69..4b00d3e9bd3 100644 --- a/lisp/calendar/cal-menu.el +++ b/lisp/calendar/cal-menu.el @@ -194,6 +194,18 @@ (put 'insert-yearly-diary-entry 'menu-enable '(calendar-cursor-to-date)) (put 'insert-monthly-diary-entry 'menu-enable '(calendar-cursor-to-date)) (put 'insert-weekly-diary-entry 'menu-enable '(calendar-cursor-to-date)) +(put 'cal-tex-cursor-day 'menu-enable '(calendar-cursor-to-date)) +(put 'cal-tex-cursor-week 'menu-enable '(calendar-cursor-to-date)) +(put 'cal-tex-cursor-week2 'menu-enable '(calendar-cursor-to-date)) +(put 'cal-tex-cursor-week3 'menu-enable '(calendar-cursor-to-date)) +(put 'cal-tex-cursor-week4 'menu-enable '(calendar-cursor-to-date)) +(put 'cal-tex-cursor-week5 'menu-enable '(calendar-cursor-to-date)) +(put 'cal-tex-cursor-week6 'menu-enable '(calendar-cursor-to-date)) +(put 'cal-tex-cursor-month 'menu-enable '(calendar-cursor-to-date)) +(put 'cal-tex-cursor-month-landscape 'menu-enable '(calendar-cursor-to-date)) +(put 'cal-tex-cursor-year 'menu-enable '(calendar-cursor-to-date)) +(put 'cal-tex-cursor-filofax-year 'menu-enable '(calendar-cursor-to-date)) +(put 'cal-tex-cursor-year-landscape 'menu-enable '(calendar-cursor-to-date)) (defun calendar-event-to-date (&optional error) "Date of last event. @@ -271,6 +283,95 @@ ERROR is t, otherwise just returns nil." (calendar-goto-date (calendar-event-to-date)) (calendar-set-mark nil))) +(defun cal-tex-mouse-day () + "Make a buffer with LaTeX commands for the day mouse is on." + (interactive) + (save-excursion + (calendar-goto-date (calendar-event-to-date)) + (cal-tex-cursor-day nil))) + +(defun cal-tex-mouse-week () + "One page calendar for week indicated by cursor. +Holidays are included if `cal-tex-holidays' is t." + (interactive) + (save-excursion + (calendar-goto-date (calendar-event-to-date)) + (cal-tex-cursor-week nil))) + +(defun cal-tex-mouse-week2 () + "Make a buffer with LaTeX commands for the week cursor is on. +The printed output will be on two pages." + (interactive) + (save-excursion + (calendar-goto-date (calendar-event-to-date)) + (cal-tex-cursor-week2 nil))) + +(defun cal-tex-mouse-week3 () + "One page calendar for week indicated by cursor. +Holidays are included if `cal-tex-holidays' is t." + (interactive) + (save-excursion + (calendar-goto-date (calendar-event-to-date)) + (cal-tex-cursor-week3 nil))) + +(defun cal-tex-mouse-week4 () + "One page calendar for week indicated by cursor." + (interactive) + (save-excursion + (calendar-goto-date (calendar-event-to-date)) + (cal-tex-cursor-week4 nil))) + +(defun cal-tex-mouse-week5 () + "One page Filofax calendar for week indicated by cursor." + (interactive) + (save-excursion + (calendar-goto-date (calendar-event-to-date)) + (cal-tex-cursor-week5 nil))) + +(defun cal-tex-mouse-week6 () + "Two page Filofax calendar for week indicated by cursor." + (interactive) + (save-excursion + (calendar-goto-date (calendar-event-to-date)) + (cal-tex-cursor-week6 nil))) + +(defun cal-tex-mouse-month () + "Make a buffer with LaTeX commands for the month cursor is on. +Calendar is condensed onto one page." + (interactive) + (save-excursion + (calendar-goto-date (calendar-event-to-date)) + (cal-tex-cursor-month nil))) + +(defun cal-tex-mouse-month-landscape () + "Make a buffer with LaTeX commands for the month cursor is on. +The output is in landscape format, one month to a page." + (interactive) + (save-excursion + (calendar-goto-date (calendar-event-to-date)) + (cal-tex-cursor-month-landscape nil))) + +(defun cal-tex-mouse-year () + "Make a buffer with LaTeX commands for the year cursor is on." + (interactive) + (save-excursion + (calendar-goto-date (calendar-event-to-date)) + (cal-tex-cursor-year nil))) + +(defun cal-tex-mouse-filofax-year () + "Make a buffer with LaTeX commands for Filofax calendar of year cursor is on." + (interactive) + (save-excursion + (calendar-goto-date (calendar-event-to-date)) + (cal-tex-cursor-filofax-year nil))) + +(defun cal-tex-mouse-year-landscape () + "Make a buffer with LaTeX commands for the year cursor is on." + (interactive) + (save-excursion + (calendar-goto-date (calendar-event-to-date)) + (cal-tex-cursor-year-landscape nil))) + (defun calendar-mouse-print-dates () "Pop up menu of equivalent dates to mouse selected date." (interactive) @@ -337,6 +438,7 @@ ERROR is t, otherwise just returns nil." '("Mark date" . calendar-mouse-set-mark) '("Sunrise/sunset" . calendar-mouse-sunrise/sunset) '("Other calendars" . calendar-mouse-print-dates) + '("Prepare LaTeX buffer" . calendar-mouse-cal-tex-menu) '("Diary entries" . calendar-mouse-view-diary-entries) '("Insert diary entry" . calendar-mouse-insert-diary-entry) '("Other diary file entries" @@ -344,6 +446,43 @@ ERROR is t, otherwise just returns nil." ))))) (and selection (call-interactively selection)))) +(defun calendar-mouse-cal-tex-menu (event) + "Pop up submenu for Mouse-2 for cal-tex commands for selected date in the calendar window." + (interactive "e") + (let* ((selection + (x-popup-menu + event + (list "Menu" + (list + (calendar-date-string date t nil) + '("Daily (1 page)" . cal-tex-mouse-day) + '("Weekly (1 page)" . cal-tex-mouse-week) + '("Weekly (2 pages)" . cal-tex-mouse-week2) + '("Weekly (other style; 1 page)" . cal-tex-mouse-week3) + '("Weekly (yet another style; 1 page)" . cal-tex-mouse-week4) + '("Monthly" . cal-tex-mouse-month) + '("Monthly (landscape)" . cal-tex-mouse-month-landscape) + '("Yearly" . cal-tex-mouse-year) + '("Yearly (landscape)" . cal-tex-mouse-year-landscape) + '("Filofax styles" . cal-tex-mouse-filofax) + ))))) + (and selection (call-interactively selection)))) + +(defun cal-tex-mouse-filofax (event) + "Pop up sub-submenu for Mouse-2 for Filofax cal-tex commands for selected date." + (interactive "e") + (let* ((selection + (x-popup-menu + event + (list "Menu" + (list + (calendar-date-string date t nil) + '("Filofax Weekly (1 page)" . cal-tex-mouse-week5) + '("Filofax Weekly (2 pages)" . cal-tex-mouse-week6) + '("Filofax Yearly" . cal-tex-mouse-filofax-year) + ))))) + (and selection (call-interactively selection)))) + (define-key calendar-mouse-3-map [exit-calendar] '("Exit calendar" . exit-calendar)) (define-key calendar-mouse-3-map [show-diary] -- 2.39.2