[Bug: 21.5-b28] font-lock-fontify-buffer not working in HTML mode

robert delius royar xemacs at frinabulax.org
Sat Sep 22 12:20:54 EDT 2007


Fri, 21 Sep 2007 (12:28 +0900 UTC) Stephen J. Turnbull wrote:

> Dr. Robert Delius Royar writes:
>
> > This began with 21.5-b28 (+CVS-20070918).  When html files are
> > read, the system reports they are being fontified, but no regexp
> > calls appear to be made.  Here is an excerpt from the *Message-Log*
> > buffer to show the difference between font locking messages for a
> > perl file and an html file:
>
> I don't see any recent changes likely to affect this.
>
> What modes are active when you edit HTML?  (In an HTML buffer, do C-h
> m, and just send the whole buffer that is popped up.)

HTML mode:
Major mode for editing HTML documents.
This is based on PSGML mode, and has a sophisticated SGML parser in it.
It knows how to properly indent HTML/SGML documents, and it can do
   a form of document validation (use C-c C-o to find
   the next error in your document).
Commands beginning with C-z insert various types of HTML tags
   (prompting for the required information); to iconify or suspend,
   use C-z C-z.
To literally insert special characters such as < and &, use C-c followed
   by the character.
Use C-c / to insert the proper closing tag.
Use C-c C-a to edit the attributes for a tag.
Use C-c C-c to show the current HTML context.

More specifically:

tab				sgml-indent-or-tab
/				sgml-slash
>				sgml-close-angle
button3			popup-mode-menu
C-c				<< Prefix Command >>
C-i				sgml-indent-or-tab
C-z				<< html-helper-base-map >>
M-tab			sgml-complete
M-return		tempo-template-html-paragraph
M-iso-left-tab	 tempo-complete-tag
M-C-space		sgml-mark-element
M-C-@			sgml-mark-element
M-C-a			sgml-beginning-of-element
M-C-b			sgml-backward-element
M-C-d			sgml-down-element
M-C-e			sgml-end-of-element
M-C-f			sgml-forward-element
M-C-h			sgml-mark-current-element
M-C-i			sgml-complete
M-C-k			sgml-kill-element
M-C-m			tempo-template-html-paragraph
M-C-t			sgml-transpose-element
M-C-u			sgml-backward-up-element

C-c return		tempo-template-html-line-break
C-c space		tempo-template-html-nonbreaking-space
C-c "			tempo-template-html-quotation-mark
C-c #			tempo-template-html-ascii-code
C-c $			tempo-template-html-registered
C-c &			tempo-template-html-ampersand
C-c -			tempo-template-html-soft-hyphen
C-c <			tempo-template-html-less-than
C-c =			tempo-template-html-horizontal-line
C-c >			tempo-template-html-greater-than
C-c @			tempo-template-html-copyright
C-c C-m			tempo-template-html-line-break

C-z -			tempo-template-html-strikethru
C-z 1			tempo-template-html-header-1
C-z 2			tempo-template-html-header-2
C-z 3			tempo-template-html-header-3
C-z 4			tempo-template-html-header-4
C-z 5			tempo-template-html-header-5
C-z 6			tempo-template-html-header-6
C-z a			tempo-template-html-applet
C-z b			tempo-template-html-base-font-size
C-z c			tempo-template-html-font-color
C-z d			tempo-template-html-definition
C-z e			tempo-template-html-emphasized
C-z g			html-insert-mailto-reference-from-click
C-z h			tempo-template-html-hyperlink
C-z i			html-helper-smart-insert-item
C-z k			tempo-template-html-keyboard-input
C-z n			tempo-template-html-link-target
C-z o			tempo-template-html-italic
C-z p			tempo-template-html-superscript
C-z q			tempo-template-html-blockquote
C-z r			tempo-template-html-citation
C-z s			tempo-template-html-font-size
C-z t			tempo-template-html-fixed
C-z u			tempo-template-html-underline
C-z v			tempo-template-html-variable
C-z x			tempo-template-html-sample
C-z C-z			suspend-or-iconify-emacs

C-c tab			sgml-add-element-to-element
C-c return		sgml-split-element
C-c #			sgml-make-character-reference
C-c +			sgml-insert-attribute
C-c -			sgml-untag-element
C-c /			sgml-insert-end-tag
C-c <			sgml-insert-tag
C-c =			sgml-change-element-name
C-c C-a			sgml-edit-attributes
C-c C-c			sgml-show-context
C-c C-d			sgml-next-data-field
C-c C-e			sgml-insert-element
C-c C-f			<< Prefix Command >>
C-c C-i			sgml-add-element-to-element
C-c C-k			sgml-kill-markup
C-c C-m			sgml-split-element
C-c C-n			sgml-up-element
C-c C-o			sgml-next-trouble-spot
C-c C-p			sgml-load-doctype
C-c C-q			sgml-fill-element
C-c C-r			sgml-tag-region
C-c C-s			sgml-show-structure
C-c C-t			sgml-show-current-element-type
C-c C-u			<< Prefix Command >>
C-c C-v			sgml-validate
C-c C-w			sgml-what-element
C-c C-z			sgml-trim-and-leave-element

