"An alist mapping from key ID to user ID.")
(defvar epg-read-point nil)
+(defvar epg-process-filter-running nil)
(defvar epg-pending-status-list nil)
(defvar epg-key-id nil)
(defvar epg-context nil)
(with-current-buffer buffer
(make-local-variable 'epg-read-point)
(setq epg-read-point (point-min))
+ (make-local-variable 'epg-process-filter-running)
+ (setq epg-process-filter-running nil)
(make-local-variable 'epg-pending-status-list)
(setq epg-pending-status-list nil)
(make-local-variable 'epg-key-id)
(set-buffer (process-buffer process))
(goto-char (point-max))
(insert input)
- (goto-char epg-read-point)
- (beginning-of-line)
- (while (looking-at ".*\n") ;the input line finished
- (save-excursion
- (if (looking-at "\\[GNUPG:] \\([A-Z_]+\\) ?\\(.*\\)")
- (let* ((status (match-string 1))
- (string (match-string 2))
- (symbol (intern-soft (concat "epg--status-" status))))
- (if (member status epg-pending-status-list)
- (setq epg-pending-status-list nil))
- (if (and symbol
- (fboundp symbol))
- (funcall symbol epg-context string)))))
- (forward-line))
- (setq epg-read-point (point)))))
+ (unless epg-process-filter-running
+ (unwind-protect
+ (progn
+ (setq epg-process-filter-running t)
+ (goto-char epg-read-point)
+ (beginning-of-line)
+ (while (looking-at ".*\n") ;the input line finished
+ (save-excursion
+ (if (looking-at "\\[GNUPG:] \\([A-Z_]+\\) ?\\(.*\\)")
+ (let* ((status (match-string 1))
+ (string (match-string 2))
+ (symbol (intern-soft (concat "epg--status-"
+ status))))
+ (if (member status epg-pending-status-list)
+ (setq epg-pending-status-list nil))
+ (if (and symbol
+ (fboundp symbol))
+ (funcall symbol epg-context string)))))
+ (forward-line))
+ (setq epg-read-point (point)))
+ (setq epg-process-filter-running nil))))))
(defun epg-read-output (context)
"Read the output file CONTEXT and return the content as a string."