From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/42127 Path: main.gmane.org!not-for-mail From: Matthieu Moy Newsgroups: gmane.emacs.gnus.general Subject: [BBDB] Message shown when adding someone to database (a solution) Date: Thu, 17 Jan 2002 12:18:29 +0100 Organization: Verimag Sender: owner-ding@hpc.uh.edu Message-ID: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035177412 9729 80.91.224.250 (21 Oct 2002 05:16:52 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 05:16:52 +0000 (UTC) Return-Path: Original-Received: (qmail 15613 invoked from network); 17 Jan 2002 11:19:16 -0000 Original-Received: from malifon.math.uh.edu (mail@129.7.128.13) by mastaler.com with SMTP; 17 Jan 2002 11:19:16 -0000 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 16RAZI-0007Dj-00; Thu, 17 Jan 2002 05:18:52 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Thu, 17 Jan 2002 05:18:44 -0600 (CST) Original-Received: from sclp3.sclp.com (qmailr@sclp3.sclp.com [209.196.61.66]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id FAA04885 for ; Thu, 17 Jan 2002 05:18:30 -0600 (CST) Original-Received: (qmail 15603 invoked by alias); 17 Jan 2002 11:18:33 -0000 Original-Received: (qmail 15598 invoked from network); 17 Jan 2002 11:18:32 -0000 Original-Received: from ingebrigtsen.no (HELO quimby2.netfonds.no) (195.204.10.66) by gnus.org with SMTP; 17 Jan 2002 11:18:32 -0000 Original-Received: from news by quimby2.netfonds.no with local (Exim 3.12 #1 (Debian)) id 16RAbS-0002dt-00 for ; Thu, 17 Jan 2002 12:21:06 +0100 Original-To: ding@gnus.org Original-Path: not-for-mail Original-Newsgroups: gnus.ding Original-Lines: 42 Original-NNTP-Posting-Host: ubaye.imag.fr Original-X-Trace: quimby2.netfonds.no 1011266466 9403 129.88.43.88 (17 Jan 2002 11:21:06 GMT) Original-X-Complaints-To: usenet@quimby2.netfonds.no Original-NNTP-Posting-Date: 17 Jan 2002 11:21:06 GMT X-Home-Page: http://www-ensimag.imag.fr/eleves/Matthieu.Moy/ X-Url: http://www-ensimag.imag.fr/eleves/Matthieu.Moy/ X-Face: %xEb27l:C~bcH,tGGRk8m'o_}XBMb*NoIbS$sp(:3s+l@PwMH+C*7Vf@Y_]%rP)*/'`Lpt[O9C;jbVo?Qp User-Agent: Gnus/5.090005 (Oort Gnus v0.05) Emacs/21.1 (i686-pc-linux-gnu) Cancel-Lock: sha1:llxmXIU5Vm8KnumJ+Y6qHq3HNLI= Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:42127 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:42127 I found it boring to have to answer to the question "XXX is not in the db, add ?" while the message is narrowed to headers only. There is a slight modification to do in bbdb-gnus.el for that : I think this should be the default behaviour of the next version ... (defun bbdb/gnus-update-record (&optional offer-to-create) "returns the record corresponding to the current GNUS message, creating or modifying it as necessary. A record will be created if bbdb/news-auto-create-p is non-nil, or if OFFER-TO-CREATE is true and the user confirms the creation." (set-buffer gnus-article-buffer) (save-restriction (widen) ;;(gnus-article-show-all-headers) (narrow-to-region (point-min) (progn (goto-char (point-min)) (if (search-forward "\n\n" nil 'force) (- (point) 2) (point)))) (let ((from (mail-fetch-field "from")) name net) (if (or (null from) (string-match (bbdb-user-mail-names) (mail-strip-quoted-names from))) ;; if logged-in user sent this, use recipients. (setq from (or (mail-fetch-field "to") from))) (widen) ; <---------------------- This line should be added ** ; (line 67) (if from (bbdb-annotate-message-sender from t (or (bbdb-invoke-hook-for-value bbdb/news-auto-create-p) offer-to-create) (or (bbdb-invoke-hook-for-value bbdb/prompt-for-create-p) offer-to-create)))))) -- Matthieu