diff options
| author | Michaël Cadilhac | 2007-09-10 14:21:31 +0000 |
|---|---|---|
| committer | Michaël Cadilhac | 2007-09-10 14:21:31 +0000 |
| commit | 89c19c1eb7315ee885add1c570ccfc84a74e396c (patch) | |
| tree | 4798b9478c4b0070ec24e193a6c81b6f2ab8d0b1 | |
| parent | 481249ca9a59cca4e1b8a7a517ce9a8d90d70963 (diff) | |
| download | emacs-89c19c1eb7315ee885add1c570ccfc84a74e396c.tar.gz emacs-89c19c1eb7315ee885add1c570ccfc84a74e396c.zip | |
(meta-font-lock-keywords)
(font-lock-match-meta-declaration-item-and-skip-to-next)
(meta-comment-indent, meta-indent-previous-line)
(meta-indent-unfinished-line, meta-beginning-of-defun)
(meta-end-of-defun, meta-common-initialization): Handle \f.
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/progmodes/meta-mode.el | 41 |
2 files changed, 28 insertions, 19 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2fab7d98ad2..bc915b8ee05 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,11 @@ | |||
| 1 | 2007-09-10 Micha,Ak(Bl Cadilhac <michael@cadilhac.name> | 1 | 2007-09-10 Micha,Ak(Bl Cadilhac <michael@cadilhac.name> |
| 2 | 2 | ||
| 3 | * progmodes/meta-mode.el (meta-font-lock-keywords) | ||
| 4 | (font-lock-match-meta-declaration-item-and-skip-to-next) | ||
| 5 | (meta-comment-indent, meta-indent-previous-line) | ||
| 6 | (meta-indent-unfinished-line, meta-beginning-of-defun) | ||
| 7 | (meta-end-of-defun, meta-common-initialization): Handle \f. | ||
| 8 | |||
| 3 | * files.el (file-modes-char-to-who, file-modes-char-to-right) | 9 | * files.el (file-modes-char-to-who, file-modes-char-to-right) |
| 4 | (file-modes-rights-to-number): Auxiliary functions for symbolic to | 10 | (file-modes-rights-to-number): Auxiliary functions for symbolic to |
| 5 | numeric notation of file modes. | 11 | numeric notation of file modes. |
diff --git a/lisp/progmodes/meta-mode.el b/lisp/progmodes/meta-mode.el index 6b911dd1e7a..4d4ab2c8fbf 100644 --- a/lisp/progmodes/meta-mode.el +++ b/lisp/progmodes/meta-mode.el | |||
| @@ -194,42 +194,42 @@ | |||
| 194 | (list | 194 | (list |
| 195 | ;; embedded TeX code in btex ... etex | 195 | ;; embedded TeX code in btex ... etex |
| 196 | (cons (concat "\\(btex\\|verbatimtex\\)" | 196 | (cons (concat "\\(btex\\|verbatimtex\\)" |
| 197 | "[ \t]+\\(.*\\)[ \t]+" | 197 | "[ \t\f]+\\(.*\\)[ \t\f]+" |
| 198 | "\\(etex\\)") | 198 | "\\(etex\\)") |
| 199 | '((1 font-lock-keyword-face) | 199 | '((1 font-lock-keyword-face) |
| 200 | (2 font-lock-string-face) | 200 | (2 font-lock-string-face) |
| 201 | (3 font-lock-keyword-face))) | 201 | (3 font-lock-keyword-face))) |
| 202 | ;; unary macro definitions: def, vardef, let | 202 | ;; unary macro definitions: def, vardef, let |
| 203 | (cons (concat "\\<" macro-keywords-1 "\\>" | 203 | (cons (concat "\\<" macro-keywords-1 "\\>" |
| 204 | "[ \t]+\\(\\sw+\\|\\s_+\\|\\s.+\\)") | 204 | "[ \t\f]+\\(\\sw+\\|\\s_+\\|\\s.+\\)") |
| 205 | '((1 font-lock-keyword-face) | 205 | '((1 font-lock-keyword-face) |
| 206 | (2 font-lock-function-name-face))) | 206 | (2 font-lock-function-name-face))) |
| 207 | ;; binary macro defintions: <leveldef> x operator y | 207 | ;; binary macro defintions: <leveldef> x operator y |
| 208 | (cons (concat "\\<" macro-keywords-2 "\\>" | 208 | (cons (concat "\\<" macro-keywords-2 "\\>" |
| 209 | "[ \t]+\\(\\sw+\\)" | 209 | "[ \t\f]+\\(\\sw+\\)" |
| 210 | "[ \t]*\\(\\sw+\\|\\s.+\\)" | 210 | "[ \t\f]*\\(\\sw+\\|\\s.+\\)" |
| 211 | "[ \t]*\\(\\sw+\\)") | 211 | "[ \t\f]*\\(\\sw+\\)") |
| 212 | '((1 font-lock-keyword-face) | 212 | '((1 font-lock-keyword-face) |
| 213 | (2 font-lock-variable-name-face nil t) | 213 | (2 font-lock-variable-name-face nil t) |
| 214 | (3 font-lock-function-name-face nil t) | 214 | (3 font-lock-function-name-face nil t) |
| 215 | (4 font-lock-variable-name-face nil t))) | 215 | (4 font-lock-variable-name-face nil t))) |
| 216 | ;; variable declarations: numeric, pair, color, ... | 216 | ;; variable declarations: numeric, pair, color, ... |
| 217 | (cons (concat "\\<" type-keywords "\\>" | 217 | (cons (concat "\\<" type-keywords "\\>" |
| 218 | "\\([ \t]+\\(\\sw+\\)\\)*") | 218 | "\\([ \t\f]+\\(\\sw+\\)\\)*") |
| 219 | '((1 font-lock-type-face) | 219 | '((1 font-lock-type-face) |
| 220 | (font-lock-match-meta-declaration-item-and-skip-to-next | 220 | (font-lock-match-meta-declaration-item-and-skip-to-next |
| 221 | (goto-char (match-end 1)) nil | 221 | (goto-char (match-end 1)) nil |
| 222 | (1 font-lock-variable-name-face nil t)))) | 222 | (1 font-lock-variable-name-face nil t)))) |
| 223 | ;; argument declarations: expr, suffix, text, ... | 223 | ;; argument declarations: expr, suffix, text, ... |
| 224 | (cons (concat "\\<" args-keywords "\\>" | 224 | (cons (concat "\\<" args-keywords "\\>" |
| 225 | "\\([ \t]+\\(\\sw+\\|\\s_+\\)\\)*") | 225 | "\\([ \t\f]+\\(\\sw+\\|\\s_+\\)\\)*") |
| 226 | '((1 font-lock-type-face) | 226 | '((1 font-lock-type-face) |
| 227 | (font-lock-match-meta-declaration-item-and-skip-to-next | 227 | (font-lock-match-meta-declaration-item-and-skip-to-next |
| 228 | (goto-char (match-end 1)) nil | 228 | (goto-char (match-end 1)) nil |
| 229 | (1 font-lock-variable-name-face nil t)))) | 229 | (1 font-lock-variable-name-face nil t)))) |
| 230 | ;; special case of arguments: expr x of y | 230 | ;; special case of arguments: expr x of y |
| 231 | (cons (concat "\\(expr\\)[ \t]+\\(\\sw+\\)" | 231 | (cons (concat "\\(expr\\)[ \t\f]+\\(\\sw+\\)" |
| 232 | "[ \t]+\\(of\\)[ \t]+\\(\\sw+\\)") | 232 | "[ \t\f]+\\(of\\)[ \t\f]+\\(\\sw+\\)") |
| 233 | '((1 font-lock-type-face) | 233 | '((1 font-lock-type-face) |
| 234 | (2 font-lock-variable-name-face) | 234 | (2 font-lock-variable-name-face) |
| 235 | (3 font-lock-keyword-face nil t) | 235 | (3 font-lock-keyword-face nil t) |
| @@ -245,7 +245,7 @@ | |||
| 245 | 'font-lock-keyword-face) | 245 | 'font-lock-keyword-face) |
| 246 | ;; input, generate | 246 | ;; input, generate |
| 247 | (cons (concat "\\<" input-keywords "\\>" | 247 | (cons (concat "\\<" input-keywords "\\>" |
| 248 | "[ \t]+\\(\\sw+\\)") | 248 | "[ \t\f]+\\(\\sw+\\)") |
| 249 | '((1 font-lock-keyword-face) | 249 | '((1 font-lock-keyword-face) |
| 250 | (2 font-lock-constant-face))) | 250 | (2 font-lock-constant-face))) |
| 251 | ;; embedded Metafont/MetaPost code in comments | 251 | ;; embedded Metafont/MetaPost code in comments |
| @@ -264,7 +264,7 @@ | |||
| 264 | ;; `forward-sexp'. The list of items is expected to be separated | 264 | ;; `forward-sexp'. The list of items is expected to be separated |
| 265 | ;; by commas and terminated by semicolons or equals signs. | 265 | ;; by commas and terminated by semicolons or equals signs. |
| 266 | ;; | 266 | ;; |
| 267 | (if (looking-at "[ \t]*\\(\\sw+\\|\\s_+\\)") | 267 | (if (looking-at "[ \t\f]*\\(\\sw+\\|\\s_+\\)") |
| 268 | (save-match-data | 268 | (save-match-data |
| 269 | (condition-case nil | 269 | (condition-case nil |
| 270 | (save-restriction | 270 | (save-restriction |
| @@ -272,7 +272,7 @@ | |||
| 272 | (narrow-to-region (point-min) limit) | 272 | (narrow-to-region (point-min) limit) |
| 273 | (goto-char (match-end 1)) | 273 | (goto-char (match-end 1)) |
| 274 | ;; Move over any item value, etc., to the next item. | 274 | ;; Move over any item value, etc., to the next item. |
| 275 | (while (not (looking-at "[ \t]*\\(\\(,\\)\\|;\\|=\\|$\\)")) | 275 | (while (not (looking-at "[ \t\f]*\\(\\(,\\)\\|;\\|=\\|$\\)")) |
| 276 | (goto-char (or (scan-sexps (point) 1) (point-max)))) | 276 | (goto-char (or (scan-sexps (point) 1) (point-max)))) |
| 277 | (goto-char (match-end 2))) | 277 | (goto-char (match-end 2))) |
| 278 | (error t))))) | 278 | (error t))))) |
| @@ -586,7 +586,7 @@ If the list was changed, sort the list and remove duplicates first." | |||
| 586 | (if (and meta-left-comment-regexp | 586 | (if (and meta-left-comment-regexp |
| 587 | (looking-at meta-left-comment-regexp)) | 587 | (looking-at meta-left-comment-regexp)) |
| 588 | (current-column) | 588 | (current-column) |
| 589 | (skip-chars-backward "\t ") | 589 | (skip-chars-backward "\t\f ") |
| 590 | (max (if (bolp) 0 (1+ (current-column))) | 590 | (max (if (bolp) 0 (1+ (current-column))) |
| 591 | comment-column))) | 591 | comment-column))) |
| 592 | 592 | ||
| @@ -647,11 +647,11 @@ If the list was changed, sort the list and remove duplicates first." | |||
| 647 | 647 | ||
| 648 | (defun meta-indent-previous-line () | 648 | (defun meta-indent-previous-line () |
| 649 | "Go to the previous line of code, skipping comments." | 649 | "Go to the previous line of code, skipping comments." |
| 650 | (skip-chars-backward "\n\t ") | 650 | (skip-chars-backward "\n\t\f ") |
| 651 | (move-to-column (current-indentation)) | 651 | (move-to-column (current-indentation)) |
| 652 | ;; Ignore comments. | 652 | ;; Ignore comments. |
| 653 | (while (and (looking-at comment-start) (not (bobp))) | 653 | (while (and (looking-at comment-start) (not (bobp))) |
| 654 | (skip-chars-backward "\n\t ") | 654 | (skip-chars-backward "\n\t\f ") |
| 655 | (if (not (bobp)) | 655 | (if (not (bobp)) |
| 656 | (move-to-column (current-indentation))))) | 656 | (move-to-column (current-indentation))))) |
| 657 | 657 | ||
| @@ -672,7 +672,7 @@ If the list was changed, sort the list and remove duplicates first." | |||
| 672 | ;; See if the last statement of the line is environment-related, | 672 | ;; See if the last statement of the line is environment-related, |
| 673 | ;; or exists at all. | 673 | ;; or exists at all. |
| 674 | (if (meta-indent-looking-at-code | 674 | (if (meta-indent-looking-at-code |
| 675 | (concat "[ \t]*\\($\\|" (regexp-quote comment-start) | 675 | (concat "[ \t\f]*\\($\\|" (regexp-quote comment-start) |
| 676 | "\\|\\<" meta-end-environment-regexp "\\>" | 676 | "\\|\\<" meta-end-environment-regexp "\\>" |
| 677 | "\\|\\<" meta-begin-environment-regexp "\\>" | 677 | "\\|\\<" meta-begin-environment-regexp "\\>" |
| 678 | "\\|\\<" meta-within-environment-regexp "\\>\\)")) | 678 | "\\|\\<" meta-within-environment-regexp "\\>\\)")) |
| @@ -782,7 +782,7 @@ Returns t unless search stops due to beginning or end of buffer." | |||
| 782 | (concat "\\<" meta-begin-defun-regexp "\\>") nil t arg) | 782 | (concat "\\<" meta-begin-defun-regexp "\\>") nil t arg) |
| 783 | (progn (goto-char (match-beginning 0)) | 783 | (progn (goto-char (match-beginning 0)) |
| 784 | (skip-chars-backward "%") | 784 | (skip-chars-backward "%") |
| 785 | (skip-chars-backward " \t") t))) | 785 | (skip-chars-backward " \t\f") t))) |
| 786 | 786 | ||
| 787 | (defun meta-end-of-defun (&optional arg) | 787 | (defun meta-end-of-defun (&optional arg) |
| 788 | "Move forward to end of a defun in Metafont or MetaPost code. | 788 | "Move forward to end of a defun in Metafont or MetaPost code. |
| @@ -796,7 +796,7 @@ Returns t unless search stops due to beginning or end of buffer." | |||
| 796 | (concat "\\<" meta-end-defun-regexp "\\>") nil t arg) | 796 | (concat "\\<" meta-end-defun-regexp "\\>") nil t arg) |
| 797 | (progn (goto-char (match-end 0)) | 797 | (progn (goto-char (match-end 0)) |
| 798 | (skip-chars-forward ";") | 798 | (skip-chars-forward ";") |
| 799 | (skip-chars-forward " \t") | 799 | (skip-chars-forward " \t\f") |
| 800 | (if (looking-at "\n") (forward-line 1)) t))) | 800 | (if (looking-at "\n") (forward-line 1)) t))) |
| 801 | 801 | ||
| 802 | 802 | ||
| @@ -1014,11 +1014,14 @@ The environment marked is the one that contains point or follows point." | |||
| 1014 | (make-local-variable 'comment-start) | 1014 | (make-local-variable 'comment-start) |
| 1015 | (make-local-variable 'comment-end) | 1015 | (make-local-variable 'comment-end) |
| 1016 | (make-local-variable 'comment-multi-line) | 1016 | (make-local-variable 'comment-multi-line) |
| 1017 | (setq comment-start-skip "%+[ \t]*") | 1017 | (setq comment-start-skip "%+[ \t\f]*") |
| 1018 | (setq comment-start "%") | 1018 | (setq comment-start "%") |
| 1019 | (setq comment-end "") | 1019 | (setq comment-end "") |
| 1020 | (setq comment-multi-line nil) | 1020 | (setq comment-multi-line nil) |
| 1021 | 1021 | ||
| 1022 | ;; We use `back-to-indentation' but \f is no indentation sign. | ||
| 1023 | (modify-syntax-entry ?\f "_ ") | ||
| 1024 | |||
| 1022 | (make-local-variable 'parse-sexp-ignore-comments) | 1025 | (make-local-variable 'parse-sexp-ignore-comments) |
| 1023 | (setq parse-sexp-ignore-comments t) | 1026 | (setq parse-sexp-ignore-comments t) |
| 1024 | 1027 | ||