emacs-devel
[Top][All Lists]
Advanced

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

open parens in column zero and c-mode


From: martin rudalics
Subject: open parens in column zero and c-mode
Date: Sun, 21 May 2006 00:20:31 +0200
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

With emacs -Q  open `syntax.c' and execute the following function:

(defun foo ()
  (interactive)
  (re-search-forward "string-to-syntax")
  (forward-line 6)
  (recenter 0))

My Emacs misfontifies some 20 lines with `font-lock-string-face' here.
The culprit is obviously the left paren before CODE in the doc-string of
`string-to-syntax'

(CODE . MATCHING-CHAR) that can be used as value of a `syntax-table'

and it would be easy to correct that.  What I want to ask, however, is
whether there's any good reason why

1. `open-paren-in-column-0-is-defun-start' is t in c-mode,

2. `syntax-begin-function' is not `c-beginning-of-defun' in c-mode, and

3. `beginning-of-defun-function' and `end-of-defun-function' are not
   respectively `c-beginning-of-defun' and `c-end-of-defun' in c-mode.

If any of these questions has to be answered with `yes' I'd suggest to
color left parens within comments at bol with `font-lock-warning-face'
as in Lisp mode to satisfy the following excerpt from the Emacs manual:

   "To help you catch violations of this convention, Font Lock mode
highlights confusing opening delimiters (those that ought to be quoted)
in bold red."





reply via email to

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