C-c C-f C-e		sgml-fold-element
C-c C-f C-r		sgml-fold-region
C-c C-f C-s		sgml-fold-subelement
C-c C-f C-x		sgml-expand-element

C-c C-u return	 sgml-custom-markup
C-c C-u C-a		sgml-unfold-all
C-c C-u C-d		sgml-custom-dtd
C-c C-u C-e		sgml-unfold-element
C-c C-u C-l		sgml-unfold-line
C-c C-u C-m		sgml-custom-markup



In addition to any hooks its parent mode `sgml-mode' might have run,
this mode runs the hook `html-mode-hook', as the final step
during initialization.

----

Filladapt minor mode (indicator Filladapt):
Toggle Filladapt minor mode.
With arg, turn Filladapt mode on iff arg is positive.  When
Filladapt mode is enabled, auto-fill-mode and the fill-paragraph
command are both smarter about guessing a proper fill-prefix and
finding paragraph boundaries when bulleted and indented lines and
paragraphs are used.

----

Pending-Delete minor mode (indicator PenDel):
Toggle Pending Delete minor mode.
When the pending delete is on, typed text replaces the selection.
With a positive argument, turns it on.
With a non-positive argument, turns it off.

----

Flyspell minor mode (indicator Fly):
Minor mode performing on-the-fly spelling checking.
Ispell is automatically spawned on background for each entered words.
The default flyspell behavior is to highlight incorrect words.
With no argument, this command toggles Flyspell mode.
With a prefix argument ARG, turn Flyspell minor mode on iff ARG is 
positive.

Bindings:
M-$: correct words (using Ispell).
M-x flyspell-auto-correct-word: automatically correct word.
M-x flyspell-auto-correct-previous-word: automatically correct the last 
misspelled word.
M-x flyspell-correct-word (or down-mouse-2): popup correct words.

Hooks:
This runs `flyspell-mode-hook' after flyspell is entered.

Remark:
`flyspell-mode' uses `ispell-mode'.  Thus all Ispell options are
valid.  For instance, a personal dictionary can be used by
invoking `ispell-change-dictionary'.

Consider using the `ispell-parser' to check your text.  For instance
consider adding:
(add-hook 'tex-mode-hook (function (lambda () (setq ispell-parser 
'tex))))
in your .emacs file.

M-x flyspell-region checks all words inside a region.
M-x flyspell-buffer checks the whole buffer.

----

Font-Lock minor mode (indicator Font):
Toggle Font Lock Mode.
With arg, turn font-lock mode on if and only if arg is positive.

When Font Lock mode is enabled, text is fontified as you type it:

  - Comments are displayed in `font-lock-comment-face';
  - Strings are displayed in `font-lock-string-face';
  - Documentation strings (in Lisp-like languages) are displayed in
    `font-lock-doc-string-face';
  - Language keywords ("reserved words") are displayed in
    `font-lock-keyword-face';
  - Function names in their defining form are displayed in
    `font-lock-function-name-face';
  - Variable names in their defining form are displayed in
    `font-lock-variable-name-face';
  - Type names are displayed in `font-lock-type-face';
  - References appearing in help files and the like are displayed
    in `font-lock-reference-face';
  - Preprocessor declarations are displayed in
   `font-lock-preprocessor-face';

    and

  - Certain other expressions are displayed in other faces according
    to the value of the variable `font-lock-keywords'.

Where modes support different levels of fontification, you can use the 
variable
`font-lock-maximum-decoration' to specify which level you generally 
prefer.
When you turn Font Lock mode on/off the buffer is fontified/defontified, 
though
fontification occurs only if the buffer is less than 
`font-lock-maximum-size'.
To fontify a buffer without turning on Font Lock mode, and regardless of 
buffer
size, you can use M-x font-lock-fontify-buffer.

See the variable `font-lock-keywords' for customization.

----

Column-Number minor mode (indicator):
Toggle Column Number mode.
With arg, enable Column Number mode if arg is positive, else disable.
When Column Number mode is enabled, the column number appears
in the mode line.

----

Line-Number minor mode (indicator):
Toggle Line Number mode.
With arg, enable Line Number mode if arg is positive, else disable.
When Line Number mode is enabled, the line number appears
in the mode line.

----

auto-fill-function minor mode (indicator Fill):
Automatically break line at a previous space, in insertion of text.

----

Abbrev minor mode (indicator Abbrev):
Toggle abbrev mode.
With argument ARG, enable abbrev mode if ARG is positive, else disable.
In abbrev mode, inserting an abbreviation causes it to expand
and be replaced by its expansion.

----

>
> Note that it's not just the regexp calls, but the syntactic
> fontification as well.  What are the values of
> font-lock-fontify-region-function and font-lock-fontify-buffer-function
> in that buffer?

`font-lock-fontify-region-function' is a variable declared in Lisp.
   -- loaded from "font-lock"

Value: font-lock-default-fontify-region

`font-lock-fontify-buffer-function' is a variable declared in Lisp.
   -- loaded from "font-lock"

Value: font-lock-default-fontify-buffer


>
> _______________________________________________
> XEmacs-Beta mailing list
> XEmacs-Beta at xemacs.org
> http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-beta
>



-- 
Dr. Robert Delius Royar                   Associate Professor of English
Morehead State University                             Morehead, Kentucky



More information about the XEmacs-Beta mailing list