annotate lisp/hyperbole/wrolo-menu.el @ 0:376386a54a3c r19-14

Import from CVS: tag r19-14
author cvs
date Mon, 13 Aug 2007 08:45:50 +0200
parents
children 85ec50267440
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;;!emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 ;; FILE: wrolo-menu.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 ;; SUMMARY: Pulldown and popup menus of Hyperbole rolodex commands.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 ;; USAGE: GNU Emacs Lisp Library
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 ;; KEYWORDS: hypermedia, matching, mouse
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 ;; AUTHOR: Bob Weiner
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 ;; ORG: Motorola, Inc., PPG
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ;; ORIG-DATE: 28-Oct-94 at 10:59:44
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;; LAST-MOD: 31-Oct-95 at 18:45:24 by Bob Weiner
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;; Copyright (C) 1994-1995 Free Software Foundation, Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;; This file is part of Hyperbole.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ;; DESCRIPTION:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 ;; DESCRIP-END.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 ;;; Public variables
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 ;;; This definition is used by InfoDock and XEmacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 (defconst infodock-wrolo-menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 '("Rolodex"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 ["Manual" (id-tool-invoke id-man-rolodex) t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 "----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 ["Add-Entry" (id-tool-invoke 'rolo-add) t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 ["Delete-Entry" (id-tool-invoke 'rolo-kill) t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 ["Display-Prior-Matches" (id-tool-invoke 'rolo-display-matches) t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 ["Edit-Entry" (id-tool-invoke 'rolo-edit) t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 ["Edit-Rolodex" (id-tool-invoke
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 '(progn (require 'wrolo)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 (find-file (car rolo-file-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 (setq buffer-read-only nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 ["Insert-Entry-at-Point" (id-tool-invoke 'rolo-yank) t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 ["Mail-to-Address" (id-tool-invoke 'rolo-mail-to) t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 ["Search-for-Regexp" (id-tool-invoke 'rolo-grep) t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 ["Search-for-String" (id-tool-invoke 'rolo-fgrep) t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 ["Search-for-Word" (id-tool-invoke 'rolo-word) t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 ["Sort-Entries" (id-tool-invoke 'rolo-sort) t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 ;;; This definition is used by InfoDock only.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 (defconst id-menubar-wrolo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 '("Wrolo"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 ["Help" describe-mode t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 ["Manual" (id-info "(hyperbole.info)Rolo Keys") t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 "----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 ["Toggle-Read-Only" toggle-read-only t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 ["Write (Save as)" write-file t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 "----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 ["Quit" (id-tool-quit '(kill-buffer nil)) t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 '["Edit-Entry-at-Point" rolo-edit-entry t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 ["Mail-to-Address" (id-tool-invoke 'rolo-mail-to) t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 '("Move"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 ["Scroll-Backward" scroll-down t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 ["Scroll-Forward" scroll-up t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 ["To-Beginning" beginning-of-buffer t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 ["To-End" end-of-buffer t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 "----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 ["To-Next-Entry" outline-next-visible-heading t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 ["To-Next-Same-Level" outline-forward-same-level t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 ["To-Previous-Entry" outline-previous-visible-heading t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 ["To-Previous-Same-Level" outline-backward-same-level t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 ["Up-a-Level" outline-up-heading t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 '("Outline"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 ["Hide (Collapse)" hide-subtree t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 ["Show (Expand)" show-subtree t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 ["Show-All" show-all t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 ["Show-Only-First-Line" hide-body t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 '["Next-Match" rolo-next-match t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 '["Previous-Match" rolo-previous-match t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 infodock-wrolo-menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 ;;; This definition is used by InfoDock and XEmacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 (defconst id-popup-wrolo-menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 "Wrolo"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 '["Help" describe-mode t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 '["Manual" (id-info "(hyperbole.info)Rolo Keys") t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 "----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 '["Edit-Entry-at-Point" rolo-edit-entry t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 "----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 '["Next-Match" rolo-next-match t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 '["Previous-Match" rolo-previous-match t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 "----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 '("Move"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 ["Scroll-Backward" scroll-down t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 ["Scroll-Forward" scroll-up t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 ["To-Beginning" beginning-of-buffer t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 ["To-End" end-of-buffer t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 "----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 ["To-Next-Entry" outline-next-visible-heading t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 ["To-Next-Same-Level" outline-forward-same-level t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 ["To-Previous-Entry" outline-previous-visible-heading t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 ["To-Previous-Same-Level" outline-backward-same-level t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 ["Up-a-Level" outline-up-heading t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 '("Outline"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 ["Hide (Collapse)" hide-subtree t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 ["Show (Expand)" show-subtree t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 ["Show-All" show-all t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 ["Show-Only-First-Line" hide-body t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 infodock-wrolo-menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 "----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 '["Quit" (id-tool-quit 'rolo-quit) t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 ;;; Public functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 ;;; This definition is used only by XEmacs and Emacs19.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 (defun wrolo-menubar-menu ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 "Add a Hyperbole Rolodex menu to the rolodex match buffer menubar."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 (cond ((fboundp 'popup-mode-menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 (setq mode-popup-menu id-popup-wrolo-menu))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 (hyperb:lemacs-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 (define-key wrolo-mode-map 'button3 'wrolo-popup-menu))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 (t ;; hyperb:emacs19-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 (define-key wrolo-mode-map [down-mouse-3] 'wrolo-popup-menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 (define-key wrolo-mode-map [mouse-3] nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 (if (and (boundp 'current-menubar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 (or hyperb:emacs19-p current-menubar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 (not (car (find-menu-item current-menubar '("Wrolo")))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 (set-buffer-menubar (copy-sequence current-menubar))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 (if (fboundp 'add-submenu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 (add-submenu nil id-popup-wrolo-menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 (add-menu nil (car id-popup-wrolo-menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 (cdr id-popup-wrolo-menu))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 ;;; This definition is used only by XEmacs and Emacs19.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 (defun wrolo-popup-menu (event)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 "Popup the Hyperbole Rolodex match buffer menu."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 (interactive "@e")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 (mouse-set-point event)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 (if (fboundp 'popup-mode-menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 (popup-mode-menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 (popup-menu id-popup-wrolo-menu)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 (cond ((null hyperb:window-system))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 ((fboundp 'id-menubar-set)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 ;; InfoDock under a window system
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 (require 'id-menubars)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 (id-menubar-set 'wrolo-mode 'id-menubar-wrolo))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 (hyperb:lemacs-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 ;; XEmacs under a window system
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 (add-hook 'wrolo-mode-hook 'wrolo-menubar-menu))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 (hyperb:emacs19-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 ;; Emacs 19 under a window system
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 (require 'lmenu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 (add-hook 'wrolo-mode-hook 'wrolo-menubar-menu)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 (provide 'wrolo-menu)