Mercurial > emacs
view lisp/calendar/cal-menu.el @ 110523:a5ad4f188e19
Synch Semantic to CEDET 1.0.
Move CEDET ChangeLog entries to new file lisp/cedet/ChangeLog.
* semantic.el (semantic-version): Update to 2.0.
(semantic-mode-map): Add "," and "m" bindings.
(navigate-menu): Update.
* semantic/symref.el (semantic-symref-calculate-rootdir):
New function.
(semantic-symref-detect-symref-tool): Use it.
* semantic/symref/grep.el (semantic-symref-grep-shell): New var.
(semantic-symref-perform-search): Use it. Calculate root dir with
semantic-symref-calculate-rootdir.
(semantic-symref-derive-find-filepatterns): Improve error message.
* semantic/symref/list.el
(semantic-symref-results-mode-map): New bindings.
(semantic-symref-auto-expand-results): New option.
(semantic-symref-results-dump): Obey auto-expand.
(semantic-symref-list-expand-all, semantic-symref-regexp)
(semantic-symref-list-contract-all)
(semantic-symref-list-map-open-hits)
(semantic-symref-list-update-open-hits)
(semantic-symref-list-create-macro-on-open-hit)
(semantic-symref-list-call-macro-on-open-hits): New functions.
(semantic-symref-list-menu-entries)
(semantic-symref-list-menu): New vars.
(semantic-symref-list-map-open-hits): Move cursor to beginning of
match before calling the mapped function.
* semantic/doc.el
(semantic-documentation-comment-preceeding-tag): Do nothing if the
mode doesn't provide comment-start-skip.
* semantic/scope.el
(semantic-analyze-scope-nested-tags-default): Strip duplicates.
(semantic-analyze-scoped-inherited-tag-map): Take the tag we are
looking for as part of the scoped tags list.
* semantic/html.el (semantic-default-html-setup): Add
senator-step-at-tag-classes.
* semantic/decorate/include.el
(semantic-decoration-on-unknown-includes): Change light bgcolor.
(semantic-decoration-on-includes-highlight-default): Check that
the include tag has a postion.
* semantic/complete.el (semantic-collector-local-members):
(semantic-complete-read-tag-local-members)
(semantic-complete-jump-local-members): New class and functions.
(semantic-complete-self-insert): Save excursion before completing.
* semantic/analyze/complete.el
(semantic-analyze-possible-completions-default): If no completions
are found, return the raw by-name-only completion list. Add FLAGS
arguments. Add support for 'no-tc (type constraint) and
'no-unique, or no stripping duplicates.
(semantic-analyze-possible-completions-default): Add FLAGS arg.
* semantic/util-modes.el
(semantic-stickyfunc-show-only-functions-p): New option.
(semantic-stickyfunc-fetch-stickyline): Don't show stickytext for
the very first line in a buffer.
* semantic/util.el (semantic-hack-search)
(semantic-recursive-find-nonterminal-by-name)
(semantic-current-tag-interactive): Deleted.
(semantic-describe-buffer): Fix expand-nonterminal. Add
lex-syntax-mods, type relation separator char, and command
separation char.
(semantic-sanity-check): Only message if called interactively.
* semantic/tag.el (semantic-tag-deep-copy-one-tag): Copy the
:filename property and the tag position.
* semantic/lex-spp.el (semantic-lex-spp-lex-text-string):
Add recursion limit.
* semantic/imenu.el (semantic-imenu-bucketize-type-members):
Make this buffer local, not the obsoleted variable.
* semantic/idle.el: Add breadcrumbs support.
(semantic-idle-summary-current-symbol-info-default)
(semantic-idle-tag-highlight)
(semantic-idle-completion-list-default): Use
semanticdb-without-unloaded-file-searches for speed, and to
conform to the controls that specify if the idle timer is supposed
to be parsing unparsed includes.
(semantic-idle-symbol-highlight-face)
(semantic-idle-symbol-maybe-highlight): Rename from *-summary-*.
Callers changed.
(semantic-idle-work-parse-neighboring-files-flag): Default to nil.
(semantic-idle-work-update-headers-flag): New var.
(semantic-idle-work-for-one-buffer): Use it.
(semantic-idle-local-symbol-highlight): Rename from
semantic-idle-tag-highlight.
(semantic-idle-truncate-long-summaries): New option.
* semantic/ia.el (semantic-ia-cache)
(semantic-ia-get-completions): Deleted. Callers changed.
(semantic-ia-show-variants): New command.
(semantic-ia-show-doc): If doc is empty, don't make a temp buffer.
(semantic-ia-show-summary): If there isn't anything to show, say so.
* semantic/grammar.el (semantic-grammar-create-package):
Save the buffer even in batch mode.
* semantic/fw.el
(semanticdb-without-unloaded-file-searches): New macro.
* semantic/dep.el (semantic-dependency-find-file-on-path):
Fix case dereferencing ede-object when it is a list.
* semantic/db-typecache.el (semanticdb-expand-nested-tag)
(semanticdb-typecache-faux-namespace): New functions.
(semanticdb-typecache-file-tags)
(semanticdb-typecache-merge-streams): Use them.
(semanticdb-typecache-file-tags): When deriving tags from a file,
give the mode a chance to monkey with the tag copy.
(semanticdb-typecache-find-default): Wrap find in save-excursion.
(semanticdb-typecache-find-by-name-helper): Merge found names down.
* semantic/db-global.el
(semanticdb-enable-gnu-global-in-buffer): Don't show messages if
GNU Global is not available and we don't want to throw an error.
* semantic/db-find.el (semanticdb-find-result-nth-in-buffer):
When trying to normalize the tag to a buffer, don't error if
set-buffer method doesn't exist.
* semantic/db-file.el (semanticdb-save-db): Simplify msg.
* semantic/db.el (semanticdb-refresh-table): If forcing a
refresh on a file not in a buffer, use semantic-find-file-noselect
and delete the buffer after use.
(semanticdb-current-database-list): When calculating root via
hooks, force it through true-filename and skip the list of
possible roots.
* semantic/ctxt.el (semantic-ctxt-imported-packages): New.
* semantic/analyze/debug.el
(semantic-analyzer-debug-insert-tag): Reset standard output to
current buffer.
(semantic-analyzer-debug-global-symbol)
(semantic-analyzer-debug-missing-innertype): Change "prefix" to
"symbol" in messages.
* semantic/analyze/refs.el: (semantic-analyze-refs-impl)
(semantic-analyze-refs-proto): When calculating value, make sure
the found tag is 'similar' to the originating tag.
(semantic--analyze-refs-find-tags-with-parent): Attempt to
identify matches via imported symbols of parents.
(semantic--analyze-refs-full-lookup-with-parents): Do a deep
search during the brute search.
* semantic/analyze.el
(semantic-analyze-find-tag-sequence-default): Be robust to
calculated scopes being nil.
* semantic/bovine/c.el (semantic-c-describe-environment): Add
project macro symbol array.
(semantic-c-parse-lexical-token): Add recursion limit.
(semantic-ctxt-imported-packages, semanticdb-expand-nested-tag):
New overrides.
(semantic-expand-c-tag-namelist): Split a full type from a typedef
out to its own tag.
(semantic-expand-c-tag-namelist): Do not split out a typedef'd
inline type if it is an anonymous type.
(semantic-c-reconstitute-token): Use the optional initializers as
a clue that some function is probably a constructor. When
defining the type of these constructors, split the parent name,
and use only the class part, if applicable.
* semantic/bovine/c-by.el:
* semantic/wisent/python-wy.el: Regenerate.
author | Chong Yidong <cyd@stupidchicken.com> |
---|---|
date | Sat, 18 Sep 2010 22:49:54 -0400 |
parents | 1d1d5d9bd884 |
children | 280c8ae2476d 376148b31b5e |
line wrap: on
line source
;;; cal-menu.el --- calendar functions for menu bar and popup menu support ;; Copyright (C) 1994, 1995, 2001, 2002, 2003, 2004, 2005, 2006, 2007, ;; 2008, 2009, 2010 Free Software Foundation, Inc. ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu> ;; Lara Rios <lrios@coewl.cen.uiuc.edu> ;; Maintainer: Glenn Morris <rgm@gnu.org> ;; Keywords: calendar ;; Human-Keywords: calendar, popup menus, menu bar ;; This file is part of GNU Emacs. ;; GNU Emacs is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or ;; (at your option) any later version. ;; GNU Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. ;;; Commentary: ;; See calendar.el. ;;; Code: (require 'calendar) (defconst cal-menu-sunmoon-menu '("Sun/Moon" ["Lunar Phases" calendar-lunar-phases] ["Sunrise/sunset for cursor date" calendar-sunrise-sunset] ["Sunrise/sunset for cursor month" calendar-sunrise-sunset-month]) "Key map for \"Sun/Moon\" menu in the calendar.") (defconst cal-menu-diary-menu '("Diary" ["Other File" diary-view-other-diary-entries] ["Cursor Date" diary-view-entries] ["Mark All" diary-mark-entries] ["Show All" diary-show-all-entries] ["Insert Diary Entry" diary-insert-entry] ["Insert Weekly" diary-insert-weekly-entry] ["Insert Monthly" diary-insert-monthly-entry] ["Insert Yearly" diary-insert-yearly-entry] ["Insert Anniversary" diary-insert-anniversary-entry] ["Insert Block" diary-insert-block-entry] ["Insert Cyclic" diary-insert-cyclic-entry] ("Insert Baha'i" ["One time" diary-bahai-insert-entry] ["Monthly" diary-bahai-insert-monthly-entry] ["Yearly" diary-bahai-insert-yearly-entry]) ("Insert Islamic" ["One time" diary-islamic-insert-entry] ["Monthly" diary-islamic-insert-monthly-entry] ["Yearly" diary-islamic-insert-yearly-entry]) ("Insert Hebrew" ["One time" diary-hebrew-insert-entry] ["Monthly" diary-hebrew-insert-monthly-entry] ["Yearly" diary-hebrew-insert-yearly-entry])) "Key map for \"Diary\" menu in the calendar.") (defun cal-menu-holiday-window-suffix () "Return a string suffix for the \"Window\" entry in `cal-menu-holidays-menu'." (let ((my1 (calendar-increment-month-cons -1)) (my2 (calendar-increment-month-cons 1))) ;; Mon1-Mon2, Year or Mon1, Year1-Mon2, Year2. (format "%s%s-%s, %d" (calendar-month-name (car my1) 'abbrev) (if (= (cdr my1) (cdr my2)) "" (format ", %d" (cdr my1))) (calendar-month-name (car my2) 'abbrev) (cdr my2)))) (defvar displayed-year) ; from calendar-generate (defconst cal-menu-holidays-menu `("Holidays" ["For Cursor Date -" calendar-cursor-holidays :suffix (calendar-date-string (calendar-cursor-to-date) t t) :visible (calendar-cursor-to-date)] ["For Window -" calendar-list-holidays :suffix (cal-menu-holiday-window-suffix)] ["For Today -" (calendar-cursor-holidays (calendar-current-date)) :suffix (calendar-date-string (calendar-current-date) t t)] "--" ,@(let ((l ())) ;; Show 11 years--5 before, 5 after year of middle month. ;; We used to use :suffix rather than :label and bumped into ;; an easymenu bug: ;; http://lists.gnu.org/archive/html/emacs-devel/2007-11/msg01813.html ;; The bug has since been fixed. (dotimes (i 11) (push (vector (format "hol-year-%d" i) `(lambda () (interactive) (holiday-list (+ displayed-year ,(- i 5)))) :label `(format "For Year %d" (+ displayed-year ,(- i 5)))) l)) (nreverse l)) "--" ["Unmark Calendar" calendar-unmark] ["Mark Holidays" calendar-mark-holidays]) "Key map for \"Holidays\" menu in the calendar.") (defconst cal-menu-goto-menu '("Goto" ["Today" calendar-goto-today] ["Beginning of Week" calendar-beginning-of-week] ["End of Week" calendar-end-of-week] ["Beginning of Month" calendar-beginning-of-month] ["End of Month" calendar-end-of-month] ["Beginning of Year" calendar-beginning-of-year] ["End of Year" calendar-end-of-year] ["Other Date" calendar-goto-date] ["Day of Year" calendar-goto-day-of-year] ["ISO Week" calendar-iso-goto-week] ["ISO Date" calendar-iso-goto-date] ["Astronomical Date" calendar-astro-goto-day-number] ["Hebrew Date" calendar-hebrew-goto-date] ["Persian Date" calendar-persian-goto-date] ["Baha'i Date" calendar-bahai-goto-date] ["Islamic Date" calendar-islamic-goto-date] ["Julian Date" calendar-julian-goto-date] ["Chinese Date" calendar-chinese-goto-date] ["Coptic Date" calendar-coptic-goto-date] ["Ethiopic Date" calendar-ethiopic-goto-date] ("Mayan Date" ["Next Tzolkin" calendar-mayan-next-tzolkin-date] ["Previous Tzolkin" calendar-mayan-previous-tzolkin-date] ["Next Haab" calendar-mayan-next-haab-date] ["Previous Haab" calendar-mayan-previous-haab-date] ["Next Round" calendar-mayan-next-round-date] ["Previous Round" calendar-mayan-previous-round-date]) ["French Date" calendar-french-goto-date]) "Key map for \"Goto\" menu in the calendar.") (defconst cal-menu-scroll-menu '("Scroll" ["Scroll Commands" nil :help "Commands that scroll the visible window"] ["Forward 1 Month" calendar-scroll-left] ["Forward 3 Months" calendar-scroll-left-three-months] ["Forward 1 Year" (calendar-scroll-left 12) :keys "4 C-v"] ["Backward 1 Month" calendar-scroll-right] ["Backward 3 Months" calendar-scroll-right-three-months] ["Backward 1 Year" (calendar-scroll-right 12) :keys "4 M-v"] "--" ["Motion Commands" nil :help "Commands that move point"] ["Forward 1 Day" calendar-forward-day] ["Forward 1 Week" calendar-forward-week] ["Forward 1 Month" calendar-forward-month] ["Forward 1 Year" calendar-forward-year] ["Backward 1 Day" calendar-backward-day] ["Backward 1 Week" calendar-backward-week] ["Backward 1 Month" calendar-backward-month] ["Backward 1 Year" calendar-backward-year]) "Key map for \"Scroll\" menu in the calendar.") (declare-function x-popup-menu "menu.c" (position menu)) (defmacro cal-menu-x-popup-menu (event title &rest body) "Call `x-popup-menu' at position EVENT, with TITLE and contents BODY. Signals an error if popups are unavailable." (declare (indent 2)) `(if (display-popup-menus-p) (x-popup-menu ,event (list ,title (append (list ,title) ,@body))) (error "Popup menus are not available on this system"))) (autoload 'diary-list-entries "diary-lib") ;; Autoloaded in diary-lib. (declare-function calendar-check-holidays "holidays" (date)) (defun calendar-mouse-view-diary-entries (&optional date diary event) "Pop up menu of diary entries for mouse-selected date. Use optional DATE and alternative file DIARY. EVENT is the event that invoked this command. Shows holidays if `diary-show-holidays-flag' is non-nil." (interactive "i\ni\ne") (let* ((date (or date (calendar-cursor-to-date nil event))) (diary-file (or diary diary-file)) (diary-list-include-blanks nil) (diary-entries (mapcar (lambda (x) (split-string (cadr x) "\n")) (diary-list-entries date 1 'list-only))) (holidays (if diary-show-holidays-flag (calendar-check-holidays date))) (title (format "Diary entries%s for %s" (if diary (format " from %s" diary) "") (calendar-date-string date))) (selection (cal-menu-x-popup-menu event title (mapcar (lambda (x) (list (concat " " x))) holidays) (if holidays (list "--shadow-etched-in" "--shadow-etched-in")) (if diary-entries (mapcar 'list (apply 'append diary-entries)) '("None"))))) (and selection (call-interactively selection)))) (defun calendar-mouse-view-other-diary-entries (&optional event) "Pop up menu of diary entries from alternative file on mouse-selected date." (interactive "e") (calendar-mouse-view-diary-entries (calendar-cursor-to-date nil event) (read-file-name "Enter diary file name: " default-directory nil t) event)) ;; In 22, the equivalent code gave an error when not called on a date, ;; but easymenu does not seem to allow this (?). ;; The ignore-errors is because `documentation' can end up calling ;; this in a non-calendar buffer where displayed-month is unbound. (Bug#3862) (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 mouse menu for selected date in the calendar window." '("cal-menu-context-mouse-menu" :filter cal-menu-set-date-title "--" ["Holidays" calendar-cursor-holidays] ["Mark date" calendar-set-mark] ["Sunrise/sunset" calendar-sunrise-sunset] ["Other calendars" calendar-print-other-dates] ;; There was a bug (#447; fixed) with last-nonmenu-event and submenus. ;; These did not work if called without calendar window selected. ("Prepare LaTeX buffer" ["Daily (1 page)" cal-tex-cursor-day] ["Weekly (1 page)" cal-tex-cursor-week] ["Weekly (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-cursor-month-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-cursor-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-entries :keys "d"] ["Insert diary entry" diary-insert-entry] ["Other diary file entries" calendar-mouse-view-other-diary-entries :keys "D"])) (easy-menu-define cal-menu-global-mouse-menu nil "Menu bound to a mouse event, not specific to the mouse-click location." '("Calendar" ["Scroll forward" calendar-scroll-left-three-months] ["Scroll backward" calendar-scroll-right-three-months] ["Mark diary entries" diary-mark-entries] ["List holidays" calendar-list-holidays] ["Mark holidays" calendar-mark-holidays] ["Unmark" calendar-unmark] ["Lunar phases" calendar-lunar-phases] ["Sunrise times for month" calendar-sunrise-sunset-month] ["Show diary" diary-show-all-entries] ["Exit calendar" calendar-exit])) ;; Undocumented and probably useless. (defvar cal-menu-load-hook nil "Hook run on loading of the `cal-menu' package.") (make-obsolete-variable 'cal-menu-load-hook "it will be removed in future." "23.1") (run-hooks 'cal-menu-load-hook) (provide 'cal-menu) ;; arch-tag: aa81cf73-ce89-48a4-97ec-9ef861e87fe9 ;;; cal-menu.el ends here