From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: dalanicolai Newsgroups: gmane.emacs.devel Subject: Re: [ELPA] New package: toc-mode Date: Wed, 21 Sep 2022 09:12:31 +0200 Message-ID: References: <87h711pwde.fsf@mail.jao.io> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000b1873b05e92aabbc" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38192"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Emacs Devel To: Jose A Ortega Ruiz Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Sep 21 09:15:14 2022 Return-path: Envelope-to: ged-emacs-devel@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 1oatwv-0009is-P7 for ged-emacs-devel@m.gmane-mx.org; Wed, 21 Sep 2022 09:15:13 +0200 Original-Received: from localhost ([::1]:46842 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oatwu-0002td-D9 for ged-emacs-devel@m.gmane-mx.org; Wed, 21 Sep 2022 03:15:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50694) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oatub-00022m-BO for emacs-devel@gnu.org; Wed, 21 Sep 2022 03:12:49 -0400 Original-Received: from mail-ej1-x62a.google.com ([2a00:1450:4864:20::62a]:42915) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oatuZ-0002C6-3U; Wed, 21 Sep 2022 03:12:48 -0400 Original-Received: by mail-ej1-x62a.google.com with SMTP id sb3so11471581ejb.9; Wed, 21 Sep 2022 00:12:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=WINcYJUWYPChsxBUfReZh63ABXvGqFnxFmZiUeWnksE=; b=hGL51nXyf9IRHYRLAIbLUFK7xUYUI1b+RUXsXAdxpwTVxfXeizZapuHVx+X0hydMrE myxKxvoZKVVlTcAA6BI2pIjK9XnFSQ1t+oL2c9HrjzJ1pmD/bq3cDJPu52y/LwySIwWw rI4aSvNcNvA91FH+HBk1znil1ixwVo5uv33bSE/smSMuJc9WoDojDW/g8y36ndk6MUgx 3uRl5+dAMNHukFFfJ90qhTlZd+jx5G6YO9FlayaSKi+9EGQBTC+nC7MpkweJzDPaZMNk L0gO1IKPYY1sOEIdfuidf1tEwVxddgwHmoi7lobu9MVOSwtYAZ83y4rnIFA8IPS54+HG R/8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=WINcYJUWYPChsxBUfReZh63ABXvGqFnxFmZiUeWnksE=; b=K35Iz3Zfij0BD7o8e05DsYlxtSv1RQvmzY6bdxNYr5rT3liSwUmcdN+5RF8jG+sA0o gG8MgeaQ1yHB8zlq331HytIUwV5fBscRrRQGTpykhOow0slybQ6qjtSdvcmAz3daofq5 spVZOoLVCq+uyUvmb1ab/OcbHLUJyKuaEK9MUs0o6qr+ICrVR3yFycgkB777El9nslC8 SMmCJ3dsPMAYq2nwV2HBLCb6cvX6Tk0JqA4eW73bzNrUr21HJtrDQ3Iqw3Og2MRMcY2O XP9HVYmAPdP8UtW5drQZpr/0pBXbYFxrYn9r6qSsOADfOneua9q611X/XG2T1BZ9rQPb vSAA== X-Gm-Message-State: ACrzQf3UojvMNa7PbfkhW5lnKZezMfCQBElOwBM/+fxKJKmwG81WgPu5 g+28T2y5rJa9YjrVLOF0YOUGQmBhXVwwIjpRA2naqSLGxiA= X-Google-Smtp-Source: AMsMyM4tmQ6Y6JBxOUZFcLCgyAbVxPEf/QKi3mlRPdoOVQeZibU5BTOglDDYpQcNczbEyzYqUq7rJxI506Tipl+fsT8= X-Received: by 2002:a17:906:974f:b0:780:4a3c:d179 with SMTP id o15-20020a170906974f00b007804a3cd179mr130901ejy.289.1663744361987; Wed, 21 Sep 2022 00:12:41 -0700 (PDT) In-Reply-To: <87h711pwde.fsf@mail.jao.io> Received-SPF: pass client-ip=2a00:1450:4864:20::62a; envelope-from=dalanicolai@gmail.com; helo=mail-ej1-x62a.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, HTML_MESSAGE=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-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:295862 Archived-At: --000000000000b1873b05e92aabbc Content-Type: text/plain; charset="UTF-8" The package is for extracting a TOC when the document does not yet contain one. But it includes a command also to extract the TOC if the document already has one (so that it can be altered) I am working on some alternative/upgrade to doc-view, pdf-tools and djvu.el, although it might take a while as it is a lot of work. I did not make a project page yet, but will probably post a link to it soon here. Indeed, for now it provides imenu commands for pdf and djvu documents. If you like, I could drop the code for creating the imenu index here (you have it already of course, but you might like to see different solutions). Just, let me know if you are interested. On Tue, 20 Sept 2022 at 23:30, Jose A Ortega Ruiz wrote: > On Tue, Sep 20 2022, dalanicolai wrote: > > > This package has been for a while on MELPA now, but it would be nice if > it > > could be moved to ELPA. The source can be found at > > https://github.com/dalanicolai/toc-mode. > > > > I would like to mention that the PDF functionalities largely depend on > > pdf-tools, which is not on ELPA of course (doc-view unfortunately does > > not provide the right features). I am not sure if that somehow is a > > problem. > > for doc-view, if you're willing to rely on "mutool" (a cli program that > is installed with mupdf), one can extract an outline with something > similar to this function: > > https://codeberg.org/jao/elibs/src/branch/main/lib/doc/jao-pdf.el#L48 > > > i then for instance use it to provide imenu jumping with this code: > > > https://codeberg.org/jao/elibs/src/branch/main/lib/doc/jao-doc-view.el#L50 > > just in case you'd like to add something like that to your package (all > in all it's just a dozen lines per function). > > cheers, > jao > -- > Who knows what Columbus would have discovered if America hadn't got in the > way. -Stanislaw J. Lec, poet and aphorist (1909-1966) > --000000000000b1873b05e92aabbc Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
The package is for extracting a TOC when the document= does not yet contain one.
But it includes a command also to extr= act the TOC if the document already has one
(so that it can be al= tered)

