1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-07 15:21:46 +00:00

(icon-imenu-generic-expression): Improved regexp.

(icon-font-lock-keywords-1): Improved regexps.
(icon-font-lock-keywords-2): Likewise.
(icon-mode): Don't set font-lock-comment-start-regexp via
font-lock-defaults; it is not needed anymore.

(icon-imenu-generic-expression): Improved regexp.
(icon-mode): Don't use pushnew.
This commit is contained in:
Richard M. Stallman 1997-06-16 23:13:12 +00:00
parent 1036798c64
commit b0edcc39e0

View File

@ -126,7 +126,7 @@ when the TAB command is used."
:group 'icon) :group 'icon)
(defvar icon-imenu-generic-expression (defvar icon-imenu-generic-expression
'((nil "^[ \t]*procedure[ \t]*\\(\\sw+\\)[ \t]*(" 1)) '((nil "^[ \t]*procedure[ \t]+\\(\\sw+\\)[ \t]*(" 1))
"Imenu expression for Icon mode. See `imenu-generic-expression'.") "Imenu expression for Icon mode. See `imenu-generic-expression'.")
@ -193,20 +193,21 @@ with no args, if that value is non-nil."
(make-local-variable 'font-lock-defaults) (make-local-variable 'font-lock-defaults)
(setq font-lock-defaults (setq font-lock-defaults
'((icon-font-lock-keywords '((icon-font-lock-keywords
icon-font-lock-keywords-1 icon-font-lock-keywords-1 icon-font-lock-keywords-2)
icon-font-lock-keywords-2
)
nil nil ((?_ . "w")) beginning-of-defun nil nil ((?_ . "w")) beginning-of-defun
(font-lock-comment-start-regexp . "#") ;; Obsoleted by Emacs 19.35 parse-partial-sexp's COMMENTSTOP.
;(font-lock-comment-start-regexp . "#")
(font-lock-mark-block-function . mark-defun))) (font-lock-mark-block-function . mark-defun)))
;; imenu support ;; imenu support
(make-local-variable 'imenu-generic-expression) (make-local-variable 'imenu-generic-expression)
(setq imenu-generic-expression icon-imenu-generic-expression) (setq imenu-generic-expression icon-imenu-generic-expression)
;; hideshow support ;; hideshow support
;; we start from the assertion that `hs-special-modes-alist' is autoloaded. ;; we start from the assertion that `hs-special-modes-alist' is autoloaded.
(pushnew '(icon-mode "\\<procedure\\>" "\\<end\\>" nil (unless (assq 'icon-mode hs-special-modes-alist)
icon-forward-sexp-function) (setq hs-special-modes-alist
hs-special-modes-alist :test 'equal) (cons '(icon-mode "\\<procedure\\>" "\\<end\\>" nil
icon-forward-sexp-function)
hs-special-modes-alist)))
(run-hooks 'icon-mode-hook)) (run-hooks 'icon-mode-hook))
;; This is used by indent-for-comment to decide how much to ;; This is used by indent-for-comment to decide how much to
@ -619,7 +620,7 @@ Returns nil if line starts inside a string, t if in a comment."
;; Fontify procedure name definitions. ;; Fontify procedure name definitions.
'("^[ \t]*\\(procedure\\)[ \t]*\\(\\sw+\\)[ \t]*(" '("^[ \t]*\\(procedure\\)[ \t]*\\(\\sw+\\)[ \t]*("
(1 font-lock-builtin-face) (2 font-lock-function-name-face nil t)))) (1 font-lock-builtin-face) (2 font-lock-function-name-face nil t))))
"Subdued level highlighting for `icon-mode'.") "Subdued level highlighting for Icon mode.")
(defconst icon-font-lock-keywords-2 (defconst icon-font-lock-keywords-2
(append (append
@ -674,10 +675,9 @@ Returns nil if line starts inside a string, t if in a comment."
font-lock-variable-name-face))))) font-lock-variable-name-face)))))
(cons ;; $define $elif $ifdef $ifdef $ifndef (cons ;; $define $elif $ifdef $ifdef $ifndef
(concat (concat "^"
"^" (regexp-opt'("$define" "$elif" "$ifdef" "$ifndef" "$undef") t)
(regexp-opt'("$define" "$elif" "$ifdef" "$ifdef" "$ifndef" "$undef") t) "\\>[ \t]*\\([^ \t\n]+\\)?")
"[ \t]+\\([^ \t\n]+\\)")
'((1 font-lock-builtin-face) '((1 font-lock-builtin-face)
(4 font-lock-variable-name-face nil t))) (4 font-lock-variable-name-face nil t)))
(cons ;; $dump $endif $else $include (cons ;; $dump $endif $else $include
@ -685,9 +685,10 @@ Returns nil if line starts inside a string, t if in a comment."
"^" (regexp-opt'("$dump" "$endif" "$else" "$include") t) "\\>" ) "^" (regexp-opt'("$dump" "$endif" "$else" "$include") t) "\\>" )
'font-lock-builtin-face) 'font-lock-builtin-face)
(cons ;; $warning $error (cons ;; $warning $error
(concat "^" (regexp-opt '("$warning" "$error") t) "[ \t]+\\([^\n]+\\)") (concat "^" (regexp-opt '("$warning" "$error") t)
'((1 font-lock-builtin-face) (3 font-lock-warning-face nil t)))))) "\\>[ \t]*\\(.+\\)?")
"Gaudy level highlighting for `icon-mode'.") '((1 font-lock-builtin-face) (3 font-lock-warning-face nil t))))))
"Gaudy level highlighting for Icon mode.")
(defvar icon-font-lock-keywords icon-font-lock-keywords-1 (defvar icon-font-lock-keywords icon-font-lock-keywords-1
"Default expressions to highlight in `icon-mode'.") "Default expressions to highlight in `icon-mode'.")