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

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