From a5d5683da2e4397fc346f8462b801951ed02e47b Mon Sep 17 00:00:00 2001 From: skimo Date: Wed, 12 Jul 2000 12:23:29 +0000 Subject: [PATCH] display tag message --- ex/ex_tag.c | 14 ++++++++++++-- ex/tag.h | 4 +++- perl_scripts/make.pl | 47 ++++++++++++++++++++--------------------------- 3 files changed, 35 insertions(+), 30 deletions(-) rewrite perl_scripts/make.pl (94%) diff --git a/ex/ex_tag.c b/ex/ex_tag.c index e2364136..3d754439 100644 --- a/ex/ex_tag.c +++ b/ex/ex_tag.c @@ -13,7 +13,7 @@ #include "config.h" #ifndef lint -static const char sccsid[] = "$Id: ex_tag.c,v 10.43 2000/06/29 19:41:52 skimo Exp $ (Berkeley) $Date: 2000/06/29 19:41:52 $"; +static const char sccsid[] = "$Id: ex_tag.c,v 10.44 2000/07/12 12:23:29 skimo Exp $ (Berkeley) $Date: 2000/07/12 12:23:29 $"; #endif /* not lint */ #include @@ -174,6 +174,8 @@ ex_tag_next(sp, cmdp) (void)cscope_search(sp, tqp, tp); else (void)ctag_search(sp, tp->search, tp->slen, tqp->tag); + if (tqp->current->msg) + msgq(sp, M_INFO, tqp->current->msg); return (0); } @@ -209,6 +211,8 @@ ex_tag_prev(sp, cmdp) (void)cscope_search(sp, tqp, tp); else (void)ctag_search(sp, tp->search, tp->slen, tqp->tag); + if (tqp->current->msg) + msgq(sp, M_INFO, tqp->current->msg); return (0); } @@ -664,13 +668,17 @@ tag_copy(sp, otp, tpp) len += otp->fnlen + 1; if (otp->search != NULL) len += otp->slen + 1; + if (otp->msg != NULL) + len += otp->mlen + 1; MALLOC_RET(sp, tp, TAG *, len); memcpy(tp, otp, len); if (otp->fname != NULL) tp->fname = tp->buf; if (otp->search != NULL) - tp->search = tp->fname + otp->fnlen + 1; + tp->search = tp->buf + (otp->search - otp->buf); + if (otp->msg != NULL) + tp->msg = tp->buf + (otp->msg - otp->buf); *tpp = tp; return (0); @@ -798,6 +806,8 @@ tagq_push(sp, tqp, new_screen, force) (void)ctag_search(sp, tqp->current->search, tqp->current->slen, tqp->tag); + if (tqp->current->msg) + msgq(sp, M_INFO, tqp->current->msg); /* * Move the current context from the temporary save area into the diff --git a/ex/tag.h b/ex/tag.h index 18e71070..c15cec59 100644 --- a/ex/tag.h +++ b/ex/tag.h @@ -8,7 +8,7 @@ * * See the LICENSE file for redistribution information. * - * $Id: tag.h,v 10.6 2000/04/21 19:00:38 skimo Exp $ (Berkeley) $Date: 2000/04/21 19:00:38 $ + * $Id: tag.h,v 10.7 2000/07/12 12:23:29 skimo Exp $ (Berkeley) $Date: 2000/07/12 12:23:29 $ */ /* @@ -86,6 +86,8 @@ struct _tag { /* Tag list. */ db_recno_t slno; /* Search line number. */ char *search; /* Search string. */ size_t slen; /* Search string length. */ + char *msg; /* Message string. */ + size_t mlen; /* Message string length. */ char buf[1]; /* Variable length buffer. */ }; diff --git a/perl_scripts/make.pl b/perl_scripts/make.pl dissimilarity index 94% index 118dd99a..54a9c86c 100644 --- a/perl_scripts/make.pl +++ b/perl_scripts/make.pl @@ -1,27 +1,20 @@ -sub make { - open MAKE, "make 2>&1 1>/dev/null |"; - while() { - if (($file, $line, $msg) = /([^: ]*):(\d*):(.+)/) { - if ($file == $prevfile && $line == $prevline) { - $error[-1]->[2] .= "\n$msg"; - } else { - push @error, [$file, $line, $msg]; - ($prevline, $prevfile) = ($line, $file); - } - } - } - close MAKE; -} - -sub nexterror { - if ($index <= $#error) { - my $error = $error[$index++]; - $curscr->Edit($error->[0]); - $curscr->SetCursor($error->[1],0); - $curscr->Msg($error->[2]); - } -} - -# preverror is left as an exercise - -1; +sub push_tags { + my ($fh) = shift; + my ($tagq) = $curscr->TagQ("msg"); + while(<$fh>) { + my ($f, $l, $m); + if ((($f, $l, $m) = split /:/) >= 2 && -f $f && $l =~ /^\d+$/) { + $tagq->Add($f, $l, $m); + } + } + $tagq->Push(); +} + +sub make { + local (*FH); + open FH, "make 2>&1 |"; + ::push_tags(\*FH); + close FH; +} + +1; -- 2.11.4.GIT