X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=emacs%2Fnotmuch-parser.el;fp=emacs%2Fnotmuch-parser.el;h=294e05445b467ac98504d4810053b270c6b3a074;hp=b8c3fd2c67df90932ec2e66ad0d3c4a8c863937e;hb=93c95802a4c369c1460bae4d6b8ace8d664a8494;hpb=9be8c6802fa5ce7fa61a2656daf337ac935da423 diff --git a/emacs/notmuch-parser.el b/emacs/notmuch-parser.el index b8c3fd2c..294e0544 100644 --- a/emacs/notmuch-parser.el +++ b/emacs/notmuch-parser.el @@ -140,15 +140,6 @@ beginning of a list, throw invalid-read-syntax." (forward-char) (signal 'invalid-read-syntax (list (string (char-before))))))) -(defun notmuch-sexp-eof (sp) - "Signal an error if there is more data in SP's buffer. - -Moves point to the beginning of any trailing data or to the end -of the buffer if there is only trailing whitespace." - (skip-chars-forward " \n\r\t") - (unless (eobp) - (error "Trailing garbage following expression"))) - (defvar notmuch-sexp--parser nil "The buffer-local notmuch-sexp-parser instance. @@ -187,8 +178,11 @@ move point in the input buffer." (t (with-current-buffer result-buffer (funcall result-function result)))))) (end - ;; Any trailing data is unexpected - (notmuch-sexp-eof notmuch-sexp--parser) + ;; Skip over trailing whitespace. + (skip-chars-forward " \n\r\t") + ;; Any trailing data is unexpected. + (unless (eobp) + (error "Trailing garbage following expression")) (setq done t))))) ;; Clear out what we've parsed (delete-region (point-min) (point)))