comparison lisp/hyperbole/hui-mouse.el @ 70:131b0175ea99 r20-0b30

Import from CVS: tag r20-0b30
author cvs
date Mon, 13 Aug 2007 09:02:59 +0200
parents 56c54cf7c5b6
children 4be1180a9e89
comparison
equal deleted inserted replaced
69:804d1389bcd6 70:131b0175ea99
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: InfoDock Associates 11 ;; ORG: Brown U.
12 ;; 12 ;;
13 ;; ORIG-DATE: 04-Feb-89 13 ;; ORIG-DATE: 04-Feb-89
14 ;; LAST-MOD: 20-Feb-97 at 11:55:00 by Bob Weiner 14 ;; LAST-MOD: 1-Nov-95 at 20:45:57 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 ;;
91 ((if (not (eobp)) 84 ((if (not (eobp))
92 (or (eolp) (if selective-display 85 (or (eolp) (if selective-display
93 (= (following-char) ?\^M)))) . 86 (= (following-char) ?\^M)))) .
94 ((smart-scroll-up) . (smart-scroll-down))) 87 ((smart-scroll-up) . (smart-scroll-down)))
95 ;; 88 ;;
96 ((eq major-mode 'smart-menu-mode) . 89 ((eq major-mode 'smart-menu-mode) .
97 ((smart-menu-select) . (smart-menu-help))) 90 ((smart-menu-select) . (smart-menu-help)))
98 ;; 91 ;;
99 ;; If on a Hyperbole button, perform action or give help. 92 ;; If on a Hyperbole button, perform action or give help.
100 ((if (fboundp 'hbut:at-p) (or (hbut:at-p) (hbut:label-p))) . 93 ((if (fboundp 'hbut:at-p) (or (hbut:at-p) (hbut:label-p))) .
101 ((hui:hbut-act 'hbut:current) . (hui:hbut-help 'hbut:current))) 94 ((hui:hbut-act 'hbut:current) . (hui:hbut-help 'hbut:current)))
102 ;; 95 ;;
103 ;; The Smart Menu system provides menus within Emacs on a dumb terminal. 96 ;; The Smart Menu system provides menus within Emacs running on a dumb
104 ;; It is a part of InfoDock, but may also be obtained as a separate 97 ;; terminal. It is part of InfoDock and is not available separately.
105 ;; package. It is not included with Hyperbole.
106 ((and (fboundp 'smart-menu-choose-menu) 98 ((and (fboundp 'smart-menu-choose-menu)
107 (setq hkey-value (and hkey-always-display-menu 99 (setq hkey-value (and hkey-always-display-menu
108 (smart-menu-choose-menu))) 100 (smart-menu-choose-menu)))
109 (not (and (get-buffer-window *smart-menu-buffer*) 101 (not (and (get-buffer-window *smart-menu-buffer*)
110 (eq hkey-value *smart-menu-curr*)))) . 102 (eq hkey-value *smart-menu-curr*)))) .
126 ((View-scroll-lines-forward) . (View-scroll-lines-backward))) 118 ((View-scroll-lines-forward) . (View-scroll-lines-backward)))
127 ;; 119 ;;
128 ((eq major-mode 'kotl-mode) . 120 ((eq major-mode 'kotl-mode) .
129 ((kotl-mode:action-key) . (kotl-mode:help-key))) 121 ((kotl-mode:action-key) . (kotl-mode:help-key)))
130 ;; 122 ;;
131 ;; Rdb-mode Supports direct selection and viewing on in-memory relational 123 ;; Support direct selection and viewing on in-memory relational databases.
132 ;; databases. Rdb-mode is available only as a part of InfoDock. 124 ;; Rdb-mode has not been publicly released.
133 ;; It is not included with Hyperbole. 125 ;; It is not included with Hyperbole.
134 ((eq major-mode 'rdb-mode) . ((smart-rdb) . (smart-rdb-assist))) 126 ((eq major-mode 'rdb-mode) . ((smart-rdb) . (smart-rdb-assist)))
135 ;; 127 ;;
136 ;; Restore window config and hide help buffer when click at buffer end. 128 ;; Restore window config and hide help buffer when click at buffer end.
137 ((if (= (point) (point-max)) (string-match "Help\\*$" (buffer-name))) . 129 ((if (= (point) (point-max)) (string-match "Help\\*$" (buffer-name))) .
138 ((hkey-help-hide) . (hkey-help-hide))) 130 ((hkey-help-hide) . (hkey-help-hide)))
139 ;; 131 ;;
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 ;;
140 ((and (memq major-mode '(c-mode c++-c-mode)) 137 ((and (memq major-mode '(c-mode c++-c-mode))
141 buffer-file-name (smart-c-at-tag-p)) . 138 buffer-file-name (setq hkey-value (smart-c-at-tag-p))) .
142 ((smart-c) . (smart-c nil 'next-tag))) 139 ((smart-c) . (smart-c nil 'next-tag)))
143 ;; 140 ;;
144 ((and (eq major-mode 'asm-mode) 141 ((and (eq major-mode 'asm-mode)
145 buffer-file-name (smart-asm-at-tag-p)) . 142 buffer-file-name (setq hkey-value (smart-asm-at-tag-p))) .
146 ((smart-asm) . (smart-asm nil 'next-tag))) 143 ((smart-asm) . (smart-asm nil 'next-tag)))
147 ;; 144 ;;
148 ((if (smart-lisp-mode-p) (smart-lisp-at-tag-p)) . 145 ((if (smart-lisp-mode-p) (smart-lisp-at-tag-p)) .
149 ((smart-lisp) . (smart-lisp 'next-tag))) 146 ((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)))
159 ;; 147 ;;
160 ((and (eq major-mode 'c++-mode) buffer-file-name 148 ((and (eq major-mode 'c++-mode) buffer-file-name
161 ;; Don't use smart-c++-at-tag-p here since it will prevent #include 149 ;; Don't use smart-c++-at-tag-p here since it will prevent #include
162 ;; lines from matching. 150 ;; lines from matching.
163 (smart-c-at-tag-p)) . 151 (setq hkey-value (smart-c-at-tag-p))) .
164 ((smart-c++) . (smart-c++ nil 'next-tag))) 152 ( ;; Only fboundp if OO-Browser has been loaded.
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))))
165 ;; 158 ;;
166 ((and (eq major-mode 'objc-mode) buffer-file-name 159 ((and (eq major-mode 'objc-mode) buffer-file-name
167 (smart-objc-at-tag-p)) . 160 (setq hkey-value (smart-objc-at-tag-p))) .
168 ((smart-objc) . (smart-objc nil 'next-tag))) 161 ( ;; Only fboundp if OO-Browser has been loaded.
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))))
169 ;; 167 ;;
170 ((and (eq major-mode 'fortran-mode) 168 ((and (eq major-mode 'fortran-mode)
171 buffer-file-name (smart-fortran-at-tag-p)) . 169 buffer-file-name (setq hkey-value (smart-fortran-at-tag-p))) .
172 ((smart-fortran) . (smart-fortran nil 'next-tag))) 170 ((smart-fortran) . (smart-fortran nil 'next-tag)))
173 ;; 171 ;;
174 ((eq major-mode 'occur-mode) . 172 ((eq major-mode 'occur-mode) .
175 ((occur-mode-goto-occurrence) . (occur-mode-goto-occurrence))) 173 ((occur-mode-goto-occurrence) . (occur-mode-goto-occurrence)))
176 ;; 174 ;;
225 ((smart-wrolo) . (smart-wrolo-assist))) 223 ((smart-wrolo) . (smart-wrolo-assist)))
226 ;; 224 ;;
227 ;; Gomoku game 225 ;; Gomoku game
228 ((eq major-mode 'gomoku-mode) . 226 ((eq major-mode 'gomoku-mode) .
229 ((gomoku-human-plays) . (gomoku-human-takes-back))) 227 ((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)))
235 ;; 228 ;;
236 ;; Outline minor mode is on and usable. 229 ;; Outline minor mode is on and usable.
237 (selective-display . 230 (selective-display .
238 ((smart-outline) . (smart-outline-assist))) 231 ((smart-outline) . (smart-outline-assist)))
239 ) 232 )
431 ;; For Tree-dired compatibility 424 ;; For Tree-dired compatibility
432 ((fboundp 'dired-do-flagged-delete) 425 ((fboundp 'dired-do-flagged-delete)
433 (dired-do-flagged-delete)) 426 (dired-do-flagged-delete))
434 (t (error "(smart-dired): No Dired expunge function."))) 427 (t (error "(smart-dired): No Dired expunge function.")))
435 (dired-quit)))) 428 (dired-quit))))
436 (t (hpath:find (dired-get-filename))))) 429 (t (hpath:find-other-window (dired-get-filename)))))
437 430
438 (defun smart-dired-assist () 431 (defun smart-dired-assist ()
439 "Uses a single assist-key or mouse assist-key to manipulate directory entries. 432 "Uses a single assist-key or mouse assist-key to manipulate directory entries.
440 433
441 Invoked via an assist-key press when in dired-mode. It assumes that its 434 Invoked via an assist-key press when in dired-mode. It assumes that its
456 (cond ((last-line-p) 449 (cond ((last-line-p)
457 (dired-unflag (- (count-lines (point-min) (point-max)))) 450 (dired-unflag (- (count-lines (point-min) (point-max))))
458 (goto-char (point-max))) 451 (goto-char (point-max)))
459 ((looking-at "~") (dired-flag-backup-files)) 452 ((looking-at "~") (dired-flag-backup-files))
460 ((looking-at "#") (dired-flag-auto-save-files)) 453 ((looking-at "#") (dired-flag-auto-save-files))
461 (t (dired-flag-file-deletion 1)))) 454 (t (dired-flag-file-deleted 1))))
462 455
463 ;;; ************************************************************************ 456 ;;; ************************************************************************
464 ;;; smart-gnus functions 457 ;;; smart-gnus functions
465 ;;; ************************************************************************ 458 ;;; ************************************************************************
466 459