;;; tcl.el --- Tcl code editing commands for Emacs
-;; Copyright (C) 1994, 1998-2012 Free Software Foundation, Inc.
+;; Copyright (C) 1994, 1998-2016 Free Software Foundation, Inc.
-;; Maintainer: FSF
+;; Maintainer: emacs-devel@gnu.org
;; Author: Tom Tromey <tromey@redhat.com>
;; Chris Lindblad <cjl@lcs.mit.edu>
;; Keywords: languages tcl modes
(eval-when-compile
(require 'imenu)
- (require 'outline)
(require 'dabbrev)
(require 'add-log))
:group 'languages)
(defcustom tcl-indent-level 4
- "*Indentation of Tcl statements with respect to containing block."
+ "Indentation of Tcl statements with respect to containing block."
:type 'integer
:group 'tcl)
(put 'tcl-indent-level 'safe-local-variable 'integerp)
(defcustom tcl-continued-indent-level 4
- "*Indentation of continuation line relative to first line of command."
+ "Indentation of continuation line relative to first line of command."
:type 'integer
:group 'tcl)
(put 'tcl-continued-indent-level 'safe-local-variable 'integerp)
(defcustom tcl-auto-newline nil
- "*Non-nil means automatically newline before and after braces you insert."
+ "Non-nil means automatically newline before and after braces you insert."
:type 'boolean
:group 'tcl)
(defcustom tcl-tab-always-indent tab-always-indent
- "*Control effect of TAB key.
+ "Control effect of TAB key.
If t (the default), always indent current line.
If nil and point is not in the indentation area at the beginning of
the line, a TAB is inserted.
6. Move backward to start of comment, indenting if necessary."
:type '(choice (const :tag "Always" t)
(const :tag "Beginning only" nil)
- (const :tag "Maybe move or make or delete comment" 'tcl))
+ (other :tag "Maybe move or make or delete comment" tcl))
:group 'tcl)
(defcustom tcl-electric-hash-style nil ;; 'smart
- "*Style of electric hash insertion to use.
+ "Style of electric hash insertion to use.
Possible values are `backslash', meaning that `\\' quoting should be
done; `quote', meaning that `\"' quoting should be done; `smart',
meaning that the choice between `backslash' and `quote' should be
:group 'tcl)
(defcustom tcl-help-directory-list nil
- "*List of topmost directories containing TclX help files."
+ "List of topmost directories containing TclX help files."
:type '(repeat directory)
:group 'tcl)
(defcustom tcl-use-smart-word-finder t
- "*If not nil, use smart way to find current word, for Tcl help feature."
+ "If not nil, use smart way to find current word, for Tcl help feature."
:type 'boolean
:group 'tcl)
(defcustom tcl-application "wish"
- "*Name of Tcl program to run in inferior Tcl mode."
+ "Name of Tcl program to run in inferior Tcl mode."
:type 'string
:group 'tcl)
(defcustom tcl-command-switches nil
- "*List of switches to supply to the `tcl-application' program."
+ "List of switches to supply to the `tcl-application' program."
:type '(repeat string)
:group 'tcl)
(defcustom tcl-prompt-regexp "^\\(% \\|\\)"
- "*If not nil, a regexp that will match the prompt in the inferior process.
+ "If not nil, a regexp that will match the prompt in the inferior process.
If nil, the prompt is the name of the application with \">\" appended.
The default is \"^\\(% \\|\\)\", which will match the default primary
:group 'tcl)
(defcustom inferior-tcl-source-command "source %s\n"
- "*Format-string for building a Tcl command to load a file.
+ "Format-string for building a Tcl command to load a file.
This format string should use `%s' to substitute a file name
and should result in a Tcl expression that will command the
inferior Tcl to load that file. The filename will be appropriately
;; Maybe someone has a better set?
(let ((map (make-sparse-keymap)))
;; Will inherit from `comint-mode-map' thanks to define-derived-mode.
- (define-key map "\t" 'comint-dynamic-complete)
+ (define-key map "\t" 'completion-at-point)
(define-key map "\M-?" 'comint-dynamic-list-filename-completions)
(define-key map "\177" 'backward-delete-char-untabify)
(define-key map "\M-\C-x" 'tcl-eval-defun)
["Tcl help" tcl-help-on-word tcl-help-directory-list]))
(defvar inferior-tcl-buffer nil
- "*The current inferior-tcl process buffer.
+ "The current inferior-tcl process buffer.
MULTIPLE PROCESS SUPPORT
===========================================================================
Whenever \\[inferior-tcl] fires up a new process, it resets
`inferior-tcl-buffer' to be the new process's buffer. If you only run
one process, this does the right thing. If you run multiple
-processes, you can change `inferior-tcl-buffer' to another process
-buffer with \\[set-variable].")
+processes, you might need to set `inferior-tcl-buffer' to
+whichever process buffer you want to use.")
;;
;; Hooks and other customization.
;; The mode itself.
;;
+(defvar outline-regexp)
+(defvar outline-level)
+
;;;###autoload
(define-derived-mode tcl-mode prog-mode "Tcl"
"Major mode for editing Tcl code.
(with-current-buffer (process-buffer proc)
;; Delete prompt if requested.
(when (marker-buffer inferior-tcl-delete-prompt-marker)
- (delete-region (process-mark proc) inferior-tcl-delete-prompt-marker)
+ (let ((inhibit-read-only t))
+ (delete-region (process-mark proc) inferior-tcl-delete-prompt-marker))
(set-marker inferior-tcl-delete-prompt-marker nil))))
(comint-output-filter proc string))