Mercurial > emacs
comparison lisp/ediff-help.el @ 49588:37645a051842
Trailing whitespace deleted.
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Tue, 04 Feb 2003 11:26:42 +0000 |
parents | 633233bf2bbf |
children | 695cf19ef79e d7ddb3e565de |
comparison
equal
deleted
inserted
replaced
49587:e82b3fe06d4c | 49588:37645a051842 |
---|---|
22 ;; Boston, MA 02111-1307, USA. | 22 ;; Boston, MA 02111-1307, USA. |
23 | 23 |
24 ;;; Commentary: | 24 ;;; Commentary: |
25 | 25 |
26 ;;; Code: | 26 ;;; Code: |
27 | 27 |
28 (provide 'ediff-help) | 28 (provide 'ediff-help) |
29 | 29 |
30 ;; Compiler pacifier start | 30 ;; Compiler pacifier start |
31 (defvar ediff-multiframe) | 31 (defvar ediff-multiframe) |
32 | 32 |
45 " Move around | Toggle features | Manipulate | 45 " Move around | Toggle features | Manipulate |
46 =====================|===========================|=============================" | 46 =====================|===========================|=============================" |
47 "The head of the full help message.") | 47 "The head of the full help message.") |
48 (defconst ediff-long-help-message-tail | 48 (defconst ediff-long-help-message-tail |
49 "=====================|===========================|============================= | 49 "=====================|===========================|============================= |
50 R -show registry | = -compare regions | M -show session group | 50 R -show registry | = -compare regions | M -show session group |
51 D -diff output | E -browse Ediff manual| G -send bug report | 51 D -diff output | E -browse Ediff manual| G -send bug report |
52 i -status info | ? -help off | z/q -suspend/quit | 52 i -status info | ? -help off | z/q -suspend/quit |
53 ------------------------------------------------------------------------------- | 53 ------------------------------------------------------------------------------- |
54 For help on a specific command: Click Button 2 over it; or | 54 For help on a specific command: Click Button 2 over it; or |
55 Put the cursor over it and type RET." | 55 Put the cursor over it and type RET." |
56 "The tail of the full-help message.") | 56 "The tail of the full-help message.") |
57 | 57 |
58 (defconst ediff-long-help-message-compare3 | 58 (defconst ediff-long-help-message-compare3 |
59 " | 59 " |
60 p,DEL -previous diff | | -vert/horiz split | xy -copy buf X's region to Y | 60 p,DEL -previous diff | | -vert/horiz split | xy -copy buf X's region to Y |
61 n,SPC -next diff | h -hilighting | rx -restore buf X's old diff | 61 n,SPC -next diff | h -hilighting | rx -restore buf X's old diff |
62 j -jump to diff | @ -auto-refinement | * -refine current region | 62 j -jump to diff | @ -auto-refinement | * -refine current region |
63 gx -goto X's point| | ! -update diff regions | 63 gx -goto X's point| | ! -update diff regions |
64 C-l -recenter | ## -ignore whitespace | | 64 C-l -recenter | ## -ignore whitespace | |
65 v/V -scroll up/dn | #f/#h -focus/hide regions | wx -save buf X | 65 v/V -scroll up/dn | #f/#h -focus/hide regions | wx -save buf X |
66 </> -scroll lt/rt | X -read-only in buf X | wd -save diff output | 66 </> -scroll lt/rt | X -read-only in buf X | wd -save diff output |
67 ~ -rotate buffers| m -wide display | | 67 ~ -rotate buffers| m -wide display | |
68 " | 68 " |
69 "Help message usually used for 3-way comparison. | 69 "Help message usually used for 3-way comparison. |
70 Normally, not a user option. See `ediff-help-message' for details.") | 70 Normally, not a user option. See `ediff-help-message' for details.") |
71 | 71 |
72 (defconst ediff-long-help-message-compare2 | 72 (defconst ediff-long-help-message-compare2 |
73 " | 73 " |
74 p,DEL -previous diff | | -vert/horiz split |a/b -copy A/B's region to B/A | 74 p,DEL -previous diff | | -vert/horiz split |a/b -copy A/B's region to B/A |
75 n,SPC -next diff | h -hilighting | rx -restore buf X's old diff | 75 n,SPC -next diff | h -hilighting | rx -restore buf X's old diff |
76 j -jump to diff | @ -auto-refinement | * -refine current region | 76 j -jump to diff | @ -auto-refinement | * -refine current region |
77 gx -goto X's point| | ! -update diff regions | 77 gx -goto X's point| | ! -update diff regions |
78 C-l -recenter | ## -ignore whitespace | | 78 C-l -recenter | ## -ignore whitespace | |
79 v/V -scroll up/dn | #f/#h -focus/hide regions | wx -save buf X | 79 v/V -scroll up/dn | #f/#h -focus/hide regions | wx -save buf X |
80 </> -scroll lt/rt | X -read-only in buf X | wd -save diff output | 80 </> -scroll lt/rt | X -read-only in buf X | wd -save diff output |
81 ~ -swap variants | m -wide display | | 81 ~ -swap variants | m -wide display | |
82 " | 82 " |
83 "Help message usually used for 2-way comparison. | 83 "Help message usually used for 2-way comparison. |
84 Normally, not a user option. See `ediff-help-message' for details.") | 84 Normally, not a user option. See `ediff-help-message' for details.") |
85 | 85 |
86 (defconst ediff-long-help-message-narrow2 | 86 (defconst ediff-long-help-message-narrow2 |
87 " | 87 " |
88 p,DEL -previous diff | | -vert/horiz split |a/b -copy A/B's region to B/A | 88 p,DEL -previous diff | | -vert/horiz split |a/b -copy A/B's region to B/A |
89 n,SPC -next diff | h -hilighting | rx -restore buf X's old diff | 89 n,SPC -next diff | h -hilighting | rx -restore buf X's old diff |
90 j -jump to diff | @ -auto-refinement | * -refine current region | 90 j -jump to diff | @ -auto-refinement | * -refine current region |
91 gx -goto X's point| % -narrow/widen buffs | ! -update diff regions | 91 gx -goto X's point| % -narrow/widen buffs | ! -update diff regions |
92 C-l -recenter | ## -ignore whitespace | | 92 C-l -recenter | ## -ignore whitespace | |
93 v/V -scroll up/dn | #f/#h -focus/hide regions | wx -save buf X | 93 v/V -scroll up/dn | #f/#h -focus/hide regions | wx -save buf X |
94 </> -scroll lt/rt | X -read-only in buf X | wd -save diff output | 94 </> -scroll lt/rt | X -read-only in buf X | wd -save diff output |
95 ~ -swap variants | m -wide display | | 95 ~ -swap variants | m -wide display | |
96 " | 96 " |
97 "Help message when comparing windows or regions line-by-line. | 97 "Help message when comparing windows or regions line-by-line. |
98 Normally, not a user option. See `ediff-help-message' for details.") | 98 Normally, not a user option. See `ediff-help-message' for details.") |
99 | 99 |
100 (defconst ediff-long-help-message-word-mode | 100 (defconst ediff-long-help-message-word-mode |
101 " | 101 " |
102 p,DEL -previous diff | | -vert/horiz split | xy -copy buf X's region to Y | 102 p,DEL -previous diff | | -vert/horiz split | xy -copy buf X's region to Y |
103 n,SPC -next diff | h -hilighting | rx -restore buf X's old diff | 103 n,SPC -next diff | h -hilighting | rx -restore buf X's old diff |
104 j -jump to diff | | | 104 j -jump to diff | | |
105 gx -goto X's point| % -narrow/widen buffs | ! -recompute diffs | 105 gx -goto X's point| % -narrow/widen buffs | ! -recompute diffs |
106 C-l -recenter | | | 106 C-l -recenter | | |
107 v/V -scroll up/dn | #f/#h -focus/hide regions | wx -save buf X | 107 v/V -scroll up/dn | #f/#h -focus/hide regions | wx -save buf X |
108 </> -scroll lt/rt | X -read-only in buf X | wd -save diff output | 108 </> -scroll lt/rt | X -read-only in buf X | wd -save diff output |
109 ~ -swap variants | m -wide display | | 109 ~ -swap variants | m -wide display | |
110 " | 110 " |
111 "Help message when comparing windows or regions word-by-word. | 111 "Help message when comparing windows or regions word-by-word. |
112 Normally, not a user option. See `ediff-help-message' for details.") | 112 Normally, not a user option. See `ediff-help-message' for details.") |
113 | 113 |
114 (defconst ediff-long-help-message-merge | 114 (defconst ediff-long-help-message-merge |
115 " | 115 " |
116 p,DEL -previous diff | | -vert/horiz split | x -copy buf X's region to C | 116 p,DEL -previous diff | | -vert/horiz split | x -copy buf X's region to C |
117 n,SPC -next diff | h -hilighting | r -restore buf C's old diff | 117 n,SPC -next diff | h -hilighting | r -restore buf C's old diff |
118 j -jump to diff | @ -auto-refinement | * -refine current region | 118 j -jump to diff | @ -auto-refinement | * -refine current region |
119 gx -goto X's point| ## -ignore whitespace | ! -update diff regions | 119 gx -goto X's point| ## -ignore whitespace | ! -update diff regions |
120 C-l -recenter | #f/#h -focus/hide regions | + -combine diff regions | 120 C-l -recenter | #f/#h -focus/hide regions | + -combine diff regions |
121 v/V -scroll up/dn | X -read-only in buf X | wx -save buf X | 121 v/V -scroll up/dn | X -read-only in buf X | wx -save buf X |
122 </> -scroll lt/rt | m -wide display | wd -save diff output | 122 </> -scroll lt/rt | m -wide display | wd -save diff output |
123 ~ -swap variants | s -shrink window C | / -show ancestor buff | 123 ~ -swap variants | s -shrink window C | / -show ancestor buff |
124 | $$ -show clashes only | & -merge w/new default | 124 | $$ -show clashes only | & -merge w/new default |
125 | $* -skip changed regions | | 125 | $* -skip changed regions | |
126 " | 126 " |
127 "Help message for merge sessions. | 127 "Help message for merge sessions. |
128 Normally, not a user option. See `ediff-help-message' for details.") | 128 Normally, not a user option. See `ediff-help-message' for details.") |
129 | 129 |
130 ;; The actual long help message. | 130 ;; The actual long help message. |
131 (ediff-defvar-local ediff-long-help-message "" | 131 (ediff-defvar-local ediff-long-help-message "" |
132 "Normally, not a user option. See `ediff-help-message' for details.") | 132 "Normally, not a user option. See `ediff-help-message' for details.") |
133 | 133 |
134 (defconst ediff-brief-message-string | 134 (defconst ediff-brief-message-string |
135 " ? -quick help " | 135 " ? -quick help " |
136 "Contents of the brief help message.") | 136 "Contents of the brief help message.") |
137 ;; The actual brief help message | 137 ;; The actual brief help message |
138 (ediff-defvar-local ediff-brief-help-message "" | 138 (ediff-defvar-local ediff-brief-help-message "" |
139 "Normally, not a user option. See `ediff-help-message' for details.") | 139 "Normally, not a user option. See `ediff-help-message' for details.") |
140 | 140 |
141 (ediff-defvar-local ediff-brief-help-message-function nil | 141 (ediff-defvar-local ediff-brief-help-message-function nil |
142 "The brief help message that the user can customize. | 142 "The brief help message that the user can customize. |
143 If the user sets this to a parameter-less function, Ediff will use it to | 143 If the user sets this to a parameter-less function, Ediff will use it to |
144 produce the brief help message. This function must return a string.") | 144 produce the brief help message. This function must return a string.") |
145 (ediff-defvar-local ediff-long-help-message-function nil | 145 (ediff-defvar-local ediff-long-help-message-function nil |
155 (ediff-defvar-local ediff-help-message "" | 155 (ediff-defvar-local ediff-help-message "" |
156 "The actual help message. | 156 "The actual help message. |
157 Normally, the user shouldn't touch this. However, if you want Ediff to | 157 Normally, the user shouldn't touch this. However, if you want Ediff to |
158 start up with different help messages for different jobs, you can change | 158 start up with different help messages for different jobs, you can change |
159 the value of this variable and the variables `ediff-help-message-*' in | 159 the value of this variable and the variables `ediff-help-message-*' in |
160 `ediff-startup-hook'.") | 160 `ediff-startup-hook'.") |
161 | 161 |
162 | 162 |
163 ;; the keymap that defines clicks over the quick help regions | 163 ;; the keymap that defines clicks over the quick help regions |
164 (defvar ediff-help-region-map (make-sparse-keymap)) | 164 (defvar ediff-help-region-map (make-sparse-keymap)) |
165 | 165 |
197 ;; emacs | 197 ;; emacs |
198 (setq cmd (car (mapcar (lambda (elt) | 198 (setq cmd (car (mapcar (lambda (elt) |
199 (overlay-get elt 'ediff-help-info)) | 199 (overlay-get elt 'ediff-help-info)) |
200 (overlays-at pos)))) | 200 (overlays-at pos)))) |
201 ) | 201 ) |
202 | 202 |
203 (if (not (stringp cmd)) | 203 (if (not (stringp cmd)) |
204 (error "Hmm... I don't see an Ediff command around here...")) | 204 (error "Hmm... I don't see an Ediff command around here...")) |
205 | 205 |
206 (ediff-documentation "Quick Help Commands") | 206 (ediff-documentation "Quick Help Commands") |
207 | 207 |
208 (let (case-fold-search) | 208 (let (case-fold-search) |
209 (cond ((string= cmd "?") (re-search-forward "^`\\?'")) | 209 (cond ((string= cmd "?") (re-search-forward "^`\\?'")) |
210 ((string= cmd "G") (re-search-forward "^`G'")) | 210 ((string= cmd "G") (re-search-forward "^`G'")) |
211 ((string= cmd "E") (re-search-forward "^`E'")) | 211 ((string= cmd "E") (re-search-forward "^`E'")) |
212 ((string= cmd "wd") (re-search-forward "^`wd'")) | 212 ((string= cmd "wd") (re-search-forward "^`wd'")) |
258 (goto-char (point-min)) | 258 (goto-char (point-min)) |
259 (if ediff-use-long-help-message | 259 (if ediff-use-long-help-message |
260 (next-line 1)) | 260 (next-line 1)) |
261 (end-of-line) | 261 (end-of-line) |
262 (current-column))) | 262 (current-column))) |
263 | 263 |
264 | 264 |
265 (defun ediff-indent-help-message () | 265 (defun ediff-indent-help-message () |
266 (let* ((shift (/ (max 0 (- (window-width (selected-window)) | 266 (let* ((shift (/ (max 0 (- (window-width (selected-window)) |
267 (ediff-help-message-line-length))) | 267 (ediff-help-message-line-length))) |
268 2)) | 268 2)) |
271 (goto-char (point-min)) | 271 (goto-char (point-min)) |
272 (while (< (point) (point-max)) | 272 (while (< (point) (point-max)) |
273 (insert str) | 273 (insert str) |
274 (beginning-of-line) | 274 (beginning-of-line) |
275 (forward-line 1))))) | 275 (forward-line 1))))) |
276 | 276 |
277 | 277 |
278 ;; compose the help message as a string | 278 ;; compose the help message as a string |
279 (defun ediff-set-help-message () | 279 (defun ediff-set-help-message () |
280 (setq ediff-long-help-message | 280 (setq ediff-long-help-message |
281 (cond ((and ediff-long-help-message-function | 281 (cond ((and ediff-long-help-message-function |
282 (or (symbolp ediff-long-help-message-function) | 282 (or (symbolp ediff-long-help-message-function) |
283 (consp ediff-long-help-message-function))) | 283 (consp ediff-long-help-message-function))) |
284 (funcall ediff-long-help-message-function)) | 284 (funcall ediff-long-help-message-function)) |
285 (ediff-word-mode | 285 (ediff-word-mode |
286 (concat ediff-long-help-message-head | 286 (concat ediff-long-help-message-head |
287 ediff-long-help-message-word-mode | 287 ediff-long-help-message-word-mode |
288 ediff-long-help-message-tail)) | 288 ediff-long-help-message-tail)) |
289 (ediff-narrow-job | 289 (ediff-narrow-job |
290 (concat ediff-long-help-message-head | 290 (concat ediff-long-help-message-head |
291 ediff-long-help-message-narrow2 | 291 ediff-long-help-message-narrow2 |
292 ediff-long-help-message-tail)) | 292 ediff-long-help-message-tail)) |
293 (ediff-merge-job | 293 (ediff-merge-job |
294 (concat ediff-long-help-message-head | 294 (concat ediff-long-help-message-head |
295 ediff-long-help-message-merge | 295 ediff-long-help-message-merge |
296 ediff-long-help-message-tail)) | 296 ediff-long-help-message-tail)) |
297 (ediff-diff3-job | 297 (ediff-diff3-job |
298 (concat ediff-long-help-message-head | 298 (concat ediff-long-help-message-head |
299 ediff-long-help-message-compare3 | 299 ediff-long-help-message-compare3 |
300 ediff-long-help-message-tail)) | 300 ediff-long-help-message-tail)) |
301 (t | 301 (t |
302 (concat ediff-long-help-message-head | 302 (concat ediff-long-help-message-head |
303 ediff-long-help-message-compare2 | 303 ediff-long-help-message-compare2 |
304 ediff-long-help-message-tail)))) | 304 ediff-long-help-message-tail)))) |
305 (setq ediff-brief-help-message | 305 (setq ediff-brief-help-message |
306 (cond ((and ediff-brief-help-message-function | 306 (cond ((and ediff-brief-help-message-function |
307 (or (symbolp ediff-brief-help-message-function) | 307 (or (symbolp ediff-brief-help-message-function) |
308 (consp ediff-brief-help-message-function))) | 308 (consp ediff-brief-help-message-function))) |
309 (funcall ediff-brief-help-message-function)) | 309 (funcall ediff-brief-help-message-function)) |
310 ((stringp ediff-brief-help-message-function) | 310 ((stringp ediff-brief-help-message-function) |