diff options
| author | Paul Eggert | 2011-08-24 14:20:36 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-08-24 14:20:36 -0700 |
| commit | 011ba6eaacfa50cc9871d0cfea34e8f0a7a5bc43 (patch) | |
| tree | ced7a98ff1eb289559da6ebfda46a8e436640da6 /lisp/progmodes | |
| parent | fe4496a6e27ac892283b8568adbd12831868cc54 (diff) | |
| parent | f22f4808a08e8f985d5e6175bbd13d5260e1ab1a (diff) | |
| download | emacs-011ba6eaacfa50cc9871d0cfea34e8f0a7a5bc43.tar.gz emacs-011ba6eaacfa50cc9871d0cfea34e8f0a7a5bc43.zip | |
Merge from trunk.
Diffstat (limited to 'lisp/progmodes')
| -rw-r--r-- | lisp/progmodes/cc-engine.el | 4 | ||||
| -rw-r--r-- | lisp/progmodes/cc-fonts.el | 214 | ||||
| -rw-r--r-- | lisp/progmodes/cc-langs.el | 17 | ||||
| -rw-r--r-- | lisp/progmodes/compile.el | 17 | ||||
| -rw-r--r-- | lisp/progmodes/grep.el | 7 | ||||
| -rw-r--r-- | lisp/progmodes/scheme.el | 28 | ||||
| -rw-r--r-- | lisp/progmodes/sh-script.el | 2 |
7 files changed, 211 insertions, 78 deletions
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 0d88f85d263..a1cbdc16560 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el | |||
| @@ -6325,7 +6325,9 @@ comment at the start of cc-engine.el for more info." | |||
| 6325 | (let* ((start (point)) kwd-sym kwd-clause-end found-type) | 6325 | (let* ((start (point)) kwd-sym kwd-clause-end found-type) |
| 6326 | 6326 | ||
| 6327 | ;; Look for a specifier keyword clause. | 6327 | ;; Look for a specifier keyword clause. |
| 6328 | (when (looking-at c-prefix-spec-kwds-re) | 6328 | (when (or (looking-at c-prefix-spec-kwds-re) |
| 6329 | (and (c-major-mode-is 'java-mode) | ||
| 6330 | (looking-at "@[A-Za-z0-9]+"))) | ||
| 6329 | (if (looking-at c-typedef-key) | 6331 | (if (looking-at c-typedef-key) |
| 6330 | (setq at-typedef t)) | 6332 | (setq at-typedef t)) |
| 6331 | (setq kwd-sym (c-keyword-sym (match-string 1))) | 6333 | (setq kwd-sym (c-keyword-sym (match-string 1))) |
diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el index 2277ba760ab..3d5dc30d823 100644 --- a/lisp/progmodes/cc-fonts.el +++ b/lisp/progmodes/cc-fonts.el | |||
| @@ -199,10 +199,16 @@ | |||
| 199 | (set-face-foreground 'c-annotation-face "blue") | 199 | (set-face-foreground 'c-annotation-face "blue") |
| 200 | 200 | ||
| 201 | (eval-and-compile | 201 | (eval-and-compile |
| 202 | ;; We need the following functions during compilation since they're | 202 | ;; We need the following definitions during compilation since they're |
| 203 | ;; called when the `c-lang-defconst' initializers are evaluated. | 203 | ;; used when the `c-lang-defconst' initializers are evaluated. Define |
| 204 | ;; Define them at runtime too for the sake of derived modes. | 204 | ;; them at runtime too for the sake of derived modes. |
| 205 | 205 | ||
| 206 | ;; This indicates the "font locking context", and is set just before | ||
| 207 | ;; fontification is done. If non-nil, it says, e.g., point starts | ||
| 208 | ;; from within a #if preprocessor construct. | ||
| 209 | (defvar c-font-lock-context nil) | ||
| 210 | (make-variable-buffer-local 'c-font-lock-context) | ||
| 211 | |||
| 206 | (defmacro c-put-font-lock-face (from to face) | 212 | (defmacro c-put-font-lock-face (from to face) |
| 207 | ;; Put a face on a region (overriding any existing face) in the way | 213 | ;; Put a face on a region (overriding any existing face) in the way |
| 208 | ;; font-lock would do it. In XEmacs that means putting an | 214 | ;; font-lock would do it. In XEmacs that means putting an |
| @@ -283,6 +289,45 @@ | |||
| 283 | nil))))) | 289 | nil))))) |
| 284 | res)))) | 290 | res)))) |
| 285 | 291 | ||
| 292 | (defun c-make-font-lock-search-form (regexp highlights) | ||
| 293 | ;; Return a lisp form which will fontify every occurence of REGEXP | ||
| 294 | ;; (a regular expression, NOT a function) between POINT and `limit' | ||
| 295 | ;; with HIGHLIGHTS, a list of highlighters as specified on page | ||
| 296 | ;; "Search-based Fontification" in the elisp manual. | ||
| 297 | `(while (re-search-forward ,regexp limit t) | ||
| 298 | (unless (progn | ||
| 299 | (goto-char (match-beginning 0)) | ||
| 300 | (c-skip-comments-and-strings limit)) | ||
| 301 | (goto-char (match-end 0)) | ||
| 302 | ,@(mapcar | ||
| 303 | (lambda (highlight) | ||
| 304 | (if (integerp (car highlight)) | ||
| 305 | ;; e.g. highlight is (1 font-lock-type-face t) | ||
| 306 | (progn | ||
| 307 | (unless (eq (nth 2 highlight) t) | ||
| 308 | (error | ||
| 309 | "The override flag must currently be t in %s" | ||
| 310 | highlight)) | ||
| 311 | (when (nth 3 highlight) | ||
| 312 | (error | ||
| 313 | "The laxmatch flag may currently not be set in %s" | ||
| 314 | highlight)) | ||
| 315 | `(save-match-data | ||
| 316 | (c-put-font-lock-face | ||
| 317 | (match-beginning ,(car highlight)) | ||
| 318 | (match-end ,(car highlight)) | ||
| 319 | ,(elt highlight 1)))) | ||
| 320 | ;; highlight is an "ANCHORED HIGHLIGHER" of the form | ||
| 321 | ;; (ANCHORED-MATCHER PRE-FORM POST-FORM SUBEXP-HIGHLIGHTERS...) | ||
| 322 | (when (nth 3 highlight) | ||
| 323 | (error "Match highlights currently not supported in %s" | ||
| 324 | highlight)) | ||
| 325 | `(progn | ||
| 326 | ,(nth 1 highlight) | ||
| 327 | (save-match-data ,(car highlight)) | ||
| 328 | ,(nth 2 highlight)))) | ||
| 329 | highlights)))) | ||
| 330 | |||
| 286 | (defun c-make-font-lock-search-function (regexp &rest highlights) | 331 | (defun c-make-font-lock-search-function (regexp &rest highlights) |
| 287 | ;; This function makes a byte compiled function that works much like | 332 | ;; This function makes a byte compiled function that works much like |
| 288 | ;; a matcher element in `font-lock-keywords'. It cuts out a little | 333 | ;; a matcher element in `font-lock-keywords'. It cuts out a little |
| @@ -313,43 +358,101 @@ | |||
| 313 | ;; lambda more easily. | 358 | ;; lambda more easily. |
| 314 | (byte-compile | 359 | (byte-compile |
| 315 | `(lambda (limit) | 360 | `(lambda (limit) |
| 316 | (let (;; The font-lock package in Emacs is known to clobber | 361 | (let ( ;; The font-lock package in Emacs is known to clobber |
| 317 | ;; `parse-sexp-lookup-properties' (when it exists). | 362 | ;; `parse-sexp-lookup-properties' (when it exists). |
| 318 | (parse-sexp-lookup-properties | 363 | (parse-sexp-lookup-properties |
| 319 | (cc-eval-when-compile | 364 | (cc-eval-when-compile |
| 320 | (boundp 'parse-sexp-lookup-properties)))) | 365 | (boundp 'parse-sexp-lookup-properties)))) |
| 321 | (while (re-search-forward ,regexp limit t) | 366 | |
| 322 | (unless (progn | 367 | ;; (while (re-search-forward ,regexp limit t) |
| 323 | (goto-char (match-beginning 0)) | 368 | ;; (unless (progn |
| 324 | (c-skip-comments-and-strings limit)) | 369 | ;; (goto-char (match-beginning 0)) |
| 325 | (goto-char (match-end 0)) | 370 | ;; (c-skip-comments-and-strings limit)) |
| 326 | ,@(mapcar | 371 | ;; (goto-char (match-end 0)) |
| 327 | (lambda (highlight) | 372 | ;; ,@(mapcar |
| 328 | (if (integerp (car highlight)) | 373 | ;; (lambda (highlight) |
| 329 | (progn | 374 | ;; (if (integerp (car highlight)) |
| 330 | (unless (eq (nth 2 highlight) t) | 375 | ;; (progn |
| 331 | (error | 376 | ;; (unless (eq (nth 2 highlight) t) |
| 332 | "The override flag must currently be t in %s" | 377 | ;; (error |
| 333 | highlight)) | 378 | ;; "The override flag must currently be t in %s" |
| 334 | (when (nth 3 highlight) | 379 | ;; highlight)) |
| 335 | (error | 380 | ;; (when (nth 3 highlight) |
| 336 | "The laxmatch flag may currently not be set in %s" | 381 | ;; (error |
| 337 | highlight)) | 382 | ;; "The laxmatch flag may currently not be set in %s" |
| 338 | `(save-match-data | 383 | ;; highlight)) |
| 339 | (c-put-font-lock-face | 384 | ;; `(save-match-data |
| 340 | (match-beginning ,(car highlight)) | 385 | ;; (c-put-font-lock-face |
| 341 | (match-end ,(car highlight)) | 386 | ;; (match-beginning ,(car highlight)) |
| 342 | ,(elt highlight 1)))) | 387 | ;; (match-end ,(car highlight)) |
| 343 | (when (nth 3 highlight) | 388 | ;; ,(elt highlight 1)))) |
| 344 | (error "Match highlights currently not supported in %s" | 389 | ;; (when (nth 3 highlight) |
| 345 | highlight)) | 390 | ;; (error "Match highlights currently not supported in %s" |
| 346 | `(progn | 391 | ;; highlight)) |
| 347 | ,(nth 1 highlight) | 392 | ;; `(progn |
| 348 | (save-match-data ,(car highlight)) | 393 | ;; ,(nth 1 highlight) |
| 349 | ,(nth 2 highlight)))) | 394 | ;; (save-match-data ,(car highlight)) |
| 350 | highlights)))) | 395 | ;; ,(nth 2 highlight)))) |
| 396 | ;; highlights))) | ||
| 397 | ,(c-make-font-lock-search-form regexp highlights)) | ||
| 398 | |||
| 351 | nil))) | 399 | nil))) |
| 352 | 400 | ||
| 401 | (defun c-make-font-lock-context-search-function (normal &rest state-stanzas) | ||
| 402 | ;; This function makes a byte compiled function that works much like | ||
| 403 | ;; a matcher element in `font-lock-keywords', with the following | ||
| 404 | ;; enhancement: the generated function will test for particular "font | ||
| 405 | ;; lock contexts" at the start of the region, i.e. is this point in | ||
| 406 | ;; the middle of some particular construct? if so the generated | ||
| 407 | ;; function will first fontify the tail of the construct, before | ||
| 408 | ;; going into the main loop and fontify full constructs up to limit. | ||
| 409 | ;; | ||
| 410 | ;; The generated function takes one parameter called `limit', and | ||
| 411 | ;; will fontify the region between POINT and LIMIT. | ||
| 412 | ;; | ||
| 413 | ;; NORMAL is a list of the form (REGEXP HIGHLIGHTS .....), and is | ||
| 414 | ;; used to fontify the "regular" bit of the region. | ||
| 415 | ;; STATE-STANZAS is list of elements of the form (STATE LIM REGEXP | ||
| 416 | ;; HIGHLIGHTS), each element coding one possible font lock context. | ||
| 417 | |||
| 418 | ;; o - REGEXP is a font-lock regular expression (NOT a function), | ||
| 419 | ;; o - HIGHLIGHTS is a list of zero or more highlighters as defined | ||
| 420 | ;; on page "Search-based Fontification" in the elisp manual. As | ||
| 421 | ;; yet (2009-06), they must have OVERRIDE set, and may not have | ||
| 422 | ;; LAXMATCH set. | ||
| 423 | ;; | ||
| 424 | ;; o - STATE is the "font lock context" (e.g. in-cpp-expr) and is | ||
| 425 | ;; not quoted. | ||
| 426 | ;; o - LIM is a lisp form whose evaluation will yield the limit | ||
| 427 | ;; position in the buffer for fontification by this stanza. | ||
| 428 | ;; | ||
| 429 | ;; This function does not do any hidden buffer changes, but the | ||
| 430 | ;; generated functions will. (They are however used in places | ||
| 431 | ;; covered by the font-lock context.) | ||
| 432 | ;; | ||
| 433 | ;; Note: Replace `byte-compile' with `eval' to debug the generated | ||
| 434 | ;; lambda more easily. | ||
| 435 | (byte-compile | ||
| 436 | `(lambda (limit) | ||
| 437 | (let ( ;; The font-lock package in Emacs is known to clobber | ||
| 438 | ;; `parse-sexp-lookup-properties' (when it exists). | ||
| 439 | (parse-sexp-lookup-properties | ||
| 440 | (cc-eval-when-compile | ||
| 441 | (boundp 'parse-sexp-lookup-properties)))) | ||
| 442 | ,@(mapcar | ||
| 443 | (lambda (stanza) | ||
| 444 | (let ((state (car stanza)) | ||
| 445 | (lim (nth 1 stanza)) | ||
| 446 | (regexp (nth 2 stanza)) | ||
| 447 | (highlights (cdr (cddr stanza)))) | ||
| 448 | `(if (eq c-font-lock-context ',state) | ||
| 449 | (let ((limit ,lim)) | ||
| 450 | ,(c-make-font-lock-search-form | ||
| 451 | regexp highlights))))) | ||
| 452 | state-stanzas) | ||
| 453 | ,(c-make-font-lock-search-form (car normal) (cdr normal)) | ||
| 454 | nil)))) | ||
| 455 | |||
| 353 | ; (eval-after-load "edebug" ; 2006-07-09: def-edebug-spec is now in subr.el. | 456 | ; (eval-after-load "edebug" ; 2006-07-09: def-edebug-spec is now in subr.el. |
| 354 | ; '(progn | 457 | ; '(progn |
| 355 | (def-edebug-spec c-fontify-types-and-refs let*) | 458 | (def-edebug-spec c-fontify-types-and-refs let*) |
| @@ -494,19 +597,24 @@ stuff. Used on level 1 and higher." | |||
| 494 | (c-lang-const c-cpp-expr-directives))) | 597 | (c-lang-const c-cpp-expr-directives))) |
| 495 | (cef-re (c-make-keywords-re t | 598 | (cef-re (c-make-keywords-re t |
| 496 | (c-lang-const c-cpp-expr-functions)))) | 599 | (c-lang-const c-cpp-expr-functions)))) |
| 497 | `((,(c-make-font-lock-search-function | 600 | |
| 498 | (concat noncontinued-line-end | 601 | `((,(c-make-font-lock-context-search-function |
| 499 | (c-lang-const c-opt-cpp-prefix) | 602 | `(,(concat noncontinued-line-end |
| 500 | ced-re ; 1 + ncle-depth | 603 | (c-lang-const c-opt-cpp-prefix) |
| 501 | ;; Match the whole logical line to look | 604 | ced-re ; 1 + ncle-depth |
| 502 | ;; for the functions in. | 605 | ;; Match the whole logical line to look |
| 503 | "\\(\\\\\\(.\\|[\n\r]\\)\\|[^\n\r]\\)*") | 606 | ;; for the functions in. |
| 504 | `((let ((limit (match-end 0))) | 607 | "\\(\\\\\\(.\\|[\n\r]\\)\\|[^\n\r]\\)*") |
| 505 | (while (re-search-forward ,cef-re limit 'move) | 608 | ((let ((limit (match-end 0))) |
| 506 | (c-put-font-lock-face (match-beginning 1) | 609 | (while (re-search-forward ,cef-re limit 'move) |
| 507 | (match-end 1) | 610 | (c-put-font-lock-face (match-beginning 1) |
| 508 | c-preprocessor-face-name))) | 611 | (match-end 1) |
| 509 | (goto-char (match-end ,(1+ ncle-depth))))))))) | 612 | c-preprocessor-face-name))) |
| 613 | (goto-char (match-end ,(1+ ncle-depth))))) | ||
| 614 | `(in-cpp-expr | ||
| 615 | (save-excursion (c-end-of-macro) (point)) | ||
| 616 | ,cef-re | ||
| 617 | (1 c-preprocessor-face-name t))))))) | ||
| 510 | 618 | ||
| 511 | ;; Fontify the directive names. | 619 | ;; Fontify the directive names. |
| 512 | (,(c-make-font-lock-search-function | 620 | (,(c-make-font-lock-search-function |
| @@ -759,6 +867,12 @@ casts and declarations are fontified. Used on level 2 and higher." | |||
| 759 | (c-forward-syntactic-ws limit) | 867 | (c-forward-syntactic-ws limit) |
| 760 | (c-font-lock-declarators limit t (eq prop 'c-decl-type-start)))) | 868 | (c-font-lock-declarators limit t (eq prop 'c-decl-type-start)))) |
| 761 | 869 | ||
| 870 | (setq c-font-lock-context ;; (c-guess-font-lock-context) | ||
| 871 | (save-excursion | ||
| 872 | (if (and c-cpp-expr-intro-re | ||
| 873 | (c-beginning-of-macro) | ||
| 874 | (looking-at c-cpp-expr-intro-re)) | ||
| 875 | 'in-cpp-expr))) | ||
| 762 | nil) | 876 | nil) |
| 763 | 877 | ||
| 764 | (defun c-font-lock-<>-arglists (limit) | 878 | (defun c-font-lock-<>-arglists (limit) |
| @@ -1552,7 +1666,9 @@ on level 2 only and so aren't combined with `c-complex-decl-matchers'." | |||
| 1552 | (unless (c-skip-comments-and-strings limit) | 1666 | (unless (c-skip-comments-and-strings limit) |
| 1553 | (c-forward-syntactic-ws) | 1667 | (c-forward-syntactic-ws) |
| 1554 | ;; Handle prefix declaration specifiers. | 1668 | ;; Handle prefix declaration specifiers. |
| 1555 | (when (looking-at c-prefix-spec-kwds-re) | 1669 | (when (or (looking-at c-prefix-spec-kwds-re) |
| 1670 | (and (c-major-mode-is 'java-mode) | ||
| 1671 | (looking-at "@[A-Za-z0-9]+"))) | ||
| 1556 | (c-forward-keyword-clause 1)) | 1672 | (c-forward-keyword-clause 1)) |
| 1557 | ,(if (c-major-mode-is 'c++-mode) | 1673 | ,(if (c-major-mode-is 'c++-mode) |
| 1558 | `(when (and (c-forward-type) | 1674 | `(when (and (c-forward-type) |
diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index 35097242cb7..279c5e46c46 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el | |||
| @@ -815,6 +815,16 @@ expression." | |||
| 815 | t (if (c-lang-const c-opt-cpp-prefix) | 815 | t (if (c-lang-const c-opt-cpp-prefix) |
| 816 | '("if" "elif"))) | 816 | '("if" "elif"))) |
| 817 | 817 | ||
| 818 | (c-lang-defconst c-cpp-expr-intro-re | ||
| 819 | "Regexp which matches the start of a CPP directive which contains an | ||
| 820 | expression, or nil if there aren't any in the language." | ||
| 821 | t (if (c-lang-const c-cpp-expr-directives) | ||
| 822 | (concat | ||
| 823 | (c-lang-const c-opt-cpp-prefix) | ||
| 824 | (c-make-keywords-re t (c-lang-const c-cpp-expr-directives))))) | ||
| 825 | (c-lang-defvar c-cpp-expr-intro-re | ||
| 826 | (c-lang-const c-cpp-expr-intro-re)) | ||
| 827 | |||
| 818 | (c-lang-defconst c-cpp-expr-functions | 828 | (c-lang-defconst c-cpp-expr-functions |
| 819 | "List of functions in cpp expressions." | 829 | "List of functions in cpp expressions." |
| 820 | t (if (c-lang-const c-opt-cpp-prefix) | 830 | t (if (c-lang-const c-opt-cpp-prefix) |
| @@ -1813,7 +1823,7 @@ will be handled." | |||
| 1813 | "bindsTo" "delegatesTo" "implements" "proxy" "storedOn") | 1823 | "bindsTo" "delegatesTo" "implements" "proxy" "storedOn") |
| 1814 | ;; Note: "const" is not used in Java, but it's still a reserved keyword. | 1824 | ;; Note: "const" is not used in Java, but it's still a reserved keyword. |
| 1815 | java '("abstract" "const" "final" "native" "private" "protected" "public" | 1825 | java '("abstract" "const" "final" "native" "private" "protected" "public" |
| 1816 | "static" "strictfp" "synchronized" "transient" "volatile" "@[A-Za-z0-9]+") | 1826 | "static" "strictfp" "synchronized" "transient" "volatile") |
| 1817 | pike '("final" "inline" "local" "nomask" "optional" "private" "protected" | 1827 | pike '("final" "inline" "local" "nomask" "optional" "private" "protected" |
| 1818 | "public" "static" "variant")) | 1828 | "public" "static" "variant")) |
| 1819 | 1829 | ||
| @@ -1899,10 +1909,7 @@ one of `c-type-list-kwds', `c-ref-list-kwds', | |||
| 1899 | 1909 | ||
| 1900 | (c-lang-defconst c-prefix-spec-kwds-re | 1910 | (c-lang-defconst c-prefix-spec-kwds-re |
| 1901 | ;; Adorned regexp of `c-prefix-spec-kwds'. | 1911 | ;; Adorned regexp of `c-prefix-spec-kwds'. |
| 1902 | t (c-make-keywords-re t (c-lang-const c-prefix-spec-kwds)) | 1912 | t (c-make-keywords-re t (c-lang-const c-prefix-spec-kwds))) |
| 1903 | java (replace-regexp-in-string | ||
| 1904 | "\\\\\\[" "[" | ||
| 1905 | (replace-regexp-in-string "\\\\\\+" "+" (c-make-keywords-re t (c-lang-const c-prefix-spec-kwds))))) | ||
| 1906 | 1913 | ||
| 1907 | (c-lang-defvar c-prefix-spec-kwds-re (c-lang-const c-prefix-spec-kwds-re)) | 1914 | (c-lang-defvar c-prefix-spec-kwds-re (c-lang-const c-prefix-spec-kwds-re)) |
| 1908 | 1915 | ||
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index f3b873c8b1e..79fec080d57 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el | |||
| @@ -145,7 +145,7 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1)) | |||
| 145 | 145 | ||
| 146 | (ant | 146 | (ant |
| 147 | "^[ \t]*\\[[^] \n]+\\][ \t]*\\([^: \n]+\\):\\([0-9]+\\):\\(?:\\([0-9]+\\):\\([0-9]+\\):\\([0-9]+\\):\\)?\ | 147 | "^[ \t]*\\[[^] \n]+\\][ \t]*\\([^: \n]+\\):\\([0-9]+\\):\\(?:\\([0-9]+\\):\\([0-9]+\\):\\([0-9]+\\):\\)?\ |
| 148 | \\( warning\\)?" 1 (2 . 4) (3 . 5) (4)) | 148 | \\( warning\\)?" 1 (2 . 4) (3 . 5) (6)) |
| 149 | 149 | ||
| 150 | (bash | 150 | (bash |
| 151 | "^\\([^: \n\t]+\\): line \\([0-9]+\\):" 1 2) | 151 | "^\\([^: \n\t]+\\): line \\([0-9]+\\):" 1 2) |
| @@ -523,7 +523,7 @@ you may also want to change `compilation-page-delimiter'.") | |||
| 523 | ;; Command output lines. Recognize `make[n]:' lines too. | 523 | ;; Command output lines. Recognize `make[n]:' lines too. |
| 524 | ("^\\([[:alnum:]_/.+-]+\\)\\(\\[\\([0-9]+\\)\\]\\)?[ \t]*:" | 524 | ("^\\([[:alnum:]_/.+-]+\\)\\(\\[\\([0-9]+\\)\\]\\)?[ \t]*:" |
| 525 | (1 font-lock-function-name-face) (3 compilation-line-face nil t)) | 525 | (1 font-lock-function-name-face) (3 compilation-line-face nil t)) |
| 526 | (" -\\(?:o[= ]?\\|-\\(?:outfile\\|output\\)[= ]\\)\\(\\S +\\)" . 1) | 526 | (" --?o\\(?:utfile\\|utput\\)?[= ]\\(\\S +\\)" . 1) |
| 527 | ("^Compilation \\(finished\\).*" | 527 | ("^Compilation \\(finished\\).*" |
| 528 | (0 '(face nil compilation-message nil help-echo nil mouse-face nil) t) | 528 | (0 '(face nil compilation-message nil help-echo nil mouse-face nil) t) |
| 529 | (1 compilation-info-face)) | 529 | (1 compilation-info-face)) |
| @@ -985,12 +985,15 @@ POS and RES.") | |||
| 985 | (let* ((prev | 985 | (let* ((prev |
| 986 | (or (get-text-property (1- prev-pos) 'compilation-message) | 986 | (or (get-text-property (1- prev-pos) 'compilation-message) |
| 987 | (get-text-property prev-pos 'compilation-message))) | 987 | (get-text-property prev-pos 'compilation-message))) |
| 988 | (prev-struct | 988 | (prev-file-struct |
| 989 | (car (nth 2 (car prev))))) | 989 | (and prev |
| 990 | (compilation--loc->file-struct | ||
| 991 | (compilation--message->loc prev))))) | ||
| 992 | |||
| 990 | ;; Construct FILE . DIR from that. | 993 | ;; Construct FILE . DIR from that. |
| 991 | (if prev-struct | 994 | (if prev-file-struct |
| 992 | (setq file (cons (car prev-struct) | 995 | (setq file (cons (caar prev-file-struct) |
| 993 | (cadr prev-struct)))))) | 996 | (cadr (car prev-file-struct))))))) |
| 994 | (unless file | 997 | (unless file |
| 995 | (setq file '("*unknown*"))))) | 998 | (setq file '("*unknown*"))))) |
| 996 | ;; All of these fields are optional, get them only if we have an index, and | 999 | ;; All of these fields are optional, get them only if we have an index, and |
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index 31100f3fac2..709f01444bf 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el | |||
| @@ -463,9 +463,12 @@ Set up `compilation-exit-message-function' and run `grep-setup-hook'." | |||
| 463 | (set (make-local-variable 'compilation-exit-message-function) | 463 | (set (make-local-variable 'compilation-exit-message-function) |
| 464 | (lambda (status code msg) | 464 | (lambda (status code msg) |
| 465 | (if (eq status 'exit) | 465 | (if (eq status 'exit) |
| 466 | (cond ((zerop code) | 466 | ;; This relies on the fact that `compilation-start' |
| 467 | ;; sets buffer-modified to nil before running the command, | ||
| 468 | ;; so the buffer is still unmodified if there is no output. | ||
| 469 | (cond ((and (zerop code) (buffer-modified-p)) | ||
| 467 | '("finished (matches found)\n" . "matched")) | 470 | '("finished (matches found)\n" . "matched")) |
| 468 | ((= code 1) | 471 | ((or (= code 1) (not (buffer-modified-p))) |
| 469 | '("finished with no matches found\n" . "no match")) | 472 | '("finished with no matches found\n" . "no match")) |
| 470 | (t | 473 | (t |
| 471 | (cons msg code))) | 474 | (cons msg code))) |
diff --git a/lisp/progmodes/scheme.el b/lisp/progmodes/scheme.el index 4151e2bb79a..470b309434c 100644 --- a/lisp/progmodes/scheme.el +++ b/lisp/progmodes/scheme.el | |||
| @@ -55,24 +55,24 @@ | |||
| 55 | (defvar scheme-mode-syntax-table | 55 | (defvar scheme-mode-syntax-table |
| 56 | (let ((st (make-syntax-table)) | 56 | (let ((st (make-syntax-table)) |
| 57 | (i 0)) | 57 | (i 0)) |
| 58 | 58 | ;; Symbol constituents | |
| 59 | ;; Default is atom-constituent. | 59 | ;; We used to treat chars 128-256 as symbol-constituent, but they |
| 60 | (while (< i 256) | 60 | ;; should be valid word constituents (Bug#8843). Note that valid |
| 61 | ;; identifier characters are Scheme-implementation dependent. | ||
| 62 | (while (< i ?0) | ||
| 61 | (modify-syntax-entry i "_ " st) | 63 | (modify-syntax-entry i "_ " st) |
| 62 | (setq i (1+ i))) | 64 | (setq i (1+ i))) |
| 63 | 65 | (setq i (1+ ?9)) | |
| 64 | ;; Word components. | 66 | (while (< i ?A) |
| 65 | (setq i ?0) | 67 | (modify-syntax-entry i "_ " st) |
| 66 | (while (<= i ?9) | ||
| 67 | (modify-syntax-entry i "w " st) | ||
| 68 | (setq i (1+ i))) | 68 | (setq i (1+ i))) |
| 69 | (setq i ?A) | 69 | (setq i (1+ ?Z)) |
| 70 | (while (<= i ?Z) | 70 | (while (< i ?a) |
| 71 | (modify-syntax-entry i "w " st) | 71 | (modify-syntax-entry i "_ " st) |
| 72 | (setq i (1+ i))) | 72 | (setq i (1+ i))) |
| 73 | (setq i ?a) | 73 | (setq i (1+ ?z)) |
| 74 | (while (<= i ?z) | 74 | (while (< i 128) |
| 75 | (modify-syntax-entry i "w " st) | 75 | (modify-syntax-entry i "_ " st) |
| 76 | (setq i (1+ i))) | 76 | (setq i (1+ i))) |
| 77 | 77 | ||
| 78 | ;; Whitespace | 78 | ;; Whitespace |
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index 31a4fbaef4d..7b949134c6c 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el | |||
| @@ -460,6 +460,7 @@ This is buffer-local in every such buffer.") | |||
| 460 | (define-key map "\C-c+" 'sh-add) | 460 | (define-key map "\C-c+" 'sh-add) |
| 461 | (define-key map "\C-\M-x" 'sh-execute-region) | 461 | (define-key map "\C-\M-x" 'sh-execute-region) |
| 462 | (define-key map "\C-c\C-x" 'executable-interpret) | 462 | (define-key map "\C-c\C-x" 'executable-interpret) |
| 463 | ;; FIXME: Use post-self-insert-hook. | ||
| 463 | (define-key map "<" 'sh-maybe-here-document) | 464 | (define-key map "<" 'sh-maybe-here-document) |
| 464 | (define-key map "(" 'skeleton-pair-insert-maybe) | 465 | (define-key map "(" 'skeleton-pair-insert-maybe) |
| 465 | (define-key map "{" 'skeleton-pair-insert-maybe) | 466 | (define-key map "{" 'skeleton-pair-insert-maybe) |
| @@ -3659,6 +3660,7 @@ The document is bounded by `sh-here-document-word'." | |||
| 3659 | (save-excursion | 3660 | (save-excursion |
| 3660 | (backward-char 2) | 3661 | (backward-char 2) |
| 3661 | (sh-quoted-p)) | 3662 | (sh-quoted-p)) |
| 3663 | (nth 8 (syntax-ppss)) | ||
| 3662 | (let ((tabs (if (string-match "\\`-" sh-here-document-word) | 3664 | (let ((tabs (if (string-match "\\`-" sh-here-document-word) |
| 3663 | (make-string (/ (current-indentation) tab-width) ?\t) | 3665 | (make-string (/ (current-indentation) tab-width) ?\t) |
| 3664 | "")) | 3666 | "")) |