help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: In emacs 23 compile-mode doesn't recognize (c)perl error messages


From: LanX
Subject: Re: In emacs 23 compile-mode doesn't recognize (c)perl error messages
Date: Thu, 15 Oct 2009 07:44:25 -0700 (PDT)
User-agent: G2/1.0

Hi

> I tried to find a difference with what is incperl-mode.el, and
> failed.  Where is Waldo?

Oh...sorry!

 I'm very far from being a lisp expert and after 2 weeks of debugging
and quarreling with "emacs-experts" my system is cluttered with emacs
versions and config-files... and furthermore with all these
backslashes elisp-regexes are hard to read at a glance:

---------------
(defvar cperl-compilation-error-regexp-alist2
  ;; This look like a paranoiac regexp: could anybody find a better
one? (which WORKS).
  '(("^[^\n]* \\(file\\|at\\) \\([^ \t\n]+\\)[ \n\t]+line \\([0-9]+\\)
[\\., \n]"
     2 3 nil 0)
   )
  "Alist that specifies how to match errors in perl output.")

(if (fboundp 'eval-after-load)
    (eval-after-load
        "mode-compile"
      '(setq perl-compilation-error-regexp-alist
             cperl-compilation-error-regexp-alist2)))
------------

"Waldo" is between "filename" and "at" because diagnostics tries to
fit the message into less then 80 characters.

And IMHO the variable needs to be renamed because of conflicts with
the patched version of cperl-mode which already uses the old variable
name.


My testsuite with  emacs22

---------------------------------
lanx@nc10-ubuntu:~$  emacs .emacs error.pl -f cperl-mode -l /home/
lanx/.emacs.d/debug/mode-compile.el -f mode-compile -eval "(describe-
variable 'compilation-error-regexp-alist)"

lanx@nc10-ubuntu:~$ emacs .emacs error.pl -f cperl-mode -l /home/
lanx/.emacs.d/debug/mode-compile.el -f mode-compile -eval "(describe-
variable 'compilation-error-regexp-alist)"
^C
lanx@nc10-ubuntu:~$ cat error.pl
use strict;
use diagnostics;

my $a=A;
my $a=B;
$b=B;
-----------------------------

here the corresponding code in diagnostics.pm which shortens the
errormessage:

----------------------------
lanx@nc10-ubuntu:~$ perldoc -m diagnostics |tail -15

sub shorten {
    my $line = $_[0];
    if (length($line) > 79 and index($line, "\n") == -1) {
        my $space_place = rindex($line, ' ', 79);
        if ($space_place != -1) {
            substr($line, $space_place, 1) = "\n\t";
        }
    }
    return $line;
}
---------------------------------

Bye
  Rolf


reply via email to

[Prev in Thread] Current Thread [Next in Thread]