annotate lisp/emulation/tpu-extras.el @ 98437:d35e240a4622

(xterm-turn-on-modify-other-keys) (xterm-turn-off-modify-other-keys, xterm-remove-modify-other-keys): Don't forget to pass `terminal' to `send-string-to-terminal'.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Tue, 30 Sep 2008 21:59:26 +0000
parents eb7b2376cae5
children a9dc0e7c3f2b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38436
b174db545cfd Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 34207
diff changeset
1 ;;; tpu-extras.el --- scroll margins and free cursor mode for TPU-edt
4524
3d55b6a74eec (tpu-search-internal): Changed variable
Richard M. Stallman <rms@gnu.org>
parents: 4503
diff changeset
2
74466
1d4b1a32fd66 Update copyright years.
Glenn Morris <rgm@gnu.org>
parents: 68648
diff changeset
3 ;; Copyright (C) 1993, 1994, 1995, 2000, 2001, 2002, 2003, 2004,
79705
d6d821e3ae21 Add 2008 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 79434
diff changeset
4 ;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
4421
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
6 ;; Author: Rob Riepel <riepel@networking.stanford.edu>
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
7 ;; Maintainer: Rob Riepel <riepel@networking.stanford.edu>
5140
9cde7d7fea1f Comment change.
Richard M. Stallman <rms@gnu.org>
parents: 4524
diff changeset
8 ;; Keywords: emulations
4421
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
9
4450
325bc5407213 entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 4421
diff changeset
10 ;; This file is part of GNU Emacs.
325bc5407213 entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 4421
diff changeset
11
94658
eb7b2376cae5 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 87649
diff changeset
12 ;; GNU Emacs is free software: you can redistribute it and/or modify
4450
325bc5407213 entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 4421
diff changeset
13 ;; it under the terms of the GNU General Public License as published by
94658
eb7b2376cae5 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 87649
diff changeset
14 ;; the Free Software Foundation, either version 3 of the License, or
eb7b2376cae5 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 87649
diff changeset
15 ;; (at your option) any later version.
4421
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
16
4450
325bc5407213 entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 4421
diff changeset
17 ;; GNU Emacs is distributed in the hope that it will be useful,
325bc5407213 entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 4421
diff changeset
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
325bc5407213 entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 4421
diff changeset
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
325bc5407213 entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 4421
diff changeset
20 ;; GNU General Public License for more details.
325bc5407213 entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 4421
diff changeset
21
325bc5407213 entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 4421
diff changeset
22 ;; You should have received a copy of the GNU General Public License
94658
eb7b2376cae5 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 87649
diff changeset
23 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
4421
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
24
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
25 ;;; Commentary:
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
26
12687
e7e04fe05a17 (tpu-backward-line): Only move to BOL if not already there.
Richard M. Stallman <rms@gnu.org>
parents: 11594
diff changeset
27 ;; Use the functions defined here to customize TPU-edt to your tastes by
e7e04fe05a17 (tpu-backward-line): Only move to BOL if not already there.
Richard M. Stallman <rms@gnu.org>
parents: 11594
diff changeset
28 ;; setting scroll margins and/or turning on free cursor mode. Here's an
e7e04fe05a17 (tpu-backward-line): Only move to BOL if not already there.
Richard M. Stallman <rms@gnu.org>
parents: 11594
diff changeset
29 ;; example for your .emacs file.
e7e04fe05a17 (tpu-backward-line): Only move to BOL if not already there.
Richard M. Stallman <rms@gnu.org>
parents: 11594
diff changeset
30
e7e04fe05a17 (tpu-backward-line): Only move to BOL if not already there.
Richard M. Stallman <rms@gnu.org>
parents: 11594
diff changeset
31 ;; (tpu-set-cursor-free) ; Set cursor free.
e7e04fe05a17 (tpu-backward-line): Only move to BOL if not already there.
Richard M. Stallman <rms@gnu.org>
parents: 11594
diff changeset
32 ;; (tpu-set-scroll-margins "10%" "15%") ; Set scroll margins.
e7e04fe05a17 (tpu-backward-line): Only move to BOL if not already there.
Richard M. Stallman <rms@gnu.org>
parents: 11594
diff changeset
33
e7e04fe05a17 (tpu-backward-line): Only move to BOL if not already there.
Richard M. Stallman <rms@gnu.org>
parents: 11594
diff changeset
34 ;; Scroll margins and cursor binding can be changed from within emacs using
e7e04fe05a17 (tpu-backward-line): Only move to BOL if not already there.
Richard M. Stallman <rms@gnu.org>
parents: 11594
diff changeset
35 ;; the following commands:
e7e04fe05a17 (tpu-backward-line): Only move to BOL if not already there.
Richard M. Stallman <rms@gnu.org>
parents: 11594
diff changeset
36
e7e04fe05a17 (tpu-backward-line): Only move to BOL if not already there.
Richard M. Stallman <rms@gnu.org>
parents: 11594
diff changeset
37 ;; tpu-set-scroll-margins or set scroll margins
e7e04fe05a17 (tpu-backward-line): Only move to BOL if not already there.
Richard M. Stallman <rms@gnu.org>
parents: 11594
diff changeset
38 ;; tpu-set-cursor-bound or set cursor bound
e7e04fe05a17 (tpu-backward-line): Only move to BOL if not already there.
Richard M. Stallman <rms@gnu.org>
parents: 11594
diff changeset
39 ;; tpu-set-cursor-free or set cursor free
e7e04fe05a17 (tpu-backward-line): Only move to BOL if not already there.
Richard M. Stallman <rms@gnu.org>
parents: 11594
diff changeset
40
e7e04fe05a17 (tpu-backward-line): Only move to BOL if not already there.
Richard M. Stallman <rms@gnu.org>
parents: 11594
diff changeset
41 ;; Additionally, Gold-F toggles between bound and free cursor modes.
e7e04fe05a17 (tpu-backward-line): Only move to BOL if not already there.
Richard M. Stallman <rms@gnu.org>
parents: 11594
diff changeset
42
e7e04fe05a17 (tpu-backward-line): Only move to BOL if not already there.
Richard M. Stallman <rms@gnu.org>
parents: 11594
diff changeset
43 ;; Note that switching out of free cursor mode or exiting TPU-edt while in
e7e04fe05a17 (tpu-backward-line): Only move to BOL if not already there.
Richard M. Stallman <rms@gnu.org>
parents: 11594
diff changeset
44 ;; free cursor mode strips trailing whitespace from every line in the file.
e7e04fe05a17 (tpu-backward-line): Only move to BOL if not already there.
Richard M. Stallman <rms@gnu.org>
parents: 11594
diff changeset
45
e7e04fe05a17 (tpu-backward-line): Only move to BOL if not already there.
Richard M. Stallman <rms@gnu.org>
parents: 11594
diff changeset
46
e7e04fe05a17 (tpu-backward-line): Only move to BOL if not already there.
Richard M. Stallman <rms@gnu.org>
parents: 11594
diff changeset
47 ;;; Details:
e7e04fe05a17 (tpu-backward-line): Only move to BOL if not already there.
Richard M. Stallman <rms@gnu.org>
parents: 11594
diff changeset
48
4421
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
49 ;; The functions contained in this file implement scroll margins and free
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
50 ;; cursor mode. The following keys and commands are affected.
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
51
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
52 ;; key/command function scroll cursor
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
53
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
54 ;; Up-Arrow previous line x x
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
55 ;; Down-Arrow next line x x
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
56 ;; Right-Arrow next character x
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
57 ;; Left-Arrow previous character x
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
58 ;; KP0 next or previous line x
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
59 ;; KP7 next or previous page x
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
60 ;; KP8 next or previous screen x
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
61 ;; KP2 next or previous end-of-line x x
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
62 ;; Control-e current end-of-line x
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
63 ;; Control-h previous beginning-of-line x
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
64 ;; Next Scr next screen x
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
65 ;; Prev Scr previous screen x
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
66 ;; Search find a string x
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
67 ;; Replace find and replace a string x
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
68 ;; Newline insert a newline x
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
69 ;; Paragraph next or previous paragraph x
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
70 ;; Auto-Fill break lines on spaces x
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
71
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
72 ;; These functions are not part of the base TPU-edt for the following
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
73 ;; reasons:
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
74
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
75 ;; Free cursor mode is implemented with the emacs picture-mode functions.
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
76 ;; These functions support moving the cursor all over the screen, however,
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
77 ;; when the cursor is moved past the end of a line, spaces or tabs are
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
78 ;; appended to the line - even if no text is entered in that area. In
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
79 ;; order for a free cursor mode to work exactly like TPU/edt, this trailing
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
80 ;; whitespace needs to be dealt with in every function that might encounter
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
81 ;; it. Such global changes are impractical, however, free cursor mode is
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
82 ;; too valuable to abandon completely, so it has been implemented in those
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
83 ;; functions where it serves best.
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
84
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
85 ;; The implementation of scroll margins adds overhead to previously
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
86 ;; simple and often used commands. These commands are now responsible
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
87 ;; for their normal operation and part of the display function. There
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
88 ;; is a possibility that this display overhead could adversely affect the
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
89 ;; performance of TPU-edt on slower computers. In order to support the
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
90 ;; widest range of computers, scroll margin support is optional.
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
91
12687
e7e04fe05a17 (tpu-backward-line): Only move to BOL if not already there.
Richard M. Stallman <rms@gnu.org>
parents: 11594
diff changeset
92 ;; It's actually not known whether the overhead associated with scroll
e7e04fe05a17 (tpu-backward-line): Only move to BOL if not already there.
Richard M. Stallman <rms@gnu.org>
parents: 11594
diff changeset
93 ;; margin support is significant. If you find that it is, please send
4421
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
94 ;; a note describing the extent of the performance degradation. Be sure
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
95 ;; to include a description of the platform where you're running TPU-edt.
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
96 ;; Send your note to the address provided by Gold-V.
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
97
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
98 ;; Even with these differences and limitations, these functions implement
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
99 ;; important aspects of the real TPU/edt. Those who miss free cursor mode
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
100 ;; and/or scroll margins will appreciate these implementations.
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
101
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
102 ;;; Code:
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
103
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
104
7981
54e029bb5894 Require tpu-edt.
Richard M. Stallman <rms@gnu.org>
parents: 5187
diff changeset
105 ;;; Gotta have tpu-edt
4421
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
106
7981
54e029bb5894 Require tpu-edt.
Richard M. Stallman <rms@gnu.org>
parents: 5187
diff changeset
107 (require 'tpu-edt)
4421
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
108
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
109
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
110 ;;; Customization variables
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
111
21628
4a3e3887c0dc Customize.
Stephen Eglen <stephen@gnu.org>
parents: 14169
diff changeset
112 (defcustom tpu-top-scroll-margin 0
82366
30d1e922e79c Remove spurious * in docstrings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78424
diff changeset
113 "Scroll margin at the top of the screen.
21628
4a3e3887c0dc Customize.
Stephen Eglen <stephen@gnu.org>
parents: 14169
diff changeset
114 Interpreted as a percent of the current window size."
4a3e3887c0dc Customize.
Stephen Eglen <stephen@gnu.org>
parents: 14169
diff changeset
115 :type 'integer
4a3e3887c0dc Customize.
Stephen Eglen <stephen@gnu.org>
parents: 14169
diff changeset
116 :group 'tpu)
4a3e3887c0dc Customize.
Stephen Eglen <stephen@gnu.org>
parents: 14169
diff changeset
117 (defcustom tpu-bottom-scroll-margin 0
82366
30d1e922e79c Remove spurious * in docstrings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78424
diff changeset
118 "Scroll margin at the bottom of the screen.
21628
4a3e3887c0dc Customize.
Stephen Eglen <stephen@gnu.org>
parents: 14169
diff changeset
119 Interpreted as a percent of the current window size."
4a3e3887c0dc Customize.
Stephen Eglen <stephen@gnu.org>
parents: 14169
diff changeset
120 :type 'integer
4a3e3887c0dc Customize.
Stephen Eglen <stephen@gnu.org>
parents: 14169
diff changeset
121 :group 'tpu)
4421
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
122
21628
4a3e3887c0dc Customize.
Stephen Eglen <stephen@gnu.org>
parents: 14169
diff changeset
123 (defcustom tpu-backward-char-like-tpu t
82366
30d1e922e79c Remove spurious * in docstrings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78424
diff changeset
124 "If non-nil, in free cursor mode backward-char (left-arrow) works
4421
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
125 just like TPU/edt. Otherwise, backward-char will move to the end of
21628
4a3e3887c0dc Customize.
Stephen Eglen <stephen@gnu.org>
parents: 14169
diff changeset
126 the previous line when starting from a line beginning."
4a3e3887c0dc Customize.
Stephen Eglen <stephen@gnu.org>
parents: 14169
diff changeset
127 :type 'boolean
4a3e3887c0dc Customize.
Stephen Eglen <stephen@gnu.org>
parents: 14169
diff changeset
128 :group 'tpu)
4421
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
129
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
130
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
131 ;;; Global variables
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
132
82366
30d1e922e79c Remove spurious * in docstrings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78424
diff changeset
133 ;;;###autoload
30d1e922e79c Remove spurious * in docstrings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78424
diff changeset
134 (define-minor-mode tpu-cursor-free-mode
30d1e922e79c Remove spurious * in docstrings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78424
diff changeset
135 "Minor mode to allow the cursor to move freely about the screen."
30d1e922e79c Remove spurious * in docstrings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78424
diff changeset
136 :init-value nil
30d1e922e79c Remove spurious * in docstrings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78424
diff changeset
137 (if (not tpu-cursor-free-mode)
30d1e922e79c Remove spurious * in docstrings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78424
diff changeset
138 (tpu-trim-line-ends)))
4421
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
139
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
140
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
141 ;;; Hooks -- Set cursor free in picture mode.
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
142 ;;; Clean up when writing a file from cursor free mode.
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
143
11594
ddef149290ed Removed reference to tpu-gnu-emacs18-p.
Richard M. Stallman <rms@gnu.org>
parents: 7981
diff changeset
144 (add-hook 'picture-mode-hook 'tpu-set-cursor-free)
4421
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
145
82366
30d1e922e79c Remove spurious * in docstrings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78424
diff changeset
146 (defun tpu-trim-line-ends-if-needed ()
4421
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
147 "Eliminate whitespace at ends of lines, if the cursor is free."
82366
30d1e922e79c Remove spurious * in docstrings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78424
diff changeset
148 (if (and (buffer-modified-p) tpu-cursor-free-mode) (tpu-trim-line-ends)))
30d1e922e79c Remove spurious * in docstrings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78424
diff changeset
149 (add-hook 'before-save-hook 'tpu-trim-line-ends-if-needed)
4421
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
150
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
151
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
152 ;;; Utility routines for implementing scroll margins
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
153
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
154 (defun tpu-top-check (beg lines)
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
155 "Enforce scroll margin at the top of screen."
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
156 (let ((margin (/ (* (window-height) tpu-top-scroll-margin) 100)))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
157 (cond ((< beg margin) (recenter beg))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
158 ((< (- beg lines) margin) (recenter margin)))))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
159
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
160 (defun tpu-bottom-check (beg lines)
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
161 "Enforce scroll margin at the bottom of screen."
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
162 (let* ((height (window-height))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
163 (margin (+ 1 (/ (* height tpu-bottom-scroll-margin) 100)))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
164 ;; subtract 1 from height because it includes mode line
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
165 (difference (- height margin 1)))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
166 (cond ((> beg difference) (recenter beg))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
167 ((> (+ beg lines) difference) (recenter (- margin))))))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
168
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
169
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
170 ;;; Movement by character
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
171
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
172 (defun tpu-forward-char (num)
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
173 "Move right ARG characters (left if ARG is negative)."
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
174 (interactive "p")
82366
30d1e922e79c Remove spurious * in docstrings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78424
diff changeset
175 (if tpu-cursor-free-mode (picture-forward-column num) (forward-char num)))
4421
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
176
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
177 (defun tpu-backward-char (num)
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
178 "Move left ARG characters (right if ARG is negative)."
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
179 (interactive "p")
82366
30d1e922e79c Remove spurious * in docstrings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78424
diff changeset
180 (cond ((not tpu-cursor-free-mode)
4421
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
181 (backward-char num))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
182 (tpu-backward-char-like-tpu
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
183 (picture-backward-column num))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
184 ((bolp)
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
185 (backward-char 1)
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
186 (picture-end-of-line)
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
187 (picture-backward-column (1- num)))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
188 (t
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
189 (picture-backward-column num))))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
190
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
191
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
192 ;;; Movement by line
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
193
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
194 (defun tpu-next-line (num)
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
195 "Move to next line.
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
196 Prefix argument serves as a repeat count."
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
197 (interactive "p")
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
198 (let ((beg (tpu-current-line)))
82366
30d1e922e79c Remove spurious * in docstrings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78424
diff changeset
199 (if tpu-cursor-free-mode (or (eobp) (picture-move-down num))
79434
ced2db270723 (tpu-next-line, tpu-previous-line, tpu-forward-line, tpu-backward-line)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78424
diff changeset
200 (line-move num))
4421
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
201 (tpu-bottom-check beg num)
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
202 (setq this-command 'next-line)))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
203
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
204 (defun tpu-previous-line (num)
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
205 "Move to previous line.
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
206 Prefix argument serves as a repeat count."
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
207 (interactive "p")
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
208 (let ((beg (tpu-current-line)))
82366
30d1e922e79c Remove spurious * in docstrings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78424
diff changeset
209 (if tpu-cursor-free-mode (picture-move-up num) (line-move (- num)))
4421
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
210 (tpu-top-check beg num)
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
211 (setq this-command 'previous-line)))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
212
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
213 (defun tpu-next-beginning-of-line (num)
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
214 "Move to beginning of line; if at beginning, move to beginning of next line.
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
215 Accepts a prefix argument for the number of lines to move."
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
216 (interactive "p")
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
217 (let ((beg (tpu-current-line)))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
218 (backward-char 1)
34033
a1f20ca97c0b (tpu-forward-line): Use
Gerd Moellmann <gerd@gnu.org>
parents: 21628
diff changeset
219 (forward-visible-line (- 1 num))
4421
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
220 (tpu-top-check beg num)))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
221
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
222 (defun tpu-next-end-of-line (num)
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
223 "Move to end of line; if at end, move to end of next line.
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
224 Accepts a prefix argument for the number of lines to move."
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
225 (interactive "p")
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
226 (let ((beg (tpu-current-line)))
82366
30d1e922e79c Remove spurious * in docstrings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78424
diff changeset
227 (cond (tpu-cursor-free-mode
4421
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
228 (let ((beg (point)))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
229 (if (< 1 num) (forward-line num))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
230 (picture-end-of-line)
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
231 (if (<= (point) beg) (progn (forward-line) (picture-end-of-line)))))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
232 (t
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
233 (forward-char)
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
234 (end-of-line num)))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
235 (tpu-bottom-check beg num)))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
236
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
237 (defun tpu-previous-end-of-line (num)
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
238 "Move EOL upward.
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
239 Accepts a prefix argument for the number of lines to move."
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
240 (interactive "p")
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
241 (let ((beg (tpu-current-line)))
82366
30d1e922e79c Remove spurious * in docstrings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78424
diff changeset
242 (cond (tpu-cursor-free-mode
4421
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
243 (picture-end-of-line (- 1 num)))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
244 (t
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
245 (end-of-line (- 1 num))))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
246 (tpu-top-check beg num)))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
247
78424
439c49b198b0 (tpu-before-save-hook): Rename from tpu-write-file-hook.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78218
diff changeset
248 (defun tpu-current-end-of-line ()
4421
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
249 "Move point to end of current line."
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
250 (interactive)
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
251 (let ((beg (point)))
82366
30d1e922e79c Remove spurious * in docstrings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78424
diff changeset
252 (if tpu-cursor-free-mode (picture-end-of-line) (end-of-line))
4421
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
253 (if (= beg (point)) (message "You are already at the end of a line."))))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
254
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
255 (defun tpu-forward-line (num)
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
256 "Move to beginning of next line.
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
257 Prefix argument serves as a repeat count."
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
258 (interactive "p")
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
259 (let ((beg (tpu-current-line)))
82366
30d1e922e79c Remove spurious * in docstrings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78424
diff changeset
260 (forward-line num)
30d1e922e79c Remove spurious * in docstrings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78424
diff changeset
261 (tpu-bottom-check beg num)))
4421
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
262
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
263 (defun tpu-backward-line (num)
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
264 "Move to beginning of previous line.
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
265 Prefix argument serves as repeat count."
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
266 (interactive "p")
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
267 (let ((beg (tpu-current-line)))
12687
e7e04fe05a17 (tpu-backward-line): Only move to BOL if not already there.
Richard M. Stallman <rms@gnu.org>
parents: 11594
diff changeset
268 (or (bolp) (>= 0 num) (setq num (- num 1)))
82366
30d1e922e79c Remove spurious * in docstrings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78424
diff changeset
269 (forward-line (- num))
30d1e922e79c Remove spurious * in docstrings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78424
diff changeset
270 (tpu-top-check beg num)))
4421
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
271
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
272
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
273 ;;; Movement by paragraph
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
274
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
275 (defun tpu-paragraph (num)
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
276 "Move to the next paragraph in the current direction.
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
277 A repeat count means move that many paragraphs."
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
278 (interactive "p")
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
279 (let* ((left nil)
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
280 (beg (tpu-current-line))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
281 (height (window-height))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
282 (top-percent
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
283 (if (= 0 tpu-top-scroll-margin) 10 tpu-top-scroll-margin))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
284 (bottom-percent
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
285 (if (= 0 tpu-bottom-scroll-margin) 15 tpu-bottom-scroll-margin))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
286 (top-margin (/ (* height top-percent) 100))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
287 (bottom-up-margin (+ 1 (/ (* height bottom-percent) 100)))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
288 (bottom-margin (max beg (- height bottom-up-margin 1)))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
289 (top (save-excursion (move-to-window-line top-margin) (point)))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
290 (bottom (save-excursion (move-to-window-line bottom-margin) (point)))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
291 (far (save-excursion
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
292 (goto-char bottom) (forward-line (- height 2)) (point))))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
293 (cond (tpu-advance
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
294 (tpu-next-paragraph num)
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
295 (cond((> (point) far)
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
296 (setq left (save-excursion (forward-line height)))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
297 (if (= 0 left) (recenter top-margin)
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
298 (recenter (- left bottom-up-margin))))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
299 (t
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
300 (and (> (point) bottom) (recenter bottom-margin)))))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
301 (t
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
302 (tpu-previous-paragraph num)
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
303 (and (< (point) top) (recenter (min beg top-margin)))))))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
304
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
305
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
306 ;;; Movement by page
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
307
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
308 (defun tpu-page (num)
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
309 "Move to the next page in the current direction.
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
310 A repeat count means move that many pages."
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
311 (interactive "p")
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
312 (let* ((left nil)
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
313 (beg (tpu-current-line))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
314 (height (window-height))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
315 (top-percent
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
316 (if (= 0 tpu-top-scroll-margin) 10 tpu-top-scroll-margin))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
317 (bottom-percent
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
318 (if (= 0 tpu-bottom-scroll-margin) 15 tpu-bottom-scroll-margin))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
319 (top-margin (/ (* height top-percent) 100))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
320 (bottom-up-margin (+ 1 (/ (* height bottom-percent) 100)))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
321 (bottom-margin (max beg (- height bottom-up-margin 1)))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
322 (top (save-excursion (move-to-window-line top-margin) (point)))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
323 (bottom (save-excursion (move-to-window-line bottom-margin) (point)))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
324 (far (save-excursion
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
325 (goto-char bottom) (forward-line (- height 2)) (point))))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
326 (cond (tpu-advance
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
327 (forward-page num)
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
328 (cond((> (point) far)
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
329 (setq left (save-excursion (forward-line height)))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
330 (if (= 0 left) (recenter top-margin)
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
331 (recenter (- left bottom-up-margin))))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
332 (t
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
333 (and (> (point) bottom) (recenter bottom-margin)))))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
334 (t
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
335 (backward-page num)
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
336 (and (< (point) top) (recenter (min beg top-margin)))))))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
337
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
338
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
339 ;;; Scrolling
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
340
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
341 (defun tpu-scroll-window-down (num)
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
342 "Scroll the display down to the next section.
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
343 A repeat count means scroll that many sections."
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
344 (interactive "p")
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
345 (let* ((beg (tpu-current-line))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
346 (height (1- (window-height)))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
347 (lines (* num (/ (* height tpu-percent-scroll) 100))))
79434
ced2db270723 (tpu-next-line, tpu-previous-line, tpu-forward-line, tpu-backward-line)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78424
diff changeset
348 (line-move (- lines))
4421
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
349 (tpu-top-check beg lines)))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
350
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
351 (defun tpu-scroll-window-up (num)
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
352 "Scroll the display up to the next section.
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
353 A repeat count means scroll that many sections."
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
354 (interactive "p")
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
355 (let* ((beg (tpu-current-line))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
356 (height (1- (window-height)))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
357 (lines (* num (/ (* height tpu-percent-scroll) 100))))
79434
ced2db270723 (tpu-next-line, tpu-previous-line, tpu-forward-line, tpu-backward-line)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78424
diff changeset
358 (line-move lines)
4421
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
359 (tpu-bottom-check beg lines)))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
360
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
361
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
362 ;;; Replace the TPU-edt internal search function
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
363
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
364 (defun tpu-search-internal (pat &optional quiet)
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
365 "Search for a string or regular expression."
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
366 (let* ((left nil)
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
367 (beg (tpu-current-line))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
368 (height (window-height))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
369 (top-percent
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
370 (if (= 0 tpu-top-scroll-margin) 10 tpu-top-scroll-margin))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
371 (bottom-percent
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
372 (if (= 0 tpu-bottom-scroll-margin) 15 tpu-bottom-scroll-margin))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
373 (top-margin (/ (* height top-percent) 100))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
374 (bottom-up-margin (+ 1 (/ (* height bottom-percent) 100)))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
375 (bottom-margin (max beg (- height bottom-up-margin 1)))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
376 (top (save-excursion (move-to-window-line top-margin) (point)))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
377 (bottom (save-excursion (move-to-window-line bottom-margin) (point)))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
378 (far (save-excursion
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
379 (goto-char bottom) (forward-line (- height 2)) (point))))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
380 (tpu-search-internal-core pat quiet)
4524
3d55b6a74eec (tpu-search-internal): Changed variable
Richard M. Stallman <rms@gnu.org>
parents: 4503
diff changeset
381 (if tpu-searching-forward
4421
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
382 (cond((> (point) far)
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
383 (setq left (save-excursion (forward-line height)))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
384 (if (= 0 left) (recenter top-margin)
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
385 (recenter (- left bottom-up-margin))))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
386 (t
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
387 (and (> (point) bottom) (recenter bottom-margin))))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
388 (and (< (point) top) (recenter (min beg top-margin))))))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
389
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
390
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
391
78424
439c49b198b0 (tpu-before-save-hook): Rename from tpu-write-file-hook.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78218
diff changeset
392 ;; Advise the newline, newline-and-indent, and do-auto-fill functions.
439c49b198b0 (tpu-before-save-hook): Rename from tpu-write-file-hook.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78218
diff changeset
393 (defadvice newline (around tpu-respect-bottom-scroll-margin activate disable)
439c49b198b0 (tpu-before-save-hook): Rename from tpu-write-file-hook.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78218
diff changeset
394 "Respect `tpu-bottom-scroll-margin'."
439c49b198b0 (tpu-before-save-hook): Rename from tpu-write-file-hook.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78218
diff changeset
395 (let ((beg (tpu-current-line))
439c49b198b0 (tpu-before-save-hook): Rename from tpu-write-file-hook.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78218
diff changeset
396 (num (prefix-numeric-value (ad-get-arg 0))))
439c49b198b0 (tpu-before-save-hook): Rename from tpu-write-file-hook.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78218
diff changeset
397 ad-do-it
4421
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
398 (tpu-bottom-check beg num)))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
399
78424
439c49b198b0 (tpu-before-save-hook): Rename from tpu-write-file-hook.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78218
diff changeset
400 (defadvice newline-and-indent (around tpu-respect-bottom-scroll-margin)
439c49b198b0 (tpu-before-save-hook): Rename from tpu-write-file-hook.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78218
diff changeset
401 "Respect `tpu-bottom-scroll-margin'."
4421
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
402 (let ((beg (tpu-current-line)))
78424
439c49b198b0 (tpu-before-save-hook): Rename from tpu-write-file-hook.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78218
diff changeset
403 ad-do-it
4421
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
404 (tpu-bottom-check beg 1)))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
405
78424
439c49b198b0 (tpu-before-save-hook): Rename from tpu-write-file-hook.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78218
diff changeset
406 (defadvice do-auto-fill (around tpu-respect-bottom-scroll-margin)
439c49b198b0 (tpu-before-save-hook): Rename from tpu-write-file-hook.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78218
diff changeset
407 "Respect `tpu-bottom-scroll-margin'."
4421
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
408 (let ((beg (tpu-current-line)))
78424
439c49b198b0 (tpu-before-save-hook): Rename from tpu-write-file-hook.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78218
diff changeset
409 ad-do-it
4421
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
410 (tpu-bottom-check beg 1)))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
411
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
412
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
413 ;;; Function to set scroll margins
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
414
5187
3c6f2b0ecf8b Remove free/bound cursor and scroll
Richard M. Stallman <rms@gnu.org>
parents: 5140
diff changeset
415 ;;;###autoload
4421
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
416 (defun tpu-set-scroll-margins (top bottom)
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
417 "Set scroll margins."
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
418 (interactive
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
419 "sEnter top scroll margin (N lines or N%% or RETURN for current value): \
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
420 \nsEnter bottom scroll margin (N lines or N%% or RETURN for current value): ")
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
421 ;; set top scroll margin
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
422 (or (string= top "")
78424
439c49b198b0 (tpu-before-save-hook): Rename from tpu-write-file-hook.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78218
diff changeset
423 (setq tpu-top-scroll-margin
439c49b198b0 (tpu-before-save-hook): Rename from tpu-write-file-hook.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78218
diff changeset
424 (if (string= "%" (substring top -1))
439c49b198b0 (tpu-before-save-hook): Rename from tpu-write-file-hook.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78218
diff changeset
425 (string-to-number top)
62402
a7e02ef1e3d6 Replace `string-to-int' by `string-to-number'.
Juanma Barranquero <lekktu@gmail.com>
parents: 52401
diff changeset
426 (/ (1- (+ (* (string-to-number top) 100) (window-height)))
4421
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
427 (window-height)))))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
428 ;; set bottom scroll margin
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
429 (or (string= bottom "")
78424
439c49b198b0 (tpu-before-save-hook): Rename from tpu-write-file-hook.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78218
diff changeset
430 (setq tpu-bottom-scroll-margin
439c49b198b0 (tpu-before-save-hook): Rename from tpu-write-file-hook.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78218
diff changeset
431 (if (string= "%" (substring bottom -1))
439c49b198b0 (tpu-before-save-hook): Rename from tpu-write-file-hook.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78218
diff changeset
432 (string-to-number bottom)
62402
a7e02ef1e3d6 Replace `string-to-int' by `string-to-number'.
Juanma Barranquero <lekktu@gmail.com>
parents: 52401
diff changeset
433 (/ (1- (+ (* (string-to-number bottom) 100) (window-height)))
4421
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
434 (window-height)))))
78424
439c49b198b0 (tpu-before-save-hook): Rename from tpu-write-file-hook.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78218
diff changeset
435 (dolist (f '(newline newline-and-indent do-auto-fill))
439c49b198b0 (tpu-before-save-hook): Rename from tpu-write-file-hook.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78218
diff changeset
436 (ad-enable-advice f 'around 'tpu-respect-bottom-scroll-margin)
439c49b198b0 (tpu-before-save-hook): Rename from tpu-write-file-hook.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78218
diff changeset
437 (ad-activate f))
4421
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
438 ;; report scroll margin settings if running interactively
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
439 (and (interactive-p)
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
440 (message "Scroll margins set. Top = %s%%, Bottom = %s%%"
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
441 tpu-top-scroll-margin tpu-bottom-scroll-margin)))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
442
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
443
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
444 ;;; Functions to set cursor bound or free
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
445
5187
3c6f2b0ecf8b Remove free/bound cursor and scroll
Richard M. Stallman <rms@gnu.org>
parents: 5140
diff changeset
446 ;;;###autoload
78424
439c49b198b0 (tpu-before-save-hook): Rename from tpu-write-file-hook.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78218
diff changeset
447 (defun tpu-set-cursor-free ()
4421
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
448 "Allow the cursor to move freely about the screen."
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
449 (interactive)
82366
30d1e922e79c Remove spurious * in docstrings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78424
diff changeset
450 (tpu-cursor-free-mode 1)
4421
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
451 (message "The cursor will now move freely about the screen."))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
452
5187
3c6f2b0ecf8b Remove free/bound cursor and scroll
Richard M. Stallman <rms@gnu.org>
parents: 5140
diff changeset
453 ;;;###autoload
78424
439c49b198b0 (tpu-before-save-hook): Rename from tpu-write-file-hook.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78218
diff changeset
454 (defun tpu-set-cursor-bound ()
4421
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
455 "Constrain the cursor to the flow of the text."
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
456 (interactive)
82366
30d1e922e79c Remove spurious * in docstrings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78424
diff changeset
457 (tpu-cursor-free-mode -1)
4421
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
458 (message "The cursor is now bound to the flow of your text."))
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
459
82366
30d1e922e79c Remove spurious * in docstrings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78424
diff changeset
460 ;; Local Variables:
30d1e922e79c Remove spurious * in docstrings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78424
diff changeset
461 ;; generated-autoload-file: "tpu-edt.el"
30d1e922e79c Remove spurious * in docstrings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78424
diff changeset
462 ;; End:
30d1e922e79c Remove spurious * in docstrings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78424
diff changeset
463
78424
439c49b198b0 (tpu-before-save-hook): Rename from tpu-write-file-hook.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 78218
diff changeset
464 ;; arch-tag: 89676fa4-33ec-48cb-9135-6f3bf230ab1a
4421
95bb7e28d761 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
465 ;;; tpu-extras.el ends here