diff options
| author | Stefan Monnier | 2007-08-06 16:21:33 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2007-08-06 16:21:33 +0000 |
| commit | 036f2966c3247692ee79a800b2f40f0778da19c7 (patch) | |
| tree | 4d4d0fb1ec0e77062b233ce0df5a233d12f8971c | |
| parent | f2b189796cf660c7cc06a6fb8b9f59295594b77b (diff) | |
| download | emacs-036f2966c3247692ee79a800b2f40f0778da19c7.tar.gz emacs-036f2966c3247692ee79a800b2f40f0778da19c7.zip | |
(tpu-current-line): Use posn-at-point and count-screen-lines.
(tpu-edt-off): Disable relevant pieces of advice.
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/emulation/tpu-edt.el | 8 |
2 files changed, 10 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 079f60d281c..f5319ac3ce9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,9 @@ | |||
| 1 | 2007-08-06 Stefan Monnier <monnier@iro.umontreal.ca> | 1 | 2007-08-06 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 2 | ||
| 3 | * emulation/tpu-edt.el (tpu-current-line): Use posn-at-point and | ||
| 4 | count-screen-lines. | ||
| 5 | (tpu-edt-off): Disable relevant pieces of advice. | ||
| 6 | |||
| 3 | * emulation/tpu-extras.el (tpu-before-save-hook): Rename from | 7 | * emulation/tpu-extras.el (tpu-before-save-hook): Rename from |
| 4 | tpu-write-file-hook. Activate it with add-hook on buffer-save-hook. | 8 | tpu-write-file-hook. Activate it with add-hook on buffer-save-hook. |
| 5 | (newline, newline-and-indent, do-auto-fill): Use advice instead of | 9 | (newline, newline-and-indent, do-auto-fill): Use advice instead of |
diff --git a/lisp/emulation/tpu-edt.el b/lisp/emulation/tpu-edt.el index 414ae7bf14e..9220090df25 100644 --- a/lisp/emulation/tpu-edt.el +++ b/lisp/emulation/tpu-edt.el | |||
| @@ -826,10 +826,13 @@ Create the key map if necessary." | |||
| 826 | (use-local-map tpu-buffer-local-map))) | 826 | (use-local-map tpu-buffer-local-map))) |
| 827 | (local-set-key key func)) | 827 | (local-set-key key func)) |
| 828 | 828 | ||
| 829 | (defun tpu-current-line nil | 829 | (defun tpu-current-line () |
| 830 | "Return the vertical position of point in the selected window. | 830 | "Return the vertical position of point in the selected window. |
| 831 | Top line is 0. Counts each text line only once, even if it wraps." | 831 | Top line is 0. Counts each text line only once, even if it wraps." |
| 832 | (+ (count-lines (window-start) (point)) (if (= (current-column) 0) 1 0) -1)) | 832 | (or |
| 833 | (cdr (nth 6 (posn-at-point))) | ||
| 834 | (if (eq (window-start) (point)) 0 | ||
| 835 | (1- (count-screen-lines (window-start) (point) 'count-final-newline))))) | ||
| 833 | 836 | ||
| 834 | 837 | ||
| 835 | ;;; | 838 | ;;; |
| @@ -2479,6 +2482,7 @@ If FILE is nil, try to load a default file. The default file names are | |||
| 2479 | (if (eq tpu-global-map parent) | 2482 | (if (eq tpu-global-map parent) |
| 2480 | (set-keymap-parent map (keymap-parent parent)) | 2483 | (set-keymap-parent map (keymap-parent parent)) |
| 2481 | (setq map parent))))) | 2484 | (setq map parent))))) |
| 2485 | (ad-disable-regexp "\\`tpu-") | ||
| 2482 | (setq tpu-edt-mode nil)) | 2486 | (setq tpu-edt-mode nil)) |
| 2483 | 2487 | ||
| 2484 | (provide 'tpu-edt) | 2488 | (provide 'tpu-edt) |