From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Visuwesh Newsgroups: gmane.emacs.bugs Subject: bug#73719: [PATCH] Add imenu support for OpenOffice documents in doc-view Date: Wed, 09 Oct 2024 19:40:39 +0530 Message-ID: <87bjzt4ba8.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40534"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: "Tassilo Horn" To: 73719@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Oct 09 16:12:17 2024 Return-path: Envelope-to: geb-bug-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 1syXQG-000AOX-KN for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 09 Oct 2024 16:12:16 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1syXPw-0004HH-J9; Wed, 09 Oct 2024 10:11:56 -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 1syXPt-0004Go-TP for bug-gnu-emacs@gnu.org; Wed, 09 Oct 2024 10:11:54 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1syXPs-0008In-JN; Wed, 09 Oct 2024 10:11:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:Subject; bh=Pd7Ys553Z2/iOI312SvhPQBbbgqcY0qVOuCl+Zlgei8=; b=tIvklp2Jri6fyHetRCkyI/ap/llYVNeZnS4eaB0e2gR9JL6P9Turc07NnHuDOWwkX3PRS7B2lwk08xjMispRSn/t0s2w45CZjDPAT6h23zoiYtuQ9JJUBox8P3iii65eUYsJ8DCSNS5Y60Jd7iodXaQm7aA+fwnHMjOjZYLY5FmblrxAGbaCHNDQmjysbGIPu6+ajcRtdDS2WeD6x3/nvu2s73cjk6xuozUAdnetmIm8gC0xZwJgC8fz6756r9ibtvRHPUpOVIvccjCkWI+Wj1V9+fhlPXp10LwI1fPze2Pml8wv2FXG5NuVVBl8C6Y5kOfeL+NKW5xp4sWCSBRKxA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1syXQ2-0002D3-CX; Wed, 09 Oct 2024 10:12:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Visuwesh Original-Sender: "Debbugs-submit" Resent-CC: tsdh@gnu.org, bug-gnu-emacs@gnu.org Resent-Date: Wed, 09 Oct 2024 14:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 73719 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org X-Debbugs-Original-Xcc: "Tassilo Horn" Original-Received: via spool by submit@debbugs.gnu.org id=B.17284830658393 (code B ref -1); Wed, 09 Oct 2024 14:12:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 9 Oct 2024 14:11:05 +0000 Original-Received: from localhost ([127.0.0.1]:57226 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1syXP6-0002BF-Rl for submit@debbugs.gnu.org; Wed, 09 Oct 2024 10:11:05 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:38524) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1syXP2-0002Am-3r for submit@debbugs.gnu.org; Wed, 09 Oct 2024 10:11:02 -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 1syXOr-00046e-Dd for bug-gnu-emacs@gnu.org; Wed, 09 Oct 2024 10:10:49 -0400 Original-Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1syXOo-00086G-UE for bug-gnu-emacs@gnu.org; Wed, 09 Oct 2024 10:10:48 -0400 Original-Received: by mail-pg1-x544.google.com with SMTP id 41be03b00d2f7-7ea06275ef2so2341969a12.0 for ; Wed, 09 Oct 2024 07:10:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728483043; x=1729087843; darn=gnu.org; h=mime-version:user-agent:message-id:date:subject:to:from:from:to:cc :subject:date:message-id:reply-to; bh=Pd7Ys553Z2/iOI312SvhPQBbbgqcY0qVOuCl+Zlgei8=; b=f5WrpUYTL2dqM1lLXSK1mZvfBtZrE0y3x14gfnCxLOrtskZ03h/qm8LuRlBkX/dL5V yNEbNpwJbEcDsj6XtIXZmxAb6Zziufvs7l2JGAOPA5Sh2DQlbW2HHF+OZ2vzPXHILUj1 j6VEqgdvnFCg+def9ZVIAI1wbhIxluCMKMneCFiweXcxInLQ+HO+2Sk9KkRrpnhtn2Ff a4d1xIV5r9fOmaQ5n1yYTKFcVRF4NhGkrvLaxo+93FNBMdEPnVlldj8/MW3Lue8uFi+C zEh86Hbzgcz0uYqN68fwYG6TaDPNWGcyaoD1dbVI8LYt3zAikeUEOfKNW3gY0mkMyDkB m6fA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728483043; x=1729087843; h=mime-version:user-agent:message-id:date:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Pd7Ys553Z2/iOI312SvhPQBbbgqcY0qVOuCl+Zlgei8=; b=XNXSFjcw5MutQSd/A9j3lfGafoGIj8zobFmHlG1zfOS4OskU6DjTQ0h9IeBkHebtPE pHb9MSwPWD4HlR67AwmkZLgM5G2rTqFlMMN3tZEoYF+drOcUyYJyva8IO5R6hDof9kRd zcWjmRKp0ZUW2egr7y6b9JDy2ns8uqRyGZ3gQ16Dwske9IVrk73JtTPHYwwMlwfOFXir mky+9fIlYmlENjE4f43o8SGJ/3mXNZPHJFq9RUN0wz5Wda4QHO0zCACouCfnRGiM8W2G ymQB64ZdaHfyamYa+RM8UbbnCcC1SGY7aJDJGjYxtP6NHSrKuQVfwzENauF+Yyk6P4Bq KuXg== X-Gm-Message-State: AOJu0YwoqXbCqYkDrzY8rKY4NLTIYnF2h6ga3zsExepB2glDGG1S0y3d 5eCQWKgdAh5PzPPKsqOaNZvxbdGQHlR7FwQ2vtY9vD8HLMM1/UvH2rNRtqHv X-Google-Smtp-Source: AGHT+IEwG3/auAmspaKmDNgXqNMPZD+AkbtUEXlpjIOqu2GQk9JVfOLr269CzbnzmusCRSeYxRmlKw== X-Received: by 2002:a05:6a21:2d89:b0:1cf:9a86:a29b with SMTP id adf61e73a8af0-1d8a3c0d8f8mr4658729637.20.1728483043278; Wed, 09 Oct 2024 07:10:43 -0700 (PDT) Original-Received: from localhost ([115.240.90.130]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71df0d452b7sm7832377b3a.108.2024.10.09.07.10.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2024 07:10:42 -0700 (PDT) Received-SPF: pass client-ip=2607:f8b0:4864:20::544; envelope-from=visuweshm@gmail.com; helo=mail-pg1-x544.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 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:293217 Archived-At: --=-=-= Content-Type: text/plain Tags: patch Hi again, Tassilo! The attached patch adds imenu index support for docx files. This is done by simply passing the PDF file to doc-view--pdf-outline. This should be the last patch I have in store for doc-view. Many thanks for your attention thus far. In GNU Emacs 31.0.50 (build 13, x86_64-pc-linux-gnu, X toolkit, cairo version 1.18.0, Xaw scroll bars) of 2024-10-06 built on astatine Repository revision: 500f5da5fb62cd0bbded8df754d93e3147d1d847 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12101011 System Description: Debian GNU/Linux trixie/sid Configured using: 'configure --with-sound=alsa --with-x-toolkit=lucid --without-xaw3d --without-gconf --without-libsystemd --with-cairo CFLAGS=-g3' --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-Add-imenu-support-for-OpenOffice-documents-in-doc-vi.patch >From 15db10f756e1069ba59a4a22462da408a58088e7 Mon Sep 17 00:00:00 2001 From: Visuwesh Date: Wed, 9 Oct 2024 19:36:18 +0530 Subject: [PATCH] Add imenu support for OpenOffice documents in doc-view * lisp/doc-view.el (doc-view--outline): Pass the right file to doc-view--pdf-outline. * doc/emacs/misc.texi (DocView Navigation): Mention support for OpenOffice documents too. * etc/NEWS: Announce the change. --- doc/emacs/misc.texi | 14 ++++++++------ etc/NEWS | 6 ++++-- lisp/doc-view.el | 2 ++ 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi index 83b83ea7ae9..14196c107c1 100644 --- a/doc/emacs/misc.texi +++ b/doc/emacs/misc.texi @@ -586,12 +586,14 @@ DocView Navigation @vindex doc-view-djvused-program DocView can generate an outline menu for PDF and DjVu documents using the @command{mutool} and the @command{djvused} programs, respectively, -when they are available. This uses the @code{imenu} facility -(@pxref{Imenu}). You can customize how the @code{imenu} items for this -outline are formatted and displayed using the variables -@code{doc-view-imenu-format} and @code{doc-view-imenu-flatten}. The -filename of the @command{djvused} program can be customized by changing -the @code{doc-view-djvused-program} user option. +when they are available. The outline for OpenOffice documents are also +generated using the @command{mutool} after they are converted to PDF. +This uses the @code{imenu} facility (@pxref{Imenu}). You can customize +how the @code{imenu} items for this outline are formatted and displayed +using the variables @code{doc-view-imenu-format} and +@code{doc-view-imenu-flatten}. The filename of the @command{djvused} +program can be customized by changing the +@code{doc-view-djvused-program} user option. @cindex registers, in DocView mode @findex doc-view-page-to-register diff --git a/etc/NEWS b/etc/NEWS index 67d768f0584..5b6dcf6fa18 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -390,9 +390,11 @@ command 'doc-view-page-to-register' (bound to 'm'), and later the stored page can be restored with 'doc-view-jump-to-register' (bound to '''). +++ -*** Docview can generate imenu index for DjVu files. +*** Docview can generate imenu index for DjVu and OpenOffice documents. When the 'djvused' program is available, Docview can now generate imenu -index for DjVu files from its outline. +index for DjVu files from its outline. Index for OpenOffice files are +generated using the 'mutool' program after their initial conversion to +PDF format. The name of the 'djvused' program can be customized by changing the user option 'doc-view-djvused-program'. diff --git a/lisp/doc-view.el b/lisp/doc-view.el index 57a24418616..bbfbbdec925 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el @@ -2103,6 +2103,8 @@ doc-view--outline ('djvu (when doc-view-djvused-program (doc-view--djvu-outline file-name))) + ('odf + (doc-view--pdf-outline (doc-view-current-cache-doc-pdf))) (_ (doc-view--pdf-outline file-name))))) (when outline (imenu-add-to-menubar "Outline")) -- 2.45.2 --=-=-=--