From: Alan Mackenzie <acm@muc.de>
To: Chong Yidong <cyd@stupidchicken.com>
Cc: "Eric M. Ludlam" <zappo@gnu.org>, emacs-devel@gnu.org
Subject: Re: Semantic parser uses c-forward-conditional
Date: Tue, 22 Sep 2009 10:57:35 +0000 [thread overview]
Message-ID: <20090922105735.GA3722@muc.de> (raw)
In-Reply-To: <87zl8oumvl.fsf@stupidchicken.com>
Hi, Yidong!
On Mon, Sep 21, 2009 at 03:19:10PM -0400, Chong Yidong wrote:
> Hi Alan,
> Semantic's C parser calls c-forward-conditional while it's parsing C
> files. This happens frequently, often at idle time, if you visit a
> large C file.
Ah. c-forward-conditional is really intended as an interactive command
rather than for use in a lisp function - a bit like beginning-of-buffer.
> The trouble is that c-forward-conditional sets the mark. The call to it
> is wrapped in a save-excursion, so it doesn't clobber the user's mark,
> but it does lead to a stream of ugly "Mark set" messages.
> Would it be possible to change c-forward-conditional so that it pushes
> the mark only if called interactively?
I'm not very keen on that, but how about this instead: a new defun
c-forward-conditional-1 which does the same, except it doesn't push a
mark, doesn't throw errors like "No following conditional at this
level", and returns the final point, or nil?
Then all occurances inside CEDET can be changed to
(cedet-forward-c-conditional), where the following macro goes into
CEDET:
(require 'cc-cmds)
(defmacro forward-cedet-c-conditional (count &optional target-depth with-else)
....
(if (fboundp 'c-forward-conditional-1) ...)
....
)
This will avoid complexifying cc-cmds.el, whilst still allowing CEDET
and friends to work with older CC MODE versions. It would also be good
for CC MODE to separate out the "engine" part of the command from the
"wrapper".
As a matter of interest, have you grepped CEDET to find other similar
problems?
--
Alan Mackenzie (Nuremberg, Germany).
next prev parent reply other threads:[~2009-09-22 10:57 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-21 19:19 Semantic parser uses c-forward-conditional Chong Yidong
2009-09-21 19:21 ` Chong Yidong
2009-09-22 10:57 ` Alan Mackenzie [this message]
2009-09-22 11:43 ` Eric M. Ludlam
2009-09-22 22:08 ` Alan Mackenzie
2009-09-23 6:30 ` Richard Stallman
2009-09-23 9:24 ` Alan Mackenzie
2009-09-23 11:22 ` Eric M. Ludlam
2009-09-24 20:44 ` Alan Mackenzie
2009-09-22 16:24 ` 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=20090922105735.GA3722@muc.de \
--to=acm@muc.de \
--cc=cyd@stupidchicken.com \
--cc=emacs-devel@gnu.org \
--cc=zappo@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 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.