unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#23565: 24.5; tcl-end-of-defun and tcl-eval-defun doesn't work reliable
@ 2016-05-17 22:10 Rolf Ade
       [not found] ` <handler.23565.B.146353542425998.ack@debbugs.gnu.org>
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Rolf Ade @ 2016-05-17 22:10 UTC (permalink / raw)
  To: 23565



Recipt:

- Start emacs -Q

- Open some buffer and enable tcl-mode (M-x tcl-mode).

Copy the following tcl code into it:

proc bad {{value ""}} {
    # do something
}

proc good {value} {
    # do something
}


This is valid tcl code, creating two functions (or procedures, als Tcl
also calls them). The first function has an optional argument. If that
argument isn't given, the argument variable 'value' will have the
default value ("" in the bad example) given in the proc definition. The
second is an example for a function. that always expects one argument.

- Put the point at the beginning of the proc bad and call
  tcl-end-of-defun (which is an alias of end-of-defun, therefor all
  keybindings to that will work). Now the point is (marked as: _P_
 
proc bad {{value ""}} _P_{
    # do something
}

This is wrong, this is not the end of the proc. In general,
tcl-end-of-defun does work. Look at the proc good. Placing the point at
the beginning of proc good and calling tcl-end-of-defun, the point is
where expected:

proc good {value} {
    # do something
}_P_

This is only an example of the mis-functioning. It seems always to show
up, if a proc definition has the syntax for one ore more optional
arguments with the empty string (given as "" in the code) as default
value.

Since tcl-eval-defun is implemented with the help of end-of-defun, it
suffers from this, too. 



In GNU Emacs 24.5.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.10)
 of 2015-04-11 on linux-qg7d
Windowing system distributor `The X.Org Foundation', version 11.0.11203000





^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2019-10-13  3:19 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-17 22:10 bug#23565: 24.5; tcl-end-of-defun and tcl-eval-defun doesn't work reliable Rolf Ade
     [not found] ` <handler.23565.B.146353542425998.ack@debbugs.gnu.org>
2016-05-18 12:40   ` bug#23565: Acknowledgement (24.5; tcl-end-of-defun and tcl-eval-defun doesn't work reliable) Rolf Ade
2016-06-17  3:55 ` bug#23565: " Noam Postavsky
2018-06-24 17:35 ` bug#23565: 24.5; tcl-end-of-defun and tcl-eval-defun doesn't work reliable Tom Tromey
2018-07-02 12:04   ` Rolf Ade
2018-07-04 22:10     ` Rolf Ade
2018-07-05 13:07       ` Tom Tromey
2019-07-30 22:45         ` Rolf Ade
2019-09-28  0:20           ` Rolf Ade
2019-09-28 17:47             ` Lars Ingebrigtsen
2019-10-13  3:19               ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).