unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* C++ mode and c-beginning-of-current-token
@ 2007-05-12 10:39 Herbert Euler
  2007-05-12 13:19 ` Alan Mackenzie
                   ` (3 more replies)
  0 siblings, 4 replies; 41+ messages in thread
From: Herbert Euler @ 2007-05-12 10:39 UTC (permalink / raw)
  To: acm; +Cc: emacs-devel

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/

^ permalink raw reply	[flat|nested] 41+ messages in thread

end of thread, other threads:[~2007-05-22 12:08 UTC | newest]

Thread overview: 41+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).