summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1992-08-02 03:36:38 +0000
committerRoland McGrath <roland@gnu.org>1992-08-02 03:36:38 +0000
commitc540863c2914bb9b5bfd69c1f7cb981486338c4c (patch)
tree4f61ee87eee34d1f5df337897f5079ade7c29daa /lisp
parente5aaf3466bfbf7e981b3bdaa6b2588af3fefff41 (diff)
downloademacs-c540863c2914bb9b5bfd69c1f7cb981486338c4c.tar.gz
*** empty log message ***
Diffstat (limited to 'lisp')
-rw-r--r--lisp/diff.el10
-rw-r--r--lisp/mail/mailabbrev.el10
-rw-r--r--lisp/progmodes/compile.el42
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
is nil, REGEXP matches only half a section.")
;; See compilation-parse-errors-function (compile.el).
-(defun diff-parse-differences (limit-search)
+(defun diff-parse-differences (limit-search find-at-least)
(setq compilation-error-list nil)
(message "Parsing differences...")
@@ -118,9 +118,11 @@ is nil, REGEXP matches only half a section.")
(if (nth 2 g) ;NEW-IDX
(funcall new-error diff-new-file (nth 2 g)))
- (and limit-search (>= (point) limit-search)
- ;; The user wanted a specific diff, and we're past it.
- (setq found-desired t)))
+ (if (or (and find-at-least (>= nfound find-at-least))
+ (and limit-search (>= (point) limit-search)))
+ ;; We have found as many new errors as the user wants,
+ ;; or the user wanted a specific diff, and we're past it.
+ (setq found-desired t)))
(if found-desired
(setq compilation-parsing-end (point))
;; 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 @@
;;; Copyright (C) 1985, 1986, 1987, 1992 Free Software Foundation, Inc.
;; Author: Jamie Zawinski <jwz@lucid.com>
-;; Roland McGrath <roland@gnu.ai.mit.edu>
+;; Maintainer: Jamie Zawinski <jwz@lucid.com>
;; Created: 19 Oct 90
;; Keywords: mail
;;; ??? We must get papers for this or delete it.
+
;;; This file is part of GNU Emacs.
;;; 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.)")
(forward-char 1)))
(goto-char (point-min))
(while (re-search-forward
- "^\\(a\\(lias\\|\\)\\|g\\(roup\\)\\|source\\)[ \t]+" nil t)
+ "^\\(a\\(lias\\)?\\|g\\(roup\\)?\\|source\\)[ \t]+" nil t)
(beginning-of-line)
(if (looking-at "source[ \t]+\\([^ \t\n]+\\)")
(progn
@@ -524,7 +525,10 @@ characters which may be a part of the name of a mail-alias.")
(defun mail-interactive-insert-alias (&optional alias)
"Prompt for and insert a mail alias."
- (interactive (list (completing-read "Expand alias: " mail-aliases nil t)))
+ (interactive (progn
+ (if (not (vectorp mail-aliases)) (mail-aliases-setup))
+ (list (completing-read "Expand alias: " mail-aliases nil t))))
+ (if (not (vectorp mail-aliases)) (mail-aliases-setup))
(insert (or (and alias (symbol-value (intern-soft alias mail-aliases))) "")))
(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.")
(defvar compilation-parse-errors-function 'compilation-parse-errors
"Function to call to parse error messages from a compilation.
-It takes one arg: if non-nil, don't bother parsing past that location.
+It takes args LIMIT-SEARCH and FIND-AT-LEAST.
+If LIMIT-SEARCH is non-nil, don't bother parsing past that location.
+If FIND-AT-LEAST is non-nil, don't bother parsing after finding that
+ many new erros.
It should read in the source files which have errors and set
`compilation-error-list' to a list with an element for each error message
found. See that variable for more info.")
@@ -450,7 +453,7 @@ Does NOT find the source line like \\[next-error]."
;; Parse any new errors in the compilation buffer,
;; or reparse from the beginning if the user has asked for that.
-(defun compile-reinitialize-errors (argp &optional limit-search)
+(defun compile-reinitialize-errors (argp &optional limit-search find-at-least)
(save-excursion
(set-buffer compilation-last-buffer)
;; If we are out of errors, or if user says "reparse",
@@ -459,14 +462,17 @@ Does NOT find the source line like \\[next-error]."
(consp argp))
(progn (compilation-forget-errors)
(setq compilation-parsing-end 1)))
- (if (and compilation-error-list (not limit-search))
+ (if (and compilation-error-list
+ (not limit-search)
+ (or (not find-at-least)
+ (> (length compilation-error-list) find-at-least)))
;; Since compilation-error-list is non-nil, it points to a specific
;; error the user wanted. So don't move it around.
nil
(switch-to-buffer compilation-last-buffer)
(set-buffer-modified-p nil)
(let ((at-start (= compilation-parsing-end 1)))
- (funcall compilation-parse-errors-function limit-search)
+ (funcall compilation-parse-errors-function limit-search find-at-least)
;; Remember the entire list for compilation-forget-errors.
;; If this is an incremental parse, append to previous list.
(if at-start
@@ -559,7 +565,7 @@ See variables `compilation-parse-errors-function' and
\`compilation-error-regexp-alist' for customization ideas."
(interactive "P")
(setq compilation-last-buffer (compilation-find-buffer))
- (compile-reinitialize-errors argp)
+ (compile-reinitialize-errors argp nil (prefix-numeric-value argp))
;; Make ARGP nil if the prefix arg was just C-u,
;; since that means to reparse the errors, which the
;; compile-reinitialize-errors call just did.
@@ -750,7 +756,7 @@ See variables `compilation-parse-errors-function' and
(setq groupings (1+ groupings))))))))
groupings))
-(defun compilation-parse-errors (limit-search)
+(defun compilation-parse-errors (limit-search find-at-least)
"Parse the current buffer as grep, cc or lint error messages.
See variable `compilation-parse-errors-function' for the interface it uses."
(setq compilation-error-list nil)
@@ -758,7 +764,8 @@ See variable `compilation-parse-errors-function' for the interface it uses."
(let (text-buffer
regexp enter-group leave-group error-group
alist subexpr error-regexp-groups
- (found-desired nil))
+ (found-desired nil)
+ (nfound 0))
;; Don't reparse messages already seen at last parse.
(goto-char compilation-parsing-end)
@@ -873,18 +880,25 @@ See variable `compilation-parse-errors-function' for the interface it uses."
(setq compilation-error-list
(cons (cons (point-marker)
(cons filename linenum))
- compilation-error-list)))))
+ compilation-error-list))))
+ (setq nfound (1+ nfound))
+ (message "Parsing error messages...%d (%d%% of buffer)"
+ nfound
+ (/ (* 100 (point)) (point-max)))
+ (and find-at-least (>= nfound find-at-least)
+ ;; We have found as many new errors as the user wants.
+ (setq found-desired t)))
(t
(error "compilation-parse-errors: impossible regexp match!")))
(and limit-search (>= (point) limit-search)
;; The user wanted a specific error, and we're past it.
(setq found-desired t)))
- (if found-desired
- (setq compilation-parsing-end (point))
- ;; We have searched the whole buffer.
- (setq compilation-parsing-end (point-max))
- (message "Parsing error messages...done")))
- (setq compilation-error-list (nreverse compilation-error-list)))
+ (setq compilation-parsing-end (if found-desired
+ (point)
+ ;; We have searched the whole buffer.
+ (point-max))))
+ (setq compilation-error-list (nreverse compilation-error-list))
+ (message "Parsing error messages...done"))
(define-key ctl-x-map "`" 'next-error)