Re: bbdbv3 and wanderlust
Rob Walker <[email protected]>
| Newsgroups | gmane.mail.wanderlust.general |
|---|---|
| Message-ID | <84377vqbh3.wl-rob__32480.9849066243$1505027266$gmane$org@ladle.net> |
I can't be certain, but I *think* that when we are inside of the
bbdb/wl-header function, the call to wl-summary-message-number returns
nil. I have tried to fake it with hardcoded values, but gotten no
success, so I don't know.
Thanks,
Rob
On Sat, 09 Sep 2017 16:23:48 -0700,
Rob Walker wrote:
>
> Hi everyone,
>
> tl;dr I tried a bunch of things, and I get stuck debugging in the
> function bbdb/wl-header in the file bbdb-wl.el.
>
> I have some questions about using bbdbv3 with Wanderlust. I have the
> most simple setup I could implement.
>
> I have only added melpa, installed wl and bbdb from melpa. ("adduser
> g" and "ssh -X g@localhost" are great to create pristine environments)
>
> My bbdb initialization code consists of the following lines:
>
> (require 'bbdb)
> (bbdb-initialize 'wl)
> (bbdb-mua-auto-update-init 'wl)
>
> The call to bbdb-initialize works, because
>
> wl-init-hook is a variable defined in ‘wl-vars.el’.
> Its value is (bbdb-insinuate-wl wl-plugged-init-icons wl-biff-init-icons)
>
> Also, while I am in the Summary buffer, C-h k : returns
>
> : runs the command bbdb-mua-display-sender (found in
> wl-summary-mode-map), which is an interactive autoloaded compiled Lisp
> function in ‘bbdb-mua.el’.
>
> It is bound to :.
>
> (bbdb-mua-display-sender &optional UPDATE-P)
>
> The first time I do this, I get the message:
>
> (New file)
>
> At that moment, I am able to bring up a buffer called "bbdb", which
> has the following in it:
>
> ;; -*- mode: Emacs-Lisp; coding: utf-8; -*-
> ;;; file-format: 7
>
> So far, so good, right? Yes, except that file has no data in it. I
> then hit : on a few more emails, and still nothing is added to the
> bbdb file.
>
> The second line seems to work as well, since:
>
> wl-message-redisplay-hook is a variable defined in ‘wl-vars.el’.
> Its value is (bbdb-mua-auto-update)
>
> However, nothing happens when I'm reading emails. We enter
> (bbdb-mua-auto-update), but we never exit the function.
>
> (let* ((bbdb-silent-internal t)
> (records (bbdb-mua-update-records header-class
> (or update-p
> bbdb-mua-auto-update-p)))
> (bbdb-pop-up-window-size bbdb-mua-pop-up-window-size))
> (if bbdb-mua-pop-up
> (if records
> (bbdb-display-records records bbdb-pop-up-layout
> nil nil (bbdb-mua-window-p))
> ;; If there are no records, empty the BBDB window.
> (bbdb-undisplay-records)))
> records)
>
> is the code that is failing.
>
> We enter (bbdb-mua-update-records), but never exit it.
>
> We enter (bbdb-mua), but never exit it. At the time of entering
> (bbdb-mua),
>
> bbdb-mua-mode-alist - ((vm vm-mode vm-virtual-mode vm-summary-mode vm-presentation-mode) (gnus gnus-summary-mode gnus-article-mode gnus-tree-mode) (rmail rmail-mode rmail-summary-mode) (mh mhe-mode mhe-summary-mode mh-folder-mode) (mu4e mu4e-view-mode) (wl wl-summary-mode wl-draft-mode) (message message-mode mu4e-compose-mode notmuch-message-mode) (mail mail-mode))
>
> I believe the problem is that our display buffer is in
>
> major-mode is a variable defined in ‘C source code’.
> Its value is ‘mime-view-mode’
> Original value was fundamental-mode
> Local in buffer *WL:Message*-608594; global value is fundamental-mode
>
> Automatically becomes buffer-local when set.
>
> Documentation:
>
> I added mime-view-mode to the (defconst bbdb-mua-mode-alist) and now
> we exit (bbdb-mua) and (bbdb-mua-update-records). So with that one
> change, I think we are able to get to the code at line 615 in
> bbdb-mua.el which looks like this:
>
> ;; Wanderlust
> ((eq mua 'wl)
> (bbdb-update-records (bbdb-get-address-components header-class)
> update-p sort))
>
>
> This is where I get lost. I am currently looking at
> bbdb-get-adress-components, but I don't know how it is getting the
> addresses. I suspect it isn't able to jump into the mime-view file
> somehow. My thoughts moving forward are to figure out how the code at
> https://bitbucket.org/cnngimenez/bbdb-wl grabs the headers, and use
> that instead of what bbdb.el is doing. But that's just a guess.
>
> Thanks,
> Rob
>