[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
address@hidden: tcl.el tcl-end-of-defun failure]
From: |
Richard Stallman |
Subject: |
address@hidden: tcl.el tcl-end-of-defun failure] |
Date: |
Wed, 20 Nov 2002 16:14:09 -0500 |
I don't know TCL so I have no idea if this has a hidden pitfall or not.
Could someone who does know TCL report on whether it is the right fix?
------- Start of forwarded message -------
Envelope-to: address@hidden
Delivery-date: Tue, 19 Nov 2002 12:19:14 -0500
X-Authentication-Warning: kuiper.rlent.pnet: roland set sender to
address@hidden using -f
Sender: address@hidden
To: address@hidden
Subject: tcl.el tcl-end-of-defun failure
From: Roland Roberts <address@hidden>
Date: 19 Nov 2002 12:19:04 -0500
X-Spam-Status: No, hits=-0.9 required=5.0
tests=PATCH_UNIFIED_DIFF,SPAM_PHRASE_00_01,X_AUTH_WARNING
version=2.41
X-Spam-Level:
- --=-=-=
In 21.2.92, tcl.el uses a value for defun-prompt-regexp which fails to
correctly skip of Tcl proc argument lists which have default values,
e.g.,
proc foo {arg1 {arg2 "arg2_default"}} {
puts "hello, world"
}
This patch fixes that problem and seems to still work fine for
non-proc cases e.g.,
mm arg {
puts "hello, world"
}
Note that in all cases, tcl-end-of-defun does not work correctly if
the proc does not start in column 0. E.g.,
namespace eval foo {
proc bar {args} {
puts $args
}
}
NB: This patch includes the patches sent earlier to fix
comment-start-skip. The only required change for this patch is to
tcl-omit-ws-regexp.
roland
- --
PGP Key ID: 66 BC 3B CD
Roland B. Roberts, PhD RL Enterprises
address@hidden 6818 Madeline Court
address@hidden Brooklyn, NY 11220
- --=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment; filename=tcl.el.diff
Content-Description: tcl.el tcl-end-of-defun fix
- --- /usr/local/share/emacs/21.2.92/lisp/progmodes/tcl.el Fri Apr 12
13:14:49 2002
+++ elisp/tcl.el Tue Nov 19 11:33:07 2002
@@ -559,7 +559,7 @@
;; end-of-defun doesn't really use the brace matching the one that
;; trails defun-prompt-regexp.
;; ?? Is there a bug now ??
- -(defconst tcl-omit-ws-regexp "^[^ \t\n#}][^\n}]+}*[ \t]+")
+(defconst tcl-omit-ws-regexp "^[^ \t\n#][^\n]+}*[ \t]+")
(defun tcl-internal-beginning-of-defun (&optional arg)
"Move backward to next beginning of defun.
@@ -764,7 +764,7 @@
(make-local-variable 'comment-start)
(setq comment-start "# ")
(make-local-variable 'comment-start-skip)
- - (setq comment-start-skip "#+ *")
+ (setq comment-start-skip "\\(^\\s +#+\\s *\\|;#+\\s *\\)")
(make-local-variable 'comment-column)
(setq comment-column 40)
(make-local-variable 'comment-end)
@@ -1874,7 +1874,7 @@
(insert
(if (tcl-real-command-p) "" ";")
"# ")
- - (backward-char))))))
+ (backward-char 2))))))
;; Point is just after the "#" starting a comment. Move it as
;; appropriate.
(let* ((indent (or (funcall comment-indent-function) comment-column))
@@ -1883,7 +1883,7 @@
(point))))
(if (/= begpos indent)
(progn
- - (skip-chars-backward " \t" (save-excursion
+ (skip-chars-backward "; \t" (save-excursion
(beginning-of-line)
(point)))
(delete-region (point) begpos)
- --=-=-=--
------- End of forwarded message -------
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- address@hidden: tcl.el tcl-end-of-defun failure],
Richard Stallman <=