emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/progmodes/tcl.el


From: Stefan Monnier
Subject: [Emacs-diffs] Changes to emacs/lisp/progmodes/tcl.el
Date: Mon, 01 Apr 2002 16:01:04 -0500

Index: emacs/lisp/progmodes/tcl.el
diff -c emacs/lisp/progmodes/tcl.el:1.68 emacs/lisp/progmodes/tcl.el:1.69
*** emacs/lisp/progmodes/tcl.el:1.68    Mon Apr  1 15:18:48 2002
--- emacs/lisp/progmodes/tcl.el Mon Apr  1 16:01:04 2002
***************
*** 2,12 ****
  
  ;; Copyright (C) 1994, 1998, 1999, 2000, 2001, 2002  Free Software 
Foundation, Inc.
  
! ;; Maintainer: Tom Tromey <address@hidden>
  ;; Author: Tom Tromey <address@hidden>
  ;;    Chris Lindblad <address@hidden>
  ;; Keywords: languages tcl modes
! ;; Version: $Revision: 1.68 $
  
  ;; This file is part of GNU Emacs.
  
--- 2,12 ----
  
  ;; Copyright (C) 1994, 1998, 1999, 2000, 2001, 2002  Free Software 
Foundation, Inc.
  
! ;; Maintainer: FSF
  ;; Author: Tom Tromey <address@hidden>
  ;;    Chris Lindblad <address@hidden>
  ;; Keywords: languages tcl modes
! ;; Version: $Revision: 1.69 $
  
  ;; This file is part of GNU Emacs.
  
***************
*** 60,74 ****
  ;; Jesper Pedersen <address@hidden>
  ;; address@hidden (Doug Farmer)
  ;; "Chris Alfeld" <address@hidden>
! ;; Ben Wing <address@hidden>
  
  ;; KNOWN BUGS:
! ;; * In Tcl "#" is not always a comment character.  This can confuse
! ;;   tcl.el in certain circumstances.  For now the only workaround is
! ;;   to enclose offending hash characters in quotes or precede it with
! ;;   a backslash.  Note that using braces won't work -- quotes change
! ;;   the syntax class of characters between them, while braces do not.
! ;;   The electric-# mode helps alleviate this problem somewhat.
  ;; * indent-tcl-exp is untested.
  
  ;; TODO:
--- 60,75 ----
  ;; Jesper Pedersen <address@hidden>
  ;; address@hidden (Doug Farmer)
  ;; "Chris Alfeld" <address@hidden>
! ;; Ben Wing <address@hidden>
  
  ;; KNOWN BUGS:
! ;; * In Tcl "#" is not always a comment character.  This can confuse tcl.el
! ;;   in certain circumstances.  For now the only workaround is to use
! ;;   font-lock which will mark the # chars accordingly or enclose offending
! ;;   hash characters in quotes or precede them with a backslash.  Note that
! ;;   using braces won't work -- quotes change the syntax class of characters
! ;;   between them, while braces do not.  If you don't use font-lock, the
! ;;   electric-# mode helps alleviate this problem somewhat.
  ;; * indent-tcl-exp is untested.
  
  ;; TODO:
***************
*** 154,167 ****
                 (const :tag "Maybe move or make or delete comment" 'tcl)))
  
  
! (defcustom tcl-electric-hash-style 'smart
    "*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
  made depending on the number of hashes inserted; or nil, meaning that
  no quoting should be done.  Any other value for this variable is
! taken to mean `smart'.  The default is `smart'."
    :group 'tcl
    :type '(choice (const backslash) (const quote) (const smart) (const nil)))
  
--- 155,168 ----
                 (const :tag "Maybe move or make or delete comment" 'tcl)))
  
  
! (defcustom tcl-electric-hash-style nil ;; 'smart
    "*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
  made depending on the number of hashes inserted; or nil, meaning that
  no quoting should be done.  Any other value for this variable is
! taken to mean `smart'.  The default is nil."
    :group 'tcl
    :type '(choice (const backslash) (const quote) (const smart) (const nil)))
  
***************
*** 508,514 ****
  
  
  (defvar tcl-imenu-generic-expression
!   '((nil "^proc[ \t]+\\([-A-Za-z0-9_:+*]+\\)" 1))
    "Imenu generic expression for `tcl-mode'.  See `imenu-generic-expression'.")
  
  
--- 509,515 ----
  
  
  (defvar tcl-imenu-generic-expression
!   `((nil ,(concat tcl-proc-regexp "\\([-A-Za-z0-9_:+*]+\\)") 2))
    "Imenu generic expression for `tcl-mode'.  See `imenu-generic-expression'.")
  
  
***************
*** 538,545 ****
    `tcl-auto-newline'
      Non-nil means automatically newline before and after braces, brackets,
      and semicolons inserted in Tcl code.
-   `tcl-electric-hash-style'
-     Controls action of `#' key.
    `tcl-use-smart-word-finder'
      If not nil, use a smarter, Tcl-specific way to find the current
      word when looking up help on a Tcl command.
--- 539,544 ----
***************
*** 1276,1298 ****
             (fill-paragraph ignore)))))
    t)
  
- (defun tcl-do-auto-fill ()
-   "Auto-fill function for Tcl mode.  Only auto-fills in a comment."
-   (if (> (current-column) fill-column)
-       (let ((fill-prefix "# ")
-           in-comment col)
-       (save-excursion
-         (setq in-comment (tcl-in-comment))
-         (if in-comment
-             (setq col (1- (current-column)))))
-       (if in-comment
-           (progn
-             (do-auto-fill)
-             (save-excursion
-               (back-to-indentation)
-               (delete-region (point) (line-beginning-position))
-               (indent-to-column col)))))))
- 
  
  
  ;;
--- 1275,1280 ----
***************
*** 1468,1484 ****
        (if and-go (switch-to-tcl t)))))))
  
  (defun tcl-auto-fill-mode (&optional arg)
!   "Like `auto-fill-mode', but controls filling of Tcl comments."
    (interactive "P")
!   ;; Following code taken from "auto-fill-mode" (simple.el).
!   (prog1
!       (setq auto-fill-function
!           (if (if (null arg)
!                   (not auto-fill-function)
!                 (> (prefix-numeric-value arg) 0))
!               'tcl-do-auto-fill
!             nil))
!     (force-mode-line-update)))
  
  (defun tcl-electric-hash (&optional count)
    "Insert a `#' and quote if it does not start a real comment.
--- 1450,1461 ----
        (if and-go (switch-to-tcl t)))))))
  
  (defun tcl-auto-fill-mode (&optional arg)
!   "Like `auto-fill-mode', but sets `comment-auto-fill-only-comments'."
    (interactive "P")
!   (auto-fill-mode arg)
!   (if auto-fill-function
!       (set (make-local-variable 'comment-auto-fill-only-comments) t)
!     (kill-local-variable 'comment-auto-fill-only-comments)))
  
  (defun tcl-electric-hash (&optional count)
    "Insert a `#' and quote if it does not start a real comment.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]