aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/textmodes
diff options
context:
space:
mode:
authorSam Steingold2000-11-22 20:59:39 +0000
committerSam Steingold2000-11-22 20:59:39 +0000
commiteaae8106d7be3d9ffa8e53bb5621d4dab118d5a9 (patch)
tree60d24d128cca769f4c87de86a7c1383be6e5f07d /lisp/textmodes
parente053c60feb7ba152ddff83eff0a4e9f3c9c3efe6 (diff)
downloademacs-eaae8106d7be3d9ffa8e53bb5621d4dab118d5a9.tar.gz
emacs-eaae8106d7be3d9ffa8e53bb5621d4dab118d5a9.zip
* simple.el (delete-trailing-whitespace): New interactive function.
* progmodes/ada-mode.el (ada-mode): Use it instead of `ada-remove-trailing-spaces' (ada-remove-trailing-spaces): Removed. * textmodes/two-column.el (2C-merge): Recommend it in the doc. * textmodes/picture.el (picture-mode-exit): Call it instead of `picture-clean'. (picture-clean): Removed.
Diffstat (limited to 'lisp/textmodes')
-rw-r--r--lisp/textmodes/picture.el11
-rw-r--r--lisp/textmodes/two-column.el4
2 files changed, 4 insertions, 11 deletions
diff --git a/lisp/textmodes/picture.el b/lisp/textmodes/picture.el
index 1c6fb384063..05e5f98db91 100644
--- a/lisp/textmodes/picture.el
+++ b/lisp/textmodes/picture.el
@@ -24,7 +24,7 @@
24 24
25;;; Commentary: 25;;; Commentary:
26 26
27;; This code provides the picture-mode commands documented in the Emacs 27;; This code provides the picture-mode commands documented in the Emacs
28;; manual. The screen is treated as a semi-infinite quarter-plane with 28;; manual. The screen is treated as a semi-infinite quarter-plane with
29;; support for rectangle operations and `etch-a-sketch' character 29;; support for rectangle operations and `etch-a-sketch' character
30;; insertion in any of eight directions. 30;; insertion in any of eight directions.
@@ -735,7 +735,7 @@ With no argument strips whitespace from end of every line in Picture buffer
735 (interactive "P") 735 (interactive "P")
736 (if (not (eq major-mode 'picture-mode)) 736 (if (not (eq major-mode 'picture-mode))
737 (error "You aren't editing a Picture.") 737 (error "You aren't editing a Picture.")
738 (if (not nostrip) (picture-clean)) 738 (if (not nostrip) (delete-trailing-whitespace))
739 (setq mode-name picture-mode-old-mode-name) 739 (setq mode-name picture-mode-old-mode-name)
740 (use-local-map picture-mode-old-local-map) 740 (use-local-map picture-mode-old-local-map)
741 (setq major-mode picture-mode-old-major-mode) 741 (setq major-mode picture-mode-old-major-mode)
@@ -743,13 +743,6 @@ With no argument strips whitespace from end of every line in Picture buffer
743 (setq truncate-lines picture-mode-old-truncate-lines) 743 (setq truncate-lines picture-mode-old-truncate-lines)
744 (force-mode-line-update))) 744 (force-mode-line-update)))
745 745
746(defun picture-clean ()
747 "Eliminate whitespace at ends of lines."
748 (save-excursion
749 (goto-char (point-min))
750 (while (re-search-forward "[ \t][ \t]*$" nil t)
751 (delete-region (match-beginning 0) (point)))))
752
753(provide 'picture) 746(provide 'picture)
754 747
755;;; picture.el ends here 748;;; picture.el ends here
diff --git a/lisp/textmodes/two-column.el b/lisp/textmodes/two-column.el
index 08b7c3c8288..a4c965a6966 100644
--- a/lisp/textmodes/two-column.el
+++ b/lisp/textmodes/two-column.el
@@ -363,7 +363,7 @@ first and the associated buffer to its right."
363 (generate-new-buffer (concat "2C/" (buffer-name))))) 363 (generate-new-buffer (concat "2C/" (buffer-name)))))
364 (or buffer 364 (or buffer
365 (run-hooks '2C-other-buffer-hook)))) 365 (run-hooks '2C-other-buffer-hook))))
366 366
367 (2C-mode (prog1 (point-marker) 367 (2C-mode (prog1 (point-marker)
368 (other-window -1))))) 368 (other-window -1)))))
369 369
@@ -503,7 +503,7 @@ this one, then this one becomes the left column.
503 503
504If you want `2C-separator' on empty lines in the second column, 504If you want `2C-separator' on empty lines in the second column,
505you should put just one space in them. In the final result, you can strip 505you should put just one space in them. In the final result, you can strip
506off trailing spaces with \\[beginning-of-buffer] \\[replace-regexp] [ SPC TAB ] + $ RET RET" 506off trailing spaces with \\[delete-trailing-whitespace]."
507 (interactive) 507 (interactive)
508 (and (> (car (window-edges)) 0) ; not touching left edge of screen 508 (and (> (car (window-edges)) 0) ; not touching left edge of screen
509 (eq (window-buffer (previous-window)) 509 (eq (window-buffer (previous-window))