girzel / gnorb

Glue code between the Org, Gnus, and BBDB packages for Emacs.
32 stars 4 forks source link

gnorb-org-view error #18

Closed totherme closed 9 years ago

totherme commented 9 years ago

When I call gnorb-org-view while point is on a headline which has previously been associated with an email, I get the following error. I have verified that this headline is indeed linked with the email, by viewing the email separately, and seeing the org-headline printed in the modeline. I'm using commit 321b23b.

Debugger entered--Lisp error: (wrong-type-argument listp "id+003beb97-eaa9-466f-babe-e50e937b5a05")
  car("id+003beb97-eaa9-466f-babe-e50e937b5a05")
  (setq q (car q))
  (progn (setq q (car q)))
  (if (equal "5.13" gnus-version-number) (progn (setq q (car q))))
  (let ((q (cdr (assq (quote query) query))) (buf (get-buffer-create nnir-tmp-buffer)) msg-ids org-ids links vectors) (save-current-buffer (set-buffer buf) (erase-buffer) (setq nngnorb-attachment-file-list nil)) (if (equal "5.13" gnus-version-number) (progn (setq q (car q)))) (cond ((string-match "id\\+\\([[:alnum:]-]+\\)$" q) (condition-case err (progn (org-id-goto (match-string 1 q)) (append-to-buffer buf (point) (org-element-property :end (org-element-at-point))) (save-restriction (org-narrow-to-subtree) (setq org-ids (append ... org-ids)) (if org-ids (progn ...)))) ((debug error) (message "Error: %S" err) nil))) ((listp q) (setq links (if (plist-member q :gnus) (plist-get q :gnus) q))) (t (org-map-entries (function (lambda nil (setq org-ids (cons ... org-ids)) (append-to-buffer buf (point) (save-excursion ... ...)))) q (quote agenda)))) (save-current-buffer (set-buffer buf) (goto-char (point-min)) (setq links (plist-get (gnorb-scan-links (point-max) (quote gnus)) :gnus)) (goto-char (point-min)) (while (re-search-forward (concat ":" gnorb-org-msg-id-key ": \\([^\n]+\\)") (point-max) t) (setq msg-ids (append (split-string (match-string 1)) msg-ids)))) (let ((--dolist-tail-- (delq nil org-ids)) i) (while --dolist-tail-- (setq i (car --dolist-tail--)) (let ((rel-msg-id (gnorb-registry-org-id-search i))) (if rel-msg-id (progn (setq msg-ids (append rel-msg-id msg-ids))))) (setq --dolist-tail-- (cdr --dolist-tail--)))) (if msg-ids (progn (let ((--dolist-tail-- msg-ids) id) (while --dolist-tail-- (setq id (car --dolist-tail--)) (let ((link ...)) (if link (progn ...))) (setq --dolist-tail-- (cdr --dolist-tail--)))))) (setq links (delete-dups links)) (if (gnus-alive-p) nil (gnus)) (let ((--dolist-tail-- links) m) (while --dolist-tail-- (setq m (car --dolist-tail--)) (let (server-group msg-id result artno) (setq m (org-link-unescape m)) (if (string-match "\\`\\([^#]+\\)\\(#\\(.*\\)\\)?" m) (progn (setq server-group (match-string 1 m) msg-id (gnorb-bracket-message-id ...) result (condition-case nil ... ...)) (if result (progn ... ...))))) (setq --dolist-tail-- (cdr --dolist-tail--))) (setq m nil) (if vectors (progn (nreverse vectors)))))
  (save-excursion (let ((q (cdr (assq (quote query) query))) (buf (get-buffer-create nnir-tmp-buffer)) msg-ids org-ids links vectors) (save-current-buffer (set-buffer buf) (erase-buffer) (setq nngnorb-attachment-file-list nil)) (if (equal "5.13" gnus-version-number) (progn (setq q (car q)))) (cond ((string-match "id\\+\\([[:alnum:]-]+\\)$" q) (condition-case err (progn (org-id-goto (match-string 1 q)) (append-to-buffer buf (point) (org-element-property :end ...)) (save-restriction (org-narrow-to-subtree) (setq org-ids ...) (if org-ids ...))) ((debug error) (message "Error: %S" err) nil))) ((listp q) (setq links (if (plist-member q :gnus) (plist-get q :gnus) q))) (t (org-map-entries (function (lambda nil (setq org-ids ...) (append-to-buffer buf ... ...))) q (quote agenda)))) (save-current-buffer (set-buffer buf) (goto-char (point-min)) (setq links (plist-get (gnorb-scan-links (point-max) (quote gnus)) :gnus)) (goto-char (point-min)) (while (re-search-forward (concat ":" gnorb-org-msg-id-key ": \\([^\n]+\\)") (point-max) t) (setq msg-ids (append (split-string (match-string 1)) msg-ids)))) (let ((--dolist-tail-- (delq nil org-ids)) i) (while --dolist-tail-- (setq i (car --dolist-tail--)) (let ((rel-msg-id (gnorb-registry-org-id-search i))) (if rel-msg-id (progn (setq msg-ids ...)))) (setq --dolist-tail-- (cdr --dolist-tail--)))) (if msg-ids (progn (let ((--dolist-tail-- msg-ids) id) (while --dolist-tail-- (setq id (car --dolist-tail--)) (let (...) (if link ...)) (setq --dolist-tail-- (cdr --dolist-tail--)))))) (setq links (delete-dups links)) (if (gnus-alive-p) nil (gnus)) (let ((--dolist-tail-- links) m) (while --dolist-tail-- (setq m (car --dolist-tail--)) (let (server-group msg-id result artno) (setq m (org-link-unescape m)) (if (string-match "\\`\\([^#]+\\)\\(#\\(.*\\)\\)?" m) (progn (setq server-group ... msg-id ... result ...) (if result ...)))) (setq --dolist-tail-- (cdr --dolist-tail--))) (setq m nil) (if vectors (progn (nreverse vectors))))))
  nnir-run-gnorb(((query . "id+003beb97-eaa9-466f-babe-e50e937b5a05")) "nngnorb" nil)
  #[(x) "@\306    !\307\n\"\211A@\262\211\205\"
girzel commented 9 years ago

Weird! I thought that guard was necessary to make it work at all in 5.13...

If you wouldn't mind, would you find the nngnorb.el source file, and comment out the lines:

  (when (equal "5.13" gnus-version-number)
(setq q (car q)))

In the function nnir-run-gnorb. Then re-evaluate that function, and try running gnorb-org-view again? Thanks...

totherme commented 9 years ago

That does it :)

girzel commented 9 years ago

Very perplexing. Fix on the way, thanks for reporting!

totherme commented 9 years ago

Ok, so that worked on my /home/ machine, which is running emacs 24.4. On my /work/ machine, which is running 24.3.1, this problem only appeared today. I've added the lines:

      (when (and (equal "5.13" gnus-version-number) (version< emacs-version "24.4"))
    (setq q (car q)))

...and now my work machine seems ok. I'll test at home on 24.4, and if it works there too (as I hope it will...), then I'll send you a pull request.

girzel commented 9 years ago

Thanks for doing this! It's a pain testing with different emacsen, and even more so with different "gnusen", so this is helpful.

girzel commented 9 years ago

Also, when you send the pull request, can you make sure the commit message includes "TINYCHANGE" at the bottom? If you've already signed the FSF papers, then that's not necessary.

totherme commented 9 years ago

Will do -- thanks :)

totherme commented 9 years ago

This is now fixed in all versions I have available to test with. Thanks!