diff options
| author | Gerd Moellmann | 2000-11-30 12:17:21 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-11-30 12:17:21 +0000 |
| commit | 8b8a7f0189a7e1b43229161f3a400115be94cb3a (patch) | |
| tree | db8b64f9e4a85230005ce76641543fcaceee1db9 | |
| parent | 1bb45f861c2e4411c35c17b283e5298a553bc93d (diff) | |
| download | emacs-8b8a7f0189a7e1b43229161f3a400115be94cb3a.tar.gz emacs-8b8a7f0189a7e1b43229161f3a400115be94cb3a.zip | |
(tpu-version): New version.
(tpu-search-overlay, tpu-replace-overlay): New initial range.
(tpu-original-mode-line): Variable deleted.
(tpu-mark-flag): New initial value.
(tpu-set-mode-line): Don't redefine mode-line-format. Add
tpu-mark-flag to minor-mode-alist.
(tpu-update-mode-line): New mark flag logic.
(tpu-get): Use find-file-wildcards.
(tpu-search-highlight): Move overlay less, reset overlay properly.
(tpu-unselect): Deactivate mark.
(tpu-lm-replace): Reset overlay properly.
(tpu-forward-line): Use forward-visible-line.
(tpu-edt-on): Set transient mark mode. ispell autoloads deleted.
| -rw-r--r-- | lisp/ChangeLog | 19 | ||||
| -rw-r--r-- | lisp/emulation/tpu-edt.el | 76 |
2 files changed, 48 insertions, 47 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c7d8a49ad6f..d13b5a7241b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,22 @@ | |||
| 1 | 2000-11-30 Rob Riepel <riepel@Stanford.EDU> | ||
| 2 | |||
| 3 | * emulation/tpu-edt.el (tpu-version): New version. | ||
| 4 | (tpu-search-overlay, tpu-replace-overlay): New initial range. | ||
| 5 | (tpu-original-mode-line): Variable deleted. | ||
| 6 | (tpu-mark-flag): New initial value. | ||
| 7 | (tpu-set-mode-line): Don't redefine mode-line-format. Add | ||
| 8 | tpu-mark-flag to minor-mode-alist. | ||
| 9 | (tpu-update-mode-line): New mark flag logic. | ||
| 10 | (tpu-get): Use find-file-wildcards. | ||
| 11 | (tpu-search-highlight): Move overlay less, reset overlay properly. | ||
| 12 | (tpu-unselect): Deactivate mark. | ||
| 13 | (tpu-lm-replace): Reset overlay properly. | ||
| 14 | (tpu-forward-line): Use forward-visible-line. | ||
| 15 | (tpu-edt-on): Set transient mark mode. ispell autoloads deleted. | ||
| 16 | |||
| 17 | * emulation/tpu-extras.el (tpu-forward-line): Use | ||
| 18 | forward-visible-line. | ||
| 19 | |||
| 1 | 2000-11-30 Stefan Monnier <monnier@cs.yale.edu> | 20 | 2000-11-30 Stefan Monnier <monnier@cs.yale.edu> |
| 2 | 21 | ||
| 3 | * emacs-lisp/cl.el (third...tenth): Really undo change of 2000-08-05. | 22 | * emacs-lisp/cl.el (third...tenth): Really undo change of 2000-08-05. |
diff --git a/lisp/emulation/tpu-edt.el b/lisp/emulation/tpu-edt.el index c0dfda06288..ac313289a55 100644 --- a/lisp/emulation/tpu-edt.el +++ b/lisp/emulation/tpu-edt.el | |||
| @@ -1,10 +1,10 @@ | |||
| 1 | ;;; tpu-edt.el --- Emacs emulating TPU emulating EDT | 1 | ;;; tpu-edt.el --- Emacs emulating TPU emulating EDT |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1993, 1994, 1995, 2000 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Rob Riepel <riepel@networking.stanford.edu> | 5 | ;; Author: Rob Riepel <riepel@networking.stanford.edu> |
| 6 | ;; Maintainer: Rob Riepel <riepel@networking.stanford.edu> | 6 | ;; Maintainer: Rob Riepel <riepel@networking.stanford.edu> |
| 7 | ;; Version: 4.4 | 7 | ;; Version: 4.5 |
| 8 | ;; Keywords: emulations | 8 | ;; Keywords: emulations |
| 9 | 9 | ||
| 10 | ;; This file is part of GNU Emacs. | 10 | ;; This file is part of GNU Emacs. |
| @@ -77,10 +77,11 @@ | |||
| 77 | ;; In some cases, Emacs doesn't support text highlighting, so selected | 77 | ;; In some cases, Emacs doesn't support text highlighting, so selected |
| 78 | ;; regions are not shown in inverse video. Emacs uses the concept of "the | 78 | ;; regions are not shown in inverse video. Emacs uses the concept of "the |
| 79 | ;; mark". The mark is set at one end of a selected region; the cursor is | 79 | ;; mark". The mark is set at one end of a selected region; the cursor is |
| 80 | ;; at the other. The letter "M" appears in the mode line when the mark is | 80 | ;; at the other. In cases where the selected region cannot be shown in |
| 81 | ;; set. The native emacs command ^X^X (Control-X twice) exchanges the | 81 | ;; inverse video an at sign (@) appears in the mode line when mark is set. |
| 82 | ;; cursor with the mark; this provides a handy way to find the location of | 82 | ;; The native emacs command ^X^X (Control-X twice) exchanges the cursor |
| 83 | ;; the mark. | 83 | ;; with the mark; this provides a handy way to find the location of the |
| 84 | ;; mark. | ||
| 84 | 85 | ||
| 85 | ;; In TPU the cursor can be either bound or free. Bound means the cursor | 86 | ;; In TPU the cursor can be either bound or free. Bound means the cursor |
| 86 | ;; cannot wander outside the text of the file being edited. Free means | 87 | ;; cannot wander outside the text of the file being edited. Free means |
| @@ -275,7 +276,7 @@ | |||
| 275 | ;;; | 276 | ;;; |
| 276 | ;;; Version Information | 277 | ;;; Version Information |
| 277 | ;;; | 278 | ;;; |
| 278 | (defconst tpu-version "4.4" "TPU-edt version number.") | 279 | (defconst tpu-version "4.5" "TPU-edt version number.") |
| 279 | 280 | ||
| 280 | 281 | ||
| 281 | ;;; | 282 | ;;; |
| @@ -369,11 +370,11 @@ GOLD is the ASCII 7-bit escape sequence <ESC>OP.") | |||
| 369 | "If non-nil, TPU-edt is searching in the forward direction.") | 370 | "If non-nil, TPU-edt is searching in the forward direction.") |
| 370 | (defvar tpu-search-last-string "" | 371 | (defvar tpu-search-last-string "" |
| 371 | "Last text searched for by the TPU-edt search commands.") | 372 | "Last text searched for by the TPU-edt search commands.") |
| 372 | (defvar tpu-search-overlay (make-overlay 0 0) | 373 | (defvar tpu-search-overlay (make-overlay 1 1) |
| 373 | "Search highlight overlay.") | 374 | "Search highlight overlay.") |
| 374 | (overlay-put tpu-search-overlay 'face 'bold) | 375 | (overlay-put tpu-search-overlay 'face 'bold) |
| 375 | 376 | ||
| 376 | (defvar tpu-replace-overlay (make-overlay 0 0) | 377 | (defvar tpu-replace-overlay (make-overlay 1 1) |
| 377 | "Replace highlight overlay.") | 378 | "Replace highlight overlay.") |
| 378 | (overlay-put tpu-replace-overlay 'face 'highlight) | 379 | (overlay-put tpu-replace-overlay 'face 'highlight) |
| 379 | 380 | ||
| @@ -426,40 +427,21 @@ GOLD is the ASCII 7-bit escape sequence <ESC>OP.") | |||
| 426 | ;;; | 427 | ;;; |
| 427 | ;;; Mode Line - Modify the mode line to show the following | 428 | ;;; Mode Line - Modify the mode line to show the following |
| 428 | ;;; | 429 | ;;; |
| 429 | ;;; o If the mark is set. | 430 | ;;; o Mark state. |
| 430 | ;;; o Direction of motion. | 431 | ;;; o Direction of motion. |
| 431 | ;;; o Active rectangle mode. | 432 | ;;; o Active rectangle mode. |
| 433 | ;;; o Active auto indent mode. | ||
| 432 | ;;; | 434 | ;;; |
| 433 | (defvar tpu-original-mode-line mode-line-format) | ||
| 434 | (defvar tpu-original-mm-alist minor-mode-alist) | 435 | (defvar tpu-original-mm-alist minor-mode-alist) |
| 435 | 436 | ||
| 436 | (defvar tpu-mark-flag " ") | 437 | (defvar tpu-mark-flag "") |
| 437 | (make-variable-buffer-local 'tpu-mark-flag) | 438 | (make-variable-buffer-local 'tpu-mark-flag) |
| 438 | 439 | ||
| 439 | (defun tpu-set-mode-line (for-tpu) | 440 | (defun tpu-set-mode-line (for-tpu) |
| 440 | "Set the mode for TPU-edt, or reset it to default Emacs." | 441 | "Set ``minor-mode-alist'' for TPU-edt, or reset it to default Emacs." |
| 441 | (cond ((not for-tpu) | 442 | (cond ((not for-tpu) |
| 442 | (setq mode-line-format tpu-original-mode-line) | 443 | (setq minor-mode-alist tpu-original-mm-alist)) |
| 443 | (setq minor-mode-alist tpu-original-mm-alist)) | ||
| 444 | (t | 444 | (t |
| 445 | (setq-default mode-line-format | ||
| 446 | (list (purecopy "-") | ||
| 447 | 'mode-line-mule-info | ||
| 448 | 'mode-line-modified | ||
| 449 | 'mode-line-frame-identification | ||
| 450 | 'mode-line-buffer-identification | ||
| 451 | (purecopy " ") | ||
| 452 | 'global-mode-string | ||
| 453 | (purecopy " ") | ||
| 454 | 'tpu-mark-flag | ||
| 455 | (purecopy " %[(") | ||
| 456 | 'mode-name 'mode-line-process 'minor-mode-alist | ||
| 457 | (purecopy "%n") | ||
| 458 | (purecopy ")%]--") | ||
| 459 | (purecopy '(line-number-mode "L%l--")) | ||
| 460 | (purecopy '(column-number-mode "C%c--")) | ||
| 461 | (purecopy '(-3 . "%p")) | ||
| 462 | (purecopy "-%-"))) | ||
| 463 | (or (assq 'tpu-newline-and-indent-p minor-mode-alist) | 445 | (or (assq 'tpu-newline-and-indent-p minor-mode-alist) |
| 464 | (setq minor-mode-alist | 446 | (setq minor-mode-alist |
| 465 | (cons '(tpu-newline-and-indent-p | 447 | (cons '(tpu-newline-and-indent-p |
| @@ -472,11 +454,15 @@ GOLD is the ASCII 7-bit escape sequence <ESC>OP.") | |||
| 472 | (or (assq 'tpu-direction-string minor-mode-alist) | 454 | (or (assq 'tpu-direction-string minor-mode-alist) |
| 473 | (setq minor-mode-alist | 455 | (setq minor-mode-alist |
| 474 | (cons '(tpu-direction-string tpu-direction-string) | 456 | (cons '(tpu-direction-string tpu-direction-string) |
| 457 | minor-mode-alist))) | ||
| 458 | (or (assq 'tpu-mark-flag minor-mode-alist) | ||
| 459 | (setq minor-mode-alist | ||
| 460 | (cons '(tpu-mark-flag tpu-mark-flag) | ||
| 475 | minor-mode-alist)))))) | 461 | minor-mode-alist)))))) |
| 476 | 462 | ||
| 477 | (defun tpu-update-mode-line nil | 463 | (defun tpu-update-mode-line nil |
| 478 | "Make sure mode-line in the current buffer reflects all changes." | 464 | "Make sure mode-line in the current buffer reflects all changes." |
| 479 | (setq tpu-mark-flag (if (tpu-mark) "M" " ")) | 465 | (setq tpu-mark-flag (if transient-mark-mode "" (if (tpu-mark) " @" " "))) |
| 480 | (cond (tpu-emacs19-p (force-mode-line-update)) | 466 | (cond (tpu-emacs19-p (force-mode-line-update)) |
| 481 | (t (set-buffer-modified-p (buffer-modified-p)) (sit-for 0)))) | 467 | (t (set-buffer-modified-p (buffer-modified-p)) (sit-for 0)))) |
| 482 | 468 | ||
| @@ -757,7 +743,7 @@ This is useful for inserting control characters." | |||
| 757 | (defun tpu-get (file) | 743 | (defun tpu-get (file) |
| 758 | "TPU-like get file" | 744 | "TPU-like get file" |
| 759 | (interactive "FFile to get: ") | 745 | (interactive "FFile to get: ") |
| 760 | (find-file file)) | 746 | (find-file file find-file-wildcards)) |
| 761 | 747 | ||
| 762 | (defun tpu-what-line nil | 748 | (defun tpu-what-line nil |
| 763 | "Tells what line the point is on, | 749 | "Tells what line the point is on, |
| @@ -1130,7 +1116,8 @@ kills modified buffers without asking." | |||
| 1130 | (if (tpu-check-match) | 1116 | (if (tpu-check-match) |
| 1131 | (move-overlay tpu-search-overlay | 1117 | (move-overlay tpu-search-overlay |
| 1132 | (tpu-match-beginning) (tpu-match-end) (current-buffer)) | 1118 | (tpu-match-beginning) (tpu-match-end) (current-buffer)) |
| 1133 | (move-overlay tpu-search-overlay 0 0 (current-buffer)))) | 1119 | (unless (= (overlay-start tpu-search-overlay) (overlay-end tpu-search-overlay)) |
| 1120 | (move-overlay tpu-search-overlay 1 1 (current-buffer))))) | ||
| 1134 | 1121 | ||
| 1135 | (defun tpu-search nil | 1122 | (defun tpu-search nil |
| 1136 | "Search for a string or regular expression. | 1123 | "Search for a string or regular expression. |
| @@ -1292,6 +1279,7 @@ Used for reversing a search in progress." | |||
| 1292 | (defun tpu-unselect (&optional quiet) | 1279 | (defun tpu-unselect (&optional quiet) |
| 1293 | "Removes the mark to unselect the current region." | 1280 | "Removes the mark to unselect the current region." |
| 1294 | (interactive "P") | 1281 | (interactive "P") |
| 1282 | (deactivate-mark) | ||
| 1295 | (setq mark-ring nil) | 1283 | (setq mark-ring nil) |
| 1296 | (tpu-set-mark nil) | 1284 | (tpu-set-mark nil) |
| 1297 | (tpu-update-mode-line) | 1285 | (tpu-update-mode-line) |
| @@ -1619,7 +1607,7 @@ A negative argument means replace all occurrences of the search string." | |||
| 1619 | (tpu-unset-match) | 1607 | (tpu-unset-match) |
| 1620 | (setq doit nil))))))) | 1608 | (setq doit nil))))))) |
| 1621 | 1609 | ||
| 1622 | (move-overlay tpu-replace-overlay 0 0 (current-buffer)) | 1610 | (move-overlay tpu-replace-overlay 1 1 (current-buffer)) |
| 1623 | (message "Replaced %s occurrence%s." strings (if (not (= 1 strings)) "s" "")))) | 1611 | (message "Replaced %s occurrence%s." strings (if (not (= 1 strings)) "s" "")))) |
| 1624 | 1612 | ||
| 1625 | (defun tpu-emacs-replace (&optional dont-ask) | 1613 | (defun tpu-emacs-replace (&optional dont-ask) |
| @@ -1805,7 +1793,7 @@ Prefix argument serves as a repeat count." | |||
| 1805 | Accepts a prefix argument for the number of lines to move." | 1793 | Accepts a prefix argument for the number of lines to move." |
| 1806 | (interactive "p") | 1794 | (interactive "p") |
| 1807 | (backward-char 1) | 1795 | (backward-char 1) |
| 1808 | (forward-line (- 1 num))) | 1796 | (forward-visible-line (- 1 num))) |
| 1809 | 1797 | ||
| 1810 | (defun tpu-end-of-line (num) | 1798 | (defun tpu-end-of-line (num) |
| 1811 | "Move to the next end of line in the current direction. | 1799 | "Move to the next end of line in the current direction. |
| @@ -2490,15 +2478,9 @@ If FILE is nil, try to load a default file. The default file names are | |||
| 2490 | ;; we use picture-mode functions | 2478 | ;; we use picture-mode functions |
| 2491 | (require 'picture) | 2479 | (require 'picture) |
| 2492 | (tpu-set-control-keys) | 2480 | (tpu-set-control-keys) |
| 2493 | (cond (tpu-emacs19-p | 2481 | (and window-system (tpu-load-xkeys nil)) |
| 2494 | (and window-system (tpu-load-xkeys nil)) | 2482 | (tpu-arrow-history) |
| 2495 | (tpu-arrow-history)) | 2483 | (transient-mark-mode t) |
| 2496 | (t | ||
| 2497 | ;; define ispell functions | ||
| 2498 | (autoload 'ispell-word "ispell" "Check spelling of word at or before point" t) | ||
| 2499 | (autoload 'ispell-complete-word "ispell" "Complete word at or before point" t) | ||
| 2500 | (autoload 'ispell-buffer "ispell" "Check spelling of entire buffer" t) | ||
| 2501 | (autoload 'ispell-region "ispell" "Check spelling of region" t))) | ||
| 2502 | (add-hook 'post-command-hook 'tpu-search-highlight) | 2484 | (add-hook 'post-command-hook 'tpu-search-highlight) |
| 2503 | (tpu-set-mode-line t) | 2485 | (tpu-set-mode-line t) |
| 2504 | (tpu-advance-direction) | 2486 | (tpu-advance-direction) |