comparison lisp/hyperbole/hui-mouse.el @ 100:4be1180a9e89 r20-1b2

Import from CVS: tag r20-1b2
author cvs
date Mon, 13 Aug 2007 09:15:11 +0200
parents 131b0175ea99
children 6608ceec7cf8
comparison
equal deleted inserted replaced
99:2d83cbd90d8d 100:4be1180a9e89
6 ;; documentation strings for functions herein. 6 ;; documentation strings for functions herein.
7 ;; USAGE: GNU Emacs Lisp Library 7 ;; USAGE: GNU Emacs Lisp Library
8 ;; KEYWORDS: hypermedia, mouse 8 ;; KEYWORDS: hypermedia, mouse
9 ;; 9 ;;
10 ;; AUTHOR: Bob Weiner 10 ;; AUTHOR: Bob Weiner
11 ;; ORG: Brown U. 11 ;; ORG: InfoDock Associates
12 ;; 12 ;;
13 ;; ORIG-DATE: 04-Feb-89 13 ;; ORIG-DATE: 04-Feb-89
14 ;; LAST-MOD: 1-Nov-95 at 20:45:57 by Bob Weiner 14 ;; LAST-MOD: 20-Feb-97 at 11:55:00 by Bob Weiner
15 ;; 15 ;;
16 ;; This file is part of Hyperbole. 16 ;; This file is part of Hyperbole.
17 ;; Available for use and distribution under the same terms as GNU Emacs. 17 ;; Available for use and distribution under the same terms as GNU Emacs.
18 ;; 18 ;;
19 ;; Copyright (C) 1989-1995, Free Software Foundation, Inc. 19 ;; Copyright (C) 1989-1995, Free Software Foundation, Inc.
79 ;; argument, allow selection of an item at point. 79 ;; argument, allow selection of an item at point.
80 ((if (> (minibuffer-depth) 0) (setq hkey-value (hargs:at-p))) . 80 ((if (> (minibuffer-depth) 0) (setq hkey-value (hargs:at-p))) .
81 ((hargs:select-p hkey-value) . 81 ((hargs:select-p hkey-value) .
82 (hargs:select-p hkey-value 'assist))) 82 (hargs:select-p hkey-value 'assist)))
83 ;; 83 ;;
84 ;; The ID-edit package supports rapid killing, copying, yanking and
85 ;; display management. It is available only as a part of InfoDock.
86 ;; It is not included with Hyperbole.
87 ((and (boundp 'id-edit-mode) id-edit-mode
88 (not buffer-read-only)) .
89 ((id-edit-yank) . (id-edit-yank)))
90 ;;
84 ((if (not (eobp)) 91 ((if (not (eobp))
85 (or (eolp) (if selective-display 92 (or (eolp) (if selective-display
86 (= (following-char) ?\^M)))) . 93 (= (following-char) ?\^M)))) .
87 ((smart-scroll-up) . (smart-scroll-down))) 94 ((smart-scroll-up) . (smart-scroll-down)))
88 ;; 95 ;;
89 ((eq major-mode 'smart-menu-mode) . 96 ((eq major-mode 'smart-menu-mode) .
90 ((smart-menu-select) . (smart-menu-help))) 97 ((smart-menu-select) . (smart-menu-help)))
91 ;; 98 ;;
92 ;; If on a Hyperbole button, perform action or give help. 99 ;; If on a Hyperbole button, perform action or give help.
93 ((if (fboundp 'hbut:at-p) (or (hbut:at-p) (hbut:label-p))) . 100 ((if (fboundp 'hbut:at-p) (or (hbut:at-p) (hbut:label-p))) .
94 ((hui:hbut-act 'hbut:current) . (hui:hbut-help 'hbut:current))) 101 ((hui:hbut-act 'hbut:current) . (hui:hbut-help 'hbut:current)))
95 ;; 102 ;;
96 ;; The Smart Menu system provides menus within Emacs running on a dumb 103 ;; The Smart Menu system provides menus within Emacs on a dumb terminal.
97 ;; terminal. It is part of InfoDock and is not available separately. 104 ;; It is a part of InfoDock, but may also be obtained as a separate
105 ;; package. It is not included with Hyperbole.
98 ((and (fboundp 'smart-menu-choose-menu) 106 ((and (fboundp 'smart-menu-choose-menu)
99 (setq hkey-value (and hkey-always-display-menu 107 (setq hkey-value (and hkey-always-display-menu
100 (smart-menu-choose-menu))) 108 (smart-menu-choose-menu)))
101 (not (and (get-buffer-window *smart-menu-buffer*) 109 (not (and (get-buffer-window *smart-menu-buffer*)
102 (eq hkey-value *smart-menu-curr*)))) . 110 (eq hkey-value *smart-menu-curr*)))) .
118 ((View-scroll-lines-forward) . (View-scroll-lines-backward))) 126 ((View-scroll-lines-forward) . (View-scroll-lines-backward)))
119 ;; 127 ;;
120 ((eq major-mode 'kotl-mode) . 128 ((eq major-mode 'kotl-mode) .
121 ((kotl-mode:action-key) . (kotl-mode:help-key))) 129 ((kotl-mode:action-key) . (kotl-mode:help-key)))
122 ;; 130 ;;
123 ;; Support direct selection and viewing on in-memory relational databases. 131 ;; Rdb-mode Supports direct selection and viewing on in-memory relational
124 ;; Rdb-mode has not been publicly released. 132 ;; databases. Rdb-mode is available only as a part of InfoDock.
125 ;; It is not included with Hyperbole. 133 ;; It is not included with Hyperbole.
126 ((eq major-mode 'rdb-mode) . ((smart-rdb) . (smart-rdb-assist))) 134 ((eq major-mode 'rdb-mode) . ((smart-rdb) . (smart-rdb-assist)))
127 ;; 135 ;;
128 ;; Restore window config and hide help buffer when click at buffer end. 136 ;; Restore window config and hide help buffer when click at buffer end.
129 ((if (= (point) (point-max)) (string-match "Help\\*$" (buffer-name))) . 137 ((if (= (point) (point-max)) (string-match "Help\\*$" (buffer-name))) .
130 ((hkey-help-hide) . (hkey-help-hide))) 138 ((hkey-help-hide) . (hkey-help-hide)))
131 ;; 139 ;;
132 ;; Support the OO-Browser, a part of InfoDock, XEmacs, and soon to be a
133 ;; part of Emacs.
134 ((or (br-in-browser) (eq major-mode 'br-mode)) .
135 ((smart-br-dispatch) . (smart-br-assist-dispatch)))
136 ;;
137 ((and (memq major-mode '(c-mode c++-c-mode)) 140 ((and (memq major-mode '(c-mode c++-c-mode))
138 buffer-file-name (setq hkey-value (smart-c-at-tag-p))) . 141 buffer-file-name (smart-c-at-tag-p)) .
139 ((smart-c) . (smart-c nil 'next-tag))) 142 ((smart-c) . (smart-c nil 'next-tag)))
140 ;; 143 ;;
141 ((and (eq major-mode 'asm-mode) 144 ((and (eq major-mode 'asm-mode)
142 buffer-file-name (setq hkey-value (smart-asm-at-tag-p))) . 145 buffer-file-name (smart-asm-at-tag-p)) .
143 ((smart-asm) . (smart-asm nil 'next-tag))) 146 ((smart-asm) . (smart-asm nil 'next-tag)))
144 ;; 147 ;;
145 ((if (smart-lisp-mode-p) (smart-lisp-at-tag-p)) . 148 ((if (smart-lisp-mode-p) (smart-lisp-at-tag-p)) .
146 ((smart-lisp) . (smart-lisp 'next-tag))) 149 ((smart-lisp) . (smart-lisp 'next-tag)))
150 ;;
151 ((and (eq major-mode 'java-mode) buffer-file-name
152 (or (smart-java-at-tag-p)
153 ;; Also handle Java @see cross-references.
154 (looking-at "@see[ \t]+")
155 (save-excursion
156 (and (re-search-backward "[@\n\r\f]" nil t)
157 (looking-at "@see[ \t]+"))))) .
158 ((smart-java) . (smart-java nil 'next-tag)))
147 ;; 159 ;;
148 ((and (eq major-mode 'c++-mode) buffer-file-name 160 ((and (eq major-mode 'c++-mode) buffer-file-name
149 ;; Don't use smart-c++-at-tag-p here since it will prevent #include 161 ;; Don't use smart-c++-at-tag-p here since it will prevent #include
150 ;; lines from matching. 162 ;; lines from matching.
151 (setq hkey-value (smart-c-at-tag-p))) . 163 (smart-c-at-tag-p)) .
152 ( ;; Only fboundp if OO-Browser has been loaded. 164 ((smart-c++) . (smart-c++ nil 'next-tag)))
153 (if (fboundp 'c++-to-definition)
154 (smart-c++-oobr) (smart-c++)) .
155 (if (fboundp 'c++-to-definition)
156 (smart-c++-oobr)
157 (smart-c++ nil 'next-tag))))
158 ;; 165 ;;
159 ((and (eq major-mode 'objc-mode) buffer-file-name 166 ((and (eq major-mode 'objc-mode) buffer-file-name
160 (setq hkey-value (smart-objc-at-tag-p))) . 167 (smart-objc-at-tag-p)) .
161 ( ;; Only fboundp if OO-Browser has been loaded. 168 ((smart-objc) . (smart-objc nil 'next-tag)))
162 (if (fboundp 'objc-to-definition)
163 (smart-objc-oobr) (smart-objc)) .
164 (if (fboundp 'objc-to-definition)
165 (smart-objc-oobr)
166 (smart-objc nil 'next-tag))))
167 ;; 169 ;;
168 ((and (eq major-mode 'fortran-mode) 170 ((and (eq major-mode 'fortran-mode)
169 buffer-file-name (setq hkey-value (smart-fortran-at-tag-p))) . 171 buffer-file-name (smart-fortran-at-tag-p)) .
170 ((smart-fortran) . (smart-fortran nil 'next-tag))) 172 ((smart-fortran) . (smart-fortran nil 'next-tag)))
171 ;; 173 ;;
172 ((eq major-mode 'occur-mode) . 174 ((eq major-mode 'occur-mode) .
173 ((occur-mode-goto-occurrence) . (occur-mode-goto-occurrence))) 175 ((occur-mode-goto-occurrence) . (occur-mode-goto-occurrence)))
174 ;; 176 ;;
223 ((smart-wrolo) . (smart-wrolo-assist))) 225 ((smart-wrolo) . (smart-wrolo-assist)))
224 ;; 226 ;;
225 ;; Gomoku game 227 ;; Gomoku game
226 ((eq major-mode 'gomoku-mode) . 228 ((eq major-mode 'gomoku-mode) .
227 ((gomoku-human-plays) . (gomoku-human-takes-back))) 229 ((gomoku-human-plays) . (gomoku-human-takes-back)))
230 ;;
231 ;; Support the OO-Browser, a part of InfoDock and XEmacs, and an add on
232 ;; to Emacs. It is not included with Hyperbole.
233 ((or (br-in-browser) (eq major-mode 'br-mode)) .
234 ((smart-br-dispatch) . (smart-br-assist-dispatch)))
228 ;; 235 ;;
229 ;; Outline minor mode is on and usable. 236 ;; Outline minor mode is on and usable.
230 (selective-display . 237 (selective-display .
231 ((smart-outline) . (smart-outline-assist))) 238 ((smart-outline) . (smart-outline-assist)))
232 ) 239 )
424 ;; For Tree-dired compatibility 431 ;; For Tree-dired compatibility
425 ((fboundp 'dired-do-flagged-delete) 432 ((fboundp 'dired-do-flagged-delete)
426 (dired-do-flagged-delete)) 433 (dired-do-flagged-delete))
427 (t (error "(smart-dired): No Dired expunge function."))) 434 (t (error "(smart-dired): No Dired expunge function.")))
428 (dired-quit)))) 435 (dired-quit))))
429 (t (hpath:find-other-window (dired-get-filename))))) 436 (t (hpath:find (dired-get-filename)))))
430 437
431 (defun smart-dired-assist () 438 (defun smart-dired-assist ()
432 "Uses a single assist-key or mouse assist-key to manipulate directory entries. 439 "Uses a single assist-key or mouse assist-key to manipulate directory entries.
433 440
434 Invoked via an assist-key press when in dired-mode. It assumes that its 441 Invoked via an assist-key press when in dired-mode. It assumes that its