From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id MOY9C6S1WmIN4wAAgWs5BA (envelope-from ) for ; Sat, 16 Apr 2022 14:25:08 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 8NqfCKS1WmLJOwAA9RJhRA (envelope-from ) for ; Sat, 16 Apr 2022 14:25:08 +0200 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 A594AE8E for ; Sat, 16 Apr 2022 14:25:07 +0200 (CEST) Received: from localhost ([::1]:41924 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nfhUA-0005vC-Np for larch@yhetil.org; Sat, 16 Apr 2022 08:25:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56670) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nfhTK-0005v2-32 for emacs-orgmode@gnu.org; Sat, 16 Apr 2022 08:24:14 -0400 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]:35711) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nfhTI-0000HF-Ac for emacs-orgmode@gnu.org; Sat, 16 Apr 2022 08:24:13 -0400 Received: by mail-pl1-x635.google.com with SMTP id y6so9017795plg.2 for ; Sat, 16 Apr 2022 05:24:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:w-woof-bug:date :message-id:mime-version; bh=kR2zQw/T87+4t4EdB9XSUfrzKzO6xYCoeH59HnD7N7k=; b=RsN91NSJRCqrg1y+aGFrQ+TBRJYvIf1WjBbHDrLs19rworQuZ23RWs72ugTE36Yj9G xKCBGSIvjimJgzRDYlIX6J/e/MVvJAtsIfBvtJGcjjtqyQpNGFI2BoV0TDaxwEz4hkQn VJdFrz48ev2XgggS2YM6E5soZd+GZil+4yqWwTsf9HgeQGcEXqvJyitjHR7x+Q33aczi rSnX5WR2RJMeX1WP1dzxMXe3arP/ud0GlGWiyEkNqPby7luQeJOLpwxAUDJw0K273pEs Yx4dw7qwm/E7+U6XM6/IrlBX/0sliUTE/Bql27CLT27PvVlr6PZ5COHQ664uUUU2Tn82 6v+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references :w-woof-bug:date:message-id:mime-version; bh=kR2zQw/T87+4t4EdB9XSUfrzKzO6xYCoeH59HnD7N7k=; b=RKBZJZ9EFh1xRVqn+5Cri2NDOqhtZsFEuYkkcKtYp2odo25ntdwYF4hlsOScliOajw wlkzfyCRqEaTZtm265W44WO5ag1esyIeR5T3lc8aYVPaMYmN1ncLtbLfRwkYOIlsDgY1 g0U1f4gMAabXBfhTDYPE7vyHH1blcdh6Ba2JeNnzuSH0Qkgk38oHyRtRt6A6E+NkriAK 00Y8s5VaFjz5VwsNPlWwyg/obyvByYhLhmxboqaTU7sN03OIhTf5xUGZSJNMrU+d9Gz/ jK+aN0XGOkTepB+MCOFMQ902oi7ndK1V1WjK7hQx3kE814lTHkG1CYvGNl6mJr7QWNAn QOuQ== X-Gm-Message-State: AOAM533vcjWpRqKEOMccdcZT9ot9ZEGtQda92uqpfNT0rrbnkWCzWIMr XWWs2e72uyhmsRehBrryPQE= X-Google-Smtp-Source: ABdhPJzf8GZt9Uic10v2iLFI8z7RuzcJ/mXq70DecrOuo0wz0V3w9L3IER29tgFqlYrkCcl4hwgkFA== X-Received: by 2002:a17:90b:4b82:b0:1cb:7aec:a830 with SMTP id lr2-20020a17090b4b8200b001cb7aeca830mr9034816pjb.232.1650111850715; Sat, 16 Apr 2022 05:24:10 -0700 (PDT) Received: from localhost ([134.73.240.160]) by smtp.gmail.com with ESMTPSA id y23-20020a056a00181700b0050839558f4bsm6444552pfa.40.2022.04.16.05.24.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Apr 2022 05:24:10 -0700 (PDT) From: Ihor Radchenko To: Alan Wehmann Subject: Re: link error when file missing In-Reply-To: References: W-Woof-Bug: ol-docview: Error when opening link to non-existing file containing page locator Date: Sat, 16 Apr 2022 20:25:03 +0800 Message-ID: <87zgklmd0g.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::635; envelope-from=yantar92@gmail.com; helo=mail-pl1-x635.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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, T_SCC_BODY_TEXT_LINE=-0.01 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: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1650111907; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=kR2zQw/T87+4t4EdB9XSUfrzKzO6xYCoeH59HnD7N7k=; b=LEoMsjx0qp1UFY2saQD/ELXdk89VJpJ7buHTSP9z2UHtBoUKXNQeEyUqFK+sj7OOnGlpa6 AfLAnxDkQhZqN0XtLtO+VEmMRR6+tAQBUDxEBNJeTZAG+XPJukeHZYtigpQwlL2LjGuLXH BoPOqew0McpnMIT6jLqh59JZeq76grvZtlscSpRXV57347u/TdwbPWZ6juYi3cdk7CcAzV 3Xe2qPn6FzWK2y3E/uUvVTVC4Fo65r8yh+s6U04WAwL3/LT5gxHHzBxLJL9bZ2sliA1rz0 WSMh16oyWzVetRtImzgn4w9GOlDUeQeG+Zb8UTR06vngsJ6Oi3y59tiJ3PXH0A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1650111907; a=rsa-sha256; cv=none; b=eIk8P8tF3kKCQhn9PgCrowWiV3oSfx7l/yOzeySvVpmQa1s3H+/ISWjGPTZjRoXVeOVbVa rD1XmRqZQKnHCs487zhLLynyinj4eXnNii4PP8dugB4HZyqmYMayjv32Y9nCDmAQcfS1S3 V9QenbG0PVMsLorcozMH2DvCUY/jqRJKuwX8pNNtO5NX/PgW9F7fzuZwct5jL9p13yFmrI ydd0ZMW4CBxDi2cUIxL5Eg5Gu0aGwm+Zyh988qgLpH4dEQzUWUWgt86Qr+0KHUS02bGP7W 0U3eLZYV1cNPIduHulTe+5am5rKprcoFzhyGUd/XBPgpkhJQr5Vx93JcJ1rbpw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=RsN91NSJ; dmarc=pass (policy=none) header.from=gmail.com; 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" X-Migadu-Spam-Score: -3.55 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=RsN91NSJ; dmarc=pass (policy=none) header.from=gmail.com; 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" X-Migadu-Queue-Id: A594AE8E X-Spam-Score: -3.55 X-Migadu-Scanner: scn1.migadu.com X-TUID: CB8vWsterMn4 Alan Wehmann writes: > I have a link in a text file that looks as follows, in fundamental mode: > > 5. Contracts: [[docview:~/Documents/Wheaton_condo/landscaping/from Mark/2019/ALM_landscape_contract_Fall_2018.pdf::1][Landscape]], [[docview:~/Documents/Wheaton_condo/landscaping/from Mark/2018/ALM_snow_management_contract_Fall_2018.pdf::1][Snow]] > > The path is deliberately wrong in the first link--in order to demonstrate the error that results. The year "2019" there should be "2018" and then in that case the link works properly (when the file is set to org-mode); the result of using the proper link is that the document is shown in a docview buffer. > > As is, there is an error thrown & below is the backtrace for it (after appropriate use of "toggle-debug-on-error") > > Debugger entered--Lisp error: (wrong-type-argument listp t) > image-mode-winprops(nil) > image-mode-window-put(page 0 nil) > doc-view-goto-page(1) > org-docview-open("~/Documents/Wheaton_condo/landscaping/from Mark/20..." nil) Confirmed. This is caused by ol-docview's assumption (see org-docview-open) that org-open-file does not open non-existing file, as it is stated in org-open-file docstring: >> If the file does not exist, throw an error. However, the docstring is not quite correct. Below is code in org-open-file that is repronsible for throwing the error: (when (and (not (eq cmd 'emacs)) ; Emacs has no problems with non-ex files (not (file-exists-p file)) (not org-open-non-existing-files)) (user-error "No such file: %s" file)) Clearly, throwing or not throwing error is controlled by org-open-non-existing-files and org-open-file never throws an error with non-nil first optional argument (IN-EMACS). This code has been introduced years ago by Carsten. We have several options to fix the issue: 1. Only fix the reported issue in ol-docview.el and extend org-open-file documention 2. In addition, make org-open-file throw an error when opening non-existing files in emacs (unless org-open-non-existing-files is non-nil) The second option poses a risk of breaking existing configs. WDYT? Best, Ihor