unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Rolf Ade <rolf@pointsman.de>
To: 23565@debbugs.gnu.org
Subject: bug#23565: 24.5; tcl-end-of-defun and tcl-eval-defun doesn't work reliable
Date: Wed, 18 May 2016 00:10:01 +0200	[thread overview]
Message-ID: <87mvnoe3pi.fsf@linux-qg7d.fritz.box> (raw)



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





             reply	other threads:[~2016-05-17 22:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-17 22:10 Rolf Ade [this message]
     [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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mvnoe3pi.fsf@linux-qg7d.fritz.box \
    --to=rolf@pointsman.de \
    --cc=23565@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).