help-emacs-windows
[Top][All Lists]
Advanced

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

Re: [h-e-w] fontifying message taking over minibuffer


From: Stephen Leake
Subject: Re: [h-e-w] fontifying message taking over minibuffer
Date: 22 Jul 2002 13:38:01 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Chris Lott <address@hidden> writes:

(This is an old post; I've been on vacation)

> When using HTML-helper mode (3.0.4jolly) with emacs 21.2.1 every time
> I use a command that prompts for values (such as C-c C-a l), the area
> prompting for a value is overwritten with the message:
> 
> "fontifying filename.html... (Attributes ........)"
> 
> if I type something, the message disappears and I can fill in the
> href, etc... but it is annoying since I don't always know that I am
> being prompted for something...

I had a similar complaint. I solved it by deleting the PHP/ASP stuff
from html-helper-font-lock-keywords. There does not seem to be an easy
way to do this; I just copied the whole value and edited it:

;; copied from html-helper-mode.el; delete PHP/ASP stuff
(setq html-helper-font-lock-keywords
  (let (;; Titles and H1's, like function defs.
        ;;   We allow for HTML 3.0 attributes, like `<h1 align=center>'.
        (tword "\\(h1\\|title\\)\\([ \t\n]+[^>]+\\)?")
        ;; Names of tags to boldify.
        (bword "\\(b\\|h[2-4]\\|strong\\)\\([ \t\n]+[^>]+\\)?")
        ;; Names of tags to italify.
        (iword "\\(address\\|cite\\|em\\|i\\|var\\)\\([ \t\n]+[^>]+\\)?")
        ;; Regexp to match shortest sequence that surely isn't a bold end.
        ;; We simplify a bit by extending "</strong>" to "</str.*".
        ;; Do similarly for non-italic and non-title ends.
        (not-bend (concat "\\([^<%?]\\|<\\([^/]\\|/\\([^bhs]\\|"
                          "b[^>]\\|"
                          "h\\([^2-4]\\|[2-4][^>]\\)\\|"
                          "s\\([^t]\\|t[^r]\\)\\)\\)\\)"))
        (not-iend (concat "\\([^<%?]\\|<\\([^/]\\|/\\([^aceiv]\\|"
                          "a\\([^d]\\|d[^d]\\)\\|"
                          "c\\([^i]\\|i[^t]\\)\\|"
                          "e\\([^m]\\|m[^>]\\)\\|"
                          "i[^>]\\|"
                          "v\\([^a]\\|a[^r]\\)\\)\\)\\)"))
        (not-tend (concat "\\([^<%?]\\|<\\([^/]\\|/\\([^ht]\\|"
                          "h[^1]\\|t\\([^i]\\|i[^t]\\)\\)\\)\\)")))
    (list ; Avoid use of `keep', since XEmacs will treat it the same as `t'.
     ;; First fontify the text of a HREF anchor.  It may be overridden later.
     ;; Anchors in headings will be made bold, for instance
     '("<a\\s-+href[^>]*>\\([^>]+\\)</a>"
      1 font-lock-warning-face t)
     ;; Titles and level 1 headings (anchors do sometimes appear in h1's)
     (list (concat "<" tword ">\\(" not-tend "*\\)</\\1>")
           0 'font-lock-function-name-face t)
     ;; Underline is rarely used. Only handle it when no tags inside.
     '("<u>\\([^<]*\\)</u>" 1 html-helper-underline-face t)
     ;; Forms, anchors & images (also fontify strings inside)
     '("<\\(i\\(mg\\|nput\\)\|a\\)\\>[^>\n]*>"
       0  font-lock-constant-face t)
     ;; Any tag, general rule, just after bold/italic stuff.
     ;; w3 org says that a tag is <element-name> not < element-name>
     '("\\(<[^%a=> \t][^>]*>\\)" 1 font-lock-function-name-face t)
     '("\\(<[^%a=> \t][^>\n]*>\\)" 1 html-tag-face t)
     ;; Large-scale structure keywords (like "program" in Fortran).
     ;;   "<html>" "</html>" "<body>" "</body>" "<head>" "</head>" "</form>"
     '("\\(</?\\(body\\|form\\|h\\(ead\\|tml\\)\\)[^>\n]*>\\)"
       0 font-lock-variable-name-face t)
     ;; SGML things like <!DOCTYPE ...> with possible <!ENTITY...> inside.
     '("<![a-z]+\\>[^<>]*\\(<[^>]*>[^<>]*\\)*>"
       0 font-lock-keyword-face t)
     '("<[?%]=\\([^%?]\\|[?%][^>]\\)*[%?]>" 0 font-lock-builtin-face t t)
     ;; This one is to pick
     ;; Tag pairs like <b>...</b> etc.
     ;; Cunning repeated fontification to handle common cases of overlap.
     ;; Bold complex --- possibly with arbitrary other non-bold stuff inside.
     (list (concat "<" bword ">\\(" not-bend "*\\)</\\1>")
           0 'html-helper-bold-face t)
     ;; Italic complex --- possibly with arbitrary non-italic kept inside.
     (list (concat "<" iword ">\\(" not-iend "*\\)</\\1>")
           0 'html-helper-italic-face t)
     ;; Bold simple --- first fontify bold regions with no tags inside.
     (list (concat "<" bword ">\\("  "[^<]"  "*\\)</\\1>")
           0 'html-helper-bold-face t)
     ; string stuff is pretty weird with asp. You can have strings
     ; containing asp code containing strings and empty
     ; strings. Replaced original [^\"] with this one...
     '("[=(&]?[ 
\t\n]*\\(\"[^\"\n]*<%[^\"\n]*\\(\"[^\"\n]*\"\\)[^\"\n]*%>[^\"\n]*\\)" 1 
font-lock-string-face t)
     '("[=(&]?[ \t\n]*\\(\"[^\"\n]*\"\\)"  1 font-lock-string-face t)
     ;; HTML special characters
     '("&[a-zA-Z0-9#]+;" 0 font-lock-warning-face t)
     ; after painting strings, you have to restore asp stuff inside strings
      '("\\(<%=\\s*\\)" 1 font-lock-builtin-face t)
      '("\\(\")[^\"\n]*%>\\)" 1 font-lock-builtin-face t)
      '("\\(<%=[^%]*%>\\)" 1 font-lock-builtin-face t)
      '("\\(<\\?=\\s*\\)" 1 font-lock-builtin-face t)
      '("\\(\")[^\"\n]*\\?>\\)" 1 font-lock-builtin-face t)
      '("\\(<\\?=[^%]*\\?>\\)" 1 font-lock-builtin-face t)
      ;; That's krazy, strings higlight matches ) too, so i paint
      ;; parantheses...
      '("\\(<%\\|\\s(\\)" 1 font-lock-function-name-face t)
      '("\\(\\s)\\|%>\\)" 1 font-lock-function-name-face t)
      '("\\(<\\?\\|\\s(\\)" 1 font-lock-function-name-face t)
      '("\\(\\s)\\|\\?>\\)" 1 font-lock-function-name-face t)
      '("\\([\"]\\)" 0 font-lock-string-face t)
     ;; Comment declarations according to the HTML 2.0 spec at
     ;; <URL:http://www.w3.org/pub/WWW/MarkUp/html-spec/html-spec_3.html>.
     ;; Usually `<!-- ... -->', but also e.g the single, complete declaration
     ;; `<!--c1--  -- c2 -- -->c3 (still comment) ----c4- c4--   >'.
     ;; Note that e.g. Netscape 3.01 Gold doesn't fully live up to the spec.
    '("<!\\(--\\([^-]\\|-[^-]\\)*--\\s-*\\)*>" 0 font-lock-comment-face t))))



-- 
-- Stephe




reply via email to

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