;; This file is part of GNU Emacs.
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;; TPU-edt is based on tpu.el by Jeff Kowalski and Bob Covey.
;;; User Configurable Variables
;;;
(defcustom tpu-have-ispell t
- "If non-nil (default), TPU-edt uses Ispell for spell checking."
+ "Non-nil means `tpu-spell-check' uses `ispell-region' for spell checking.
+Otherwise, use `spell-region'."
:type 'boolean
:group 'tpu)
+(make-obsolete-variable 'tpu-have-ispell "the `spell' package is obsolete."
+ "23.1")
(defcustom tpu-kill-buffers-silently nil
"If non-nil, TPU-edt kills modified buffers without asking."
;;;
;;; Utilities
;;;
-(defun tpu-caar (thingy) (car (car thingy)))
-(defun tpu-cadr (thingy) (car (cdr thingy)))
-
-(defvar zmacs-regions)
(defun tpu-mark nil
"TPU-edt version of the mark function.
(interactive "p")
(cond ((get tpu-breadcrumb-plist num)
(switch-to-buffer (car (get tpu-breadcrumb-plist num)))
- (goto-char (tpu-cadr (get tpu-breadcrumb-plist num)))
+ (goto-char (cadr (get tpu-breadcrumb-plist num)))
(message "mark %d found." num))
(t
(message "mark %d not found." num))))
"Check the spelling of the region, or of the entire buffer,
if no region is selected."
(interactive)
- (cond (tpu-have-ispell
- (if (tpu-mark) (ispell-region (tpu-mark) (point)) (ispell-buffer)))
- (t
- (if (tpu-mark) (spell-region (tpu-mark) (point)) (spell-buffer))))
- (if (tpu-mark) (tpu-unselect t)))
+ (let ((m (tpu-mark)))
+ (apply (if tpu-have-ispell 'ispell-region
+ 'spell-region)
+ (if m
+ (if (> m (point)) (list (point) m)
+ (list m (point)))
+ (list (point-min) (point-max))))
+ (if m (tpu-unselect t))))
(defun tpu-toggle-overwrite-mode nil
"Switch in and out of overwrite mode."
"Insert a character or control code according to its ASCII decimal value."
(interactive "P")
(if overwrite-mode (delete-char 1))
- (insert (if num num 0)))
+ (insert (or num 0)))
(defun tpu-quoted-insert (num)
"Read next input character and insert it.