GNU bug report logs - #17059
24.3; cannot view extracted text for a pdf

Previous Next

Package: emacs;

Reported by: covici <at> ccs.covici.com

Date: Fri, 21 Mar 2014 16:58:02 UTC

Severity: normal

Found in version 24.3

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #20 received at 17059 <at> debbugs.gnu.org (full text, mbox):

From: Alexis <flexibeast <at> gmail.com>
To: 17059 <at> debbugs.gnu.org
Subject: Re: bug#17059: bug 17059 still present
Date: Thu, 23 Oct 2014 18:27:29 +1100
Stefan Monnier writes:

>> i then instrumented `doc-view-initiate-display` instead, and stepped
>> through it line-by-line .... and when it reached `(doc-view-open-text)`
>> and called it, the text was extracted and displayed in a buffer.
>
> The step-by-step gave the process time to finish before it gets killed.
>
>> i'm now no longer able to reproduce the issue with -nw -Q.
>
> The process is not needed any more because we reuse the output from
> earlier Emacs sessions (stashed in /tmp somewhere).

Ah, okay. Thanks for explaining!

So: calling `sit-for` in `doc-view-start-process` solves the problem for
me:

    (defun doc-view-start-process (name program args callback)
      ;; Make sure the process is started in an existing directory, (rather than                                       
      ;; some file-name-handler-managed dir, for example).                                                
      (let* ((default-directory (or (unhandled-file-name-directory
                                     default-directory)
                                  (expand-file-name "~/")))      
             (proc (apply 'start-process name doc-view-conversion-buffer
                          program args)))
        (push proc doc-view--current-converter-processes)
        (setq mode-line-process (list (format ":%s" proc)))
        (set-process-sentinel proc 'doc-view-sentinel)
        (sit-for 1)
        (process-put proc 'buffer   (current-buffer))
        (process-put proc 'callback callback)))

Is this a reasonable solution?


Alexis.




This bug report was last modified 9 years and 126 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.