Giter Club home page Giter Club logo

pdfgrep's Introduction

pdfgrep is a GNU/Emacs module providing grep comparable facilities but for PDF files. Its usage is similar to the grep function: using the next-error function gets you to the next matching page…

https://melpa.org/packages/pdfgrep-badge.svg

The pdfgrep program must be installed on your system.

If the pdf-tools module is installed and enabled, when a matching page is displayed, the matching regions are highlighted.

Configuration

(require 'pdfgrep)
(pdfgrep-mode)

Example

./screenshot.png

pdfgrep's People

Contributors

jeremy-compostella avatar ylluminarious avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pdfgrep's Issues

Make "next-error" and "previous-error" work when visiting files that contain results of "pdfgrep"

The context

Sometimes I execute pdfgrep in multiple PDF files which contain more than 1000 pages. For this reason, I want to save the results in order to visit the search results another day.

Creating the file (let's say, A) that contain the results of pdfgrep is fairly easily since the buffer that shows the results found by pdfgrep inserts a modeline into the buffer which causes Emacs to set grep as the major-mode when revisiting the file A. The code block shown below shows the results of executing M-x pdfgrep in an arbitrary file

-*- mode: grep; default-directory: "~/Experiments/" -*-
Grep started at Thu Nov 12 20:59:07

pdfgrep -H -n -i 'a' ~/Experiments/1.pdf 
/home/beep1560/Experiments/1.pdf:1:    Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit,
...

Grep finished with 64 matches found at Thu Nov 12 20:59:07

The problem

The problem is present when visiting a file that contain the results of pdfgrep. Executing M-g p (previous-error) and M-g n (next-error) show the following message in the minibuffer even when the buffer that shows the stored results of pdfgrep is *pdfgrep*.

Moved past last grep hit
Moved back before first grep hit

Additional context

next-error and previous-error do work when they are executed in the buffer that is immediately opened after executing M-x pdfgrep.

next-error and previous-error also work when visiting a file that contain results of M-x grep. I confirmed by doing the following:

  • Execute grep (i.e. M-x grep) in arbitrary files and save the results in a file with name results.
  • Close the buffer that shows the grep results.
  • Open the file results
  • Execute M-x next-error (i.e. press M-g n) and M-x previous-error (i.e. press M-g p). This caused the cursor to open the file and move the cursor to the line which contained the matching pattern.

The question

Is there any way to make the functions next-error and previous-error work (that is, open the PDF at the page that contain the selected result and don't show a error message in the minibuffer) when visiting a file that shows the results of executing pdfgrep?

Cannot run pdfgrep

Using emacs on OSX cannot run pdfgrep. I got this error

-*- mode: grep; default-directory: "~/OneDrive - SABES/" -*-
Grep started at Fri Dec 31 02:28:16

pdfgrep -H -n -i 
libc++abi.dylib: terminating with uncaught exception of type std::runtime_error: collate_byname<char>::collate_byname failed to construct for 

Grep abort trap: 6 at Fri Dec 31 02:28:16

Static Windows executable?

Is it possible for you to release a static Windows executable?

I've been trying to get it to compile under MINGW64 but I keep running into errors... I just don't know enough to actually get the job done.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.