unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* bug when fontifying cc-mode
@ 2005-08-26  3:39 Karl Chen
  2005-08-26  7:18 ` Alan Mackenzie
  0 siblings, 1 reply; 5+ messages in thread
From: Karl Chen @ 2005-08-26  3:39 UTC (permalink / raw)



Applies to emacs CVS HEAD; does not apply to emacs 21.3.

Steps to reproduce:

emacs -q /tmp/a.c

insert the following string (without quotes):

"
//
//

//
//

"

(There must be at least one blank line at the beginning, between
the double-comment lines, and at the end.)

M-x font-lock-fontify-buffer


Lisp error: (error "Point after end of properties")
  forward-comment(5)
  c-find-decl-spots( ... )
  c-font-lock-declarations(24)
  font-lock-fontify-keywords-region(1 24 t)
  font-lock-default-fontify-region(1 24 t)
  font-lock-fontify-region(1 24 t)
  byte-code( ... )
  font-lock-default-fontify-buffer()
  font-lock-fontify-buffer()

Fforward_comment hasn't changed in 5 years.

-- 
Karl 2005-08-25 20:38

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

* Re: bug when fontifying cc-mode
  2005-08-26  3:39 bug when fontifying cc-mode Karl Chen
@ 2005-08-26  7:18 ` Alan Mackenzie
  2005-08-26 10:38   ` Karl Chen
  2005-08-26 15:43   ` Stefan Monnier
  0 siblings, 2 replies; 5+ messages in thread
From: Alan Mackenzie @ 2005-08-26  7:18 UTC (permalink / raw)
  Cc: Emacs Developement List

Hi, Chen!

On Thu, 25 Aug 2005, Karl Chen wrote:

