all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#13369: 24.1; compile message parsing slow because of omake hack
@ 2013-01-06 20:03 Mattias Engdegård
  2013-01-07  1:24 ` Glenn Morris
  0 siblings, 1 reply; 16+ messages in thread
From: Mattias Engdegård @ 2013-01-06 20:03 UTC (permalink / raw)
  To: 13369

Parsing compilation messages in compilation-mode can be very slow for
large buffers (thousands of error lines); it can take many
seconds. Experiments show that it is the presence of omake in
compilation-error-regexp-alist that causes most of the trouble; removing
it mostly cures the problem.

The omake regexp does not look too troublesome, but there are some
omake-specific hacks in compile.el that are more worrying. In
particular, this code (in compilation-parse-errors) looks suspicious:

       (cond
        ((not (memq 'omake compilation-error-regexp-alist)) nil)
        ((string-match "\\`\\([^^]\\|^\\( \\*\\|\\[\\)\\)" pat)
         nil) ;; Not anchored or anchored but already allows empty  
spaces.
        (t (setq pat (concat "^ *" (substring pat 1)))))

The slightly alarming concept of regexp-matching a regexp aside, this
one doesn't make sense - shouldn't the ^ (following the \|) be escaped?
Apparently the code was at some time changed from

   (when (and (= ?^ (aref pat 0)) ; anchored: starts with "^"
              ;; but does not allow an arbitrary number of leading  
spaces
              (not (and (= ?  (aref pat 1)) (= ?* (aref pat 2)))))

which looks more correct, and conveys the intent somewhat better
(and may be more efficient than the regexp for all I know).

It's not clear to me how the present code could ever have worked.
At the very least the regexp in compilation-parse-errors should
be fixed.

In GNU Emacs 24.1.1 (powerpc-apple-darwin, NS apple-appkit-1038.36)
  of 2012-06-10 on bob.porkrind.org
Windowing system distributor `Apple', version 10.3.949






^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2013-01-10 19:34 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-06 20:03 bug#13369: 24.1; compile message parsing slow because of omake hack Mattias Engdegård
2013-01-07  1:24 ` Glenn Morris
2013-01-07  1:41   ` Mattias Engdegård
2013-01-07  8:14     ` Glenn Morris
2013-01-07 21:50       ` Mattias Engdegård
2013-01-08 20:14         ` Glenn Morris
2013-01-08 21:09           ` Mattias Engdegård
2013-01-08 22:40             ` Glenn Morris
2013-01-09  1:47               ` Stefan Monnier
2013-01-09 11:11                 ` Mattias Engdegård
2013-01-09 13:42                   ` Jambunathan K
2013-01-09 14:31                     ` Mattias Engdegård
2013-01-09 15:17                       ` Jambunathan K
2013-01-10 18:55                         ` Mattias Engdegård
2013-01-10 19:34                           ` Stefan Monnier
2013-01-09 20:20                   ` Stefan Monnier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.