diff options
| author | Roland McGrath | 1992-08-02 03:36:38 +0000 |
|---|---|---|
| committer | Roland McGrath | 1992-08-02 03:36:38 +0000 |
| commit | c540863c2914bb9b5bfd69c1f7cb981486338c4c (patch) | |
| tree | 4f61ee87eee34d1f5df337897f5079ade7c29daa | |
| parent | e5aaf3466bfbf7e981b3bdaa6b2588af3fefff41 (diff) | |
| download | emacs-c540863c2914bb9b5bfd69c1f7cb981486338c4c.tar.gz emacs-c540863c2914bb9b5bfd69c1f7cb981486338c4c.zip | |
*** empty log message ***
| -rw-r--r-- | lisp/diff.el | 10 | ||||
| -rw-r--r-- | lisp/mail/mailabbrev.el | 10 | ||||
| -rw-r--r-- | lisp/progmodes/compile.el | 42 |
3 files changed, 41 insertions, 21 deletions
diff --git a/lisp/diff.el b/lisp/diff.el index 2c778c20610..347bbb75d35 100644 --- a/lisp/diff.el +++ b/lisp/diff.el | |||
| @@ -54,7 +54,7 @@ subexpression gives the line number in the new file. If OLD-IDX or NEW-IDX | |||
| 54 | is nil, REGEXP matches only half a section.") | 54 | is nil, REGEXP matches only half a section.") |
| 55 | 55 | ||
| 56 | ;; See compilation-parse-errors-function (compile.el). | 56 | ;; See compilation-parse-errors-function (compile.el). |
| 57 | (defun diff-parse-differences (limit-search) | 57 | (defun diff-parse-differences (limit-search find-at-least) |
| 58 | (setq compilation-error-list nil) | 58 | (setq compilation-error-list nil) |
| 59 | (message "Parsing differences...") | 59 | (message "Parsing differences...") |
| 60 | 60 | ||
| @@ -118,9 +118,11 @@ is nil, REGEXP matches only half a section.") | |||
| 118 | (if (nth 2 g) ;NEW-IDX | 118 | (if (nth 2 g) ;NEW-IDX |
| 119 | (funcall new-error diff-new-file (nth 2 g))) | 119 | (funcall new-error diff-new-file (nth 2 g))) |
| 120 | 120 | ||
| 121 | (and limit-search (>= (point) limit-search) | 121 | (if (or (and find-at-least (>= nfound find-at-least)) |
| 122 | ;; The user wanted a specific diff, and we're past it. | 122 | (and limit-search (>= (point) limit-search))) |
| 123 | (setq found-desired t))) | 123 | ;; We have found as many new errors as the user wants, |
| 124 | ;; or the user wanted a specific diff, and we're past it. | ||
| 125 | (setq found-desired t))) | ||
| 124 | (if found-desired | 126 | (if found-desired |
| 125 | (setq compilation-parsing-end (point)) | 127 | (setq compilation-parsing-end (point)) |
| 126 | ;; Set to point-max, not point, so we don't perpetually | 128 | ;; Set to point-max, not point, so we don't perpetually |
diff --git a/lisp/mail/mailabbrev.el b/lisp/mail/mailabbrev.el index 0ea8bf8d69d..27941351c49 100644 --- a/lisp/mail/mailabbrev.el +++ b/lisp/mail/mailabbrev.el | |||
| @@ -3,11 +3,12 @@ | |||
| 3 | ;;; Copyright (C) 1985, 1986, 1987, 1992 Free Software Foundation, Inc. | 3 | ;;; Copyright (C) 1985, 1986, 1987, 1992 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Jamie Zawinski <jwz@lucid.com> | 5 | ;; Author: Jamie Zawinski <jwz@lucid.com> |
| 6 | ;; Roland McGrath <roland@gnu.ai.mit.edu> | 6 | ;; Maintainer: Jamie Zawinski <jwz@lucid.com> |
| 7 | ;; Created: 19 Oct 90 | 7 | ;; Created: 19 Oct 90 |
| 8 | ;; Keywords: mail | 8 | ;; Keywords: mail |
| 9 | 9 | ||
| 10 | ;;; ??? We must get papers for this or delete it. | 10 | ;;; ??? We must get papers for this or delete it. |
| 11 | |||
| 11 | ;;; This file is part of GNU Emacs. | 12 | ;;; This file is part of GNU Emacs. |
| 12 | 13 | ||
| 13 | ;;; GNU Emacs is free software; you can redistribute it and/or modify | 14 | ;;; GNU Emacs is free software; you can redistribute it and/or modify |
| @@ -220,7 +221,7 @@ no aliases, which is represented by this being a table with no entries.)") | |||
| 220 | (forward-char 1))) | 221 | (forward-char 1))) |
| 221 | (goto-char (point-min)) | 222 | (goto-char (point-min)) |
| 222 | (while (re-search-forward | 223 | (while (re-search-forward |
| 223 | "^\\(a\\(lias\\|\\)\\|g\\(roup\\)\\|source\\)[ \t]+" nil t) | 224 | "^\\(a\\(lias\\)?\\|g\\(roup\\)?\\|source\\)[ \t]+" nil t) |
| 224 | (beginning-of-line) | 225 | (beginning-of-line) |
| 225 | (if (looking-at "source[ \t]+\\([^ \t\n]+\\)") | 226 | (if (looking-at "source[ \t]+\\([^ \t\n]+\\)") |
| 226 | (progn | 227 | (progn |
| @@ -524,7 +525,10 @@ characters which may be a part of the name of a mail-alias.") | |||
| 524 | 525 | ||
| 525 | (defun mail-interactive-insert-alias (&optional alias) | 526 | (defun mail-interactive-insert-alias (&optional alias) |
| 526 | "Prompt for and insert a mail alias." | 527 | "Prompt for and insert a mail alias." |
| 527 | (interactive (list (completing-read "Expand alias: " mail-aliases nil t))) | 528 | (interactive (progn |
| 529 | (if (not (vectorp mail-aliases)) (mail-aliases-setup)) | ||
| 530 | (list (completing-read "Expand alias: " mail-aliases nil t)))) | ||
| 531 | (if (not (vectorp mail-aliases)) (mail-aliases-setup)) | ||
| 528 | (insert (or (and alias (symbol-value (intern-soft alias mail-aliases))) ""))) | 532 | (insert (or (and alias (symbol-value (intern-soft alias mail-aliases))) ""))) |
| 529 | 533 | ||
| 530 | (defun abbrev-hacking-next-line (&optional arg) | 534 | (defun abbrev-hacking-next-line (&optional arg) |
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index c0e781646c9..477cca1bddb 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el | |||
| @@ -49,7 +49,10 @@ error messages should be reparsed the next time the list of errors is wanted.") | |||
| 49 | 49 | ||
| 50 | (defvar compilation-parse-errors-function 'compilation-parse-errors | 50 | (defvar compilation-parse-errors-function 'compilation-parse-errors |
| 51 | "Function to call to parse error messages from a compilation. | 51 | "Function to call to parse error messages from a compilation. |
| 52 | It takes one arg: if non-nil, don't bother parsing past that location. | 52 | It takes args LIMIT-SEARCH and FIND-AT-LEAST. |
| 53 | If LIMIT-SEARCH is non-nil, don't bother parsing past that location. | ||
| 54 | If FIND-AT-LEAST is non-nil, don't bother parsing after finding that | ||
| 55 | many new erros. | ||
| 53 | It should read in the source files which have errors and set | 56 | It should read in the source files which have errors and set |
| 54 | `compilation-error-list' to a list with an element for each error message | 57 | `compilation-error-list' to a list with an element for each error message |
| 55 | found. See that variable for more info.") | 58 | found. See that variable for more info.") |
| @@ -450,7 +453,7 @@ Does NOT find the source line like \\[next-error]." | |||
| 450 | 453 | ||
| 451 | ;; Parse any new errors in the compilation buffer, | 454 | ;; Parse any new errors in the compilation buffer, |
| 452 | ;; or reparse from the beginning if the user has asked for that. | 455 | ;; or reparse from the beginning if the user has asked for that. |
| 453 | (defun compile-reinitialize-errors (argp &optional limit-search) | 456 | (defun compile-reinitialize-errors (argp &optional limit-search find-at-least) |
| 454 | (save-excursion | 457 | (save-excursion |
| 455 | (set-buffer compilation-last-buffer) | 458 | (set-buffer compilation-last-buffer) |
| 456 | ;; If we are out of errors, or if user says "reparse", | 459 | ;; If we are out of errors, or if user says "reparse", |
| @@ -459,14 +462,17 @@ Does NOT find the source line like \\[next-error]." | |||
| 459 | (consp argp)) | 462 | (consp argp)) |
| 460 | (progn (compilation-forget-errors) | 463 | (progn (compilation-forget-errors) |
| 461 | (setq compilation-parsing-end 1))) | 464 | (setq compilation-parsing-end 1))) |
| 462 | (if (and compilation-error-list (not limit-search)) | 465 | (if (and compilation-error-list |
| 466 | (not limit-search) | ||
| 467 | (or (not find-at-least) | ||
| 468 | (> (length compilation-error-list) find-at-least))) | ||
| 463 | ;; Since compilation-error-list is non-nil, it points to a specific | 469 | ;; Since compilation-error-list is non-nil, it points to a specific |
| 464 | ;; error the user wanted. So don't move it around. | 470 | ;; error the user wanted. So don't move it around. |
| 465 | nil | 471 | nil |
| 466 | (switch-to-buffer compilation-last-buffer) | 472 | (switch-to-buffer compilation-last-buffer) |
| 467 | (set-buffer-modified-p nil) | 473 | (set-buffer-modified-p nil) |
| 468 | (let ((at-start (= compilation-parsing-end 1))) | 474 | (let ((at-start (= compilation-parsing-end 1))) |
| 469 | (funcall compilation-parse-errors-function limit-search) | 475 | (funcall compilation-parse-errors-function limit-search find-at-least) |
| 470 | ;; Remember the entire list for compilation-forget-errors. | 476 | ;; Remember the entire list for compilation-forget-errors. |
| 471 | ;; If this is an incremental parse, append to previous list. | 477 | ;; If this is an incremental parse, append to previous list. |
| 472 | (if at-start | 478 | (if at-start |
| @@ -559,7 +565,7 @@ See variables `compilation-parse-errors-function' and | |||
| 559 | \`compilation-error-regexp-alist' for customization ideas." | 565 | \`compilation-error-regexp-alist' for customization ideas." |
| 560 | (interactive "P") | 566 | (interactive "P") |
| 561 | (setq compilation-last-buffer (compilation-find-buffer)) | 567 | (setq compilation-last-buffer (compilation-find-buffer)) |
| 562 | (compile-reinitialize-errors argp) | 568 | (compile-reinitialize-errors argp nil (prefix-numeric-value argp)) |
| 563 | ;; Make ARGP nil if the prefix arg was just C-u, | 569 | ;; Make ARGP nil if the prefix arg was just C-u, |
| 564 | ;; since that means to reparse the errors, which the | 570 | ;; since that means to reparse the errors, which the |
| 565 | ;; compile-reinitialize-errors call just did. | 571 | ;; compile-reinitialize-errors call just did. |
| @@ -750,7 +756,7 @@ See variables `compilation-parse-errors-function' and | |||
| 750 | (setq groupings (1+ groupings)))))))) | 756 | (setq groupings (1+ groupings)))))))) |
| 751 | groupings)) | 757 | groupings)) |
| 752 | 758 | ||
| 753 | (defun compilation-parse-errors (limit-search) | 759 | (defun compilation-parse-errors (limit-search find-at-least) |
| 754 | "Parse the current buffer as grep, cc or lint error messages. | 760 | "Parse the current buffer as grep, cc or lint error messages. |
| 755 | See variable `compilation-parse-errors-function' for the interface it uses." | 761 | See variable `compilation-parse-errors-function' for the interface it uses." |
| 756 | (setq compilation-error-list nil) | 762 | (setq compilation-error-list nil) |
| @@ -758,7 +764,8 @@ See variable `compilation-parse-errors-function' for the interface it uses." | |||
| 758 | (let (text-buffer | 764 | (let (text-buffer |
| 759 | regexp enter-group leave-group error-group | 765 | regexp enter-group leave-group error-group |
| 760 | alist subexpr error-regexp-groups | 766 | alist subexpr error-regexp-groups |
| 761 | (found-desired nil)) | 767 | (found-desired nil) |
| 768 | (nfound 0)) | ||
| 762 | 769 | ||
| 763 | ;; Don't reparse messages already seen at last parse. | 770 | ;; Don't reparse messages already seen at last parse. |
| 764 | (goto-char compilation-parsing-end) | 771 | (goto-char compilation-parsing-end) |
| @@ -873,18 +880,25 @@ See variable `compilation-parse-errors-function' for the interface it uses." | |||
| 873 | (setq compilation-error-list | 880 | (setq compilation-error-list |
| 874 | (cons (cons (point-marker) | 881 | (cons (cons (point-marker) |
| 875 | (cons filename linenum)) | 882 | (cons filename linenum)) |
| 876 | compilation-error-list))))) | 883 | compilation-error-list)))) |
| 884 | (setq nfound (1+ nfound)) | ||
| 885 | (message "Parsing error messages...%d (%d%% of buffer)" | ||
| 886 | nfound | ||
| 887 | (/ (* 100 (point)) (point-max))) | ||
| 888 | (and find-at-least (>= nfound find-at-least) | ||
| 889 | ;; We have found as many new errors as the user wants. | ||
| 890 | (setq found-desired t))) | ||
| 877 | (t | 891 | (t |
| 878 | (error "compilation-parse-errors: impossible regexp match!"))) | 892 | (error "compilation-parse-errors: impossible regexp match!"))) |
| 879 | (and limit-search (>= (point) limit-search) | 893 | (and limit-search (>= (point) limit-search) |
| 880 | ;; The user wanted a specific error, and we're past it. | 894 | ;; The user wanted a specific error, and we're past it. |
| 881 | (setq found-desired t))) | 895 | (setq found-desired t))) |
| 882 | (if found-desired | 896 | (setq compilation-parsing-end (if found-desired |
| 883 | (setq compilation-parsing-end (point)) | 897 | (point) |
| 884 | ;; We have searched the whole buffer. | 898 | ;; We have searched the whole buffer. |
| 885 | (setq compilation-parsing-end (point-max)) | 899 | (point-max)))) |
| 886 | (message "Parsing error messages...done"))) | 900 | (setq compilation-error-list (nreverse compilation-error-list)) |
| 887 | (setq compilation-error-list (nreverse compilation-error-list))) | 901 | (message "Parsing error messages...done")) |
| 888 | 902 | ||
| 889 | (define-key ctl-x-map "`" 'next-error) | 903 | (define-key ctl-x-map "`" 'next-error) |
| 890 | 904 | ||