annotate lisp/hyperbole/hui-mini.el @ 24:4103f0995bd7 r19-15b95

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