From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id KCXCLHU4KmPdYgAAbAwnHQ (envelope-from ) for ; Wed, 21 Sep 2022 00:02:29 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id sMqALHU4KmMRfQEAauVa8A (envelope-from ) for ; Wed, 21 Sep 2022 00:02:29 +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 73AF83A1DE for ; Wed, 21 Sep 2022 00:02:29 +0200 (CEST) Received: from localhost ([::1]:59166 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oal4T-0005lE-7Y for larch@yhetil.org; Tue, 20 Sep 2022 17:46:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38656) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oageh-0001kX-Hy for emacs-orgmode@gnu.org; Tue, 20 Sep 2022 13:03:31 -0400 Received: from ciao.gmane.io ([116.202.254.214]:39426) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oagef-00078l-UJ for emacs-orgmode@gnu.org; Tue, 20 Sep 2022 13:03:31 -0400 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1oagec-00080H-OD for emacs-orgmode@gnu.org; Tue, 20 Sep 2022 19:03:26 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: emacs-orgmode@gnu.org From: Max Nikulin Subject: Re: Org mode links: Open a PDF file at a given page and highlight a given string Date: Wed, 21 Sep 2022 00:03:18 +0700 Message-ID: References: <87lfb5pbej.fsf@gmail.com> <87r106z2g5.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Content-Language: en-US In-Reply-To: <87r106z2g5.fsf@localhost> Received-SPF: pass client-ip=116.202.254.214; envelope-from=geo-emacs-orgmode@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: 6 X-Spam_score: 0.6 X-Spam_bar: / X-Spam_report: (0.6 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FORGED_MUA_MOZILLA=2.309, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, NICE_REPLY_A=-2.182, NML_ADSP_CUSTOM_MED=0.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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" 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=1663711349; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=4Ly6JV2ejr6tbjIHoxlpq1fgviApsPlpwK8UVez+9HQ=; b=ExvNPapvV59Ste8WcyIyaBLGqfu9na/q8eHcjlfGzekjwCK3Qjq8l6PUh2Z2RMXAi+UZGT f+ta0avtpwuCWnNth0ygC0SfRsQB7iqgGwfhvZKdL/OcTSQhlRfE/QcZsQKAEsizbj4RXj Azr/6Kq0Q8SmtwQVlVfYW5R6zpWIiUdYTqlouxbiKaAjoIKhft/psGQMM6NBLFIVAQz5Ak H27ofjhbdgBLD8BeIy4fIElShdBHqPcIWfTBErYeVm79S5clJTI5rvRty6d0iXYwaWzad8 fizW2KtRn8Gz2jar4aVVJHi4dCfz5ZuKHOD+Xbb92Vy1DWMDFRMgDr4YkiLvKw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1663711349; a=rsa-sha256; cv=none; b=rR0mPpZCJi8TZJVQsRLLLtnw/uPCmHBZVrYTErAmrQjncJBDmecZj/3w5bDZv0Opap7dCq RQxt0S8W7y6UvyF1JVKmhICxRwQnO2h7K8/gHUSPg72fFEcvG4RTML4kBH8HunuShd+3+K xgsqv/SjtB5EMvvgSFroCiDBn3En3V62kmbssapwgodhv7j8DqtpmoouVHNEQIhh+Izx4v wfERMA7/sTp2zL7ck7Acqv/GkZyU9EDM1kJsoP3XeozHlN0DVEyR/13pzGZetuoEgU0aFz lvSEL//rE2Ui1pMCU7iHCFsCNWwuetDeZe+hC8H9bGKAaUJlqoLpkF8E9orfCQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); 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: 4.37 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); 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: 73AF83A1DE X-Spam-Score: 4.37 X-Migadu-Scanner: scn1.migadu.com X-TUID: LFaGnqKDcuYl On 20/09/2022 18:54, Ihor Radchenko wrote: > Max Nikulin writes: > >> Currently I believe that instead of injecting up to 6 entries into >> `org-file-apps' for various combinations of page, anchor, and search >> pattern, it is better to add single record with function handler. Notice >> that the approach presented above is not affected by the bug with >> multiple regexp group. Its additional advantage is that shell is not >> involved, so peculiar file names can not cause execution of some code >> when quoting and escaping are messed up. >> >> I think a set of functions for popular PDF viewers (evince, zathura, >> okular, xpdf, xpopple, firefox, chromium & Co., etc.) should be defined >> in some package, but I am in doubts if it suitable for Org core. >> >> Proof of concept implementation. > > Thanks for taking time to implement this proof of concept! I have realized that it misses customization of application binary (exact name or full path to non-standard location). > I think that it is a very good idea for Org core to support search terms > in file links that are handled by Free Software. Maybe I misunderstand something, but your stress on Free Software here surprised me. I did not mention explicitly any proprietary application such as Adobe Reader. On the other hand support of Chromium (that is free) unavoidably assumes Google Chrome and likely MS Edge with other derived products with same customization as chromium vs. chromium-browser command name discrepancy in Linux distros. > Moreover, I think that we should, by default, auto-detect and use Free > Software to open file links, when such software is installed on user > machine (unless the user explicitly instruct otherwise). Could you, please, elaborate? E.g. for PDF file default is docview mode. Unless a user has an override in `org-file-apps', likely it should be used. Perhaps system-wide handler may be considered as a candidate, but on linux it means XDG MIME handlers that is not supported by Emacs, so only mailcap remains. Both XDG database and mailcap have no notion of location within the file to open. > I see Free Software support as dedicated files like ol-evince, > ol-okular, etc. The file functionality and common function may probably > be factored out into ol-file library. I am considering a single package, something like org-pdfviewer, that has definitions for all popular viewers: evince, okular, firefox, chromium, etc. I believed that user should explicitly configure preferred viewer by either adding an entry with supplied function to `org-file-apps' or this package has its own defcustoms and the entry injected to some variable as you suggested in Ihor Radchenko. Re: [PATCH v2] org.el: Fix percent substitutions in `org-open-file' Mon, 05 Sep 2022 13:46:41 +0800. https://list.orgmode.org/875yi2xtj2.fsf@localhost The point of defcustoms in the package instead of (or in addition to) `org-file-apps' is that evince and okular support more formats than PDF.