annotate 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
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-mouse.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 ;; SUMMARY: Use key or mouse key for many functions, e.g. Hypb menus.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 ;; See the "${data-directory}/hypb-mouse.txt" file and the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 ;; documentation strings for functions herein.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 ;; USAGE: GNU Emacs Lisp Library
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 ;; KEYWORDS: hypermedia, mouse
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;; AUTHOR: Bob Weiner
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
11 ;; ORG: Brown U.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;; ORIG-DATE: 04-Feb-89
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
14 ;; LAST-MOD: 1-Nov-95 at 20:45:57 by Bob Weiner
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;; This file is part of Hyperbole.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ;; Available for use and distribution under the same terms as GNU Emacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 ;; Copyright (C) 1989-1995, Free Software Foundation, Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 ;; Developed with support from Motorola Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 ;; DESCRIPTION:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 ;; This code is machine independent. It works best with a pointing device but
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 ;; may also be used from a keyboard. When used with a pointing device it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 ;; requires an Emacs command that sets point to the location of the pointing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 ;; device's cursor.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 ;; If you want to use your shift-middle mouse button to select Hyperbole menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 ;; items and Hyperbole buttons, follow these instructions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 ;; If you plan to use a mouse only with X windows (Lucid Emacs, GNU Emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 ;; 19, or Epoch), NEXTSTEP, SunView, Apollo's DM, and you want to use the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 ;; shift-middle and shift-right buttons, you need not do any mouse
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 ;; configuration. Your Emacs executable must have been built so as to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 ;; include the mouse support files for your window system, however. These
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 ;; are in the Emacs "src" directory: for X "x*.c", for SunView "sunfns.c",
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 ;; and for Apollo DM "apollo.c" and "apollo.el".
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 ;; To use a different mouse key or a different window system, modify the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 ;; mouse key bindings in "hmouse-key.el".
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 ;; Using the Action Mouse Key to browse through and delete files from
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 ;; Dired listings is exceptionally nice, just as it is when reading mail.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 ;; DESCRIP-END.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 ;;; Public variables
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 (defvar hmouse-set-point-command nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 "*Command that sets point to mouse cursor position.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 (defvar action-key-default-function 'hui:menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 "*Symbol name of function run by the Action Key in an unspecified context.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 (defvar assist-key-default-function 'hkey-summarize
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 "*Symbol name of function run by the Assist Key in an unspecified context.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 ;;; Hyperbole context-sensitive keys dispatch table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 (defvar hkey-value nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 "Communicates a value between a Smart Key predicate and its actions.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 (defvar hkey-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 '(
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 ;; If click in the minibuffer and reading an argument,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 ;; accept argument or give completion help.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 ((and (> (minibuffer-depth) 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 (eq (selected-window) (minibuffer-window))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 (not (eq hargs:reading-p 'hmenu))) .
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 ((exit-minibuffer) . (smart-completion-help)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 ;; If reading a Hyperbole menu item or a Hyperbole completion-based
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 ;; argument, allow selection of an item at point.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 ((if (> (minibuffer-depth) 0) (setq hkey-value (hargs:at-p))) .
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 ((hargs:select-p hkey-value) .
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 (hargs:select-p hkey-value 'assist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 ((if (not (eobp))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
85 (or (eolp) (if selective-display
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
86 (= (following-char) ?\^M)))) .
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 ((smart-scroll-up) . (smart-scroll-down)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 ((eq major-mode 'smart-menu-mode) .
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 ((smart-menu-select) . (smart-menu-help)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 ;; If on a Hyperbole button, perform action or give help.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 ((if (fboundp 'hbut:at-p) (or (hbut:at-p) (hbut:label-p))) .
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 ((hui:hbut-act 'hbut:current) . (hui:hbut-help 'hbut:current)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 ;;
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
96 ;; The Smart Menu system provides menus within Emacs running on a dumb
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
97 ;; terminal. It is part of InfoDock and is not available separately.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 ((and (fboundp 'smart-menu-choose-menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 (setq hkey-value (and hkey-always-display-menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 (smart-menu-choose-menu)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 (not (and (get-buffer-window *smart-menu-buffer*)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 (eq hkey-value *smart-menu-curr*)))) .
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 ((smart-menu hkey-value) .
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 (smart-menu hkey-value)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 ;; View minor mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 ((if (boundp 'view-minor-mode) view-minor-mode) .
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 ((cond ((last-line-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 (view-quit))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 ((pos-visible-in-window-p (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 (goto-char (point-max)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 (t (scroll-up))) .
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 (scroll-down)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 ;; View major mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 ((eq major-mode 'view-mode) .
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 ((View-scroll-lines-forward) . (View-scroll-lines-backward)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 ((eq major-mode 'kotl-mode) .
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 ((kotl-mode:action-key) . (kotl-mode:help-key)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 ;;
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
123 ;; Support direct selection and viewing on in-memory relational databases.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
124 ;; Rdb-mode has not been publicly released.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 ;; It is not included with Hyperbole.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 ((eq major-mode 'rdb-mode) . ((smart-rdb) . (smart-rdb-assist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 ;; Restore window config and hide help buffer when click at buffer end.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 ((if (= (point) (point-max)) (string-match "Help\\*$" (buffer-name))) .
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 ((hkey-help-hide) . (hkey-help-hide)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 ;;
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
132 ;; Support the OO-Browser, a part of InfoDock, XEmacs, and soon to be a
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
133 ;; part of Emacs.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
134 ((or (br-in-browser) (eq major-mode 'br-mode)) .
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
135 ((smart-br-dispatch) . (smart-br-assist-dispatch)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
136 ;;
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 ((and (memq major-mode '(c-mode c++-c-mode))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
138 buffer-file-name (setq hkey-value (smart-c-at-tag-p))) .
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 ((smart-c) . (smart-c nil 'next-tag)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 ((and (eq major-mode 'asm-mode)
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
142 buffer-file-name (setq hkey-value (smart-asm-at-tag-p))) .
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 ((smart-asm) . (smart-asm nil 'next-tag)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 ((if (smart-lisp-mode-p) (smart-lisp-at-tag-p)) .
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 ((smart-lisp) . (smart-lisp 'next-tag)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 ((and (eq major-mode 'c++-mode) buffer-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 ;; Don't use smart-c++-at-tag-p here since it will prevent #include
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 ;; lines from matching.
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
151 (setq hkey-value (smart-c-at-tag-p))) .
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
152 ( ;; Only fboundp if OO-Browser has been loaded.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
153 (if (fboundp 'c++-to-definition)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
154 (smart-c++-oobr) (smart-c++)) .
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
155 (if (fboundp 'c++-to-definition)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
156 (smart-c++-oobr)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
157 (smart-c++ nil 'next-tag))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 ((and (eq major-mode 'objc-mode) buffer-file-name
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
160 (setq hkey-value (smart-objc-at-tag-p))) .
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
161 ( ;; Only fboundp if OO-Browser has been loaded.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
162 (if (fboundp 'objc-to-definition)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
163 (smart-objc-oobr) (smart-objc)) .
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
164 (if (fboundp 'objc-to-definition)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
165 (smart-objc-oobr)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
166 (smart-objc nil 'next-tag))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 ((and (eq major-mode 'fortran-mode)
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
169 buffer-file-name (setq hkey-value (smart-fortran-at-tag-p))) .
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 ((smart-fortran) . (smart-fortran nil 'next-tag)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 ((eq major-mode 'occur-mode) .
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 ((occur-mode-goto-occurrence) . (occur-mode-goto-occurrence)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 ((eq major-mode 'moccur-mode) .
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 ((moccur-mode-goto-occurrence) . (moccur-mode-goto-occurrence)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 ((eq major-mode 'calendar-mode) .
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 ((smart-calendar) . (smart-calendar-assist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 ((eq major-mode 'unix-apropos-mode) .
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 ((smart-apropos) . (smart-apropos-assist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 ((eq major-mode 'outline-mode) .
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 ((smart-outline) . (smart-outline-assist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 ((eq major-mode 'Info-mode) .
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 ((smart-info) . (smart-info-assist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 ((if (boundp 'hmail:reader)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 (or (eq major-mode hmail:reader)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 (eq major-mode hmail:lister))) .
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 ((smart-hmail) . (smart-hmail-assist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 ((eq major-mode 'gnus-group-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 (smart-gnus-group) . (smart-gnus-group-assist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 ((eq major-mode 'gnus-summary-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 (smart-gnus-summary) . (smart-gnus-summary-assist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 ((eq major-mode 'gnus-article-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 (smart-gnus-article) . (smart-gnus-article-assist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 ((eq major-mode 'Buffer-menu-mode) .
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 ((smart-buffer-menu) . (smart-buffer-menu-assist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 ((eq major-mode 'dired-mode) .
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 ((smart-dired) . (smart-dired-assist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 ((eq major-mode 'tar-mode) .
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 ((smart-tar) . (smart-tar-assist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 ;; Follow references in man pages.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 ((setq hkey-value (smart-man-entry-ref)) .
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 ((smart-man-display hkey-value) .
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 (smart-man-display hkey-value)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 ((eq major-mode 'w3-mode) .
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 ((w3-follow-link) . (w3-goto-last-buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 ((if (boundp 'rolo-display-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 (equal (buffer-name) rolo-display-buffer)) .
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 ((smart-wrolo) . (smart-wrolo-assist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 ;; Gomoku game
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 ((eq major-mode 'gomoku-mode) .
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 ((gomoku-human-plays) . (gomoku-human-takes-back)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 ;; Outline minor mode is on and usable.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 (selective-display .
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231 ((smart-outline) . (smart-outline-assist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 "Alist of predicates and form-conses for Action and Assist Keys.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 When the Action or Assist Key is pressed, the first or second form,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 respectively, associated with the first non-nil predicate is evaluated.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 ;;; driver code
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 ;; The following autoload is needed if another subsystem besides
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 ;; Hyperbole uses this mouse handling code.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 (autoload 'var:append "hvar" "Append to a list variable." nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 (require 'hargs)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 (require 'hmouse-key)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 (if hyperb:window-system
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 (defvar hmouse-alist hkey-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 "Alist of predicates and form-conses for context-sensitive smart key mouse actions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251 When the action-key or the assist-key is pressed, the first or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 second form, respectively, associated with the first non-nil predicate is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253 evaluated.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254 (load "hui-window")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 ;;; support code
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 ;; The 'load' line below loads any local Smart Key function definitions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261 ;; The public distribution contains none. You may leave it commented out if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 ;; you prefer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 ;; (load "smart-local" t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266 ;;; Required Init functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 (defun first-line-p ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270 "Returns true if point is on the first line of the buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271 (save-excursion (beginning-of-line) (bobp)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 (defun last-line-p ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 "Returns true if point is on the last line of the buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 (save-excursion (end-of-line) (eobp)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 (defun smart-completion-help ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 "Offer completion help for current minibuffer argument, if any."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 (if (where-is-internal 'minibuffer-completion-help (current-local-map))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 (minibuffer-completion-help)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 (defun smart-symlink-expand (path)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283 "Returns referent for possible symbolic link, PATH."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 (if (not (fboundp 'symlink-referent))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285 path
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 (let ((start 0) (len (length path)) (ref) (part))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 (while (and (< start len) (setq part (string-match "/[^/]*" path start)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288 (setq part (concat ref
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289 (substring path start (setq start (match-end 0))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290 ref (symlink-referent part)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291 ref)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294 ;;; smart-buffer-menu functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297 (defun smart-buffer-menu (&optional in-browser)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298 "Uses a single key or mouse key to manipulate buffer-menu entries.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300 Invoked via a key press when in Buffer-menu-mode. It assumes that its
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301 caller has already checked that the key was pressed in an appropriate buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302 and has moved the cursor there.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
304 Optional non-nil IN-BROWSER indicates use within the OO-Browser.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
305
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306 If key is pressed:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307 (1) on the first column of an entry, the selected buffer is marked for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
308 display;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309 (2) on the second column of an entry, the selected buffer is marked to be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310 saved;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311 (3) anywhere else within an entry line, all saves and deletes are done, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
312 selected buffers are displayed, including the one just clicked on (if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313 IN-BROWSER, only the selected buffer is displayed);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314 (4) on or after the last line in the buffer, all saves and deletes are done."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317 (cond ((last-line-p) (Buffer-menu-execute))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318 ((bolp) (Buffer-menu-mark))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319 ((save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320 (goto-char (1- (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321 (bolp))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322 (Buffer-menu-save))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 (in-browser (br-buffer-menu-select))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324 (t (Buffer-menu-select))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
325
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326 (defun smart-buffer-menu-assist ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327 "Uses a single assist-key or mouse assist-key to manipulate buffer-menu entries.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329 Invoked via an assist-key press when in Buffer-menu-mode. It assumes that its
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330 caller has already checked that the assist-key was pressed in an appropriate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
331 buffer and has moved the cursor there.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
332
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333 If assist-key is pressed:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
334 (1) on the first or second column of an entry, the selected buffer is unmarked
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
335 for display and for saving or deletion;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
336 (2) anywhere else within an entry line, the selected buffer is marked for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337 deletion;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338 (3) on or after the last line in the buffer, all display, save, and delete
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 marks on all entries are undone."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
341 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
342 (cond ((last-line-p) (progn (list-buffers) (forward-line 3)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
343 ((bolp) (Buffer-menu-unmark))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
344 ((save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345 (goto-char (1- (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
346 (bolp))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
347 (Buffer-menu-unmark))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
348 (t (Buffer-menu-delete))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
349
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
350 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
351 ;;; smart-calendar functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354 (defun smart-calendar ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355 "Uses a single key or mouse key to manipulate the scrolling calendar.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
356
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357 Invoked via a key press when in calendar-mode. It assumes that its
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358 caller has already checked that the key was pressed in an appropriate buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359 and has moved the cursor there.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361 If key is pressed:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362 (1) at the end of the buffer, the calendar is scrolled forward 3 months;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363 (2) to the left of any dates on a calendar line, the calendar is scrolled
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
364 backward 3 months;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
365 (3) on a date, the diary entries for the date, if any, are displayed."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368 (cond ((eobp) (calendar-cursor-to-nearest-date)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369 (scroll-calendar-left-three-months 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
370 ((< (current-column) 5) (calendar-cursor-to-nearest-date)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371 (scroll-calendar-right-three-months 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372 (t (calendar-cursor-to-nearest-date)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373 (view-diary-entries 1))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375 (defun smart-calendar-assist ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
376 "Uses a single assist-key or mouse assist-key to manipulate the scrolling calendar.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
377
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
378 Invoked via an assist-key press when in calendar-mode. It assumes that its
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
379 caller has already checked that the assist-key was pressed in an appropriate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
380 buffer and has moved the cursor there.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
381
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
382 If assist-key is pressed:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
383 (1) at the end of the buffer, the calendar is scrolled backward 3 months;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
384 (2) to the left of any dates on a calendar line, the calendar is scrolled
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
385 forward 3 months;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
386 (3) anywhere else, all dates with marking diary entries are marked in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
387 calendar window."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
388
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
389 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
390 (cond ((eobp) (calendar-cursor-to-nearest-date)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
391 (scroll-calendar-right-three-months 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
392 ((< (current-column) 5) (calendar-cursor-to-nearest-date)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
393 (scroll-calendar-left-three-months 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
394 (t (mark-diary-entries))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
395
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
396
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
397 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
398 ;;; smart-dired functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
399 ;;; ************************************************************************
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 smart-dired ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
402 "Uses a single key or mouse key to manipulate directory entries.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
403
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
404 Invoked via a key press when in dired-mode. It assumes that its
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
405 caller has already checked that the key was pressed in an appropriate buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
406 and has moved the cursor there.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
407
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
408 If key is pressed:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
409 (1) within an entry line, the selected file/directory is displayed for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
410 editing in the other window;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
411 (2) on or after the last line in the buffer, if any deletes are to be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
412 performed, they are executed after user verification, otherwise, this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
413 dired invocation is quit."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
414
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
415 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
416 (cond ((last-line-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
417 (let (flagged)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
418 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
419 (goto-char 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
420 (setq flagged (re-search-forward "^D" nil t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
421 (if flagged
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
422 (cond ((fboundp 'dired-do-deletions)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
423 (dired-do-deletions))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
424 ;; For Tree-dired compatibility
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
425 ((fboundp 'dired-do-flagged-delete)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
426 (dired-do-flagged-delete))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
427 (t (error "(smart-dired): No Dired expunge function.")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
428 (dired-quit))))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
429 (t (hpath:find-other-window (dired-get-filename)))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
430
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
431 (defun smart-dired-assist ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
432 "Uses a single assist-key or mouse assist-key to manipulate directory entries.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
433
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
434 Invoked via an assist-key press when in dired-mode. It assumes that its
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
435 caller has already checked that the assist-key was pressed in an appropriate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
436 buffer and has moved the cursor there.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
437
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
438 If assist-key is pressed:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
439 (1) on a '~' character, all backup files in the directory are marked for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
440 deletion;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
441 (2) on a '#' character, all auto-save files in the directory are marked for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
442 deletion;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
443 (3) anywhere else within an entry line, the current entry is marked for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
444 deletion;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
445 (4) on or after the last line in the buffer, all delete marks on all entries
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
446 are undone."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
447
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
448 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
449 (cond ((last-line-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
450 (dired-unflag (- (count-lines (point-min) (point-max))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
451 (goto-char (point-max)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
452 ((looking-at "~") (dired-flag-backup-files))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
453 ((looking-at "#") (dired-flag-auto-save-files))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
454 (t (dired-flag-file-deleted 1))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
455
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
456 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
457 ;;; smart-gnus functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
458 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
459
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
460 (defun smart-gnus-group ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
461 "Uses a key or mouse key to move through Gnus Newsgroup listings.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
462 Invoked via a key press when in gnus-group-mode. It assumes that its caller
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
463 has already checked that the key was pressed in an appropriate buffer and has
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
464 moved the cursor to the selected buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
465
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
466 If key is pressed within:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
467 (1) a GNUS-GROUP line, that newsgroup is read;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
468 (2) to the left of any GNUS-GROUP line, on any of the whitespace, the current
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
469 group is unsubscribed or resubscribed;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
470 (3) at the end of the GNUS-GROUP buffer, after all lines, checks for new
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
471 news."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
472
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
473 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
474 (cond ((last-line-p) (gnus-group-get-new-news))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
475 ((progn (skip-chars-backward " U") (bolp))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
476 (gnus-group-unsubscribe-current-group))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
477 (t (gnus-group-read-group nil))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
478
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
479 (defun smart-gnus-group-assist ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
480 "Uses an assist-key or assist-mouse key to move through Gnus Newsgroup listings.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
481 Invoked via an assist-key press when in gnus-group-mode. It assumes that its
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
482 caller has already checked that the key was pressed in an appropriate buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
483 and has moved the cursor to the selected buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
484
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
485 If key is pressed within:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
486 (1) a GNUS-GROUP line, that newsgroup is read;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
487 (2) to the left of any GNUS-GROUP line, on any of the whitespace, the user is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
488 prompted for a group name to subscribe or unsubscribe to;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
489 (3) at the end of the GNUS-GROUP buffer, after all lines, quits from the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
490 newsreader."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
491
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
492 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
493 (cond ((last-line-p) (gnus-group-exit))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
494 ((progn (skip-chars-backward " U") (bolp))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
495 (call-interactively 'gnus-group-unsubscribe-group))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
496 (t (gnus-group-read-group nil))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
497
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
498 (defun smart-gnus-summary ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
499 "Uses a key or mouse key to move through Gnus News article listings.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
500 Invoked via a key press when in gnus-summary-mode. It assumes that its caller
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
501 has already checked that the key was pressed in an appropriate buffer and has
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
502 moved the cursor to the selected buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
503
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
504 If key is pressed within:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
505 (1) to the left of an article number, that article is marked as unread;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
506 (2) a GNUS-SUMMARY line, that article is read, marked deleted, and scrolled
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
507 forward;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
508 (3) at the end of the GNUS-SUMMARY buffer, the next undeleted article
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
509 is read or the next group is entered."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
510
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
511 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
512 (cond ((last-line-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
513 (if gnus-current-article
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
514 (progn (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
515 (re-search-forward
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
516 (format "^.[ ]+%d:" gnus-current-article) nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
517 (setq this-command 'gnus-summary-next-page)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
518 (call-interactively 'gnus-summary-next-page))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
519 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
520 (setq this-command 'gnus-summary-first-unread-article)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
521 (call-interactively 'gnus-summary-first-unread-article)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
522 ((save-excursion (skip-chars-backward " D") (bolp))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
523 (gnus-summary-mark-as-unread-forward 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
524 (t (setq this-command 'gnus-summary-next-page)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
525 (call-interactively 'gnus-summary-next-page))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
526
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
527 (defun smart-gnus-summary-assist ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
528 "Uses an assist-key or assist-mouse key to move through Gnus News articles.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
529 Invoked via an assist-key press when in gnus-summary-mode. It assumes that its
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
530 caller has already checked that the key was pressed in an appropriate buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
531 and has moved the cursor to the selected buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
532
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
533 If key is pressed within:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
534 (1) to the left of an article number, that article is marked as unread;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
535 (2) a GNUS-SUMMARY line, that article is read and scrolled backward;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
536 (3) at the end of the GNUS-SUMMARY buffer, the summary is exited, the user
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
537 is returned to group mode."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
538
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
539 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
540 (cond ((last-line-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
541 (setq this-command 'gnus-summary-prev-page)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
542 (call-interactively 'gnus-summary-exit))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
543 ((save-excursion (skip-chars-backward " D") (bolp))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
544 (gnus-summary-mark-as-unread-backward 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
545 (t (setq this-command 'gnus-summary-prev-page)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
546 (call-interactively 'gnus-summary-prev-page))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
547
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
548 (defun smart-gnus-article ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
549 "Uses a key or mouse key to move through Gnus netnews articles.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
550
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
551 Invoked via a key press when in gnus-article-mode.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
552 It assumes that its caller has already checked that the key was pressed in an
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
553 appropriate buffer and has moved the cursor to the selected buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
554
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
555 If key is pressed within:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
556 (1) the first line or end of an article, the next unread message is displayed;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
557 (2) the first line of an Info cross reference, the reference is followed;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
558 (3) anywhere else, the window is scrolled up a windowful."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
559 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
560 (cond ((or (last-line-p) (and (not (eolp)) (first-line-p)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
561 (unwind-protect
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
562 (progn (set-buffer gnus-summary-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
563 (setq this-command 'gnus-summary-next-unread-article)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
564 (gnus-summary-next-unread-article)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
565 (gnus-summary-goto-subject gnus-current-article)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
566 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
567 (let ((artic (get-buffer-window gnus-article-buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
568 (if artic (select-window artic)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
569 ((and (not (eolp)) (Info-handle-in-note)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
570 (t (smart-scroll-up))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
571
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
572 (defun smart-gnus-article-assist ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
573 "Uses an assist-key or mouse assist-key to move through Gnus netnews articles.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
574
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
575 Invoked via an assist-key press when in gnus-article-mode.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
576 It assumes that its caller has already checked that the assist-key was pressed in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
577 an appropriate buffer and has moved the cursor to the selected buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
578
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
579 If assist-key is pressed within:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
580 (1) the first line or end of an article, the previous message is displayed;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
581 (2) the first line of an Info cross reference, the reference is followed;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
582 (3) anywhere else, the window is scrolled down a windowful."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
583 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
584 (cond ((or (last-line-p) (and (not (eolp)) (first-line-p)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
585 (unwind-protect
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
586 (progn (set-buffer gnus-summary-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
587 (setq this-command 'gnus-summary-prev-article)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
588 (gnus-summary-prev-article nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
589 (gnus-summary-goto-subject gnus-current-article)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
590 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
591 (let ((artic (get-buffer-window gnus-summary-buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
592 (if artic (select-window artic)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
593 ((and (not (eolp)) (Info-handle-in-note)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
594 (t (smart-scroll-down))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
595
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
596 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
597 ;;; smart-hmail functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
598 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
599
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
600 (defun smart-hmail ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
601 "Uses a key or mouse key to move through e-mail messages and summaries.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
602
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
603 Invoked via a key press when in hmail:reader or hmail:lister mode.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
604 It assumes that its caller has already checked that the key was pressed in an
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
605 appropriate buffer and has moved the cursor to the selected buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
606
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
607 If key is pressed within:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
608 (1) a msg buffer, within the first line or at the end of a message,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
609 the next undeleted message is displayed;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
610 (2) a msg buffer within the first line of an Info cross reference, the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
611 reference is followed;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
612 (3) anywhere else in a msg buffer, the window is scrolled up a windowful;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
613 (4) a msg summary buffer on a header entry, the message corresponding to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
614 the header is displayed in the msg window;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
615 (5) a msg summary buffer, on or after the last line, the messages marked
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
616 for deletion are expunged."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
617
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
618 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
619 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
620 ;; Branch on buffer type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
621 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
622 (cond ((eq major-mode hmail:reader)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
623 (cond ((or (last-line-p) (and (not (eolp)) (first-line-p)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
624 (rmail:msg-next))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
625 ((and (not (eolp)) (Info-handle-in-note)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
626 ((smart-scroll-up))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
627 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
628 ;; Assume are in msg summary buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
629 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
630 ((last-line-p) (lmail:expunge))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
631 (t (lmail:goto))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
632
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
633 (defun smart-hmail-assist ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
634 "Uses an assist key or mouse key to move through e-mail messages and summaries.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
635
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
636 Invoked via an assist key press when in hmail:reader or hmail:lister mode.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
637 It assumes that its caller has already checked that the assist-key was pressed in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
638 an appropriate buffer and has moved the cursor to the selected buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
639
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
640 If assist-key is pressed within:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
641 (1) a msg buffer, within the first line or at the end of a message,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
642 the previous undeleted message is displayed;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
643 (2) a msg buffer within the first line of an Info cross reference, the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
644 reference is followed;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
645 (3) anywhere else in a msg buffer, the window is scrolled down a windowful;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
646 (4) a msg summary buffer on a header entry, the message corresponding to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
647 the header is marked as deleted;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
648 (5) a msg summary buffer, on or after the last line, all messages are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
649 marked undeleted."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
650
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
651 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
652 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
653 ;; Branch on buffer type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
654 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
655 (cond ((eq major-mode hmail:reader)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
656 (cond ((or (last-line-p) (and (not (eolp)) (first-line-p)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
657 (rmail:msg-prev))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
658 ((and (not (eolp)) (Info-handle-in-note)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
659 ((smart-scroll-down))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
660 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
661 ;; Assume are in msg summary buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
662 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
663 ((last-line-p) (lmail:undelete-all))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
664 (t (lmail:delete))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
665
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
666
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
667 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
668 ;;; smart-info functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
669 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
670 ;;; Autoloaded in "hyperbole.el".
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
671
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
672 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
673 ;;; smart-man functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
674 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
675
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
676 ;; "unix-apropos.el" is a publicly available Emacs Lisp package that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
677 ;; allows man page browsing from apropos listings. "superman.el" is a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
678 ;; newer, much more complete package that you would probably prefer at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
679 ;; this point, but there is no Smart Key apropos support for it. There
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
680 ;; is smart key support within the man page buffers it produces, however.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
681 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
682
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
683 (defun smart-apropos ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
684 "Moves through UNIX man apropos listings by using one key or mouse key.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
685
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
686 Invoked via a key press when in unix-apropos-mode. It assumes that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
687 its caller has already checked that the key was pressed in an appropriate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
688 buffer and has moved the cursor to the selected buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
689
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
690 If key is pressed:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
691 (1) on a UNIX man apropos entry, the man page for that entry is displayed in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
692 another window;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
693 (2) on or after the last line, the buffer in the other window is scrolled up
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
694 a windowful."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
695
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
696 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
697 (if (last-line-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
698 (scroll-other-window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
699 (unix-apropos-get-man)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
700
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
701 (defun smart-apropos-assist ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
702 "Moves through UNIX man apropos listings by using one assist-key or mouse assist-key.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
703
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
704 Invoked via an assist-key press when in unix-apropos-mode. It assumes that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
705 its caller has already checked that the assist-key was pressed in an appropriate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
706 buffer and has moved the cursor to the selected buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
707
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
708 If assist-key is pressed:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
709 (1) on a UNIX man apropos entry, the man page for that entry is displayed in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
710 another window;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
711 (2) on or after the last line, the buffer in the other window is scrolled down
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
712 a windowful."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
713
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
714 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
715 (if (last-line-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
716 (scroll-other-window (- 3 (window-height)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
717 (unix-apropos-get-man)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
718
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
719 (defun smart-man-display (lisp-form)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
720 "Evaluates LISP-FORM returned from 'smart-man-entry-ref' to display a man page."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
721 (eval lisp-form))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
722
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
723 (defun smart-man-entry-ref ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
724 "Returns form which displays referenced manual entry that point is on or nil.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
725 Handles references in sections: NAME, SEE ALSO, or PACKAGES USED. Also can
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
726 display C routine definitions selected in a man page, see
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
727 'smart-man-c-routine-ref'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
728
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
729 Man page buffer must either have an attached file or else a `man-path'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
730 local variable containing its pathname."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
731 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
732 (let ((ref ""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
733 (if (not (or (if (string-match "Manual Entry\\|\\*man "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
734 (buffer-name (current-buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
735 (progn (and (boundp 'man-path) man-path
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
736 (setq ref (smart-symlink-expand man-path)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
737 t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
738 (if buffer-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
739 (string-match "/man/" (setq ref (smart-symlink-expand
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
740 buffer-file-name))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
741 (setq ref nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
742 (or (setq ref (or (smart-man-file-ref)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
743 (smart-man-c-routine-ref)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
744 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
745 (let ((opoint (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
746 (case-fold-search))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
747 (and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
748 (re-search-backward "^[.A-Z]" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
749 (looking-at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
750 "\\(\\.SH[ \t]+\\)?\\(SEE ALSO\\|NAME\\|PACKAGES USED\\)")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
751 (progn (goto-char opoint)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
752 (skip-chars-backward "-_a-zA-Z0-9?.(")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
753 (let ((start (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
754 (skip-chars-forward "-_a-zA-Z0-9?.()")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
755 (setq ref (buffer-substring start (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
756 ;; Leave only one char within ref parens
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
757 (if ref
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
758 (if (string-match "(\\(.\\)\\(.+\\))" ref)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
759 (setq ref (concat (substring ref 0 (match-end 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
760 "\)"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
761 )))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
762 (cond ((equal ref "") nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
763 ((stringp ref) (list 'manual-entry ref))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
764 (t ref))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
765
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
766 (defun smart-man-c-routine-ref ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
767 "Returns form to jump to def of C function whose name is at point, if any.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
768 Valid sections within the man page are: ROUTINES, MACROS or FUNCTIONS.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
769 Uses (smart-tags-file) function to determine etags file from which to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
770 locate the definition.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
771
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
772 Returns etags file name if point is on an identifier in the appropriate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
773 section and the jump is done, otherwise, returns nil."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
774 (let ((ref)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
775 (opoint (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
776 (case-fold-search))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
777 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
778 (and (re-search-backward "^[.A-Z]" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
779 (looking-at "^\\(FUNCTIONS\\|ROUTINES\\|MACROS\\)[ \t\n]")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
780 (progn (goto-char opoint)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
781 (skip-chars-backward "_~<>:a-zA-Z0-9(")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
782 (if (or (looking-at "\\([_~<>:a-zA-Z0-9]+\\)[ \t\n]*(")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
783 (looking-at "\\([_~<:A-Z][_<>:A-Z0-9]+\\)"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
784 (setq ref (buffer-substring
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
785 (match-beginning 1) (match-end 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
786 )))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
787 (if ref
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
788 (let ((tags-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
789 (smart-tags-file (if (and (boundp 'man-path) man-path)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
790 man-path
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
791 default-directory))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
792 (and (file-exists-p tags-file-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
793 (file-readable-p tags-file-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
794 (list 'let (list (list 'tags-file-name tags-file-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
795 (list (if (br-in-browser)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
796 'find-tag 'find-tag-other-window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
797 ref)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
798
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
799 (defun smart-man-file-ref ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
800 "Returns form to eval to display file whose name point is on, within a FILES man page section.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
801 If not on a file name, returns nil."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
802 (let ((ref)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
803 (opoint (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
804 (case-fold-search))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
805 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
806 (and (re-search-backward "^[.A-Z]" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
807 (looking-at "^FILES[ \t\n]")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
808 (progn (goto-char opoint)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
809 (skip-chars-backward "^ \t")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
810 (if (looking-at "/[^ \t\n]+")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
811 (setq ref (buffer-substring
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
812 (match-beginning 0) (match-end 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
813 )))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
814 (if ref
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
815 (list (if (br-in-browser)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
816 'find-file 'find-file-other-window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
817 ref))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
818
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
819 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
820 ;;; smart-outline functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
821 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
822
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
823 ;; The functions in this section require InfoDock's version of outline.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
824 ;; in order to work properly.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
825
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
826 (defvar smart-outline-cut nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
827 "Non-nil means outline region was cut and is ready to be pasted at point.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
828
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
829 (let ((proc
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
830 '((lambda ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
831 (make-local-variable 'smart-outline-cut)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
832 ;; Non-nil means outline region was cut and is available to be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
833 ;; pasted at point.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
834 (setq smart-outline-cut nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
835 ))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
836 (if (boundp 'outline-mode-map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
837 (eval proc)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
838 (var:append 'outline-mode-hook proc)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
839
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
840 (defun smart-outline ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
841 "Collapses, expands, and moves outline entries.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
842 Invoked via a key press when in outline-mode. It assumes that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
843 its caller has already checked that the key was pressed in an appropriate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
844 buffer and has moved the cursor to the selected buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
845
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
846 If key is pressed:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
847 (1) after an outline heading has been cut via the Action Key, then paste the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
848 cut heading at point;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
849 (2) at the end of buffer, show all buffer text
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
850 (3) at the beginning of a heading line, cut the headings subtree from the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
851 buffer;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
852 (4) on a header line but not at the beginning or end, if headings subtree is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
853 hidden then show it, otherwise hide it;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
854 (5) anywhere else, scroll up a windowful."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
855
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
856 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
857 (cond (smart-outline-cut
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
858 (setq smart-outline-cut nil) (yank))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
859 ((eobp) (show-all))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
860 ((and (bolp) (looking-at outline-regexp))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
861 (setq smart-outline-cut t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
862 (kill-region
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
863 (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
864 (or (outline-get-next-sibling)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
865 ;; Skip past start of current entry
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
866 (progn (re-search-forward outline-regexp nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
867 (smart-outline-to-entry-end t (outline-level))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
868
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
869 ((or (eolp) (zerop (save-excursion (beginning-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
870 (outline-level))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
871 (smart-scroll-up))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
872 ;; On an outline header line but not at the start/end of line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
873 ((smart-outline-subtree-hidden-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
874 (show-subtree))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
875 (t (hide-subtree))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
876
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
877
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
878 (defun smart-outline-assist ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
879 "Collapses, expands, and moves outline entries.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
880 Invoked via an assist-key press when in outline-mode. It assumes that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
881 its caller has already checked that the assist-key was pressed in an appropriate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
882 buffer and has moved the cursor to the selected buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
883
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
884 If assist-key is pressed:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
885 (1) after an outline heading has been cut via the action-key, allow multiple
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
886 pastes throughout the buffer (last paste should be done with the Action Key,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
887 not the Assist Key);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
888 (2) at the end of buffer, hide all bodies in buffer;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
889 (3) at the beginning of a heading line, cut the current heading (sans
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
890 subtree) from the buffer;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
891 (4) on a header line but not at the beginning or end, if heading body is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
892 hidden then show it, otherwise hide it;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
893 (5) anywhere else, scroll down a windowful."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
894
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
895 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
896 (cond (smart-outline-cut (yank))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
897 ((eobp) (hide-body ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
898 ((and (bolp) (looking-at outline-regexp))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
899 (setq smart-outline-cut t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
900 (kill-region (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
901 ;; Skip past start of current entry
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
902 (progn (re-search-forward outline-regexp nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
903 (smart-outline-to-entry-end
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
904 nil (outline-level)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
905 ((or (eolp) (zerop (save-excursion (beginning-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
906 (outline-level))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
907 (smart-scroll-down))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
908 ;; On an outline header line but not at the start/end of line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
909 ((smart-outline-subtree-hidden-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
910 (show-entry))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
911 (t (hide-entry))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
912
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
913 (defun smart-outline-to-entry-end
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
914 (&optional include-sub-entries curr-entry-level)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
915 "Goes to end of whole entry if optional INCLUDE-SUB-ENTRIES is non-nil.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
916 CURR-ENTRY-LEVEL is an integer representing the length of the current level
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
917 string which matched to 'outline-regexp'. If INCLUDE-SUB-ENTRIES is nil,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
918 CURR-ENTRY-LEVEL is not needed."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
919 (let (next-entry-exists)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
920 (while (and (setq next-entry-exists
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
921 (re-search-forward outline-regexp nil t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
922 include-sub-entries
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
923 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
924 (beginning-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
925 (> (outline-level)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
926 curr-entry-level))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
927 (if next-entry-exists
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
928 (progn (beginning-of-line) (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
929 (goto-char (point-max)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
930
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
931 (defun smart-outline-subtree-hidden-p ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
932 "Returns t if at least initial subtree of heading is hidden, else nil."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
933 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
934 (if (re-search-forward "[\n\^M]" nil t) (= (preceding-char) ?\^M))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
935
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
936 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
937 ;;; smart-tar functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
938 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
939
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
940 (defun smart-tar ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
941 "Uses a single key or mouse key to manipulate tar file entries.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
942
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
943 Invoked via a key press when in tar-mode. It assumes that its
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
944 caller has already checked that the key was pressed in an appropriate buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
945 and has moved the cursor there.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
946
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
947 If key is pressed:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
948 (1) within an entry line, the selected file/directory is displayed for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
949 editing in the other window;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
950 (2) on or after the last line in the buffer, if any deletes are to be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
951 performed, they are executed after user verification, otherwise, this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
952 tar file browser is quit."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
953
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
954 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
955 (cond ((last-line-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
956 (let (flagged)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
957 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
958 (goto-char 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
959 (setq flagged (re-search-forward "^D" nil t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
960 (if flagged
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
961 (tar-expunge)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
962 (kill-buffer nil))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
963 (t (tar-extract-other-window))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
964
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
965 (defun smart-tar-assist ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
966 "Uses a single assist-key or mouse assist-key to manipulate tar file entries.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
967
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
968 Invoked via an assist-key press when in dired-mode. It assumes that its
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
969 caller has already checked that the assist-key was pressed in an appropriate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
970 buffer and has moved the cursor there.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
971
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
972 If assist-key is pressed:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
973 (1) on an entry line, the current entry is marked for deletion;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
974 (2) on or after the last line in the buffer, all delete marks on all entries
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
975 are undone."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
976
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
977 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
978 (cond ((last-line-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
979 (tar-unflag (- (count-lines (point-min) (point-max))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
980 (goto-char (point-max)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
981 (t (tar-flag-deleted 1))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
982
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
983 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
984 ;;; smart-wrolo functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
985 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
986
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
987 (defun smart-wrolo ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
988 "In wrolo match buffer, edits current entry.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
989 Uses one key or mouse key.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
990
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
991 Invoked via a key press when in the 'rolo-display-buffer'. It assumes that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
992 its caller has already checked that the key was pressed in an appropriate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
993 buffer and has moved the cursor to the selected buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
994 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
995 (rolo-edit-entry))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
996
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
997 (fset 'smart-wrolo-assist 'smart-wrolo)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
998
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
999 (provide 'hui-mouse)