From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: torys.anderson@gmail.com (Tory S. Anderson) Newsgroups: gmane.emacs.help Subject: Re: Bookmark a PDF, open in external program Date: Tue, 10 Feb 2015 13:50:33 -0500 Message-ID: <87zj8llhxi.fsf@gmail.com> References: <87lhkiewjy.fsf@gmail.com> <790c44d6-43b0-496b-8a49-29acf0ea8de0@default> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1423594273 18173 80.91.229.3 (10 Feb 2015 18:51:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 10 Feb 2015 18:51:13 +0000 (UTC) Cc: emacs list To: Drew Adams Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Feb 10 19:51:02 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YLFtl-0001pw-Tj for geh-help-gnu-emacs@m.gmane.org; Tue, 10 Feb 2015 19:51:02 +0100 Original-Received: from localhost ([::1]:41356 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLFtl-00022L-Ae for geh-help-gnu-emacs@m.gmane.org; Tue, 10 Feb 2015 13:51:01 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42917) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLFtT-00020s-UL for help-gnu-emacs@gnu.org; Tue, 10 Feb 2015 13:50:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YLFtP-0002r0-PD for help-gnu-emacs@gnu.org; Tue, 10 Feb 2015 13:50:43 -0500 Original-Received: from mail-qa0-x22e.google.com ([2607:f8b0:400d:c00::22e]:62420) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLFtP-0002py-CZ for help-gnu-emacs@gnu.org; Tue, 10 Feb 2015 13:50:39 -0500 Original-Received: by mail-qa0-f46.google.com with SMTP id n4so7381386qaq.5 for ; Tue, 10 Feb 2015 10:50:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=yjfFUKvcpdq1FrvcUuRzZ64Ux3StR+NBMtF940PRZvo=; b=LHMtl1nVy0bRV0oHAVbTJxWgI2DCoYzdQS+g9R1VX4GnmIzesVgII0dcKUmUjg3vWW +Kc1ZB6EJF0Ng1vcbp2lCMpl6213n+9OWlJZl+4pMLNJBDAkQrAVimLewZfhG4c9HcC2 jAHVM5rKitxWNB4s6hjwIaVy9Tf+2//S6EW9BXTMgpsyPRb2vQVedguZWZmEhsEGHGbc jNgszYjzx3zcbTLgScjdxrjQtIW+InLuK/EX2wsdJ+DWORcgmhKO3EAA8vv8Q/oCo3UR YUfkYRnjIx0/d6U1R3paWnocmgNtnXsVSuA9xa+bv6veuU13fhCsbIUuNU3njN4r4vs1 6WqA== X-Received: by 10.229.197.134 with SMTP id ek6mr14135436qcb.21.1423594237929; Tue, 10 Feb 2015 10:50:37 -0800 (PST) Original-Received: from localhost.localdomain (lawn-143-215-51-67.lawn.gatech.edu. [143.215.51.67]) by mx.google.com with ESMTPSA id u5sm14403130qap.18.2015.02.10.10.50.36 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Feb 2015 10:50:36 -0800 (PST) In-Reply-To: <790c44d6-43b0-496b-8a49-29acf0ea8de0@default> (Drew Adams's message of "Sat, 31 Jan 2015 10:31:59 -0800 (PST)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400d:c00::22e X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:102619 Archived-At: I'm using emacs 25.0.5 and bmkp-default-handlers-for-file-types simply isn't working. Here's what I have: '(bmkp-default-handlers-for-file-types (quote (("\\.pdf$" . "xdg-open")))) Nonetheless if just opens with find-file (which is breaking for other reasons). Did I get something wrong? Drew Adams writes: >> I use the Bookmarks+ module (perhaps not relevant). I also frequently read >> PDFs. But when I bookmark a PDF, jumping to it causes it to open within >> emacs, rather than with my system default viewer. There are many people >> asking similar questions online but the answers don't seem to fit; I can't >> use the dired solution of `!` to execute a shell command in this case. Any >> tips? > > Since you use Bookmark+ the answer is yes, you can easily open > a bookmark that targets a PDF file using any application you like, > and you have several possibilities: > > You can use option `bmkp-default-handlers-for-file-types' to > control which operation (bookmark handler) to use by default, > for which file types (e.g. PDF). > > `M-x customize-option bmkp-default-handlers-for-file-types' > > This is a set of associations (an alist), with each key being > a regexp matching file names, and with each associated value > being a Lisp sexp that evaluates to either a shell command > (a string) or an Emacs function (a symbol or lambda form). > > You can think of `bmkp-default-handlers-for-file-types' as > somewhat analogous to `auto-mode-alist'. But it maps file-name > patterns to file actions instead of mapping them to buffer > modes. And it has an effect only when you use certain commands. > > The default value of `bmkp-default-handlers-for-file-types' > is taken from the value of `dired-guess-shell-alist-user', so > you can, if you prefer, just customize that option. (That > option comes from standard library `dired-x.el'.) > > If `bmkp-default-handlers-for-file-types' specifies no > matching association for a given file, and if option > `bmkp-guess-default-handler-for-file-flag' is non-nil, > then Bookmark+ guesses a shell command to use. It uses > `dired-guess-shell-alist-default' (first) and your mailcap > entries (second) to guess. > > A bookmark that was created for a file without visiting it > (e.g., using `C-x p c f' or `C-x p c a') has its `file-handler' > property set automatically to the handler specified for its > type by `bmkp-default-handlers-for-file-types'. > > If you are on MS Windows, then, in _addition_ to what is > said above: > > * In the `*Bookmark List*' display you can use any of these to > open bookmarks using associated Windows `Open' applications: > > `M-RET' - `bmkp-bmenu-w32-open': this bookmark (on this line) > `M-mouse-2' - `bmkp-bmenu-w32-open-with-mouse': clicked bookmark > `M-o' - `bmkp-bmenu-w32-jump-to-marked': this bookmark & > marked bookmarks > > You can still associate particular bookmarks or file types > with particular shell commands or other programs, via option > `bmkp-default-handlers-for-file-types'. > > But you can also take advantage of the file associations > that are defined outside Emacs, for Windows. You can thus > have two different associations for the same file type and > use either of them whenever you want. > > * If you associate action `w32-browser' with a file type in > `bmkp-default-handlers-for-file-types' then you can use > command `bmkp-w32-browser-jump' (not bound to a key by > default) anytime to open a file of that type using the > Windows `Open' action. > > * You can use command `bmkp-jump-to-type' (`C-x j :') and > input `w32-browser' as the bookmark type, to limit completion > candidates to bookmarks that are associated with `w32-browser'. > > This is all covered in the Bookmark+ doc: > > * All of the doc: http://www.emacswiki.org/emacs/BookmarkPlus > > * `bmkp-default-handlers-for-file-types': > http://www.emacswiki.org/emacs/BookmarkPlus#BookmarkingFilesYouCannotVisitWithEmacs > > * Using MS Windows file associations: > http://www.emacswiki.org/emacs/BookmarkPlus#WindowsFileAssociations