Re: bbdbv3 and wanderlust

Kazuhiro Ito <[email protected]>
Newsgroups gmane.mail.wanderlust.general.japanese
Message-ID <[email protected]>
I am not user of bbdb, so below comments consist on only my thinking,
not tested.

> old file: ./.emacs.d/elpa/bbdb-20170725.300/bbdb-wl.el
> new file: ./.emacs.d/elpa/bbdb-20170725.300/bbdb-wl-pristine.el
> 39,42c39,43
> <   (elmo-message-entity-field
> <    (elmo-message-entity wl-summary-buffer-elmo-folder
> <                         (wl-summary-message-number))
> <    (intern (downcase header)) 'string))
> ---
> >   (with-current-buffer (get-buffer wl-summary-buffer-name)
> >     (elmo-message-entity-field
> >      (elmo-message-entity wl-summary-buffer-elmo-folder
> >                         (wl-summary-message-number))
> >      (intern (downcase header)) 'string)))

If you use sticky summary feature, summary buffer's name is not euqal
to wl-summary-buffer-name.  Replacing bbdb/wl-header function with the
below code should fix your problem.

(defun bbdb/wl-header (header)
  (elmo-message-entity-field
   (with-current-buffer (if (buffer-live-p wl-current-summary-buffer)
			    wl-current-summary-buffer
			  ;; Or signal some error.
			  (current-buffer))
     (elmo-message-entity wl-summary-buffer-elmo-folder
			  (wl-summary-message-number)))
   (intern (downcase header)) 'string))

If bbdb/wl-header can assume wl-current-summary-buffer always
indicates non-killed buffer, we can use more simple code.  But I'm not
sure.

(defun bbdb/wl-header (header)
  (elmo-message-entity-field
   (with-current-buffer wl-current-summary-buffer
     (elmo-message-entity wl-summary-buffer-elmo-folder
			  (wl-summary-message-number)))
   (intern (downcase header)) 'string))


> old file: ./.emacs.d/elpa/wanderlust-20170627.2306/wl-summary.el
> new file: ./.emacs.d/elpa/wanderlust-20170627.2306/wl-summary-pristine.el
> 2173,2178c2173,2179
> <   (save-excursion
> <     (beginning-of-line)
> <     (if (or (re-search-forward "\r\\(-?[0-9]+\\)" (point-at-eol) t)
> <           (re-search-forward "^ *\\(-?[0-9]+\\)" (point-at-eol) t))
> <       (string-to-number (wl-match-buffer 1))
> <       nil)))
> ---
> >   (with-current-buffer (get-buffer wl-summary-buffer-name)
> >     (save-excursion
> >       (beginning-of-line)
> >       (if (or (re-search-forward "\r\\(-?[0-9]+\\)" (point-at-eol) t)
> >             (re-search-forward "^ *\\(-?[0-9]+\\)" (point-at-eol) t))
> >         (string-to-number (wl-match-buffer 1))
> >       nil))))

wl-summary-message-number is designed to be called from summary
buffer.  If you really need that change, caller should be fixed.

-- 
Kazuhiro Ito
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.