I am working on some alternative/upgrade to= doc-view, pdf-tools and djvu.el, although
=C2=A0it might take a = while as it is a lot of work. I did not make a project page yet, but will
probably post a link to it soon here. Indeed, for now it provides = imenu commands for
pdf and djvu documents. If you like, I could d= rop the code for creating the imenu index
=C2=A0here (you have it= already of course, but you might like to see different solutions). Just,
let me know if you are interested.


On Tue, 20 Sept 2022 at 23:30, Jose A Ortega Ruiz <jao@gnu.org> wrote:
On Tue, Sep 20 2022, dalanicolai wrote:

> This package has been for a while on MELPA now, but it would be nice i= f it
> could be moved to ELPA. The source can be found at
> https://github.com/dalanicolai/toc-mode.
>
> I would like to mention that the PDF functionalities largely depend on=
> pdf-tools, which is not on ELPA of course (doc-view unfortunately does=
> not provide the right features). I am not sure if that somehow is a > problem.

for doc-view, if you're willing to rely on "mutool" (a cli pr= ogram that
is installed with mupdf), one can extract an outline with something
similar to this function:

=C2=A0 https://codeberg.org/jao= /elibs/src/branch/main/lib/doc/jao-pdf.el#L48=C2=A0 =C2=A0

i then for instance use it to provide imenu jumping with this code:

=C2=A0 https://codeberg.or= g/jao/elibs/src/branch/main/lib/doc/jao-doc-view.el#L50

just in case you'd like to add something like that to your package (all=
in all it's just a dozen lines per function).

cheers,
jao
--
Who knows what Columbus would have discovered if America hadn't got in = the
way. -Stanislaw J. Lec, poet and aphorist (1909-1966)
--000000000000b1873b05e92aabbc--