lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070917193249.GA9738@silverwood.ncultra.org>
Date:	Mon, 17 Sep 2007 15:32:49 -0400
From:	Mike Day <ncmike@...ltra.org>
To:	Andy Whitcroft <apw@...dowen.org>
Cc:	Randy Dunlap <rdunlap@...otime.net>,
	Joel Schopp <jschopp@...tin.ibm.com>,
	Andy Whitcroft <apw@...dowen.org>, linux-kernel@...r.kernel.org
Subject: [PATCH] emacs compile window support for checkpatch version .10

Adds support to checkpatch.pl for running in the emacs compile window.
This allows emacs users to jump from the error in the compile window
directly to the offending line in the patch.

Use a script like the following to run in emacs:

(defun checkpatch()
  (interactive)
  (compile (concat "checkpatch.pl --emacs " (buffer-file-name))))

Signed-off-by: Mike D. Day <ncmike@...ltra.org>

--- checkpatch.pl-0.10	2007-09-17 15:24:21.000000000 -0400
+++ checkpatch.emacs.pl	2007-09-17 14:48:38.000000000 -0400
@@ -18,12 +18,16 @@
 my $chk_signoff = 1;
 my $chk_patch = 1;
 my $tst_type = 0;
+my $emacs = 0;
+my $linenr = 0;
+
 GetOptions(
 	'q|quiet'	=> \$quiet,
 	'tree!'		=> \$tree,
 	'signoff!'	=> \$chk_signoff,
 	'patch!'	=> \$chk_patch,
 	'test-type!'	=> \$tst_type,
+    'emacs!'    => \$emacs,
 ) or exit;
 
 my $exit = 0;
@@ -33,6 +37,7 @@
 	print "version: $V\n";
 	print "options: -q           => quiet\n";
 	print "         --no-tree    => run without a kernel tree\n";
+	print "         --emacs      => emacs compile window format\n";
 	exit(1);
 }
 
@@ -306,15 +311,27 @@
 	@report;
 }
 sub ERROR {
+  if ($emacs) {
+	report("$ARGV:$linenr: ERROR: $_[0]\n");
+  } else {
 	report("ERROR: $_[0]\n");
-	our $clean = 0;
+  }
+  our $clean = 0;
 }
 sub WARN {
+  if ($emacs) {
+	report("$ARGV:$linenr: WARNING: $_[0]\n");
+  } else {
 	report("WARNING: $_[0]\n");
+  }
 	our $clean = 0;
 }
 sub CHK {
+  if ($emacs) {
+  	report("$ARGV:$linenr: CHECK: $_[0]\n");
+  } else {
 	report("CHECK: $_[0]\n");
+  }
 	our $clean = 0;
 }
 
@@ -322,7 +339,6 @@
 	my $filename = shift;
 	my @lines = @_;
 
-	my $linenr=0;
 	my $prevline="";
 	my $stashline="";
 

-- 
Mike Day
http://www.ncultra.org
AIM: ncmikeday |  Yahoo IM: ultra.runner
PGP key: http://www.ncultra.org/ncmike/pubkey.asc
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