From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Hongyi Zhao Newsgroups: gmane.emacs.help Subject: Re: use pdf-tools in Emacs. Date: Fri, 28 Apr 2023 07:55:50 +0800 Message-ID: References: <87r0s5efab.fsf@frege.mail-host-address-is-not-set> <87edo5bc61.fsf@gnu.org> <87edo52mtg.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2768"; mail-complaints-to="usenet@ciao.gmane.io" Cc: stefan-husmann@t-online.de, help-gnu-emacs@gnu.org To: Tassilo Horn Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Apr 28 01:56:26 2023 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1psBTN-0000X6-7z for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 28 Apr 2023 01:56:25 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1psBT6-0001NE-1t; Thu, 27 Apr 2023 19:56:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1psBT4-0001Mz-9f for help-gnu-emacs@gnu.org; Thu, 27 Apr 2023 19:56:06 -0400 Original-Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1psBT2-0005AQ-Bp; Thu, 27 Apr 2023 19:56:05 -0400 Original-Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-94ef0a8546fso1497814266b.1; Thu, 27 Apr 2023 16:56:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682639762; x=1685231762; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=VZh3Mut/YBzXwxD1mt5Iar+Db4StQp5ctsMLMPDjTr4=; b=MDqbC+B5+AOZAuMaVuxr5/yQL+ZLEpLTwdYr5b2GkkOzt6/sY28kChLBbmESV1AGgX Aulf2LTmDkTgSpEKc8fKn8MEeXFTzpG4Eg+zxLLi5Uz0e60zGvQpVh7TP0VwAKMVE3Nn 9WNZToh3N9lavOkZFARwJFX5FsoTdE9yMB4VuPDclMYQDm4oWXaOLnbJIfIuO0TjXHg1 bEYq48PiMV1a0zMMhvkAPQ7Ko94KylwDth0MDJwmbz3/ofTtQwlQbpBo4JCO5kCMrxPR ptXtv6nH5IEEooPr/LwcpRcP3tgBuEpG8jw72YLRSv05nTscT99fz6CnP5FX/7N8d92J Eo3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682639762; x=1685231762; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VZh3Mut/YBzXwxD1mt5Iar+Db4StQp5ctsMLMPDjTr4=; b=FDeB3P70OPgSzFjc33Y2DuZTrbpqVwSfxs8/Yram1wfgoiTvgxNUpyrEqg2/Be061q +kxpAs+2BRJtiTfm0ggoTiY9bm06NaNkJqbBwu+PX8q3EA8+9dSJ74wkyCRvLqNgkSDp Kzf1Dr+rChb3s2bajv26X8abxywMWVmK+ULgA6mZywul+bvRz20iuCik43IeVbBZG/9A +HnJuM0tfJaOwHs7AuSosceSKZoU+S4InkjUgixaJXzUr/mYnmh74QeqmieYYwdd4Qal JNguGPCuU28DqtAN8AHpGskXf0AohRfrwJeGPiTvJZG6IqTmnn6yEFqeH8RG6CY/vjLo J2jw== X-Gm-Message-State: AC+VfDwVA12ep0387f/Uv24ZhIcOt31ZUiH107Hv0uBP8JmJnMSGaKVI RTY+P8JDIPM9FRiIozTT7Bqxblp4S46KvtH799e74yC643r4FL0o6cs= X-Google-Smtp-Source: ACHHUZ51Raj2h1cpjDyY0OqfE+QaOdrWKr0650E6wkmyYdRfT+ebww058xvMnPh47AZx66f8VJ59Fcvzzq6D7MTG2Wk= X-Received: by 2002:a17:907:74d:b0:94f:2a13:4df6 with SMTP id xc13-20020a170907074d00b0094f2a134df6mr3486268ejb.36.1682639761983; Thu, 27 Apr 2023 16:56:01 -0700 (PDT) In-Reply-To: <87edo52mtg.fsf@gnu.org> Received-SPF: pass client-ip=2a00:1450:4864:20::629; envelope-from=hongyi.zhao@gmail.com; helo=mail-ej1-x629.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_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: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:143430 Archived-At: On Fri, Apr 28, 2023 at 2:37=E2=80=AFAM Tassilo Horn wrote: > > Hongyi Zhao writes: > > >> >> (use-package pdf-tools > >> >> ;;https://github.com/jwiegley/use-package#magic-handlers > >> >> :magic ("%PDF" . pdf-view-mode) > >> >> :config > >> >> (pdf-tools-install :no-query) > >> >> ;; C-h o pdf-loader-install RET > >> >> ;; This function acts as a replacement for =E2=80=98pdf-tools-ins= tall=E2=80=99 and > >> >> ;; makes Emacs load and use PDF Tools as soon as a PDF file is > >> >> ;; opened, but not sooner. > >> >> ;;(pdf-loader-install) > >> >> ) > >> >> > >> > > >> > Indeed this does notinstall anything. use-package is about loading, > >> > not installing. Use package.el or straight.el (or any other package > >> > manager) for installing. > >> > >> Well, you can add a :ensure t clause to the use-package recipe and it > >> will tell package.el to install the package. > > > > It seems that this is not true. > > I can assure you that I have > > (use-package pdf-tools > :ensure t > :init > (pdf-tools-install)) > > in my user-init-file, and that with this and just this, PDFs are opened > automatically using its `pdf-view-mode' (instead of `doc-view-mode'). > > When I do `M-x package-delete RET pdf-tools RET' and restart emacs, it > will automatically install it again which is the task of :ensure, see > (info "(use-package) Install package"). After installing the package > automatically, I'm also asked > > Need to (re)build the epdfinfo program, do it now ? (y or n) y > > which is then built and the output shown in a *compilation* buffer. I confirm that the above configuration can solve the problem. > Bye, > Tassilo Best, Zhao