;;; o tpu-update-mode-line o mode line section
;;;
(defconst tpu-emacs19-p (not (string-lessp emacs-version "19"))
- "Non-NIL if we are running Lucid or GNU Emacs version 19.")
-
-(defconst tpu-gnu-emacs18-p (not tpu-emacs19-p)
- "Non-NIL if we are running GNU Emacs version 18.")
+ "Non-nil if we are running Lucid Emacs or version 19.")
(defconst tpu-lucid-emacs19-p
(and tpu-emacs19-p (string-match "Lucid" emacs-version))
- "Non-NIL if we are running Lucid Emacs version 19.")
-
-(defconst tpu-gnu-emacs19-p (and tpu-emacs19-p (not tpu-lucid-emacs19-p))
- "Non-NIL if we are running GNU Emacs version 19.")
+ "Non-nil if we are running Lucid Emacs version 19.")
;;;
(and tpu-lucid-emacs19-p
(defvar minibuffer-local-ns-map (make-sparse-keymap)
- "Hack to give Lucid emacs the same maps as GNU emacs."))
+ "Hack to give Lucid Emacs the same maps as ordinary Emacs."))
;;;
(cond (tpu-emacs19-p (force-mode-line-update))
(t (set-buffer-modified-p (buffer-modified-p)) (sit-for 0))))
-(cond (tpu-gnu-emacs19-p
- (add-hook 'activate-mark-hook 'tpu-update-mode-line)
- (add-hook 'deactivate-mark-hook 'tpu-update-mode-line))
- (tpu-lucid-emacs19-p
+(cond (tpu-lucid-emacs19-p
(add-hook 'zmacs-deactivate-region-hook 'tpu-update-mode-line)
- (add-hook 'zmacs-activate-region-hook 'tpu-update-mode-line)))
+ (add-hook 'zmacs-activate-region-hook 'tpu-update-mode-line))
+ (tpu-emacs19-p
+ (add-hook 'activate-mark-hook 'tpu-update-mode-line)
+ (add-hook 'deactivate-mark-hook 'tpu-update-mode-line)))
;;;
(defun tpu-mark nil
"TPU-edt version of the mark function.
Return the appropriate value of the mark for the current
-version of emacs."
+version of Emacs."
(cond (tpu-lucid-emacs19-p (mark (not zmacs-regions)))
- (tpu-gnu-emacs19-p (and mark-active (mark (not transient-mark-mode))))
+ (tpu-emacs19-p (and mark-active (mark (not transient-mark-mode))))
(t (mark))))
(defun tpu-set-mark (pos)
- "TPU-edt verion of the set-mark function.
+ "TPU-edt verion of the `set-mark' function.
Sets the mark at POS and activates the region acording to the
-current version of emacs."
+current version of Emacs."
(set-mark pos)
(and tpu-lucid-emacs19-p pos (zmacs-activate-region)))
(defun tpu-y-or-n-p (prompt &optional not-yes)
"Prompt for a y or n answer with positive default.
Optional second argument NOT-YES changes default to negative.
-Like emacs y-or-n-p, also accepts space as y and DEL as n."
+Like Emacs `y-or-n-p', but also accepts space as y and DEL as n."
(message (format "%s[%s]" prompt (if not-yes "n" "y")))
(let ((doit t))
(while doit
(defun tpu-load-xkeys (file)
"Load the TPU-edt X-windows key definitions FILE.
If FILE is nil, try to load a default file. The default file names are
-~/.tpu-lucid-keys for Lucid emacs, and ~/.tpu-gnu-keys for GNU emacs."
+`~/.tpu-lucid-keys' for Lucid emacs, and `~/.tpu-keys' for Emacs."
(interactive "fX key definition file: ")
(cond (file
(setq file (expand-file-name file)))
(tpu-xkeys-file
(setq file (expand-file-name tpu-xkeys-file)))
- (tpu-gnu-emacs19-p
- (setq file (expand-file-name "~/.tpu-gnu-keys")))
(tpu-lucid-emacs19-p
- (setq file (expand-file-name "~/.tpu-lucid-keys"))))
+ (setq file (expand-file-name "~/.tpu-lucid-keys")))
+ (tpu-emacs19-p
+ (setq file (expand-file-name "~/.tpu-keys"))))
(cond ((file-readable-p file)
(load-file file))
(t
(use-global-map global-map)
(setq tpu-edt-mode nil))))
-
-;;;
-;;; Turn on TPU-edt and announce it as a feature
-;;;
-(tpu-edt-mode)
-
(provide 'tpu-edt)
;;; tpu-edt.el ends here