From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id oKmFK6Q7b2c0ZgAAe85BDQ:P1 (envelope-from ) for ; Fri, 27 Dec 2024 23:43:32 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id oKmFK6Q7b2c0ZgAAe85BDQ (envelope-from ) for ; Sat, 28 Dec 2024 00:43:32 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=purvis.id.au header.s=fm3 header.b=pgZrDJgy; dkim=fail ("body hash did not verify") header.d=messagingengine.com header.s=fm2 header.b=Q93yLZpP; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1735343012; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=ownknY9PkydnUcKon/7LwkjcfTLq9Bi9J4nOJZv+Blw=; b=eg4G+vs48dq/5GXMQaK2LRlaUwSC5BqunQyhOaGR7nXOwviAdBAWgMbr/LF0EGJQ6ByARu NQJanWevJZy7IZr0CEbOPVSsBHHPSz9Ldhq5Ga0OFUg9Jev2SijdwrO2KMVV6JNR6UWb32 fUcTM784xvkI2V5X2iH6kL18vrGTEGmoas2BVeF3ZxnBW7PuL8G4C0bFpIx2IMPUr+G/2Q diYT3YmC1v9kx/mqOhw9/Cs3QZ/mT8i/IgqY1AIQOVwdzoLBu/MaPGecVvVz+JH9/rZTSm wcJjIp3hChcNMpVe40J8AfhFLJchKsRlSNqI99uz/lGsjN4pMotIvunTAtcwlw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=purvis.id.au header.s=fm3 header.b=pgZrDJgy; dkim=fail ("body hash did not verify") header.d=messagingengine.com header.s=fm2 header.b=Q93yLZpP; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1735343012; a=rsa-sha256; cv=none; b=Z66JTgzGV9H2kjc0TlIoTj0XKgrkM2QOnEwyst+HF3zLp4WHPM2YgqhH0WHfnb4l5Hyr26 Yjslc0WBuif9K0Bjyi+4wrNbCP9y4uYlPB/HnNFR8j8Ce+0yTnY90hqAzxHjJpx2H7OJjd uskCi80YBmr7c+TI4TDFasjZxWWqx3nvN5cAW5+ZJmd2YVJBWO70NF3NAOZFK7jeBJv4iv 5WvTBzay06zwd96xUTQmTSazoClisHC/66v5HSa2uIlBpH2F4lUBNPZnhYA28eZLUJNMFf elhIA1JenF4gPQU69ZRGau0EF7TayZwFgh7AOG//QQDL295015pd+gUvlDCxfg== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 25A741A170 for ; Sat, 28 Dec 2024 00:43:31 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tRJyP-0000z7-NJ; Fri, 27 Dec 2024 18:42:29 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tRJyN-0000ym-67 for emacs-orgmode@gnu.org; Fri, 27 Dec 2024 18:42:27 -0500 Received: from fhigh-b6-smtp.messagingengine.com ([202.12.124.157]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tRJyJ-0001DS-9o for emacs-orgmode@gnu.org; Fri, 27 Dec 2024 18:42:25 -0500 Received: from phl-compute-09.internal (phl-compute-09.phl.internal [10.202.2.49]) by mailfhigh.stl.internal (Postfix) with ESMTP id 25FC4254010C for ; Fri, 27 Dec 2024 18:42:20 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-09.internal (MEProxy); Fri, 27 Dec 2024 18:42:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=purvis.id.au; h= cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1735342939; x=1735429339; bh=+XhYsNWyV3 ZtzUxaqzWJgE7eTERUc4ocnSxqbD4Qmdk=; b=pgZrDJgynag54l6BnYKSJprEOY fm+xwZcDPy6qy7eUjHaVelhLqWP58Gb+NkVBVH09QxCZtdq3ZRAX3d+ZVAJYEQXk fC0G2xGLvM9djzbi6L6ynkYXizeJxq62m2o7vCVwCFST2Iqi42E6Njcoo96Xbv4u p9IHOXuNzybRsC19DzpjQzfTcE7htYYzGoNuydjEV1r6Ytv9EnLA+dMxsgdcjGds 9gGc5Rf1+mFXipX5/PHwFTp9P4Wi6NqqRVfhY4kJ7QLbq7CkM/IIF4hf+RepjBhN EM0ALK7s/SmLPtXEUYZdZWqAwoL+tVK8IYKikELuBkZdPR7288/cxHlJkgDw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1735342939; x=1735429339; bh=+XhYsNWyV3ZtzUxaqzWJgE7eTERUc4ocnSx qbD4Qmdk=; b=Q93yLZpPCk/VSkfeVroLl+gU8A5SJuO1cRqMLTZS0Pl8qy8NLS9 aW3/qrJpfZxjMr5vCrGap9oIbvpGi4dej/RXYI706pboGhDqJBM40ETsrgQvJXV9 EleUz4CGOvWn3ObvBf+Rha5QdWigzIwu1i4oNqbxUDQUxye4CiGisrZZRKvBLc/S 0FPBvuyyq8LCEOx40O/dD6qd/r4mPxvstd9NfTWI9gmIJWEELlkj3c/l5V4krfca NaO2mEw8HPKu8SfBAsy0b0zf2NDXQFkDjtiDedQE74JytC9KTdeuTl0IT+SnY/OE EtcWJC+cR7dDlpqB5Tv+tPL6wK/vgKTSVvA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddruddvuddgudefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefhvffujg hffffkfgggtgesmhdtreertdertdenucfhrhhomhepofgrlhgtohhlmhcurfhurhhvihhs uceomhgrlhgtohhlmhesphhurhhvihhsrdhiugdrrghuqeenucggtffrrghtthgvrhhnpe eiudfhueeigfevteevgedutdevleejgedvgfduleeuvdeiueevudeukeefieelvdenucev lhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrghltgholh hmsehpuhhrvhhishdrihgurdgruhdpnhgspghrtghpthhtohepuddpmhhouggvpehsmhht phhouhhtpdhrtghpthhtohepvghmrggtshdqohhrghhmohguvgesghhnuhdrohhrgh X-ME-Proxy: Feedback-ID: i9199493a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Fri, 27 Dec 2024 18:42:18 -0500 (EST) From: Malcolm Purvis To: emacs-orgmode@gnu.org Subject: Re: [PATCH] Add next-error support to org-lint report buffer In-Reply-To: <874j2tibsn.fsf@localhost> (Ihor Radchenko's message of "Tue, 24 Dec 2024 11:02:32 +0000") References: <874j2tibsn.fsf@localhost> Date: Sat, 28 Dec 2024 10:42:16 +1100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=202.12.124.157; envelope-from=malcolm@purvis.id.au; helo=fhigh-b6-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: 0.80 X-Spam-Score: 0.80 X-Migadu-Queue-Id: 25A741A170 X-TUID: fmSBxgumrx2n --=-=-= Content-Type: text/plain; format=flowed > Thanks for the patch! Unfortunately, the patch seems to be > malformed (something inserted line breaks in inappropriate > places). May you please re-send the patch as an attachment, to > make sure that your MUA does not break things? Apologies for the malformed patch. Here it is as an attachment. Malcolm -- Malcolm Purvis --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Add-next-error-support-to-org-lint-report-buffer.patch >From 72a4e81238a78af1a58c49c1418cffb4032f3bfd Mon Sep 17 00:00:00 2001 From: Malcolm Purvis Date: Sat, 14 Dec 2024 17:18:09 +1100 Subject: [PATCH] Add next-error support to org-lint report buffer * doc/org-manual.org (Org Syntax): Add next-error keybinding * etc/ORG-NEWS: * lisp/org-lint.el: Register org-lint report buffer with next-error infra. Add callback function to display error. --- doc/org-manual.org | 12 ++++++------ etc/ORG-NEWS | 5 +++++ lisp/org-lint.el | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 6 deletions(-) diff --git a/doc/org-manual.org b/doc/org-manual.org index d95a9350e..7f6683428 100644 --- a/doc/org-manual.org +++ b/doc/org-manual.org @@ -20874,12 +20874,12 @@ a "trust level", since false-positive are possible. From there, you can operate on the reports with the following keys: #+attr_texinfo: :columns 0.22 0.78 -| {{{kbd(C-j)}}}, {{{kbd(TAB)}}} | Display the offending line | -| {{{kbd(RET)}}} | Move point to the offending line | -| {{{kbd(g)}}} | Check the document again | -| {{{kbd(h)}}} | Hide all reports from the same checker | -| {{{kbd(i)}}} | Also remove them from all subsequent checks | -| {{{kbd(S)}}} | Sort reports by the column at point | +| {{{kbd(C-j)}}}, {{{kbd(TAB)}}} | Display the offending line | +| {{{kbd(RET)}}} | Move point to the offending line | +| {{{kbd(C-x `)}}} | Move to the next report and display the offending line | +| {{{kbd(g)}}} | Check the document again | +| {{{kbd(h)}}} | Hide all reports from the same checker | +| {{{kbd(i)}}} | Also remove them from all subsequent checks | ** Context Dependent Documentation :PROPERTIES: diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index 08857962b..a38b761ad 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -355,6 +355,11 @@ The Texinfo exporter no longer removes links from headings. This applies to all headings, below and above the =H= and =toc= export =#+OPTIONS:=. +*** next-error supports =org-lint= reports + +The command =next-error= can now be used to jump to the next +=org-lint= error. + * Version 9.7 ** Important announcements and breaking changes diff --git a/lisp/org-lint.el b/lisp/org-lint.el index c85d839bc..040934235 100644 --- a/lisp/org-lint.el +++ b/lisp/org-lint.el @@ -172,6 +172,35 @@ are additional check identifiers to be removed." ;;; Reports UI +;; next-error support +(defvar org-lint--next-error-top-of-buffer t + "Is the next error the one at the first line of the buffer? + +Unlike compilation and grep buffers the first line of the org lint +report refers to an error. This needs special handling.") + +(defun org-lint--next-error-function (n &optional reset) + "Find and display the next line error in the report. +N is an integer specifying by how many errors to move. +RESET is a boolean which, if non-nil, says to go back to the beginning +of the errors before moving. + +This function is the local support for the next-error machinery." + (when reset + (setq org-lint--next-error-top-of-buffer t) + (goto-char (point-min))) + (when org-lint--next-error-top-of-buffer + (setq + org-lint--next-error-top-of-buffer nil + n (1- n))) ; In compilation buffers, point starts before the + ; first error, so stepping forward one brings you to + ; the first error. Here the first error is on the + ; first line so adjust the count accordingly. + (forward-line n) + (org-lint--show-source)) + +;; Report mode + (defvar org-lint--report-mode-map (let ((map (make-sparse-keymap))) (set-keymap-parent map tabulated-list-mode-map) @@ -186,6 +215,12 @@ are additional check identifiers to be removed." (define-derived-mode org-lint--report-mode tabulated-list-mode "OrgLint" "Major mode used to display reports emitted during linting. \\{org-lint--report-mode-map}" + ;; next-error support. + (make-local-variable 'org-lint--next-error-top-of-buffer) + (setq + next-error-function 'org-lint--next-error-function + next-error-last-buffer (current-buffer)) + (setf tabulated-list-format `[("Line" 6 (lambda (a b) -- 2.47.1 --=-=-=--