aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/emulation
diff options
context:
space:
mode:
authorPavel Janík2001-10-03 19:44:55 +0000
committerPavel Janík2001-10-03 19:44:55 +0000
commitcba04ae97ebcefc762012fe72a2705648c43169c (patch)
tree2008207af150d78be0218136b33a45be03e9e8c1 /lisp/emulation
parente89c369954d4d5849e8937ac1f8ea48a590818dd (diff)
downloademacs-cba04ae97ebcefc762012fe72a2705648c43169c.tar.gz
emacs-cba04ae97ebcefc762012fe72a2705648c43169c.zip
Make messages match original TPU/edt editor.
Diffstat (limited to 'lisp/emulation')
-rw-r--r--lisp/emulation/tpu-edt.el33
1 files changed, 19 insertions, 14 deletions
diff --git a/lisp/emulation/tpu-edt.el b/lisp/emulation/tpu-edt.el
index f17ff953884..5ed679e5c1a 100644
--- a/lisp/emulation/tpu-edt.el
+++ b/lisp/emulation/tpu-edt.el
@@ -752,9 +752,10 @@ This is useful for inserting control characters."
752 (if (eobp) 752 (if (eobp)
753 (message "You are at the End of Buffer. The last line is %d." 753 (message "You are at the End of Buffer. The last line is %d."
754 (count-lines 1 (point-max))) 754 (count-lines 1 (point-max)))
755 (message "Line %d of %d" 755 (let* ((cur (count-lines 1 (1+ (point))))
756 (count-lines 1 (1+ (point))) 756 (max (count-lines 1 (point-max)))
757 (count-lines 1 (point-max))))) 757 (pct (/ (* 100 (+ cur (/ max 200))) max)))
758 (message "You are on line %d out of %d (%d%%)." cur max pct))))
758 759
759(defun tpu-exit nil 760(defun tpu-exit nil
760 "Exit the way TPU does, save current buffer and ask about others." 761 "Exit the way TPU does, save current buffer and ask about others."
@@ -815,6 +816,10 @@ This is useful for inserting control characters."
815(fset 'help 'tpu-help) 816(fset 'help 'tpu-help)
816(fset 'HELP 'tpu-help) 817(fset 'HELP 'tpu-help)
817 818
819;; Real TPU error messages end in periods.
820;; Define this to avoid openly flouting Emacs coding standards.
821(defalias 'tpu-error 'error)
822
818(fset 'set\ cursor\ free 'tpu-set-cursor-free) 823(fset 'set\ cursor\ free 'tpu-set-cursor-free)
819(fset 'SET\ CURSOR\ FREE 'tpu-set-cursor-free) 824(fset 'SET\ CURSOR\ FREE 'tpu-set-cursor-free)
820 825
@@ -1071,7 +1076,7 @@ kills modified buffers without asking."
1071 (interactive) 1076 (interactive)
1072 (let ((list (tpu-make-file-buffer-list (buffer-list)))) 1077 (let ((list (tpu-make-file-buffer-list (buffer-list))))
1073 (setq list (delq (current-buffer) list)) 1078 (setq list (delq (current-buffer) list))
1074 (if (not list) (error "No other buffers")) 1079 (if (not list) (tpu-error "No other buffers."))
1075 (switch-to-buffer (car (reverse list))))) 1080 (switch-to-buffer (car (reverse list)))))
1076 1081
1077(defun tpu-make-file-buffer-list (buffer-list) 1082(defun tpu-make-file-buffer-list (buffer-list)
@@ -1343,7 +1348,7 @@ The text is saved for the tpu-paste command."
1343 (delete-region beg end) 1348 (delete-region beg end)
1344 (tpu-unset-match))) 1349 (tpu-unset-match)))
1345 (t 1350 (t
1346 (error "No selection active")))) 1351 (tpu-error "No selection active."))))
1347 1352
1348(defun tpu-store-text nil 1353(defun tpu-store-text nil
1349 "Copy the selected region to the cut buffer without deleting it. 1354 "Copy the selected region to the cut buffer without deleting it.
@@ -1365,7 +1370,7 @@ The text is saved for the tpu-paste command."
1365 (buffer-substring (tpu-match-beginning) (tpu-match-end))) 1370 (buffer-substring (tpu-match-beginning) (tpu-match-end)))
1366 (tpu-unset-match)) 1371 (tpu-unset-match))
1367 (t 1372 (t
1368 (error "No selection active")))) 1373 (tpu-error "No selection active."))))
1369 1374
1370(defun tpu-cut (arg) 1375(defun tpu-cut (arg)
1371 "Copy selected region to the cut buffer. In the absence of an 1376 "Copy selected region to the cut buffer. In the absence of an
@@ -1392,7 +1397,7 @@ argument, delete the selected region too."
1392 (if (not arg) (delete-region beg end)) 1397 (if (not arg) (delete-region beg end))
1393 (tpu-unset-match))) 1398 (tpu-unset-match)))
1394 (t 1399 (t
1395 (error "No selection active")))) 1400 (tpu-error "No selection active."))))
1396 1401
1397(defun tpu-delete-current-line (num) 1402(defun tpu-delete-current-line (num)
1398 "Delete one or specified number of lines after point. 1403 "Delete one or specified number of lines after point.
@@ -1532,7 +1537,7 @@ With argument reinserts the character that many times."
1532 (not case-replace) (not tpu-regexp-p)) 1537 (not case-replace) (not tpu-regexp-p))
1533 (tpu-unset-match))) 1538 (tpu-unset-match)))
1534 (t 1539 (t
1535 (error "No selection active")))) 1540 (tpu-error "No selection active."))))
1536 1541
1537(defun tpu-substitute (num) 1542(defun tpu-substitute (num)
1538 "Replace the selected region with the contents of the cut buffer, and 1543 "Replace the selected region with the contents of the cut buffer, and
@@ -1548,7 +1553,7 @@ A negative argument means replace all occurrences of the search string."
1548 (tpu-search-internal-core tpu-search-last-string))) 1553 (tpu-search-internal-core tpu-search-last-string)))
1549 (setq num (1- num)))) 1554 (setq num (1- num))))
1550 (t 1555 (t
1551 (error "No selection active")))) 1556 (tpu-error "No selection active."))))
1552 1557
1553(defun tpu-lm-replace (from to) 1558(defun tpu-lm-replace (from to)
1554 "Interactively search for OLD-string and substitute NEW-string." 1559 "Interactively search for OLD-string and substitute NEW-string."
@@ -1558,7 +1563,7 @@ A negative argument means replace all occurrences of the search string."
1558 (let ((doit t) (strings 0)) 1563 (let ((doit t) (strings 0))
1559 1564
1560 ;; Can't replace null strings 1565 ;; Can't replace null strings
1561 (if (string= "" from) (error "No string to replace")) 1566 (if (string= "" from) (tpu-error "No string to replace."))
1562 1567
1563 ;; Find the first occurrence 1568 ;; Find the first occurrence
1564 (tpu-set-search) 1569 (tpu-set-search)
@@ -1631,7 +1636,7 @@ are performed without asking. Only works in forward direction."
1631or each line in the entire buffer if no region is selected." 1636or each line in the entire buffer if no region is selected."
1632 (interactive 1637 (interactive
1633 (list (tpu-string-prompt "String to add: " 'tpu-add-at-bol-hist))) 1638 (list (tpu-string-prompt "String to add: " 'tpu-add-at-bol-hist)))
1634 (if (string= "" text) (error "No string specified")) 1639 (if (string= "" text) (tpu-error "No string specified."))
1635 (cond ((tpu-mark) 1640 (cond ((tpu-mark)
1636 (save-excursion 1641 (save-excursion
1637 (if (> (point) (tpu-mark)) (exchange-point-and-mark)) 1642 (if (> (point) (tpu-mark)) (exchange-point-and-mark))
@@ -1649,7 +1654,7 @@ or each line in the entire buffer if no region is selected."
1649or each line of the entire buffer if no region is selected." 1654or each line of the entire buffer if no region is selected."
1650 (interactive 1655 (interactive
1651 (list (tpu-string-prompt "String to add: " 'tpu-add-at-eol-hist))) 1656 (list (tpu-string-prompt "String to add: " 'tpu-add-at-eol-hist)))
1652 (if (string= "" text) (error "No string specified")) 1657 (if (string= "" text) (tpu-error "No string specified."))
1653 (cond ((tpu-mark) 1658 (cond ((tpu-mark)
1654 (save-excursion 1659 (save-excursion
1655 (if (> (point) (tpu-mark)) (exchange-point-and-mark)) 1660 (if (> (point) (tpu-mark)) (exchange-point-and-mark))
@@ -1954,7 +1959,7 @@ Accepts a prefix argument for the number of tpu-pan-columns to scroll."
1954 "Move point to ARG percentage of the buffer." 1959 "Move point to ARG percentage of the buffer."
1955 (interactive "NGoto-percentage: ") 1960 (interactive "NGoto-percentage: ")
1956 (if (or (> perc 100) (< perc 0)) 1961 (if (or (> perc 100) (< perc 0))
1957 (error "Percentage %d out of range 0 < percent < 100" perc) 1962 (tpu-error "Percentage %d out of range 0 < percent < 100." perc)
1958 (goto-char (/ (* (point-max) perc) 100)))) 1963 (goto-char (/ (* (point-max) perc) 100))))
1959 1964
1960(defun tpu-beginning-of-window nil 1965(defun tpu-beginning-of-window nil
@@ -2468,7 +2473,7 @@ If FILE is nil, try to load a default file. The default file names are
2468 (and (tpu-y-or-n-p "Copy key definitions to the new file now? ") 2473 (and (tpu-y-or-n-p "Copy key definitions to the new file now? ")
2469 (condition-case conditions 2474 (condition-case conditions
2470 (copy-file oldname newname) 2475 (copy-file oldname newname)
2471 (error (message "Sorry, couldn't copy - %s" (cdr conditions))))) 2476 (tpu-error (message "Sorry, couldn't copy - %s." (cdr conditions)))))
2472 (kill-buffer "*TPU-Notice*"))) 2477 (kill-buffer "*TPU-Notice*")))
2473 2478
2474 2479