;; Author: Tom Tromey <tromey@busco.lanl.gov>
;; Chris Lindblad <cjl@lcs.mit.edu>
;; Keywords: languages tcl modes
-;; Version: $Revision: 1.9 $
+;; Version: $Revision: 1.10 $
;; This file is part of GNU Emacs.
;; LCD Archive Entry:
;; tcl|Tom Tromey|tromey@busco.lanl.gov|
;; Major mode for editing Tcl|
-;; $Date: 1994/05/22 05:26:51 $|$Revision: 1.9 $|~/modes/tcl.el.Z|
+;; $Date: 1994/05/22 20:02:03 $|$Revision: 1.10 $|~/modes/tcl.el.Z|
;; CUSTOMIZATION NOTES:
;; * tcl-proc-list can be used to customize a list of things that
;; Change log:
;; $Log: tcl.el,v $
+; Revision 1.10 1994/05/22 20:02:03 tromey
+; Fixed bug with M-;.
+; Wrote bug-reporting code.
+;
; Revision 1.9 1994/05/22 05:26:51 tromey
; Fixes for imenu.
;
;; line individually.
;; * tcl-figure-type should stop at "beginning of line" (only ws
;; before point, and no "\" on previous line). (see tcl-real-command-p).
-;; * Fix beginning-of-defun. I believe this will be fully possible in
-;; FSF Emacs 19.23
;; * overrides some comint keybindings; fix.
;; * Trailing \ will eat blank lines. Should deal with this.
;; (this would help catch some potential bugs).
(require 'comint)
-(defconst tcl-version "$Revision$")
+(defconst tcl-version "$Revision: 1.10 $")
(defconst tcl-maintainer "Tom Tromey <tromey@busco.lanl.gov>")
;;
'("Tcl"
["Beginning of function" tcl-beginning-of-defun t]
["End of function" tcl-end-of-defun t]
- ["Mark function" mark-tcl-function t]
+ ["Mark function" tcl-mark-defun t]
["Indent region" indent-region t]
["Comment region" comment-region t]
["Uncomment region" tcl-uncomment-region t]
;; later decide to add it to inferior Tcl mode as well.
(defun tcl-add-fsf-menu (map)
(define-key map [menu-bar] (make-sparse-keymap))
+ ;; This fails in Emacs 19.22 and earlier.
(require 'lmenu)
(define-key map [menu-bar tcl]
- (cons "Tcl" (make-lucid-menu-keymap "Tcl" tcl-lucid-menu))))
+ (cons "Tcl" (make-lucid-menu-keymap "Tcl" (cdr tcl-lucid-menu)))))
(defun tcl-fill-mode-map ()
(define-key tcl-mode-map "{" 'tcl-electric-char)
;; FIXME.
(define-key tcl-mode-map "\e\C-e" 'tcl-end-of-defun)
;; FIXME.
- (define-key tcl-mode-map "\e\C-h" 'mark-tcl-function)
+ (define-key tcl-mode-map "\e\C-h" 'tcl-mark-defun)
(define-key tcl-mode-map "\e\C-q" 'indent-tcl-exp)
(define-key tcl-mode-map "\177" 'backward-delete-char-untabify)
(define-key tcl-mode-map "\t" 'tcl-indent-command)
'beginning-of-defun
'tcl-internal-beginning-of-defun))
-;; Only FSF Emacs 19 works correctly using end-of-defun. Emacs 18 and
-;; Lucid need our own function.
+;; Ditto end-of-defun.
(fset 'tcl-end-of-defun
- (if (and tcl-using-emacs-19 (not tcl-using-lemacs-19))
+ (if tcl-using-emacs-19
'end-of-defun
'tcl-internal-end-of-defun))
+;; Internal mark-defun that is used for losing Emacsen.
+(defun tcl-internal-mark-defun ()
+ "Put mark at end of Tcl function, point at beginning."
+ (interactive)
+ (push-mark (point))
+ (tcl-end-of-defun)
+ (if tcl-using-emacs-19
+ (push-mark (point) nil t)
+ (push-mark (point)))
+ (tcl-beginning-of-defun)
+ (backward-paragraph))
+
+;; In GNU Emacs 19.23 and later, mark-defun works as advertised. I
+;; don't know about Lucid Emacs, so for now it and Emacs 18 just lose.
+(fset 'tcl-mark-defun
+ (if tcl-using-emacs-19.23
+ 'mark-defun
+ 'tcl-internal-mark-defun))
+
\f
;;
\f
-(defun mark-tcl-function ()
- "Put mark at end of Tcl function, point at beginning."
- (interactive)
- (push-mark (point))
- (tcl-end-of-defun)
- (if tcl-using-emacs-19
- (push-mark (point) nil t)
- (push-mark (point)))
- (tcl-beginning-of-defun)
- (backward-paragraph))
-
-\f
-
(defun indent-tcl-exp ()
"Indent each line of the Tcl grouping following point."
(interactive)