emacs-devel
[Top][All Lists]
Advanced

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

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


From: Herbert Euler
Subject: C++ mode and c-beginning-of-current-token
Date: Sat, 12 May 2007 18:39:12 +0800

In the newest unicode 2 branch, `parse-sexp-lookup-properties' is
default to `t' in C++ mode but not in C mode.  I don't have the
Emacs 22 trunk, and so don't know the case in that trunk.  But
if this variable is set to t by default, there will be a bug in c++-mode:

1. Visit an empty, new C++ file.
2. Try to insert the following line, at the beginning of the buffer:

#include <iostream>

Well, an error will be signaled when typing the second character, "i",
says "Point before start of properties".  This error happens in the
function `c-beginning-of-current-token', when invoking
`skip-syntax-backward':

(defun c-beginning-of-current-token (&optional back-limit)
 ;; Move to the beginning of the current token.  Do not move if not
 ;; in the middle of one.  BACK-LIMIT may be used to bound the
 ;; backward search; if given it's assumed to be at the boundary
 ;; between two tokens.  Return non-nil if the point is move, nil
 ;; otherwise.
 ;;
 ;; This function might do hidden buffer changes.
   (let ((start (point)))
     (if (looking-at "\\w\\|\\s_")
         (skip-syntax-backward "w_" back-limit)
        (when (< (skip-syntax-backward ".()" back-limit) 0)
 ;; ... ...

If `parse-sexp-lookup-properties' is t, `skip-syntax-backward' would
not return -1, but signaling an error in some cases.

Regards,
Guanpeng Xu

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/





reply via email to

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