File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -61,12 +61,18 @@ Not including `pdfgrep-ignore-case'."
61
61
62
62
(defun pdfgrep-default-command ()
63
63
" Compute the default pdfgrep command for `pdfgrep' ."
64
- (let ((cmd (concat pdfgrep-program pdfgrep-options
65
- (when pdfgrep-ignore-case
66
- " -i " ))))
67
- (if pdfgrep-ignore-errors
68
- (cons (concat cmd " 2>/dev/null" ) (1+ (length cmd)))
69
- cmd)))
64
+ (let* ((cmd (concat pdfgrep-program pdfgrep-options
65
+ (when pdfgrep-ignore-case
66
+ " -i " )))
67
+ (cmd-ignore-errors (if pdfgrep-ignore-errors
68
+ (cons (concat cmd " 2>/dev/null" ) (1+ (length cmd)))
69
+ nil )))
70
+ (cond ((and (equal major-mode 'pdf-view-mode ) cmd-ignore-errors)
71
+ (cons (concat (car cmd-ignore-errors) " " buffer-file-name) (cdr cmd-ignore-errors)))
72
+ ((equal major-mode 'pdf-view-mode )
73
+ (cons (concat cmd " " buffer-file-name) (1+ (length cmd))))
74
+ (pdfgrep-ignore-errors cmd-ignore-errors)
75
+ (t cmd))))
70
76
71
77
(defun pdfgrep (command-args )
72
78
" Run pdfgrep with user-specified COMMAND-ARGS, collect output in a buffer.
You can’t perform that action at this time.
0 commit comments