Could you possibly do C-c C-b (`c-submit-bug-report') on your buffer, so
as to give a complete dump of your configuration, and then send the whole
thing to <bug-cc-mode@gnu.org>?  CC Mode is maintained as a separate
project.

Thanks!

-- 
Alan Mackenzie (Munich, Germany)

>
>Applies to emacs CVS HEAD; does not apply to emacs 21.3.
>
>Steps to reproduce:
>
>emacs -q /tmp/a.c
>
>insert the following string (without quotes):
>
>"
>//
>//
>
>//
>//
>
>"
>
>(There must be at least one blank line at the beginning, between
>the double-comment lines, and at the end.)
>
>M-x font-lock-fontify-buffer
>
>
>Lisp error: (error "Point after end of properties")
>  forward-comment(5)
>  c-find-decl-spots( ... )
>  c-font-lock-declarations(24)
>  font-lock-fontify-keywords-region(1 24 t)
>  font-lock-default-fontify-region(1 24 t)
>  font-lock-fontify-region(1 24 t)
>  byte-code( ... )
>  font-lock-default-fontify-buffer()
>  font-lock-fontify-buffer()
>
>Fforward_comment hasn't changed in 5 years.
>
>-- 
>Karl 2005-08-25 20:38
>
>
>_______________________________________________
>Emacs-devel mailing list
>Emacs-devel@gnu.org
>http://lists.gnu.org/mailman/listinfo/emacs-devel
>

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

* Re: bug when fontifying cc-mode
  2005-08-26  7:18 ` Alan Mackenzie
@ 2005-08-26 10:38   ` Karl Chen
  2005-08-26 15:43   ` Stefan Monnier
  1 sibling, 0 replies; 5+ messages in thread
From: Karl Chen @ 2005-08-26 10:38 UTC (permalink / raw)
  Cc: Emacs Developement List

>>>>> On 2005-08-26 00:18 PDT, Alan Mackenzie writes:

    Alan> Could you possibly do C-c C-b (`c-submit-bug-report') on
    Alan> your buffer, so as to give a complete dump of your
    Alan> configuration, and then send the whole thing to
    Alan> <bug-cc-mode@gnu.org>?  CC Mode is maintained as a
    Alan> separate project.

Done.  (I wasn't sure if it was cc-mode-specific or not.)

-- 
Karl 2005-08-26 03:36

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

* Re: bug when fontifying cc-mode
  2005-08-26  7:18 ` Alan Mackenzie
  2005-08-26 10:38   ` Karl Chen
@ 2005-08-26 15:43   ` Stefan Monnier
  2005-08-26 21:33     ` Nick Roberts
  1 sibling, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2005-08-26 15:43 UTC (permalink / raw)
  Cc: Karl Chen, Emacs Developement List

> Could you possibly do C-c C-b (`c-submit-bug-report') on your buffer, so
> as to give a complete dump of your configuration, and then send the whole
> thing to <bug-cc-mode@gnu.org>?  CC Mode is maintained as a separate
> project.

Don't bother.  I'm pretty sure it's a bug in src/syntax.c.  I'm even pretty
sure I've encountered it fixed it locally already a while back, but somehow
forgot to install it.


        Stefan

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

* Re: bug when fontifying cc-mode
  2005-08-26 15:43   ` Stefan Monnier
@ 2005-08-26 21:33     ` Nick Roberts
  0 siblings, 0 replies; 5+ messages in thread
From: Nick Roberts @ 2005-08-26 21:33 UTC (permalink / raw)
  Cc: Alan Mackenzie, Emacs Developement List, Karl Chen

Stefan Monnier writes:
 > > Could you possibly do C-c C-b (`c-submit-bug-report') on your buffer, so
 > > as to give a complete dump of your configuration, and then send the whole
 > > thing to <bug-cc-mode@gnu.org>?  CC Mode is maintained as a separate
 > > project.
 > 
 > Don't bother.  I'm pretty sure it's a bug in src/syntax.c.  I'm even pretty
 > sure I've encountered it fixed it locally already a while back, but somehow
 > forgot to install it.

On a related note, there are fontification problems with the C file below.
These are probably also note due to CC mode because when I load it, it doesn't
fontify correctly but if I add a character like <RET> in the middle and then
undo that change i.e leave the buffer is unmodified, it fontifies correctly.

Nick



void _initialize_infcmd (void);

#define GO_USAGE   "Usage: go <location>\n"

struct gdb_environ *inferior_environ;

void
_initialize_infcmd (void)
{
  struct cmd_list_element *c = NULL;

  /* add the filename of the terminal connected to inferior I/O */
  add_setshow_filename_cmd ("inferior-tty", class_run,
			    &inferior_io_terminal, _("\
Set terminal for future runs of program being debugged."), _("\
Show terminal for future runs of program being debugged."), _("\
Usage: set inferior-tty /dev/pts/1"), NULL, NULL, &setlist, &showlist);
  add_com_alias ("tty", "set inferior-tty", class_alias, 0);

  add_setshow_optional_filename_cmd ("args", class_run,
				     &inferior_args, _("\
Set argument list to give program being debugged when it is started."), _("\
Show argument list to give program being debugged when it is started."), _("\
Follow this command with any number of args, to be passed to the program."),
				     notice_args_set,
				     notice_args_read,
				     &setlist, &showlist);

  c = add_cmd ("environment", no_class, environment_info, _("\
The environment to give the program, or one variable's value.\n\
With an argument VAR, prints the value of environment variable VAR to\n\
give the program being debugged.  With no arguments, prints the entire\n\
environment to be given to the program."), &showlist);
  set_cmd_completer (c, noop_completer);

  add_prefix_cmd ("unset", no_class, unset_command,
		  _("Complement to certain \"set\" commands."),
		  &unsetlist, "unset ", 0, &cmdlist);

  c = add_cmd ("environment", class_run, unset_environment_command, _("\
Cancel environment variable VAR for the program.\n\
This does not affect the program until the next \"run\" command."),
	       &unsetlist);
  set_cmd_completer (c, noop_completer);

  c = add_cmd ("environment", class_run, set_environment_command, _("\
Set environment variable value to give the program.\n\
Arguments are VAR VALUE where VAR is variable name and VALUE is value.\n\
VALUES of environment variables are uninterpreted strings.\n\
This does not affect the program until the next \"run\" command."),
	       &setlist);
  set_cmd_completer (c, noop_completer);

  c = add_com ("path", class_files, path_command, _("\
Add directory DIR(s) to beginning of search path for object files.\n\
$cwd in the path means the current working directory.\n\
This path is equivalent to the $PATH shell variable.  It is a list of\n\
directories, separated by colons.  These directories are searched to find\n\
fully linked executable files and separately compiled object files as needed."));
  set_cmd_completer (c, filename_completer);

  c = add_cmd ("paths", no_class, path_info, _("\
Current search path for finding object files.\n\
$cwd in the path means the current working directory.\n\
This path is equivalent to the $PATH shell variable.  It is a list of\n\
directories, separated by colons.  These directories are searched to find\n\
fully linked executable files and separately compiled object files as needed."),
	       &showlist);
  set_cmd_completer (c, noop_completer);

  add_com ("attach", class_run, attach_command, _("\
Attach to a process or file outside of GDB.\n\
This command attaches to another target, of the same type as your last\n\
\"target\" command (\"info files\" will show your target stack).\n\
The command may take as argument a process id or a device file.\n\
For a process id, you must have permission to send the process a signal,\n\
and it must have the same effective uid as the debugger.\n\
When using \"attach\" with a process id, the debugger finds the\n\
program running in the process, looking first in the current working\n\
directory, or (if not found there) using the source file search path\n\
(see the \"directory\" command).  You can also use the \"file\" command\n\
to specify the program, and to load its symbol table."));

  add_com ("detach", class_run, detach_command, _("\
Detach a process or file previously attached.\n\
If a process, it is no longer traced, and it continues its execution.  If\n\
you were debugging a file, the file is closed and gdb no longer accesses it."));

  add_com ("disconnect", class_run, disconnect_command, _("\
Disconnect from a target.\n\
The target will wait for another debugger to connect.  Not available for\n\
all targets."));

  add_com ("signal", class_run, signal_command, _("\
Continue program giving it signal specified by the argument.\n\
An argument of \"0\" means continue program without giving it a signal."));

  add_com ("stepi", class_run, stepi_command, _("\
Step one instruction exactly.\n\
Argument N means do this N times (or till program stops for another reason)."));
  add_com_alias ("si", "stepi", class_alias, 0);

  add_com ("nexti", class_run, nexti_command, _("\
Step one instruction, but proceed through subroutine calls.\n\
Argument N means do this N times (or till program stops for another reason)."));
  add_com_alias ("ni", "nexti", class_alias, 0);

  add_com ("finish", class_run, finish_command, _("\
Execute until selected stack frame returns.\n\
Upon return, the value returned is printed and put in the value history."));

  add_com ("next", class_run, next_command, _("\
Step program, proceeding through subroutine calls.\n\
Like the \"step\" command as long as subroutine calls do not happen;\n\
when they do, the call is treated as one instruction.\n\
Argument N means do this N times (or till program stops for another reason)."));
  add_com_alias ("n", "next", class_run, 1);
  if (xdb_commands)
    add_com_alias ("S", "next", class_run, 1);

  add_com ("step", class_run, step_command, _("\
Step program until it reaches a different source line.\n\
Argument N means do this N times (or till program stops for another reason)."));
  add_com_alias ("s", "step", class_run, 1);

  c = add_com ("until", class_run, until_command, _("\
Execute until the program reaches a source line greater than the current\n\
or a specified location (same args as break command) within the current frame."));
  set_cmd_completer (c, location_completer);
  add_com_alias ("u", "until", class_run, 1);

  c = add_com ("advance", class_run, advance_command, _("\
Continue the program up to the given location (same form as args for break command).\n\
Execution will also stop upon exit from the current stack frame."));
  set_cmd_completer (c, location_completer);

  c = add_com ("jump", class_run, jump_command, _("\
Continue program being debugged at specified line or address.\n\
Give as argument either LINENUM or *ADDR, where ADDR is an expression\n\
for an address to start at."));
  set_cmd_completer (c, location_completer);

  if (xdb_commands)
    {
      c = add_com ("go", class_run, go_command, _("\
Usage: go <location>\n\
Continue program being debugged, stopping at specified line or \n\
address.\n\
Give as argument either LINENUM or *ADDR, where ADDR is an \n\
expression for an address to start at.\n\
This command is a combination of tbreak and jump."));
      set_cmd_completer (c, location_completer);
    }

  if (xdb_commands)
    add_com_alias ("g", "go", class_run, 1);

  add_com ("continue", class_run, continue_command, _("\
Continue program being debugged, after signal or breakpoint.\n\
If proceeding from breakpoint, a number N may be used as an argument,\n\
which means to set the ignore count of that breakpoint to N - 1 (so that\n\
the breakpoint won't break until the Nth time it is reached)."));
  add_com_alias ("c", "cont", class_run, 1);
  add_com_alias ("fg", "cont", class_run, 1);

  c = add_com ("run", class_run, run_command, _("\
Start debugged program.  You may specify arguments to give it.\n\
Args may include \"*\", or \"[...]\"; they are expanded using \"sh\".\n\
Input and output redirection with \">\", \"<\", or \">>\" are also allowed.\n\n\
With no arguments, uses arguments last specified (with \"run\" or \"set args\").\n\
To cancel previous arguments and run with no arguments,\n\
use \"set args\" without arguments."));
  set_cmd_completer (c, filename_completer);
  add_com_alias ("r", "run", class_run, 1);
  if (xdb_commands)
    add_com ("R", class_run, run_no_args_command,
	     _("Start debugged program with no arguments."));

  c = add_com ("start", class_run, start_command, _("\
Run the debugged program until the beginning of the main procedure.\n\
You may specify arguments to give to your program, just as with the\n\
\"run\" command."));
  set_cmd_completer (c, filename_completer);

  add_com ("interrupt", class_run, interrupt_target_command,
	   _("Interrupt the execution of the debugged program."));

  add_info ("registers", nofp_registers_info, _("\
List of integer registers and their contents, for selected stack frame.\n\
Register name as argument means describe only that register."));
  add_info_alias ("r", "registers", 1);

  if (xdb_commands)
    add_com ("lr", class_info, nofp_registers_info, _("\
List of integer registers and their contents, for selected stack frame.\n\
Register name as argument means describe only that register."));
  add_info ("all-registers", all_registers_info, _("\
List of all registers and their contents, for selected stack frame.\n\
Register name as argument means describe only that register."));

  add_info ("program", program_info,
	    _("Execution status of the program."));

  add_info ("float", float_info,
	    _("Print the status of the floating point unit\n"));

  add_info ("vector", vector_info,
	    _("Print the status of the vector unit\n"));

  inferior_environ = make_environ ();
  init_environ (inferior_environ);
}

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

end of thread, other threads:[~2005-08-26 21:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-26  3:39 bug when fontifying cc-mode Karl Chen
2005-08-26  7:18 ` Alan Mackenzie
2005-08-26 10:38   ` Karl Chen
2005-08-26 15:43   ` Stefan Monnier
2005-08-26 21:33     ` Nick Roberts

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