annotate lisp/hyperbole/hui-mini.el @ 143:50e7fedfe353

Added tag r20-2b5 for changeset 1856695b1fa9
author cvs
date Mon, 13 Aug 2007 09:33:20 +0200
parents 8619ce7e4c50
children
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: hui-mini.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 ;; SUMMARY: One line command menus for Hyperbole
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, 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
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 70
diff changeset
9 ;; ORG: InfoDock Associates
0
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: 15-Oct-91 at 20:13:17
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 108
diff changeset
12 ;; LAST-MOD: 17-Mar-97 at 21:28:26 by Bob Weiner
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;; This file is part of Hyperbole.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;; Available for use and distribution under the same terms as GNU Emacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;;
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 70
diff changeset
17 ;; Copyright (C) 1991-1997, Free Software Foundation, Inc.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ;; Developed with support from Motorola Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 ;; DESCRIPTION:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 ;; DESCRIP-END.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 ;;; Other required Elisp libraries
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 (require 'hypb)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 ;;; Public variables
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 (defvar hui:menu-select "\C-m"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 "*Upper case char-string which selects the Hyperbole menu item at point.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 (defvar hui:menu-quit "Q"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 "*Upper case char-string which quits selecting from a Hyperbole menu item.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 (defvar hui:menu-abort "\C-g"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 "*Same function as 'hui:menu-quit'.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 (defvar hui:menu-top "\C-t"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 "*Character which returns to top Hyperbole menu.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 (defvar hui:menu-p nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 "Non-nil iff a current Hyperbole menu activation exists.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 (defvar hui:menus nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 "Command menus for use with the default Hyperbole user interface.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 (setq
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 hui:menus
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 (delq nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 (list (cons
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 'hyperbole
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 (append
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 (let ((version (if (= (aref hyperb:version 0) ?0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 (substring hyperb:version 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 hyperb:version)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 (list (list (concat "Hy" version ">"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 (delq nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 '("Act" hui:hbut-act
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 "Activates button at point or prompts for explicit button.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 '("Butfile/" (menu . butfile)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 "Quick access button files menus.")
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 70
diff changeset
63 '("Cust/" (menu . cust)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 70
diff changeset
64 "Customizes Hyperbole by setting major options.")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 '("Doc/" (menu . doc)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 "Quick access to Hyperbole documentation.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 '("Ebut/" (menu . ebut)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 "Explicit button commands.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 '("Gbut/" (menu . gbut)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 "Global button commands.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 '("Hist" (hhist:remove current-prefix-arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 "Jumps back to location prior to last Hyperbole button follow.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 '("Ibut/" (menu . ibut)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 "Implicit button and button type commands.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 '("Msg/" (menu . msg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 "Mail and News messaging facilities.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 (if hyperb:kotl-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 '("Otl/" (menu . otl)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 "Autonumbered outlining and hyper-node facilities."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 '("Rolo/" (menu . rolo)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 "Hierarchical, multi-file rolodex lookup and edit commands.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 '("Win/" (menu . win)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 "Window configuration management command.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 ))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 '(butfile .
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 (("Butfile>")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 ("DirFile" (find-file hbmap:filename)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 "Edits directory-specific button file.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 ("Info"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 (id-info "(hyperbole.info)Button Files")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 "Displays manual section on button files.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 ("PersonalFile" (find-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 (expand-file-name hbmap:filename hbmap:dir-user))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 "Edits user-specific button file.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 ))
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 70
diff changeset
96 '(cust .
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 70
diff changeset
97 (("Customize>")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 70
diff changeset
98 ("Referent-Display/" (menu . cust-referents)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 70
diff changeset
99 "Sets where referents are displayed.")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 70
diff changeset
100 ("Smart-Key-at-Eol/" (menu . cust-eol)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 70
diff changeset
101 "Sets how scrolling via end of line presses works.")
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 108
diff changeset
102 ("Toggle-Rolo-Dates"
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 108
diff changeset
103 (if (and (boundp 'wrolo-add-hook) (listp wrolo-add-hook)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 108
diff changeset
104 (memq 'rolo-set-date wrolo-add-hook))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 108
diff changeset
105 (progn (remove-hook 'wrolo-add-hook 'rolo-set-date)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 108
diff changeset
106 (remove-hook 'wrolo-edit-hook 'rolo-set-date)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 108
diff changeset
107 (message "Rolodex date stamps are now turned off."))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 108
diff changeset
108 (add-hook 'wrolo-add-hook 'rolo-set-date)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 108
diff changeset
109 (add-hook 'wrolo-edit-hook 'rolo-set-date)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 108
diff changeset
110 (message "Rolodex date stamps are now turned on."))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 108
diff changeset
111 "Toggle whether date stamps are update when rolodex entries are edited.")
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 70
diff changeset
112 ("URL-Display/" (menu . cust-urls) "Sets where URLs are displayed.")))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 70
diff changeset
113 '(cust-eol .
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 70
diff changeset
114 (("Smart Key press at eol scrolls>")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 70
diff changeset
115 ("Proportionally" (setq smart-scroll-proportional t))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 70
diff changeset
116 ("Windowful" (setq smart-scroll-proportional nil))))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 70
diff changeset
117 '(cust-referents .
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 70
diff changeset
118 (("Ref display>")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 70
diff changeset
119 ("Any-Frame" (setq hpath:display-where 'other-frame))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 70
diff changeset
120 ("Current-Win" (setq hpath:display-where 'this-window))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 70
diff changeset
121 ("Diff-Frame-One-Win"
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 70
diff changeset
122 (setq hpath:display-where 'other-frame-one-window))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 70
diff changeset
123 ("New-Frame" (setq hpath:display-where 'new-frame))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 70
diff changeset
124 ("Other-Win" (setq hpath:display-where 'other-window))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 70
diff changeset
125 ("Single-Win" (setq hpath:display-where 'one-window))))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 70
diff changeset
126 '(cust-urls .
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 70
diff changeset
127 (("URL display>")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 70
diff changeset
128 ("Any-Netscape-Window"
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 70
diff changeset
129 (setq action-key-url-function 'highlight-headers-follow-url-netscape
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 70
diff changeset
130 highlight-headers-follow-url-function action-key-url-function
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 70
diff changeset
131 highlight-headers-follow-url-netscape-new-window nil))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 70
diff changeset
132 ("New-Netscape-Window"
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 70
diff changeset
133 (setq action-key-url-function 'highlight-headers-follow-url-netscape
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 70
diff changeset
134 highlight-headers-follow-url-function action-key-url-function
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 70
diff changeset
135 highlight-headers-follow-url-netscape-new-window t))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 70
diff changeset
136 ("Mosaic" (setq action-key-url-function
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 70
diff changeset
137 'highlight-headers-follow-url-mosaic
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 70
diff changeset
138 highlight-headers-follow-url-function
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 70
diff changeset
139 action-key-url-function))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 70
diff changeset
140 ("W3-Browser"
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 70
diff changeset
141 (setq action-key-url-function 'w3-fetch
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 70
diff changeset
142 highlight-headers-follow-url-function
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 70
diff changeset
143 action-key-url-function))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 '(doc .
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 (("Doc>")
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 70
diff changeset
146 ("About" (hypb:display-file-with-logo
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 70
diff changeset
147 (expand-file-name "ABOUT" hyperb:dir))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 70
diff changeset
148 "Overview of Hyperbole and InfoDock Associates.")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 ("Demo" (find-file-read-only
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 (expand-file-name "DEMO" hyperb:dir))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 "Demonstrates Hyperbole features.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 ("Files" (find-file-read-only
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 (expand-file-name "MANIFEST" hyperb:dir))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 "Summarizes Hyperbole system files. Click on an entry to view it.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 ("Glossary"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 (id-info "(hyperbole.info)Glossary")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 "Glossary of Hyperbole terms.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 ("HypbCopy" (id-info "(hyperbole.info)Top")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 "Displays general Hyperbole copyright and license details.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 ("Info" (id-info "(hyperbole.info)Top")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 "Online Info version of Hyperbole manual.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 ("MailLists" (id-info "(hyperbole.info)Mail Lists")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 "Details on Hyperbole mail list subscriptions.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 ("New" (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 (hact 'link-to-regexp-match
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 "\\*[ \t]+What's New" 2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 (expand-file-name "README" hyperb:dir))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 (setq buffer-read-only nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 (toggle-read-only))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 "Recent changes to Hyperbole.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 ("SmartKy" (find-file-read-only (hypb:mouse-help-file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 "Summarizes Smart Key mouse or keyboard handling.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 ("Types/" (menu . types)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 "Provides documentation on Hyperbole types.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 '(ebut .
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 (("EButton>")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 ("Act" hui:hbut-act
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 "Activates button at point or prompts for explicit button.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 ("Create" hui:ebut-create)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 ("Delete" hui:ebut-delete)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 ("Edit" hui:ebut-modify "Modifies any desired button attributes.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 ("Help/" (menu . ebut-help) "Summarizes button attributes.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 ("Info"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 (id-info "(hyperbole.info)Explicit Buttons")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 "Displays manual section on explicit buttons.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 ("Modify" hui:ebut-modify "Modifies any desired button attributes.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 ("Rename" hui:ebut-rename "Relabels an explicit button.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 ("Search" hui:ebut-search
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 "Locates and displays personally created buttons in context.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 '(ebut-help .
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 (("Help on>")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 ("BufferButs" (hui:hbut-report -1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 "Summarizes all explicit buttons in buffer.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 ("CurrentBut" (hui:hbut-report)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 "Summarizes only current button in buffer.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 ("OrderedButs" (hui:hbut-report 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 "Summarizes explicit buttons in lexicographically order.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 '(gbut .
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 (("GButton>")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 ("Act" gbut:act "Activates global button by name.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 ("Create" hui:gbut-create "Adds a global button to gbut:file.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 ("Edit" hui:gbut-modify "Modifies global button attributes.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 ("Help" gbut:help "Reports on a global button by name.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 ("Info" (id-info "(hyperbole.info)Global Buttons")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 "Displays manual section on global buttons.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 ("Modify" hui:gbut-modify "Modifies global button attributes.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 '(ibut .
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 (("IButton>")
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 70
diff changeset
213 ("Act" hui:hbut-current-act "Activates implicit button at point.")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 ("DeleteIButType" (hui:htype-delete 'ibtypes)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 "Deletes specified button type.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 ("Help" hui:hbut-help "Reports on button's attributes.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 ("Info" (id-info "(hyperbole.info)Implicit Buttons")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 "Displays manual section on implicit buttons.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 ("Types" (hui:htype-help 'ibtypes 'no-sort)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 "Displays documentation for one or all implicit button types.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 '(msg .
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 (("Msg>")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 ("Compose-Hypb-Mail"
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 70
diff changeset
225 (hmail:compose "hyperbole@infodock.com" '(hact 'hyp-config))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 "Send a message to the Hyperbole discussion list.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 ("Edit-Hypb-List-Entry"
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 70
diff changeset
228 (hmail:compose "hyperbole-request@infodock.com"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 '(hact 'hyp-request))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 "Add, remove or change your entry on a the Hyperbole mail list.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231 ("Modify-Hypb-Announce-Entry"
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 70
diff changeset
232 (hmail:compose "hyperbole-announce-request@infodock.com"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 '(hact 'hyp-request))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 "Add, remove or change your entry on the Hyperbole Announce mail list.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 (if hyperb:kotl-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 '(otl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 . (("Otl>")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 ("All" kotl-mode:show-all "Expand all collapsed cells.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 ("Blanks" kvspec:toggle-blank-lines
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 "Toggle blank lines between cells on or off.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 ("Create" kfile:find "Create or edit an outline file.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 ("Downto" kotl-mode:hide-sublevels
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 "Hide all cells in outline deeper than a particular level.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 ("Examp" (find-file-read-only
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 (expand-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 "EXAMPLE.kotl" (concat hyperb:dir "kotl/")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 "Display a self-descriptive example outline file.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 ("Hide" (progn (kotl-mode:is-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 (kotl-mode:hide-tree (kcell-view:label)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251 "Collapse tree rooted at point.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 ("Info"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253 (id-info "(hyperbole.info)Outliner")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254 "Display manual section on Hyperbole outliner.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255 ("Kill" kotl-mode:kill-tree
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256 "Kill ARG following trees starting from point.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 ("Link" klink:create
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258 "Create and insert an implicit link at point.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 ("Overvw" kotl-mode:overview
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 "Show first line of each cell.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261 ("Show" (progn (kotl-mode:is-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 (kotl-mode:show-tree (kcell-view:label)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 "Expand tree rooted at point.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264 ("Top" kotl-mode:top-cells
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 "Hide all but top-level cells.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266 ("Vspec" kvspec:activate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267 "Prompt for and activate a view specifiction.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268 )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 '(rolo .
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270 (("Rolo>")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271 ("Add" rolo-add "Add a new rolo entry.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272 ("Display" rolo-display-matches
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 "Display last found rolodex matches again.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 ("Edit" rolo-edit "Edit an existing rolo entry.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 ("Info" (id-info "(hyperbole.info)Rolodex")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276 "Displays manual section on Hyperbole rolodex.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 ("Kill" rolo-kill "Kill an existing rolo entry.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 ("Mail" rolo-mail-to "Mail to address following point.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 ("Order" rolo-sort "Order rolo entries in a file.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 ("RegexFind" rolo-grep "Find entries containing a regexp.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 ("StringFind" rolo-fgrep "Find entries containing a string.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 ("WordFind" rolo-word "Find entries containing words.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283 ("Yank" rolo-yank
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 "Find an entry containing a string and insert it at point.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 '(types .
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 (("Types>")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288 ("ActionTypes" (hui:htype-help 'actypes)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289 "Displays documentation for one or all action types.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290 ("IButTypes" (hui:htype-help 'ibtypes 'no-sort)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291 "Displays documentation for one or all implicit button types.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 '(win .
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294 (("WinConfig>")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295 ("AddName" wconfig-add-by-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296 "Name current window configuration.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297 ("DeleteName" wconfig-delete-by-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298 "Delete named window configuration.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299 ("RestoreName" wconfig-restore-by-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300 "Restore frame to window configuration given by name.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301 ("PopRing" (progn (wconfig-delete-pop)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302 (hyperbole 'win))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303 "Restores window configuration from ring and removes it from ring.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
304 ("SaveRing" (wconfig-ring-save)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
305 "Saves current window configuration to ring.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306 ("YankRing" (progn (call-interactively 'wconfig-yank-pop)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307 (hyperbole 'win))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
308 "Restores next window configuration from ring.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310 )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
312 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313 ;;; Public functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316 ;;; Old name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317 (fset 'hui:menu 'hyperbole)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319 ;;; Used as autoloaded main entry point to Hyperbole (but hsite.el) is the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320 ;;; file that is autoloaded when this is invoked.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321 ;;; It brings up a menu of commands.
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 100
diff changeset
322 ;;;###autoload
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 (defun hyperbole (&optional menu menu-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324 "Invokes default Hyperbole menu user interface when not already active.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
325 Suitable for binding to a key, e.g. {C-h h}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326 Non-interactively, returns t if menu is actually invoked by call, else nil.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328 Two optional arguments may be given to invoke alternative menus.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329 MENU (a symbol) specifies the menu to invoke from MENU-LIST, (a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330 Hyperbole menu list structure). MENU defaults to 'hyperbole and MENU-LIST
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
331 to `hui:menus'. See `hui:menus' definition for the format of the menu list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
332 structure."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
334 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
335 (if (and hui:menu-p (> (minibuffer-depth) 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
336 (progn (beep) nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337 (unwind-protect
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 (require 'hsite) ;; Since "hui-mini" may be loaded without loading
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340 ;; all of Hyperbole.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
341 (hyperb:init-menubar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
342 (setq hui:menu-p t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
343 (hui:menu-act (or menu 'hyperbole) menu-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
344 t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345 (setq hui:menu-p nil))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
346
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
347 (defun hui:menu-act (menu &optional menu-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
348 "Prompts user with Hyperbole MENU (a symbol) and performs selected item.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
349 Optional second argument MENU-LIST is a Hyperbole menu list structure from
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
350 which to extract MENU. It defaults to `hui:menus'. See its definition for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
351 the menu list structure."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352 (let ((set-menu '(or (and menu (symbolp menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353 (setq menu-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354 (cdr (assq menu (or menu-list hui:menus)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355 (hypb:error "(menu-act): Invalid menu symbol arg: %s"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
356 menu)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357 (show-menu t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358 (rtn)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359 menu-alist act-form)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360 (while (and show-menu (eval set-menu))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361 (cond ((and (consp (setq act-form (hui:menu-select menu-alist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362 (cdr act-form)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363 (symbolp (cdr act-form)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
364 ;; Display another menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
365 (setq menu (cdr act-form)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366 (act-form
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367 (let ((prefix-arg current-prefix-arg))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368 (cond ((symbolp act-form)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369 (if (eq act-form t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
370 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371 (setq show-menu nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372 rtn (call-interactively act-form))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373 ((stringp act-form)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374 (hui:menu-help act-form)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375 ;; Loop and show menu again.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
376 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
377 (t (setq show-menu nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
378 rtn (eval act-form))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
379 (t (setq show-menu nil))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
380 rtn))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
381
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
382 (defun hui:menu-enter (&optional char-str)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
383 "Uses CHAR-STR or last input character as minibuffer argument."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
384 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
385 (let ((input (or char-str (aref (recent-keys) (1- (length (recent-keys)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
386 (cond (hyperb:emacs19-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
387 (and (not (integerp input))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
388 (eventp input)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
389 (setq input (event-basic-type input))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
390 (hyperb:lemacs-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
391 (if (eventp input)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
392 (setq input (event-to-character input)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
393 (if (or (symbolp input)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
394 (and (integerp input)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
395 (= input ?\r)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
396 (setq input (hargs:at-p)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
397 (erase-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
398 (or (symbolp input) (insert input)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
399 (exit-minibuffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
400
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
401 (defun hui:menu-help (help-str)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
402 "Displays HELP-STR in a small window. HELP-STR must be a string."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
403 (let* ((window-min-height 2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
404 (owind (selected-window))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
405 (buf-name (hypb:help-buf-name "Menu")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
406 (unwind-protect
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
407 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
408 (save-window-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
409 (hkey-help-show buf-name)) ;; Needed to save wconfig.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
410 (if (eq (selected-window) (minibuffer-window))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
411 (other-window 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
412 (if (= (length (hypb:window-list 'no-mini)) 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
413 (split-window-vertically nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
414 (select-window (hui:bottom-window))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
415 (switch-to-buffer (get-buffer-create buf-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
416 (setq buffer-read-only nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
417 (erase-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
418 (insert "\n" help-str)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
419 (set-buffer-modified-p nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
420 (shrink-window
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
421 (- (window-height)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
422 (+ 3 (length
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
423 (delq nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
424 (mapcar (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
425 (lambda (chr) (= chr ?\n)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
426 help-str)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
427 (select-window owind))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
428
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
429 (defun hui:menu-xemacs (&optional menu menu-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
430 "Returns an XEmacs menu built from Hyperbole type menus.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
431 Optional MENU (a symbol) specifies a specific submenu of optional MENU-LIST.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
432 a Hyperbole menu list structure. Otherwise, all menus are used.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
433 MENU defaults to 'hyperbole and MENU-LIST to `hui:menus'. See `hui:menus'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
434 definition for the format of the menu list structure."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
435 (mapcar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
436 (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
437 (lambda (entry)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
438 (or (consp entry)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
439 (error "(hui:menu-xemacs): Invalid menu entry: %s" entry))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
440 (let ((label (car entry))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
441 (content (car (cdr entry))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
442 (cond ((null content) (hypb:replace-match-string ">$" label "" t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
443 ((and (consp content) (eq (car content) 'menu))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
444 (hui:menu-xemacs (cdr content)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
445 (t (vector label content 't))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
446 (cdr (assq (or menu 'hyperbole) (or menu-list hui:menus)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
447
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
448 (defun hui:menu-select (menu-alist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
449 "Prompts user to choose the first character of any item from MENU-ALIST.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
450 Case is not significant. If chosen by direct selection with the Assist Key,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
451 returns any help string for item, else returns the action form for the item."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
452 (let* ((menu-line (hui:menu-line menu-alist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
453 (set:equal-op 'eq)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
454 (select-char (string-to-char hui:menu-select))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
455 (quit-char (string-to-char hui:menu-quit))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
456 (abort-char (string-to-char hui:menu-abort))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
457 (top-char (string-to-char hui:menu-top))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
458 (item-keys (mapcar (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
459 (lambda (item) (aref item 0)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
460 (mapcar 'car (cdr menu-alist))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
461 (keys (apply 'list select-char quit-char abort-char
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
462 top-char item-keys))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
463 (key 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
464 (hargs:reading-p 'hmenu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
465 sublist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
466 (while (not (memq (setq key (upcase
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
467 (string-to-char
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
468 (read-from-minibuffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
469 "" menu-line hui:menu-mode-map))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
470 keys))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
471 (beep)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
472 (setq hargs:reading-p 'hmenu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
473 (discard-input))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
474 (cond ((eq key quit-char) nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
475 ((eq key abort-char) (beep) nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
476 ((eq key top-char) '(menu . hyperbole))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
477 ((and (eq key select-char)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
478 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
479 (if (search-backward " " nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
480 (progn (skip-chars-forward " ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
481 (setq key (following-char))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
482 nil) ;; Drop through.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
483 t))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
484 (t (if (setq sublist (memq key item-keys))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
485 (let* ((label-act-help-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
486 (nth (- (1+ (length item-keys)) (length sublist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
487 menu-alist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
488 (act-form (car (cdr label-act-help-list))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
489 (if (eq hargs:reading-p 'hmenu-help)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
490 (let ((help-str
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
491 (or (car (cdr (cdr label-act-help-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
492 "No help documentation for this item.")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
493 (concat (car label-act-help-list) "\n "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
494 help-str "\n Action: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
495 (prin1-to-string act-form)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
496 act-form)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
497
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
498 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
499 ;;; Private functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
500 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
501
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
502 (if (fboundp 'window-lowest-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
503 (defun hui:bottom-window ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
504 "Return a window that is at the bottom of the selected frame."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
505 (let ((winds (hypb:window-list 'no-mini))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
506 (window))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
507 (while (and (not window) winds)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
508 (if (window-lowest-p (car winds))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
509 (setq window (car winds))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
510 (setq winds (cdr winds))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
511 window))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
512 (defun hui:bottom-window ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
513 "Return a window that is at the bottom of the selected frame."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
514 (let* ((winds (hypb:window-list 'no-mini))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
515 (bot-list (mapcar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
516 (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
517 (lambda (wind)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
518 (nth 3 (window-edges wind))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
519 winds))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
520 (bot (apply 'max bot-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
521 (nth (- (length winds) (length (memq bot bot-list))) winds))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
522
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
523 (defun hui:menu-line (menu-alist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
524 "Returns a menu line string built from MENU-ALIST."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
525 (let ((menu-prompt (concat (car (car menu-alist)) " "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
526 (menu-items (mapconcat 'car (cdr menu-alist) " "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
527 menu-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
528 (setq menu-line (concat menu-prompt menu-items))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
529 ;; Narrow menu by changing 2 spaces to 1 if too wide for current frame.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
530 (if (>= (length menu-line) (1- (frame-width)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
531 (concat menu-prompt (mapconcat 'car (cdr menu-alist) " "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
532 menu-line)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
533
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
534 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
535 ;;; Private variables
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
536 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
537
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
538 ;; Hyperbole menu mode is suitable only for specially formatted data.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
539 (put 'hui:menu-mode 'mode-class 'special)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
540
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
541 (defvar hui:menu-mode-map nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
542 "Keymap containing hui:menu commands.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
543 (if hui:menu-mode-map
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
544 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
545 (setq hui:menu-mode-map (make-keymap))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
546 (suppress-keymap hui:menu-mode-map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
547 (define-key hui:menu-mode-map hui:menu-quit 'hui:menu-enter)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
548 (define-key hui:menu-mode-map hui:menu-abort 'hui:menu-enter)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
549 (define-key hui:menu-mode-map hui:menu-top 'hui:menu-enter)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
550 (define-key hui:menu-mode-map hui:menu-select 'hui:menu-enter)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
551 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
552 ;; This next binding is necessary since the default button1 binding under
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
553 ;; XEmacs, mouse-track, is broken under XEmacs V19.8.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
554 (and hyperb:lemacs-p window-system
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
555 (define-key hui:menu-mode-map 'button1 'mouse-set-point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
556 (let ((i 32))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
557 (while (<= i 126)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
558 (define-key hui:menu-mode-map (char-to-string i) 'hui:menu-enter)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
559 (setq i (1+ i)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
560
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
561 (provide 'hui-mini)