# HG changeset patch # User Roland McGrath # Date 712726598 0 # Node ID 48ca3bf4b5f8e138c8b9f1b7712acea5978fdc2d # Parent 97064c6420e72c122e9f0068fc792901b499f6fb *** empty log message *** diff -r 97064c6420e7 -r 48ca3bf4b5f8 lisp/diff.el --- a/lisp/diff.el Sun Aug 02 02:34:46 1992 +0000 +++ b/lisp/diff.el Sun Aug 02 03:36:38 1992 +0000 @@ -54,7 +54,7 @@ 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 @@ (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 -r 97064c6420e7 -r 48ca3bf4b5f8 lisp/mail/mailabbrev.el --- a/lisp/mail/mailabbrev.el Sun Aug 02 02:34:46 1992 +0000 +++ b/lisp/mail/mailabbrev.el Sun Aug 02 03:36:38 1992 +0000 @@ -3,11 +3,12 @@ ;;; Copyright (C) 1985, 1986, 1987, 1992 Free Software Foundation, Inc. ;; Author: Jamie Zawinski -;; Roland McGrath +;; Maintainer: Jamie Zawinski ;; 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 @@ (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 @@ (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 -r 97064c6420e7 -r 48ca3bf4b5f8 lisp/progmodes/compile.el --- a/lisp/progmodes/compile.el Sun Aug 02 02:34:46 1992 +0000 +++ b/lisp/progmodes/compile.el Sun Aug 02 03:36:38 1992 +0000 @@ -49,7 +49,10 @@ (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 @@ ;; 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 @@ (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 @@ \`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 @@ (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 @@ (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 @@ (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)