From: Masatake YAMATO <jet@gyve.org>
Cc: herberteuler@hotmail.com, emacs-devel@gnu.org
Subject: Re: Some problems in `add-log-current-defun'
Date: Wed, 27 Dec 2006 22:46:07 +0900 (JST) [thread overview]
Message-ID: <20061227.224607.31863929.jet@gyve.org> (raw)
In-Reply-To: <8664bxsf4b.fsf@lola.quinscape.zz> <BAY112-F34477621BF3C6EE6E473DBDAC00@phx.gbl>
> >> Please note that we are talking about implementing editor support, not
> >> a C++ parser. It is not our task to handle all C++ constructs
> >> perfectly. Instead, it is our task to handle reasonably formatted C++
> >> code. Code like the above may _intentionally_ be formatted in this
> >> manner in order to persuade the editor to interpret things
> >> differently.
> >
> > Just a question.
> >
> > Here do you think Emacs's C code is reasonably formatted?
>
> I can't parse your message; maybe it is not reasonably formatted...
I'm very sorry.
What I'd like to write:
Do you think that Emacs's C code is reasonably formatted?
> The examples were C++ code mostly. So what is "here" and "Emacs' C
> code" supposed to be? Some code from the previous mail, or code from
> within Emacs? An actual quote might be helpful.
C source within Emacs. Here I quote the related statements:
> II. On the change of `beginning-of-defun' in CC mode
>
> When the point is in the docstring of Emacs C source code, the
> following forms are evaluated.
>
> (let (maybe-beg)
> ;; Try to find the containing defun.
> (beginning-of-defun)
> (end-of-defun)
>
> But I found the result is wrong with the newest CC mode. Consider the
> following Emacs C source code:
>
> DEFUN ("catch", Fcatch, Scatch, 1, UNEVALLED, 0,
> doc: /* Eval BODY allowing nonlocal exits using `throw'.
> TAG is evalled to get the tag to use; it must not be nil.
>
> Then the BODY is executed.
> Within BODY, a call to `throw' with the same TAG exits BODY and this
> `catch'.
> If no throw happens, `catch' returns the value of the last BODY form.
> If a throw happens, it specifies the value to return from `catch'.
> usage: (catch TAG BODY...) */)
>
> Now suppose the point is at the beginning of the second paragarph,
> i.e. before ``Then''. This is where the point will be before
> evaluating the forms given above if one invokes
> `add-log-current-defun' when the point is in the first paragraph of
> the docstring. In the past, CC mode does not consider the arguments
> of DEFUN as a defun, so `beginning-of-defun' will move point to the
> beginning of the function that appear before this DEFUN. With the
> forms in `add-log-current-defun', the result is correct. But I found
> in the newest CC mode considers the arguments (starting with
> ``("catch"'', ending with ``*/)'') as a defun, so that
> `beginning-of-defun' will move point to the beginning of the
> arguments, i.e. between the space that is after ``DEFUN'' and the left
> paren before ``"catch"''. As a result, one cannot produce correct
> change log entry when point is in the first paragraph of this
> function, for example, when point is between ``Eval'' and ``BODY'' in
> the first paragraph.
Masatake YAMATO
next prev parent reply other threads:[~2006-12-27 13:46 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-27 10:32 Some problems in `add-log-current-defun' Herbert Euler
2006-12-27 10:45 ` David Kastrup
2006-12-27 11:48 ` Masatake YAMATO
2006-12-27 12:22 ` David Kastrup
2006-12-27 11:55 ` Masatake YAMATO
2006-12-27 13:46 ` Masatake YAMATO [this message]
2006-12-27 21:17 ` Richard Stallman
2006-12-28 12:41 ` Masatake YAMATO
2006-12-29 15:44 ` Richard Stallman
2006-12-30 4:55 ` Masatake YAMATO
2006-12-30 18:24 ` Richard Stallman
2006-12-28 12:47 ` Herbert Euler
2006-12-29 15:44 ` Richard Stallman
2006-12-29 3:10 ` Herbert Euler
-- strict thread matches above, loose matches on Subject: below --
2006-12-31 8:28 Herbert Euler
2006-12-31 22:13 ` Richard Stallman
2007-01-01 1:27 ` Herbert Euler
2007-01-02 23:35 ` Stefan Monnier
2007-01-03 21:11 ` Richard Stallman
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20061227.224607.31863929.jet@gyve.org \
--to=jet@gyve.org \
--cc=emacs-devel@gnu.org \
--cc=herberteuler@hotmail.com \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.