diff options
Diffstat (limited to 'lisp/progmodes/tcl.el')
-rw-r--r-- | lisp/progmodes/tcl.el | 29 |
1 files changed, 8 insertions, 21 deletions
diff --git a/lisp/progmodes/tcl.el b/lisp/progmodes/tcl.el index 8f80d13bab6..44ccd134a37 100644 --- a/lisp/progmodes/tcl.el +++ b/lisp/progmodes/tcl.el @@ -572,10 +572,7 @@ documentation for details): Turning on Tcl mode runs `tcl-mode-hook'. Read the documentation for `tcl-mode-hook' to see what kinds of interesting hook functions -already exist. - -Commands: -\\{tcl-mode-map}" +already exist." (unless (and (boundp 'filladapt-mode) filladapt-mode) (set (make-local-variable 'paragraph-ignore-fill-prefix) t)) @@ -607,15 +604,11 @@ Commands: (set (make-local-variable 'dabbrev-abbrev-skip-leading-regexp) "[$!]") (set (make-local-variable 'dabbrev-abbrev-char-regexp) "\\sw\\|\\s_") - ;; This can only be set to t in Emacs 19 and XEmacs. - ;; Emacs 18 and Epoch lose. (set (make-local-variable 'parse-sexp-ignore-comments) t) ;; XEmacs has defun-prompt-regexp, but I don't believe ;; that it works for end-of-defun -- only for ;; beginning-of-defun. (set (make-local-variable 'defun-prompt-regexp) tcl-omit-ws-regexp) - ;; The following doesn't work in Lucid Emacs 19.6, but maybe - ;; it will appear in later versions. (set (make-local-variable 'add-log-current-defun-function) 'tcl-add-log-defun) @@ -1068,7 +1061,7 @@ With argument, positions cursor at end of buffer." (defun inferior-tcl-proc () "Return current inferior Tcl process. See variable `inferior-tcl-buffer'." - (let ((proc (get-buffer-process (if (eq major-mode 'inferior-tcl-mode) + (let ((proc (get-buffer-process (if (derived-mode-p 'inferior-tcl-mode) (current-buffer) inferior-tcl-buffer)))) (or proc @@ -1201,15 +1194,10 @@ semicolon, opening brace, or opening bracket on the same line." "Determine if point is in a comment. Returns a list of the form `(FLAG . STATE)'. STATE can be used as input to future invocations. FLAG is nil if not in comment, -t otherwise. If in comment, leaves point at beginning of comment. - -This function does not work in Emacs 18. -See also `tcl-simple-scan-for-comment', a -simpler version that is often right, and works in Emacs 18." +t otherwise. If in comment, leaves point at beginning of comment." (let ((bol (save-excursion (goto-char end) - (beginning-of-line) - (point))) + (line-beginning-position))) real-comment last-cstart) (while (and (not last-cstart) (< (point) end)) @@ -1296,7 +1284,7 @@ to update the alist.") If FLAG is nil, just uses `current-word'. Otherwise scans backward for most likely Tcl command word." (if (and flag - (memq major-mode '(tcl-mode inferior-tcl-mode))) + (derived-mode-p 'tcl-mode 'inferior-tcl-mode)) (condition-case nil (save-excursion ;; Look backward for first word actually in alist. @@ -1372,7 +1360,7 @@ Prefix argument means switch to the Tcl buffer afterwards." ;; filename. (car (comint-get-source "Load Tcl file: " (or (and - (eq major-mode 'tcl-mode) + (derived-mode-p 'tcl-mode) (buffer-file-name)) tcl-previous-dir/file) '(tcl-mode) t)) @@ -1392,12 +1380,12 @@ Prefix argument means switch to the Tcl buffer afterwards." (list (car (comint-get-source "Restart with Tcl file: " (or (and - (eq major-mode 'tcl-mode) + (derived-mode-p 'tcl-mode) (buffer-file-name)) tcl-previous-dir/file) '(tcl-mode) t)) current-prefix-arg)) - (let* ((buf (if (eq major-mode 'inferior-tcl-mode) + (let* ((buf (if (derived-mode-p 'inferior-tcl-mode) (current-buffer) inferior-tcl-buffer)) (proc (and buf (get-process buf)))) @@ -1557,5 +1545,4 @@ The first line is assumed to look like \"#!.../program ...\"." (provide 'tcl) -;; arch-tag: 8a032554-c3ef-422e-b84c-acec0522179d ;;; tcl.el ends here |