-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code example for implementing auto-notes functionality #96
Comments
Hi Mats, The current tools aren't all that easy to use, it's true. The "Noticing and Automatic Rules" section of the manual gives the bare-bones, but it's not too clear how one would use it. I can provide more examples in the manual, but I wonder if some more convenient code tools are in order, as well. You can get the information you need using the function (defun my-test-notice-func (_rec _type)
(let ((subject (ebdb-mua-message-header "Subject")))
(message "Subject is %s"
(message-simplify-subject subject))))
(add-hook 'ebdb-notice-record-hook #'my-test-notice-func) But what isn't clear is how to update or edit a record's existing field with a new value, which can actually be a little bit difficult. I think I should probably provide some short-cut functions for doing that. What exactly would you like your function to do? What kind of information do you need in the hook, and what would you expect to be able to do to the record in question? |
Hi Eric, I would like to store the subject of the last received mail in the record. As I'm typing I realize that can be tricky. In BBDB it kicks in when I manually hit As an extra bonus if a |
Okay, I quite understand what you're after. First of all, just FYI, I've just pushed a change to master that adds a little more documentation about automatically updating records, as well as a couple of new convenience functions for setting notes and tags. Come to think of it that section could still use some full examples, I'll add that maybe over the weekend. I haven't released this change yet, but it's here on Github. For your specific request, I've also wanted the same thing, and have implemented it unfortunately as a part of a separate package, Gnorb. Actually, there's a whole "in between" package that does exactly this and nothing more, and you can see the code here: This might do more than you wanted! But it handles the question of last-seen vs last-received, lets you store references to multiple messages, and turns the references into clickable links so you can jump to the message. Looking at the code, there's almost no reason why this would need to belong to the Gnorb package at all. I only see one gnorb-* function being used in there, and it would be easy to replace. If I did that, all this code could be moved into the EBDB package, in ebdb-gnus.el. In fact, it might not be too hard to remove the dependencies on Gnus, either, in which case the field type could be generalized to work with all the MUAs that EBDB supports. It might take a while to do that. In the meantime, you could refer to the library linked above to implement something for yourself, or wait until I've moved it into EBDB and use it from there. |
Hi Eric, Thanks for putting this together but after I had a look at this I'm afraid I would still need a simple code example to get going. It is probably easy if I would have known more about eieio but if I could short circuit that learning effort it would be great. |
Hi,
In commit d7bc0c9 the auto-notes feature was dropped. It would be nice if there was some code samples on how you could implement a feature like that in order to automatically populating you own fields.
I have particular found great use of storing the subject line using BBDB and would like to implement that for EBDB. So I'm not asking for something fully customizable but rather specialized for just the subject line. (Which hopefully is much simpler.)
Yours Mats
The text was updated successfully, but these errors were encountered: