* Re: bug#1406: backward-up-list reports scan error incorrectly?
[not found] ` <20081122140446.GC3330@muc.de>
@ 2008-11-27 12:19 ` Alan Mackenzie
2008-11-27 15:56 ` xah lee
[not found] ` <mailman.1345.1227787599.26697.help-gnu-emacs@gnu.org>
1 sibling, 1 reply; 5+ messages in thread
From: Alan Mackenzie @ 2008-11-27 12:19 UTC (permalink / raw
To: xah lee; +Cc: help-gnu-emacs
Hi, Xah!
> > though, isn't this something easy to fix?
> No, because it isn't a bug. It's the way the function is meant to work.
> If there is a bug, it's that the doc-string (and maybe the elisp manual,
> I haven't looked) is vague and incomplete.
I've amended the Emacs manual (.../doc/emacs/programs.texi) and the doc
strings of `backward-up-list' and several similar functions
(.../lisp/emacs-lisp/lisp.el).
If you're interested, have a look at the changes in
<http://cvs.savannah.gnu.org/viewvc/emacs/?root=emacs>.
--
Alan Mackenzie (Nuremberg, Germany).
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: bug#1406: backward-up-list reports scan error incorrectly?
[not found] ` <mailman.1345.1227787599.26697.help-gnu-emacs@gnu.org>
@ 2008-11-27 15:52 ` Xah Lee
0 siblings, 0 replies; 5+ messages in thread
From: Xah Lee @ 2008-11-27 15:52 UTC (permalink / raw
To: help-gnu-emacs
On Nov 27, 4:19 am, Alan Mackenzie <a...@muc.de> wrote:
> Hi, Xah!
>
> > > though, isn't this something easy to fix?
> > No, because it isn't a bug. It's the way the function is meant to work.
> > If there is a bug, it's that the doc-string (and maybe the elisp manual,
> > I haven't looked) is vague and incomplete.
>
> I've amended the Emacs manual (.../doc/emacs/programs.texi) and the doc
> strings of `backward-up-list' and several similar functions
> (.../lisp/emacs-lisp/lisp.el).
>
> If you're interested, have a look at the changes in
> <http://cvs.savannah.gnu.org/viewvc/emacs/?root=emacs>.
Thanks Alan.
I'd rather hope for a fix instead of change wording to reflect current
situation.
You argued in bug list that the issue is not simple essentially due to
the fact that straight quote chars are not matching.
That is true, but i think given today's tech and computing power, we
should over come this. Just assume that double quotes in the source
code are matched, since they are most of the time. In the few cases
when the backward-up-list went to the wrong place due to un-matched
double quote, i think that's ok.
alternatively, if the cursor is inside double quote, then issue a
warning in the messag area that the result may not be correct.
Also, since this works in text-mode, so another solution is to
temporarily switch to that mode, do the cursor move, then switch back.
Or temp set the syntax table to whatever chat that made text-mode work
and emacs-lisp-mode not work.
In general, my feeling is that moving around nested pairs is a trivial
issue, that given today's technology and software, it seems wimpy to
tell users that backward-up-list won't work if it's inside double
quotes due to some complexities. Much complex problems are solved
today in emacs, in other IDEs, etc.
Thanks though for the fix on the doc.
Xah
∑ http://xahlee.org/
☄
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: bug#1406: backward-up-list reports scan error incorrectly?
2008-11-27 12:19 ` bug#1406: backward-up-list reports scan error incorrectly? Alan Mackenzie
@ 2008-11-27 15:56 ` xah lee
2008-11-27 22:09 ` Alan Mackenzie
0 siblings, 1 reply; 5+ messages in thread
From: xah lee @ 2008-11-27 15:56 UTC (permalink / raw
To: Alan Mackenzie; +Cc: help-gnu-emacs
On Nov 27, 4:19 am, Alan Mackenzie <a...@muc.de> wrote:
> Hi, Xah!
>
> > > though, isn't this something easy to fix?
> > No, because it isn't a bug. It's the way the function is meant
to work.
> > If there is a bug, it's that the doc-string (and maybe the elisp
manual,
> > I haven't looked) is vague and incomplete.
>
> I've amended the Emacs manual (.../doc/emacs/programs.texi) and
the doc
> strings of `backward-up-list' and several similar functions
> (.../lisp/emacs-lisp/lisp.el).
>
> If you're interested, have a look at the changes in
> <http://cvs.savannah.gnu.org/viewvc/emacs/?root=emacs>.
Thanks Alan.
I'd rather hope for a fix instead of change wording to reflect
current situation.
You argued in bug list that the issue is not simple essentially due
to the fact that straight quote chars are not matching pairs.
That is true, but i think given today's tech and computing power, we
can over come this. Just assume that double quotes in the source code
are matched, since they are most of the time. In the few cases when
the backward-up-list went to the wrong place due to un-matched double
quote, i think that's ok. (as opposed to, it stops dead and utter a
beep.)
alternatively, if the cursor is inside double quote, then issue a
warning in the messag area that the result may not be correct.
Also, since this works in text-mode, so apparently this can work. A
implementation is to temporarily switch to that mode, do the cursor
move, then switch back. Or temp set the syntax table to whatever chat
that made text-mode work and emacs-lisp-mode not work.
In general, my feeling is that moving around nested pairs is not a
some insurmountable issue, that given today's technology and
software, it seems wimpy to tell users that backward-up-list won't
work if it's inside double quotes. Much complex problems are solved
today in emacs, in other IDEs, etc.
Just my opinions. Thanks.
Xah
∑ http://xahlee.org/
☄
On Nov 27, 2008, at 4:19 AM, Alan Mackenzie wrote:
Hi, Xah!
>> though, isn't this something easy to fix?
> No, because it isn't a bug. It's the way the function is meant to
> work.
> If there is a bug, it's that the doc-string (and maybe the elisp
> manual,
> I haven't looked) is vague and incomplete.
I've amended the Emacs manual (.../doc/emacs/programs.texi) and the doc
strings of `backward-up-list' and several similar functions
(.../lisp/emacs-lisp/lisp.el).
If you're interested, have a look at the changes in
<http://cvs.savannah.gnu.org/viewvc/emacs/?root=emacs>.
--
Alan Mackenzie (Nuremberg, Germany).
☄
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: bug#1406: backward-up-list reports scan error incorrectly?
2008-11-27 15:56 ` xah lee
@ 2008-11-27 22:09 ` Alan Mackenzie
2008-11-27 22:49 ` xah lee
0 siblings, 1 reply; 5+ messages in thread
From: Alan Mackenzie @ 2008-11-27 22:09 UTC (permalink / raw
To: xah lee; +Cc: help-gnu-emacs
Hi, Xah.
On Thu, Nov 27, 2008 at 07:56:17AM -0800, xah lee wrote:
> On Nov 27, 4:19 am, Alan Mackenzie <a...@muc.de> wrote:
> > Hi, Xah!
> > > > though, isn't this something easy to fix?
> > > No, because it isn't a bug. It's the way the function is meant to
> > > work. If there is a bug, it's that the doc-string (and maybe the
> > > elisp manual, I haven't looked) is vague and incomplete.
> > I've amended the Emacs manual (.../doc/emacs/programs.texi) and the
> > doc strings of `backward-up-list' and several similar functions
> > (.../lisp/emacs-lisp/lisp.el).
> > If you're interested, have a look at the changes in
> > <http://cvs.savannah.gnu.org/viewvc/emacs/?root=emacs>.
> Thanks Alan.
> I'd rather hope for a fix instead of change wording to reflect
> current situation.
Again, there isn't a bug, so there's nothing to fix. What I think you're
saying is that you'd prefer C-M-u to do something a bit different; or,
put another way, you want a different function.
Personally, I like being able to use the list commands inside a comment
or string.
Don't forget that the list commands are also used a lot as
almost-primitive functions in other lisp code (they're certainly used a
lot in CC Mode), and redefining these the way you suggest would slow down
other code, possibly by a lot.
> You argued in bug list that the issue is not simple essentially due
> to the fact that straight quote chars are not matching pairs.
> That is true, but i think given today's tech and computing power, we
> can over come this. Just assume that double quotes in the source code
> are matched, since they are most of the time. In the few cases when
> the backward-up-list went to the wrong place due to un-matched double
> quote, i think that's ok. (as opposed to, it stops dead and utter a
> beep.)
The stopping dead is due to it not finding an enclosing paren.
> alternatively, if the cursor is inside double quote, then issue a
> warning in the messag area that the result may not be correct.
Why don't you write the function you want? Then submit it to
emacs-devel@gnu.org, and it could well become an option in Emacs 24.
You have to decide what "inside a string" means. It could be as simple
as the text at point being fontified with font-lock-string-face. Or,
maybe you'd want to scan from the beginning of buffer to check this.
`parse-partial-sexp' is your friend here.
> Also, since this works in text-mode, so apparently this can work. A
> implementation is to temporarily switch to that mode, do the cursor
> move, then switch back. Or temp set the syntax table to whatever chat
> that made text-mode work and emacs-lisp-mode not work.
That's another way you could do it. In text mode, I don't think there
are any string characters defined (we're talking about its "syntax table"
here). So if you did this (switching temporarily to Text Mode) in Elisp
mode, you'd just get a very crude interpretation of parens. It might be
what you want, it might not.
> In general, my feeling is that moving around nested pairs is not a
> some insurmountable issue, that given today's technology and
> software, it seems wimpy to tell users that backward-up-list won't
> work if it's inside double quotes. Much complex problems are solved
> today in emacs, in other IDEs, etc.
No, it's certainly surmountable. But first you've got to decide what you
want, then you've got to do the surmounting.
> Just my opinions. Thanks.
No problem!
> Xah
--
Alan Mackenzie (Nuremberg, Germany).
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: bug#1406: backward-up-list reports scan error incorrectly?
2008-11-27 22:09 ` Alan Mackenzie
@ 2008-11-27 22:49 ` xah lee
0 siblings, 0 replies; 5+ messages in thread
From: xah lee @ 2008-11-27 22:49 UTC (permalink / raw
To: Alan Mackenzie; +Cc: help-gnu-emacs
> Personally, I like being able to use the list commands inside a
> comment
> or string.
>
> Don't forget that the list commands are also used a lot as
> almost-primitive functions in other lisp code (they're certainly
> used a
> lot in CC Mode), and redefining these the way you suggest would
> slow down
> other code, possibly by a lot.
I see. great info.
Doh, i thought i was replying to the bug list. My prev post wast
intended for the bug list so that that the communication is unbroken
there but didn't notice it just went to help.gnu.emacs. but anyway,
you probably right.
Xah
∑ http://xahlee.org/
☄
On Nov 27, 2008, at 2:09 PM, Alan Mackenzie wrote:
Hi, Xah.
On Thu, Nov 27, 2008 at 07:56:17AM -0800, xah lee wrote:
> On Nov 27, 4:19 am, Alan Mackenzie <a...@muc.de> wrote:
>> Hi, Xah!
>>>> though, isn't this something easy to fix?
>>> No, because it isn't a bug. It's the way the function is meant to
>>> work. If there is a bug, it's that the doc-string (and maybe the
>>> elisp manual, I haven't looked) is vague and incomplete.
>> I've amended the Emacs manual (.../doc/emacs/programs.texi) and the
>> doc strings of `backward-up-list' and several similar functions
>> (.../lisp/emacs-lisp/lisp.el).
>> If you're interested, have a look at the changes in
>> <http://cvs.savannah.gnu.org/viewvc/emacs/?root=emacs>.
> Thanks Alan.
> I'd rather hope for a fix instead of change wording to reflect
> current situation.
Again, there isn't a bug, so there's nothing to fix. What I think
you're
saying is that you'd prefer C-M-u to do something a bit different; or,
put another way, you want a different function.
Personally, I like being able to use the list commands inside a comment
or string.
Don't forget that the list commands are also used a lot as
almost-primitive functions in other lisp code (they're certainly used a
lot in CC Mode), and redefining these the way you suggest would slow
down
other code, possibly by a lot.
> You argued in bug list that the issue is not simple essentially due
> to the fact that straight quote chars are not matching pairs.
> That is true, but i think given today's tech and computing power, we
> can over come this. Just assume that double quotes in the source code
> are matched, since they are most of the time. In the few cases when
> the backward-up-list went to the wrong place due to un-matched double
> quote, i think that's ok. (as opposed to, it stops dead and utter a
> beep.)
The stopping dead is due to it not finding an enclosing paren.
> alternatively, if the cursor is inside double quote, then issue a
> warning in the messag area that the result may not be correct.
Why don't you write the function you want? Then submit it to
emacs-devel@gnu.org, and it could well become an option in Emacs 24.
You have to decide what "inside a string" means. It could be as simple
as the text at point being fontified with font-lock-string-face. Or,
maybe you'd want to scan from the beginning of buffer to check this.
`parse-partial-sexp' is your friend here.
> Also, since this works in text-mode, so apparently this can work. A
> implementation is to temporarily switch to that mode, do the cursor
> move, then switch back. Or temp set the syntax table to whatever chat
> that made text-mode work and emacs-lisp-mode not work.
That's another way you could do it. In text mode, I don't think there
are any string characters defined (we're talking about its "syntax
table"
here). So if you did this (switching temporarily to Text Mode) in Elisp
mode, you'd just get a very crude interpretation of parens. It might be
what you want, it might not.
> In general, my feeling is that moving around nested pairs is not a
> some insurmountable issue, that given today's technology and
> software, it seems wimpy to tell users that backward-up-list won't
> work if it's inside double quotes. Much complex problems are solved
> today in emacs, in other IDEs, etc.
No, it's certainly surmountable. But first you've got to decide what
you
want, then you've got to do the surmounting.
> Just my opinions. Thanks.
No problem!
> Xah
--
Alan Mackenzie (Nuremberg, Germany).
☄
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-11-27 22:49 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <EAA45A2E-4CC6-4F13-863A-9A934FF60165@xahlee.org>
[not found] ` <20081121231944.GB2089@muc.de>
[not found] ` <5F3AB054-C158-4518-9C93-6938EB2D123D@xahlee.org>
[not found] ` <20081122123644.GA3330@muc.de>
[not found] ` <12CBE034-485F-49CE-9EF6-2C33A51AF0C1@xahlee.org>
[not found] ` <9331FB10-71C6-4B1B-94B6-B5C9B3667B74@xahlee.org>
[not found] ` <20081122140446.GC3330@muc.de>
2008-11-27 12:19 ` bug#1406: backward-up-list reports scan error incorrectly? Alan Mackenzie
2008-11-27 15:56 ` xah lee
2008-11-27 22:09 ` Alan Mackenzie
2008-11-27 22:49 ` xah lee
[not found] ` <mailman.1345.1227787599.26697.help-gnu-emacs@gnu.org>
2008-11-27 15:52 ` Xah Lee
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).