From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 0KcNKlXhbl9AcQAA0tVLHw (envelope-from ) for ; Sat, 26 Sep 2020 06:36:05 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id CEPaJVXhbl8NFgAAB5/wlQ (envelope-from ) for ; Sat, 26 Sep 2020 06:36:05 +0000 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 3B7469400D3 for ; Sat, 26 Sep 2020 06:36:05 +0000 (UTC) Received: from localhost ([::1]:42976 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kM3oR-0002x1-Sp for larch@yhetil.org; Sat, 26 Sep 2020 02:36:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48204) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kM3nx-0002wr-9r for emacs-orgmode@gnu.org; Sat, 26 Sep 2020 02:35:33 -0400 Received: from mail-qt1-x835.google.com ([2607:f8b0:4864:20::835]:34817) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kM3nu-0007yH-7Z for emacs-orgmode@gnu.org; Sat, 26 Sep 2020 02:35:33 -0400 Received: by mail-qt1-x835.google.com with SMTP id o21so3697903qtp.2 for ; Fri, 25 Sep 2020 23:35:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=eLsoB3/rluKQa0jkWL2c2eehaBBA7g6VG9QvVKLiT6A=; b=dEIdWT89p1/B7gCzy0X2qYgMj/EP+ZaD7rkrii6tq96lMRO+scpSadQqSvIwTFrjba pT7bQFBpB4Hk90dPgSXWKE/ww9UhJL9M5Xv1sL4jC+16knZ6tFjFgFJU7LiMUcH4Vaf2 kmwmJF1KgD4KLiupm9mAID2c2Bj5xTThOjzog8bvozcn3ZWZsFkAu/wPKn3PAeSzrmpw bsJsQk/0xD1MaylRqUsGLWIKenepK8z6gsZntYdy3GPODIO3wSAgCCQ8YIA+5JgPhYb8 W3vD47GNpm1DmB0AjA73gX23FGXBf1N/9I38pjQIZijB4tZfWi0SF7KwdqNDDxvWhpeh oVkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=eLsoB3/rluKQa0jkWL2c2eehaBBA7g6VG9QvVKLiT6A=; b=Iw2UY1YWNY9V0ae8pbIjUJa9Pz/oKS0t8lZe+6EZ/FxBGhDBAz/ESYKb5m8OtH5dPh t3UEw1/bCAFffccPSjo+L8UvJiajfrsqr6fE70tMvv2adEN2x3i3Dwa5Z8Q5rCW0a2UV w9Ba01heKcGnKkNwIGt8HP5Gu5/5kJYwto8M6IgRoChZROGsMqGX1dIrFVcnguSEZBM7 8CZPfcggZSUEAxqDMlvnH/ozvcpbkZee94vhTDV1OU7fW/H+RJGjKjIir4klKQZwxy5u A5uekmAftc1kq/VD/IybMIDoa2u43Oss25j+Ciy/CDN+g4IeQANiN+JwIvYSBdAgQuZW m60A== X-Gm-Message-State: AOAM533q8oCC2g6EStUYZ62gWxYaXPW4tf1NwWtHo5a4x/CvVgf/kOna 7HMvL7kuwKIH9D9ff3OoBee7CdWgteuSfw== X-Google-Smtp-Source: ABdhPJz85KcrNOn8UvVw5sSVRchKDfxq93sBdqY12GUw7x9IGdhWWJm2UIm/Dzvs0ylIK/514BX93Q== X-Received: by 2002:aed:27dd:: with SMTP id m29mr3422657qtg.165.1601102128414; Fri, 25 Sep 2020 23:35:28 -0700 (PDT) Received: from localhost ([208.167.241.222]) by smtp.gmail.com with ESMTPSA id w128sm3279978qkb.6.2020.09.25.23.35.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Sep 2020 23:35:27 -0700 (PDT) From: Ihor Radchenko To: emacs-orgmode@gnu.org Subject: [PATCH] Fix `org-lint-link-to-local-file' Date: Sat, 26 Sep 2020 14:34:22 +0800 Message-ID: <87wo0ht5ap.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::835; envelope-from=yantar92@gmail.com; helo=mail-qt1-x835.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=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.23 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" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=dEIdWT89; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: -1.21 X-TUID: oPxonfnhUEUz --=-=-= Content-Type: text/plain I have been trying to run org-lint on my files recently. Ended up fixing org-lint itself... See the attached. Best, Ihor --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Fix-org-lint-link-to-local-file.patch >From feacb6fd2898b5788e6d70b3139cf83359b96ca6 Mon Sep 17 00:00:00 2001 From: Ihor Radchenko Date: Sat, 26 Sep 2020 14:24:44 +0800 Subject: [PATCH] Fix `org-lint-link-to-local-file'. * lisp/org-lint.el (org-lint-link-to-local-file): 1. Fix call to `org-attach-expand' being called with point not at the attachment: link. 2. Fix typo in call to `format'. File argument had to be outside the if. --- lisp/org-lint.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lisp/org-lint.el b/lisp/org-lint.el index 79ad640e4..e4e0ef751 100644 --- a/lisp/org-lint.el +++ b/lisp/org-lint.el @@ -574,15 +574,16 @@ Use :header-args: instead" (let* ((path (org-element-property :path l)) (file (if (string= type "file") path - (org-attach-expand path)))) + (org-with-point-at (org-element-property :begin l) + (org-attach-expand path))))) (and (not (file-remote-p file)) (not (file-exists-p file)) (list (org-element-property :begin l) (format (if (org-element-lineage l '(link)) "Link to non-existent image file %S \ in description" - "Link to non-existent local file %S" - file)))))) + "Link to non-existent local file %S") + file))))) (_ nil)))))) (defun org-lint-non-existent-setupfile-parameter (ast) -- 2.26.2 --=-=-=--