30 |
;; not only source code highlighting, but also Info, RMAIL, VM, gnus... |
;; not only source code highlighting, but also Info, RMAIL, VM, gnus... |
31 |
;; Hilit19 knows (or thinks it knows) how to highlight emacs buffers in |
;; Hilit19 knows (or thinks it knows) how to highlight emacs buffers in |
32 |
;; about 25 different modes. |
;; about 25 different modes. |
33 |
;; |
;; |
34 |
;; WHERE TO GET THE LATEST VERSIONS OF HILIT19.EL (beta and release): |
;; WHERE TO GET THE LATEST VERSIONS OF HILIT19.EL (beta and release): |
35 |
;; |
;; |
36 |
;; http://hackvan.com/pub/stig/src/elisp/ |
;; http://hackvan.com/pub/stig/src/elisp/ |
55 |
;; GENERAL OVERVIEW |
;; GENERAL OVERVIEW |
56 |
;; |
;; |
57 |
;; This package installs numerous hooks to colorfully highlight your |
;; This package installs numerous hooks to colorfully highlight your |
58 |
;; source code buffers as well as mail and news buffers. Most |
;; source code buffers as well as mail and news buffers. Most |
59 |
;; programming languages have predefined highlighting patterns. |
;; programming languages have predefined highlighting patterns. |
60 |
;; Just load hilit19 and files will be automatically highlighted as |
;; Just load hilit19 and files will be automatically highlighted as |
61 |
;; they're loaded. |
;; they're loaded. |
69 |
;; |
;; |
70 |
;; Hilit19 can build faces by examining the names that you give to them |
;; Hilit19 can build faces by examining the names that you give to them |
71 |
;; For example, green/black-bold-italic-underline would be created as |
;; For example, green/black-bold-italic-underline would be created as |
72 |
;; a face with a green foreground, and a black background, using a |
;; a face with a green foreground, and a black background, using a |
73 |
;; bold-italic font...with underlining for good measure. |
;; bold-italic font...with underlining for good measure. |
74 |
;; |
;; |
75 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
76 |
;; |
;; |
77 |
;; SETUP -- In your .emacs: |
;; SETUP -- In your .emacs: |
78 |
;; |
;; |
79 |
;; |
;; |
80 |
;; (cond (window-system |
;; (cond (window-system |
81 |
;; (setq hilit-mode-enable-list '(not text-mode) |
;; (setq hilit-mode-enable-list '(not text-mode) |
82 |
;; hilit-background-mode 'light |
;; hilit-background-mode 'light |
83 |
;; hilit-inhibit-hooks nil |
;; hilit-inhibit-hooks nil |
84 |
;; hilit-inhibit-rebinding nil) |
;; hilit-inhibit-rebinding nil) |
85 |
;; |
;; |
86 |
;; (require 'hilit19) |
;; (require 'hilit19) |
87 |
;; )) |
;; )) |
88 |
;; |
;; |
89 |
;; If you like font-lock-mode and want to use both packages, then you can |
;; If you like font-lock-mode and want to use both packages, then you can |
90 |
;; disable hilit for the modes in which you want to use font-lock by listing |
;; disable hilit for the modes in which you want to use font-lock by listing |
91 |
;; said modes in hilit-mode-enable-list. |
;; said modes in hilit-mode-enable-list. |
92 |
;; |
;; |
93 |
;; (hilit-translate type 'RoyalBlue ; enable highlighting in C/C++ |
;; (hilit-translate type 'RoyalBlue ; enable highlighting in C/C++ |
94 |
;; string nil) ; disable string highlighting |
;; string nil) ; disable string highlighting |
95 |
;; |
;; |
293 |
;; |
;; |
294 |
|
|
295 |
;;;;;; AND THIS CAN BE APPLIED TO VM 5.33L_19 |
;;;;;; AND THIS CAN BE APPLIED TO VM 5.33L_19 |
296 |
;; |
;; |
297 |
;; *** ../site/vm5.33L_19/vm-summary.el Fri Jun 4 22:17:11 1993 |
;; *** ../site/vm5.33L_19/vm-summary.el Fri Jun 4 22:17:11 1993 |
298 |
;; --- ./vm-summary.el Tue Jun 22 16:39:30 1993 |
;; --- ./vm-summary.el Tue Jun 22 16:39:30 1993 |
299 |
;; *************** |
;; *************** |
303 |
;; (forward-char -2) |
;; (forward-char -2) |
304 |
;; ! (and w vm-auto-center-summary (vm-auto-center-summary)))) |
;; ! (and w vm-auto-center-summary (vm-auto-center-summary)))) |
305 |
;; (and old-window (select-window old-window))))))) |
;; (and old-window (select-window old-window))))))) |
306 |
;; |
;; |
307 |
;; (defun vm-mark-for-display-update (message) |
;; (defun vm-mark-for-display-update (message) |
308 |
;; --- 152,159 ---- |
;; --- 152,159 ---- |
309 |
;; (insert "->") |
;; (insert "->") |
312 |
;; ! (and w vm-auto-center-summary (vm-auto-center-summary)) |
;; ! (and w vm-auto-center-summary (vm-auto-center-summary)) |
313 |
;; ! (run-hooks 'vm-summary-pointer-hook))) |
;; ! (run-hooks 'vm-summary-pointer-hook))) |
314 |
;; (and old-window (select-window old-window))))))) |
;; (and old-window (select-window old-window))))))) |
315 |
;; |
;; |
316 |
;; (defun vm-mark-for-display-update (message) |
;; (defun vm-mark-for-display-update (message) |
317 |
;; |
;; |
318 |
;;;;;; |
;;;;;; |
319 |
|
|
320 |
;;; Code: |
;;; Code: |
468 |
(keyword RoyalBlue cyan bold-italic) |
(keyword RoyalBlue cyan bold-italic) |
469 |
(label red-underline orange-underlined underline) |
(label red-underline orange-underlined underline) |
470 |
(string grey40 orange underline) |
(string grey40 orange underline) |
471 |
|
|
472 |
;; some further faces for Ada |
;; some further faces for Ada |
473 |
(struct black-bold white-bold bold) |
(struct black-bold white-bold bold) |
474 |
(glob-struct magenta Plum1 default-bold-underline) |
(glob-struct magenta Plum1 default-bold-underline) |
475 |
(named-param DarkGoldenrod Goldenrod underline) |
(named-param DarkGoldenrod Goldenrod underline) |
476 |
|
|
477 |
;; and another one for LaTeX |
;; and another one for LaTeX |
478 |
(crossref DarkGoldenrod Goldenrod underline) |
(crossref DarkGoldenrod Goldenrod underline) |
479 |
(formula Goldenrod DarkGoldenrod underline) |
(formula Goldenrod DarkGoldenrod underline) |
480 |
|
|
481 |
;; compilation buffers |
;; compilation buffers |
482 |
(active-error default/pink-bold default/DeepPink-bold default-underline) |
(active-error default/pink-bold default/DeepPink-bold default-underline) |
483 |
(error red-bold yellow bold) |
(error red-bold yellow bold) |
485 |
|
|
486 |
;; Makefiles (some faces borrowed from C/C++ too) |
;; Makefiles (some faces borrowed from C/C++ too) |
487 |
(rule blue-bold-underline cyan-underline default-bold-underline) |
(rule blue-bold-underline cyan-underline default-bold-underline) |
488 |
|
|
489 |
;; VM, GNUS and Text mode |
;; VM, GNUS and Text mode |
490 |
(msg-subject blue-bold yellow bold) |
(msg-subject blue-bold yellow bold) |
491 |
(msg-from purple-bold green bold) |
(msg-from purple-bold green bold) |
512 |
(dired-ignored ForestGreen moccasin nil) |
(dired-ignored ForestGreen moccasin nil) |
513 |
(dired-deleted red-bold-italic orange bold-italic) |
(dired-deleted red-bold-italic orange bold-italic) |
514 |
(dired-marked purple Plum1 nil) |
(dired-marked purple Plum1 nil) |
515 |
|
|
516 |
;; Info-mode, and jargon-mode.el and prep.ai.mit.edu:/pub/gnu/jargon* |
;; Info-mode, and jargon-mode.el and prep.ai.mit.edu:/pub/gnu/jargon* |
517 |
(jargon-entry blue-bold cyan bold) |
(jargon-entry blue-bold cyan bold) |
518 |
(jargon-xref purple-bold Plum1 italic) |
(jargon-xref purple-bold Plum1 italic) |
557 |
cmdl))) |
cmdl))) |
558 |
(cons 'progn cmdl))) |
(cons 'progn cmdl))) |
559 |
|
|
560 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
561 |
;; This function actually translates and then creates the faces... |
;; This function actually translates and then creates the faces... |
562 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
563 |
|
|
564 |
(defun hilit-lookup-face-create (face &optional force) |
(defun hilit-lookup-face-create (face &optional force) |
565 |
"Get a FACE, or create it if it doesn't exist. In order for it to |
"Get a FACE, or create it if it doesn't exist. In order for it to |
589 |
(basefont (cdr (assq 'font (frame-parameters frame)))) |
(basefont (cdr (assq 'font (frame-parameters frame)))) |
590 |
error fgcolor bgcolor) |
error fgcolor bgcolor) |
591 |
(cond |
(cond |
592 |
((or (null face) |
((or (null face) |
593 |
(memq face hilit-predefined-face-list)) |
(memq face hilit-predefined-face-list)) |
594 |
;; do nothing if the face is nil or if it's predefined. |
;; do nothing if the face is nil or if it's predefined. |
595 |
) |
) |
616 |
(and (match-beginning 1) "#") |
(and (match-beginning 1) "#") |
617 |
(substring fn (match-beginning 2) (match-end 2))) |
(substring fn (match-beginning 2) (match-end 2))) |
618 |
fn (substring fn (match-end 0)))) |
fn (substring fn (match-end 0)))) |
619 |
|
|
620 |
(and (string= "default" fgcolor) (setq fgcolor nil)) |
(and (string= "default" fgcolor) (setq fgcolor nil)) |
621 |
(and (string= "default" bgcolor) (setq bgcolor nil)) |
(and (string= "default" bgcolor) (setq bgcolor nil)) |
622 |
|
|
623 |
;; catch errors if we can't allocate the color(s) |
;; catch errors if we can't allocate the color(s) |
624 |
(condition-case nil |
(condition-case nil |
625 |
(progn (and fgcolor (set-face-foreground 'scratch-face fgcolor)) |
(progn (and fgcolor (set-face-foreground 'scratch-face fgcolor)) |
705 |
(cond ((null patterns) |
(cond ((null patterns) |
706 |
(setq patterns (cdr (assq major-mode hilit-patterns-alist)))) |
(setq patterns (cdr (assq major-mode hilit-patterns-alist)))) |
707 |
((symbolp patterns) |
((symbolp patterns) |
708 |
(setq patterns (cdr (assq patterns hilit-patterns-alist))))) |
(setq patterns (cdr (assq patterns hilit-patterns-alist))))) |
709 |
;; txt prop: (setq patterns (reverse patterns)) |
;; txt prop: (setq patterns (reverse patterns)) |
710 |
(let ((case-fold-search (car patterns)) |
(let ((case-fold-search (car patterns)) |
711 |
(prio (1- (length patterns))) |
(prio (1- (length patterns))) |
725 |
(if (not face) ; skipped if nil |
(if (not face) ; skipped if nil |
726 |
nil |
nil |
727 |
(or quietly hilit-quietly |
(or quietly hilit-quietly |
728 |
(message "highlighting %d: %s%s" prio pstart |
(message "highlighting %d: %s%s" prio pstart |
729 |
(if (stringp pend) (concat " ... " pend) ""))) |
(if (stringp pend) (concat " ... " pend) ""))) |
730 |
(goto-char (point-min)) |
(goto-char (point-min)) |
731 |
(condition-case msg |
(condition-case msg |
732 |
(cond |
(cond |
733 |
((symbolp pstart) |
((symbolp pstart) |
734 |
;; inner loop -- special function to find pattern |
;; inner loop -- special function to find pattern |
735 |
(let (region) |
(let (region) |
799 |
|
|
800 |
;; Well, I want to remove this function...there's one sure way to find out if |
;; Well, I want to remove this function...there's one sure way to find out if |
801 |
;; anyone uses it or not...and that's to comment it out. |
;; anyone uses it or not...and that's to comment it out. |
802 |
;; |
;; |
803 |
;; (defun hilit-toggle-highlight (arg) |
;; (defun hilit-toggle-highlight (arg) |
804 |
;; "Locally toggle highlighting. With arg, forces highlighting off." |
;; "Locally toggle highlighting. With arg, forces highlighting off." |
805 |
;; (interactive "P") |
;; (interactive "P") |
835 |
\t^U \\[hilit-repaint-command]\trepaint entire buffer |
\t^U \\[hilit-repaint-command]\trepaint entire buffer |
836 |
\t^U - \\[hilit-repaint-command]\trepaint visible portion of buffer |
\t^U - \\[hilit-repaint-command]\trepaint visible portion of buffer |
837 |
\t^U n \\[hilit-repaint-command]\trepaint n lines to either side of point" |
\t^U n \\[hilit-repaint-command]\trepaint n lines to either side of point" |
838 |
(interactive "P") |
(interactive "P") |
839 |
(let (st en quietly) |
(let (st en quietly) |
840 |
(or arg (setq arg hilit-auto-rehighlight)) |
(or arg (setq arg hilit-auto-rehighlight)) |
841 |
(cond ((or (eq arg 'visible) (eq arg '-)) |
(cond ((or (eq arg 'visible) (eq arg '-)) |
878 |
|
|
879 |
;;; this line highlighting stuff is untested. play with it only if you feel |
;;; this line highlighting stuff is untested. play with it only if you feel |
880 |
;;; adventurous...don't ask me to fix it...though you're welcome to. -- Stig |
;;; adventurous...don't ask me to fix it...though you're welcome to. -- Stig |
881 |
;; |
;; |
882 |
;; (defun hilit-rehighlight-line-quietly (&rest args) |
;; (defun hilit-rehighlight-line-quietly (&rest args) |
883 |
;; "Quietly rehighlight just this line. |
;; "Quietly rehighlight just this line. |
884 |
;; Useful as an after change hook in VM/gnus summary buffers and dired buffers. |
;; Useful as an after change hook in VM/gnus summary buffers and dired buffers. |
887 |
;; (push-mark nil t) |
;; (push-mark nil t) |
888 |
;; (hilit-rehighlight-yank-region) |
;; (hilit-rehighlight-yank-region) |
889 |
;; (and orig-achange-function (apply orig-achange-function args)))) |
;; (and orig-achange-function (apply orig-achange-function args)))) |
890 |
;; |
;; |
891 |
;; (defun hilit-install-line-hooks () |
;; (defun hilit-install-line-hooks () |
892 |
;; (make-variable-buffer-local 'after-change-function) |
;; (make-variable-buffer-local 'after-change-function) |
893 |
;; (make-local-variable 'orig-achange-function) |
;; (make-local-variable 'orig-achange-function) |
897 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
898 |
;; Wysiwyg Stuff... take it away and build a whole package around it! |
;; Wysiwyg Stuff... take it away and build a whole package around it! |
899 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
900 |
;; |
;; |
901 |
;; ; For the Jargon-impaired, WYSIWYG === What You See Is What You Get |
;; ; For the Jargon-impaired, WYSIWYG === What You See Is What You Get |
902 |
;; ; Sure, it sucks to type. Oh, well. |
;; ; Sure, it sucks to type. Oh, well. |
903 |
;; (defun hilit-wysiwyg-replace () |
;; (defun hilit-wysiwyg-replace () |
904 |
;; "Replace overstruck text with normal text that's been overlaid with the |
;; "Replace overstruck text with normal text that's been overlaid with the |
905 |
;; appropriate text attribute. Suitable for a find-file hook." |
;; appropriate text attribute. Suitable for a find-file hook." |
906 |
;; (save-excursion |
;; (save-excursion |
907 |
;; (goto-char (point-min)) |
;; (goto-char (point-min)) |
918 |
;; (replace-match "") (forward-char)) |
;; (replace-match "") (forward-char)) |
919 |
;; )) |
;; )) |
920 |
;; (set-buffer-modified-p bmod)))) |
;; (set-buffer-modified-p bmod)))) |
921 |
;; |
;; |
922 |
;; ; is this more appropriate as a write-file-hook or a write-contents-hook? |
;; ; is this more appropriate as a write-file-hook or a write-contents-hook? |
923 |
;; (defun hilit-wysiwyg-write-repair () |
;; (defun hilit-wysiwyg-write-repair () |
924 |
;; "Replace wysiwyg overlays with overstrike text." |
;; "Replace wysiwyg overlays with overstrike text." |
942 |
;; nil) |
;; nil) |
943 |
|
|
944 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
945 |
;; Initialization. |
;; Initialization. |
946 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
947 |
|
|
948 |
(and (not hilit-inhibit-rebinding) |
(and (not hilit-inhibit-rebinding) |
949 |
(progn |
(progn |
950 |
(substitute-key-definition 'yank 'hilit-yank |
(substitute-key-definition 'yank 'hilit-yank |
951 |
(current-global-map)) |
(current-global-map)) |
952 |
(substitute-key-definition 'yank-pop 'hilit-yank-pop |
(substitute-key-definition 'yank-pop 'hilit-yank-pop |
956 |
|
|
957 |
(global-set-key [?\C-\S-l] 'hilit-repaint-command) |
(global-set-key [?\C-\S-l] 'hilit-repaint-command) |
958 |
|
|
959 |
(add-hook 'find-file-hooks 'hilit-find-file-hook t) |
(add-hook 'find-file-hook 'hilit-find-file-hook t) |
960 |
|
|
961 |
(eval-when-compile (require 'gnus)) ; no compilation gripes |
(eval-when-compile (require 'gnus)) ; no compilation gripes |
962 |
|
|
977 |
vm-show-message-hook |
vm-show-message-hook |
978 |
|
|
979 |
rmail-show-message-hook |
rmail-show-message-hook |
980 |
mail-setup-hook |
mail-setup-hook |
981 |
mh-show-mode-hook |
mh-show-mode-hook |
982 |
|
|
983 |
dired-after-readin-hook |
dired-after-readin-hook |
994 |
;;; inappropriate, but I don't know why I wanted hilit-patterns-alist to be |
;;; inappropriate, but I don't know why I wanted hilit-patterns-alist to be |
995 |
;;; reset on every reload... |
;;; reset on every reload... |
996 |
|
|
997 |
(setq hilit-patterns-alist nil) |
(setq hilit-patterns-alist nil) |
998 |
|
|
999 |
(defun hilit-associate (alist key val) |
(defun hilit-associate (alist key val) |
1000 |
"creates, or destructively replaces, the pair (key . val) in alist" |
"creates, or destructively replaces, the pair (key . val) in alist" |
1002 |
(if oldentry |
(if oldentry |
1003 |
(setcdr oldentry val) |
(setcdr oldentry val) |
1004 |
(set alist (cons (cons key val) (eval alist)))))) |
(set alist (cons (cons key val) (eval alist)))))) |
1005 |
|
|
1006 |
(defun hilit-set-mode-patterns (modelist patterns |
(defun hilit-set-mode-patterns (modelist patterns |
1007 |
&optional parse-fn case-fold) |
&optional parse-fn case-fold) |
1008 |
"Sets the default highlighting patterns for MODE to PATTERNS. |
"Sets the default highlighting patterns for MODE to PATTERNS. |
1016 |
(setcar (cdr p) 0)))) |
(setcar (cdr p) 0)))) |
1017 |
patterns) |
patterns) |
1018 |
(setq patterns (cons case-fold patterns)) |
(setq patterns (cons case-fold patterns)) |
1019 |
|
|
1020 |
(or (consp modelist) (setq modelist (list modelist))) |
(or (consp modelist) (setq modelist (list modelist))) |
1021 |
(let (ok (flip (eq (car hilit-mode-enable-list) 'not))) |
(let (ok (flip (eq (car hilit-mode-enable-list) 'not))) |
1022 |
(mapcar (function |
(mapcar (function |
1046 |
(hilit-set-mode-patterns mode (list new-pat))) |
(hilit-set-mode-patterns mode (list new-pat))) |
1047 |
(first |
(first |
1048 |
(setcdr old-patterns (cons new-pat (cdr old-patterns)))) |
(setcdr old-patterns (cons new-pat (cdr old-patterns)))) |
1049 |
(t |
(t |
1050 |
(nconc old-patterns (list new-pat))))) |
(nconc old-patterns (list new-pat))))) |
1051 |
(and (interactive-p) (hilit-rehighlight-buffer))) |
(and (interactive-p) (hilit-rehighlight-buffer))) |
1052 |
|
|
1066 |
(skip-chars-backward "\\\\") |
(skip-chars-backward "\\\\") |
1067 |
(forward-char 1) |
(forward-char 1) |
1068 |
(not (zerop (% (- en (point)) 2)))))) |
(not (zerop (% (- en (point)) 2)))))) |
1069 |
(and en (cons st en)))) |
(and en (cons st en)))) |
1070 |
|
|
1071 |
;; return types on same line... |
;; return types on same line... |
1072 |
;; ("^[a-zA-z].*\\(\\w\\|[$_]\\)+\\s *\\(\\(\\w\\|[$_]\\)+\\s *((\\|(\\)[^)]*)+" nil defun) |
;; ("^[a-zA-z].*\\(\\w\\|[$_]\\)+\\s *\\(\\(\\w\\|[$_]\\)+\\s *((\\|(\\)[^)]*)+" nil defun) |
1073 |
|
|
1074 |
;; On another note, a working pattern for grabbing function definitions for C is |
;; On another note, a working pattern for grabbing function definitions for C is |
1075 |
;; |
;; |
1076 |
;; ("^[a-zA-Z_]+.*[;{]$" nil ForestGreen) ; global defns ( start at col 1 ) |
;; ("^[a-zA-Z_]+.*[;{]$" nil ForestGreen) ; global defns ( start at col 1 ) |
1077 |
;; ("^[a-zA-Z_]+.*(" ")" defun) |
;; ("^[a-zA-Z_]+.*(" ")" defun) |
1078 |
;; ; defuns assumed to start at col 1, not with # or { |
;; ; defuns assumed to start at col 1, not with # or { |
1079 |
;; |
;; |
1080 |
;; this will make external declarations/definitions green, and function |
;; this will make external declarations/definitions green, and function |
1081 |
;; definitions the defun face. Hmmm - seems to work for me anyway. |
;; definitions the defun face. Hmmm - seems to work for me anyway. |
1082 |
|
|
1179 |
("\\(^[ \t]*[0-9]+\\|[ \t]continue[ \t\n]\\|format\\)" nil define) |
("\\(^[ \t]*[0-9]+\\|[ \t]continue[ \t\n]\\|format\\)" nil define) |
1180 |
("[ \t]\\(do\\|do[ \t]*[0-9]+\\|go[ \t]*to[ \t]*[0-9]+\\|end[ \t]*do\\|if\\|else[ \t]*if\\|then\\|else\\|end[ \t]*if\\)[ \t\n(]" nil define) |
("[ \t]\\(do\\|do[ \t]*[0-9]+\\|go[ \t]*to[ \t]*[0-9]+\\|end[ \t]*do\\|if\\|else[ \t]*if\\|then\\|else\\|end[ \t]*if\\)[ \t\n(]" nil define) |
1181 |
("[ \t]\\(call\\|program\\|subroutine\\|function\\|stop\\|return\\|end\\|include\\)[ \t\n]" nil include) |
("[ \t]\\(call\\|program\\|subroutine\\|function\\|stop\\|return\\|end\\|include\\)[ \t\n]" nil include) |
1182 |
("[ \t]\\(parameter[\t\n ]*([^)]*)\\|data\\|save\\|common[ \t\n]*/[^/]*/\\)" |
("[ \t]\\(parameter[\t\n ]*([^)]*)\\|data\\|save\\|common[ \t\n]*/[^/]*/\\)" |
1183 |
nil decl) |
nil decl) |
1184 |
("^ ." nil type) |
("^ ." nil type) |
1185 |
("implicit[ \t]*none" nil decl) |
("implicit[ \t]*none" nil decl) |
1249 |
("[^\\]\\\\(" "\\\\)" formula) ; \( \) |
("[^\\]\\\\(" "\\\\)" formula) ; \( \) |
1250 |
("[^\\]\\\\\\[" "\\\\\\]" formula) ; \[ \] |
("[^\\]\\\\\\[" "\\\\\\]" formula) ; \[ \] |
1251 |
("[^\\$]\\(\\$\\(\\$[^$]*\\$\\|[^$]*\\)\\$\\)" 1 formula) ; '$...$' or '$$...$$' |
("[^\\$]\\(\\$\\(\\$[^$]*\\$\\|[^$]*\\)\\$\\)" 1 formula) ; '$...$' or '$$...$$' |
1252 |
|
|
1253 |
;; things that bring in external files |
;; things that bring in external files |
1254 |
("\\\\\\(include\\|input\\|bibliography\\){" "}" include) |
("\\\\\\(include\\|input\\|bibliography\\){" "}" include) |
1255 |
|
|
1334 |
'( |
'( |
1335 |
(";.*" nil comment) |
(";.*" nil comment) |
1336 |
|
|
1337 |
;;; This almost works...but I think I'll stick with the parser function |
;;; This almost works...but I think I'll stick with the parser function |
1338 |
;;;("[^?]\\(\"\\(\"\\||\\([^\"]+\\|[\\]\\([\\][\\]\\)*\"\\)*\"\\)\\)" 1 string) |
;;;("[^?]\\(\"\\(\"\\||\\([^\"]+\\|[\\]\\([\\][\\]\\)*\"\\)*\"\\)\\)" 1 string) |
1339 |
(hilit-string-find ?\\ string) |
(hilit-string-find ?\\ string) |
1340 |
|
|
1352 |
'( |
'( |
1353 |
(";.*" nil comment) |
(";.*" nil comment) |
1354 |
("#|" "|#" comment) |
("#|" "|#" comment) |
1355 |
;;; This almost works...but I think I'll stick with the parser function |
;;; This almost works...but I think I'll stick with the parser function |
1356 |
;;;("[^?]\\(\"\\(\"\\||\\([^\"]+\\|[\\]\\([\\][\\]\\)*\"\\)*\"\\)\\)" 1 string) |
;;;("[^?]\\(\"\\(\"\\||\\([^\"]+\\|[\\]\\([\\][\\]\\)*\"\\)*\"\\)\\)" 1 string) |
1357 |
(hilit-string-find ?\\ string) |
(hilit-string-find ?\\ string) |
1358 |
|
|
1490 |
;; Pascal, strings are delimited with ' and an embedded quote is doubled, |
;; Pascal, strings are delimited with ' and an embedded quote is doubled, |
1491 |
;; thus string syntax would be extremely simple. However, if a string |
;; thus string syntax would be extremely simple. However, if a string |
1492 |
;; occurs within a comment, the following text is considered a string. |
;; occurs within a comment, the following text is considered a string. |
1493 |
;; |
;; |
1494 |
;; In Icon, strings are similar to C ones, but there are also charsets, |
;; In Icon, strings are similar to C ones, but there are also charsets, |
1495 |
;; delimited with simple quotes. I could not manage to use both regexps at |
;; delimited with simple quotes. I could not manage to use both regexps at |
1496 |
;; the same time. |
;; the same time. |