]> code.delx.au - gnu-emacs/blobdiff - lisp/progmodes/tcl.el
Update copyright year to 2016
[gnu-emacs] / lisp / progmodes / tcl.el
index 0198b32ec9fe0e2254defffa49b6f6f825c5e455..93f329165a4aa9a4e3b7a11e6a5adbd918673ca7 100644 (file)
@@ -1,8 +1,8 @@
 ;;; tcl.el --- Tcl code editing commands for Emacs
 
-;; Copyright (C) 1994, 1998-201 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.
@@ -152,12 +151,12 @@ to take place:
   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
@@ -168,27 +167,27 @@ taken to mean `smart'.  The default is nil."
   :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
@@ -197,7 +196,7 @@ and secondary prompts for tclsh and wish."
   :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
@@ -267,7 +266,7 @@ quoted for Tcl."
   ;; 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)
@@ -301,7 +300,7 @@ quoted for Tcl."
     ["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
 ===========================================================================
@@ -333,8 +332,8 @@ This process selection is performed by function `inferior-tcl-proc'.
 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.
@@ -544,6 +543,9 @@ Uses variables `tcl-proc-regexp' and `tcl-keyword-list'."
 ;; The mode itself.
 ;;
 
+(defvar outline-regexp)
+(defvar outline-level)
+
 ;;;###autoload
 (define-derived-mode tcl-mode prog-mode "Tcl"
   "Major mode for editing Tcl code.
@@ -1026,7 +1028,8 @@ Returns nil if line starts inside a string, t if in a comment."
     (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))