emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C++ mode and c-beginning-of-current-token


From: Kenichi Handa
Subject: Re: C++ mode and c-beginning-of-current-token
Date: Mon, 21 May 2007 22:01:55 +0900
User-agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/23.0.0 (i686-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)

In article <address@hidden>, Stefan Monnier <address@hidden> writes:

> > There are two bugs with identical structure - one in `skip_chars' and
> > one in `scan_words'.

> I have just installed a patch in EMACS_22_BASE for skip_chars.

Thank you.  I've just installed the corresponding change in
emacs-unicode-2.

> 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?

martin rudalics <address@hidden> writes:
> 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.

I confirmed this bug.  It seems that the following single
line change is easier to understand what was wrong, but
Martin's change makes the resulting code easier to read.

*** syntax.c    21 May 2007 21:21:30 +0900      1.205
--- syntax.c    21 May 2007 21:53:50 +0900      
***************
*** 1281,1287 ****
          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
--- 1281,1287 ----
          if (from == beg)
            break;
          temp_byte = dec_bytepos (from_byte);
!         UPDATE_SYNTAX_TABLE_BACKWARD (from - 1);
          ch0 = FETCH_CHAR (temp_byte);
          code = SYNTAX (ch0);
          if (!(words_include_escapes

---
Kenichi Handa
address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]