From: martin rudalics <rudalics@gmx.at>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: acm@muc.de, herberteuler@hotmail.com, handa@m17n.org,
rms@gnu.org, emacs-devel@gnu.org
Subject: Re: C++ mode and c-beginning-of-current-token
Date: Sat, 19 May 2007 19:48:43 +0200 [thread overview]
Message-ID: <464F387B.3080804@gmx.at> (raw)
In-Reply-To: <jwvk5v4c0bh.fsf-monnier+emacs@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 611 bytes --]
> As for scan_words, I don't know of such a bug. Also looking at the code,
> I don't see it (not that it proves anything, of course). Could you tell me
> where's the problem in scan_words?
With Emacs -Q define foo as
(defun foo ()
(interactive)
(put-text-property (1- (point)) (point) 'syntax-table '(2))
(setq parse-sexp-lookup-properties t))
open a text-mode buffer, insert a couple of non-word chars in the
buffer, leave point after them, and type M-x foo followed by M-b. It
goes back by _two_ characters instead of one. The attached patch was
supposed to fix this and the other problem.
[-- Attachment #2: syntax.patch --]
[-- Type: text/plain, Size: 1575 bytes --]
*** syntax.c Wed Jan 17 09:31:10 2007
--- syntax.c Thu May 17 23:30:50 2007
***************
*** 1276,1294 ****
position of it. */
while (1)
{
- int temp_byte;
-
if (from == beg)
break;
! temp_byte = dec_bytepos (from_byte);
UPDATE_SYNTAX_TABLE_BACKWARD (from);
! ch0 = FETCH_CHAR (temp_byte);
code = SYNTAX (ch0);
if (!(words_include_escapes
&& (code == Sescape || code == Scharquote)))
if (code != Sword || WORD_BOUNDARY_P (ch0, ch1))
! break;
! DEC_BOTH (from, from_byte);
ch1 = ch0;
}
count++;
--- 1276,1294 ----
position of it. */
while (1)
{
if (from == beg)
break;
! DEC_BOTH (from, from_byte);
UPDATE_SYNTAX_TABLE_BACKWARD (from);
! ch0 = FETCH_CHAR (from_byte);
code = SYNTAX (ch0);
if (!(words_include_escapes
&& (code == Sescape || code == Scharquote)))
if (code != Sword || WORD_BOUNDARY_P (ch0, ch1))
! {
! INC_BOTH (from, from_byte);
! break;
! }
ch1 = ch0;
}
count++;
***************
*** 1669,1678 ****
p = GPT_ADDR;
stop = endp;
}
- if (! fastmap[(int) SYNTAX (p[-1])])
- break;
p--, pos--;
! UPDATE_SYNTAX_TABLE_BACKWARD (pos - 1);
}
}
}
--- 1669,1681 ----
p = GPT_ADDR;
stop = endp;
}
p--, pos--;
! UPDATE_SYNTAX_TABLE_BACKWARD (pos);
! if (! fastmap[(int) SYNTAX (*p)])
! {
! p++, pos++;
! break;
! }
}
}
}
[-- Attachment #3: Type: text/plain, Size: 142 bytes --]
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel
next prev parent reply other threads:[~2007-05-19 17:48 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-12 10:39 C++ mode and c-beginning-of-current-token Herbert Euler
2007-05-12 13:19 ` Alan Mackenzie
2007-05-12 14:30 ` Herbert Euler
2007-05-12 14:33 ` Herbert Euler
2007-05-12 16:02 ` Herbert Euler
2007-05-12 15:30 ` Herbert Euler
2007-05-12 18:49 ` Alan Mackenzie
2007-05-13 0:51 ` Herbert Euler
2007-05-13 10:01 ` Alan Mackenzie
2007-05-14 2:00 ` Herbert Euler
2007-05-14 8:50 ` Alan Mackenzie
2007-05-14 9:24 ` Herbert Euler
2007-05-14 16:58 ` Stefan Monnier
2007-05-15 3:45 ` Herbert Euler
2007-05-15 6:39 ` martin rudalics
2007-05-16 16:15 ` Stefan Monnier
2007-05-15 13:30 ` Herbert Euler
2007-05-16 8:01 ` Herbert Euler
2007-05-16 8:05 ` Herbert Euler
2007-05-17 2:12 ` Kenichi Handa
2007-05-17 10:18 ` martin rudalics
2007-05-17 12:52 ` Herbert Euler
2007-05-17 13:51 ` martin rudalics
2007-05-17 21:40 ` martin rudalics
2007-05-17 14:32 ` Stefan Monnier
2007-05-17 14:45 ` martin rudalics
2007-05-18 13:00 ` Richard Stallman
2007-05-18 23:39 ` Herbert Euler
2007-05-19 22:31 ` Richard Stallman
2007-05-19 12:59 ` martin rudalics
2007-05-19 15:18 ` Stefan Monnier
2007-05-19 17:48 ` martin rudalics [this message]
2007-05-21 13:01 ` Kenichi Handa
2007-05-21 14:00 ` Stefan Monnier
2007-05-22 1:37 ` Kenichi Handa
2007-05-22 10:26 ` Stefan Monnier
2007-05-22 12:08 ` Kenichi Handa
2007-05-20 6:50 ` Richard Stallman
2007-05-16 9:00 ` martin rudalics
2007-05-16 11:12 ` Herbert Euler
2007-05-16 12:21 ` martin rudalics
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=464F387B.3080804@gmx.at \
--to=rudalics@gmx.at \
--cc=acm@muc.de \
--cc=emacs-devel@gnu.org \
--cc=handa@m17n.org \
--cc=herberteuler@hotmail.com \
--cc=monnier@iro.umontreal.ca \
--cc=rms@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.