Gnus development mailing list
 help / color / mirror / Atom feed
* [BBDB] Message shown when adding someone to database (a solution)
@ 2002-01-17 11:18 Matthieu Moy
  0 siblings, 0 replies; only message in thread
From: Matthieu Moy @ 2002-01-17 11:18 UTC (permalink / raw)


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



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-01-17 11:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-17 11:18 [BBDB] Message shown when adding someone to database (a solution) Matthieu Moy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).