From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 8GG7HxacPmALGwAA0tVLHw (envelope-from ) for ; Tue, 02 Mar 2021 20:12:06 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id SEB1GxacPmD9KwAAB5/wlQ (envelope-from ) for ; Tue, 02 Mar 2021 20:12:06 +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 DB0331DFD3 for ; Tue, 2 Mar 2021 21:12:05 +0100 (CET) Received: from localhost ([::1]:47382 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lHBND-0002RP-Mi for larch@yhetil.org; Tue, 02 Mar 2021 15:12:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38658) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lHBMf-0002RF-04 for emacs-orgmode@gnu.org; Tue, 02 Mar 2021 15:11:29 -0500 Received: from mail-qv1-xf2e.google.com ([2607:f8b0:4864:20::f2e]:39783) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lHBMd-0002eU-6M for emacs-orgmode@gnu.org; Tue, 02 Mar 2021 15:11:28 -0500 Received: by mail-qv1-xf2e.google.com with SMTP id k7so7912062qvo.6 for ; Tue, 02 Mar 2021 12:11:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=user-agent:from:to:subject:date:message-id:mime-version; bh=DwH4uEFQ9dcGs72Nljr39HcH1WqTriJ3GEPjpcEdC5E=; b=mH1HnHufmR0IsBXIpQV5nllqeC0LR0Ox8IzmwIzUmX8iCBODTSv7ddw6PhQ/GqTLz1 8p2Nr5WsbiQ0taT/jXhT37ELz+EMk5KJLOei7Se8GXwsN9MCGB7qZN8fTNyPZMBOsWBq eg8BJmgzToOiN7kRXHTXf9FSCexUV/jyPCtw8GWRuStPL+weZoKTP2kDnv6GvgKTan2v fJsL6G8GRFQpOwzlwRnSr6sGVrY4RdKeCGxmV1djidwIuJZQUDlxTx6GmBD8ynHqxCBN odDTXGYUqWTSypzQP7qe8gYlKOCIJAmxJsCCFogiBXaq2BACj7tgUZAzLqoKO+1ErkJX G47w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:user-agent:from:to:subject:date:message-id :mime-version; bh=DwH4uEFQ9dcGs72Nljr39HcH1WqTriJ3GEPjpcEdC5E=; b=qmkSuvLsnkvTN3Fzg4sn77+1uB7jDKxi+FSqn9IFOqLbMhhGt0Qp7KMXR8L+89cza7 is050jcv9aLU0P7DULtwRtJW5yzgX8Mr6VNEa8q3EHeDwfUGovacRYlhuv+rFUtavqbP YlsyIaLBZIA8d8XyBI/mcygLLHWA/guT6wm15JkCZvMu488l7MMoEyTS1ywBlLh2wyUr e6YaTx7Tsm0pT+UtrOhc3lZk8fzqiG8cRqOpmsmwG+x2bVwFvuWQ892zT6d2K75pEo53 k0F6ckJ2XeGcu+M56UUgU4u2bp9psgCY7u6weKrcFE+7NSWNXhUEMbnD0ey3GFga9X38 vm3g== X-Gm-Message-State: AOAM532X/vf2XZn7kXsFvl+cPGa8AqUNYD2J3q/1gbmyD+Nuzbp8uA5I wcJCHqUug5lGYVMTQB2khTbzQGYj+pc= X-Google-Smtp-Source: ABdhPJzr7YtsfqoFYShTYiqQH4yx1R1AOne+gEuRS/kXMy8f7/Bn83c56m6dgYUnRBQDCYQ4aHtjzQ== X-Received: by 2002:a05:6214:d4b:: with SMTP id 11mr5309999qvr.42.1614715885110; Tue, 02 Mar 2021 12:11:25 -0800 (PST) Received: from localhost ([190.239.232.210]) by smtp.gmail.com with ESMTPSA id b7sm15777391qkj.115.2021.03.02.12.11.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Mar 2021 12:11:24 -0800 (PST) User-agent: mu4e 1.4.14; emacs 27.1 From: Rodrigo Morales To: emacs-orgmode@gnu.org Subject: Org mode links: Open a PDF file at a given page and highlight a given string Date: Tue, 02 Mar 2021 15:07:32 -0500 Message-ID: <87lfb5pbej.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::f2e; envelope-from=moralesrodrigo1100@gmail.com; helo=mail-qv1-xf2e.google.com 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-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1614715926; 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:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=DwH4uEFQ9dcGs72Nljr39HcH1WqTriJ3GEPjpcEdC5E=; b=r7QSA2kotj8vkiBoYjZrfkIRR6t6rSew1oHe97cMOFhR4qPRVELvXMb8geUeese7PjS1Sd wJhn2oQckZjl9AZsVTSBGc97nl5zOtesfpnsuCUjOGo95XUMvZTO+22bWfwPdCdelpB+Q4 Oo+LvY6z/ozWAoCVljpCESVPukNgtBjCodh2H9wSqGjqsWxPsUkdawaPinkODQymwR62s3 c3iZ1FUCMYOB1rSMJX/J++gM4TkAg0/ajtYCrolhl9yRF2PIqDmOGnO+F5L+H4alqj8uuD 2/1enG3DT/2aGVb6TGlIVhZFG9UIQqFouDNeOTIv4D/TN+oHKDb9kWZ/IKkiuQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1614715926; a=rsa-sha256; cv=none; b=H6fT5gudQF4CdjSltuaB33vc3ziwALdRYp+wHi247so++c8DWQVkqALcZqNwh57GSvdEHz /R7axqHCJDDBfrAoDJdPvskG79lAFYX4+aulWaEoZc5H3jniZvOb/zl72+oZW8SCkIecng VB+lemfZJrkQKPcmYqfztfAVL1Wl1dcGC3Xg+gY0aWATtbt7r8BDzg8aWjwyVzGWwnr/Ii Qb9Ha9in3z3fKmQRORq9Bt0Nkfq2BuhPrJdLCYFjg2AXLyDanfelT2kD66Fw+0TI/i9b7R zfhTGCjUzdG74d6Z/abt/qhDAh3Ra+3XUsu4KVF3py0il4e6DubTLWXb529hbw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=mH1HnHuf; 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-Migadu-Spam-Score: -3.06 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=mH1HnHuf; 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-Migadu-Queue-Id: DB0331DFD3 X-Spam-Score: -3.06 X-Migadu-Scanner: scn1.migadu.com X-TUID: sQ5O3Xlthj6z I want to be able to + create a Org link to specific pages of a PDF. I've managed to accomplish this by setting the following value. #+begin_src emacs-lisp :results silent (setq org-file-apps '(("\\.pdf::\\([0-9]+\\)\\'" . "zathura -P %1 %s"))) #+end_src The following links open the PDF at the given page. [[file:~/Downloads/grub.pdf::10]] [[file:~/Downloads/grub.pdf::20]] [[file:~/Downloads/grub.pdf::30]] + create a Org link to specific pages of a PDF and highlight a given string. #+begin_src emacs-lisp :results silent (setq org-file-apps '(("\\.pdf::\\([0-9]+\\)::\\([^:]+\\)\\'" . "zathura -P %1 -f %2 %s"))) #+end_src The following link must open the PDF at a given page and highlight the given string. However, I'm getting the following error (see the =#+begin_example= block below.) [[file:~/Downloads/grub.pdf::95::do]] #+begin_example Debugger entered--Lisp error: (wrong-type-argument stringp nil) replace-match(nil t t "zathura -P 95 -f %2 /home/username/Downloads/grub....") org-open-file("~/Downloads/grub.pdf" nil nil "95::do") apply(org-open-file "~/Downloads/grub.pdf" nil (nil "95::do")) org-link-open((link (:type "file" :path "~/Downloads/grub.pdf" :format bracket :raw-link "file:~/Downloads/grub.pdf::95::do" :application nil :search-option "95::do" :begin 821 :end 858 :contents-begin nil :contents-end nil :post-blank 0 :parent (paragraph (:begin 821 :end 860 :contents-begin 821 :contents-end 859 :post-blank 1 :post-affiliated 821 :parent nil)))) nil) org-open-at-point(nil) funcall-interactively(org-open-at-point nil) call-interactively(org-open-at-point nil nil) command-execute(org-open-at-point) #+end_example Note that the following accomplishes what I'm looking for #+begin_src bash zathura -P 95 -f do ~/Downloads/grub.pdf #+end_src My question is: How can I get rid of that error so that the PDF is opened at a given page and the string is highlighted? PS: If you want a PDF to test the link presented in this message, you can download the following PDF (564K). It was the smallest PDF in gnu.org I was able to find. #+begin_src bash :dir ~/Downloads :results silent wget 'https://www.gnu.org/software/grub/manual/grub/grub.pdf' #+end_src -- Greetings, Rodrigo Morales. IRC: rdrg109 (freenode)