unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Sebastien Vauban <sva-news@mygooglest.com>
To: bug-gnu-emacs@gnu.org
Subject: Re: bug#20610: 25.0.50; Gnus fancy mail splitting not working anymore
Date: Fri, 24 Jul 2015 14:46:42 +0200	[thread overview]
Message-ID: <86pp3hvi31.fsf@missioncriticalit.com> (raw)
In-Reply-To: mailman.3483.1432330630.904.bug-gnu-emacs@gnu.org

Sebastien Vauban <sva-news@mygooglest.com> writes:
> Sebastien Vauban <sva-news@mygooglest.com> writes:
>> Katsumi Yamaoka <yamaoka@jpl.org> writes:
>>> On Tue, 19 May 2015 14:39:29 -0400, Stefan Monnier wrote:
>>>> I think we need some help from the Gnus guys here,
>>>
>>> (featurep 'bbdb-gnus) ;; Type `C-j' at the end of the form.
>>
>> It _is_ loaded; it returns `t'.  [...]  Both versions of Emacs read my
>> `~/.gnus' file and load the `bbdb-gnus' library found at
>> `~/.emacs.d/elpa/bbdb-20140830.2031/bbdb-gnus.elc'.
>
> I'm progressing -- a bit.  I just found out that [...] in Emacs 25.0,
> _after having started Gnus_, when I type `C-h v nnimap-split-methods',
> I get `nil'!!!  And similarly for `nnimap-split-fancy'... So, these
> variables gets reinitialized after my code is run...  How?  Why?

As I still need to read my mails within Emacs 25.0, and as the fancy
mail splitting still does not work for me there (while it does, with
the same config file, within Emacs 24.5), I have done more tests, adding
the following to my startup file:

--8<---------------cut here---------------start------------->8---
(defconst elt-require-depth 0 
  "Starting depth for load tree.") 

(defadvice require (around leuven-require activate)
  "Leave a trace of packages being loaded."
  (let* ((feature (ad-get-arg 0))
         (prefix-already (concat (make-string (* 4 elt-require-depth) ? ) "+-- "))
         (prefix-open    (concat (make-string (* 4 elt-require-depth) ? ) "+-> "))
         (prefix-close   (concat (make-string (* 4 elt-require-depth) ? ) "--> ")))
    (cond ((featurep feature)
           (message "    [Value of `nnimap-split-methods' before requiring `%S': %s]" feature nnimap-split-methods)
           (message "%s%s <from %s>... already loaded"
                    prefix-already feature
                    (ignore-errors (file-name-base load-file-name)))
           (message "    [Value of `nnimap-split-methods' after requiring `%S': %s]" feature nnimap-split-methods)
           (setq ad-return-value feature))
          (t
           (message "%s%s <from %s>... %s"
                    prefix-open feature
                    (ignore-errors (file-name-base load-file-name))
                    (locate-library (symbol-name feature)))
           (message "    [Value of `nnimap-split-methods' before requiring `%S': %s]" feature nnimap-split-methods)
           (let ((elt-require-depth (1+ elt-require-depth)))
             ad-do-it)
           (message "    [Value of `nnimap-split-methods' after requiring `%S': %s]" feature nnimap-split-methods)
           (message "%s%s <from %s>... loaded"
                    prefix-close feature
                    (ignore-errors (file-name-base load-file-name)))))))
--8<---------------cut here---------------end--------------->8---

The effect, shown in both Emacs 24.5 and Emacs 25.0, is shown at the
screenshot http://screencast.com/t/akk7Mbx1q:

--8<---------------cut here---------------start------------->8---
+-- nntp <from nil>... already loaded
    [Value of `nnimap-split-methods' after requiring `nntp': nnimap-split-fancy]
Opening connection to mail via tls...
    [Value of `nnimap-split-methods' before requiring `tls': nil]
+-- tls <from network-stream>... already loaded
--8<---------------cut here---------------end--------------->8---

You can see that `nnimap-split-methods' gets reset to nil (in Emacs
25.0) somewhere between requiring `nntp' and "Opening connection to
<nnimap-address> via tls..." (function `nnimap-open-connection-1' in
`nnimap.el').  Why???

That must explain why no splitting is done on my mailbox.

Can anyone give me any hint on how to debug this further?  Please!  I'm
out of ideas on how to progress.

Best regards,
  Seb

PS- "Full" config being used:

--8<---------------cut here---------------start------------->8---
;;* Loading

(require 'gnus)
(require 'nnimap)

(defconst elt-require-depth 0 
  "Starting depth for emacs-load-time tree.") 

(defadvice require (around leuven-require activate)
  "Leave a trace of packages being loaded."
  (let* ((feature (ad-get-arg 0))
         (prefix-already (concat (make-string (* 4 elt-require-depth) ? ) "+-- "))
         (prefix-open    (concat (make-string (* 4 elt-require-depth) ? ) "+-> "))
         (prefix-close   (concat (make-string (* 4 elt-require-depth) ? ) "--> ")))
    (cond ((featurep feature)
           (message "    [Value of `nnimap-split-methods' before requiring `%S': %s]" feature nnimap-split-methods)
           (message "%s%s <from %s>... already loaded"
                    prefix-already feature
                    (ignore-errors (file-name-base load-file-name)))
           (message "    [Value of `nnimap-split-methods' after requiring `%S': %s]" feature nnimap-split-methods)
           (setq ad-return-value feature)) ; set the return value in the case
                                        ; `ad-do-it' is not called
          (t
           (message "%s%s <from %s>... %s"
                    prefix-open feature
                    (ignore-errors (file-name-base load-file-name))
                    (locate-library (symbol-name feature)))
           (message "    [Value of `nnimap-split-methods' before requiring `%S': %s]" feature nnimap-split-methods)
           (let ((elt-require-depth (1+ elt-require-depth)))
             ad-do-it)
           (message "    [Value of `nnimap-split-methods' after requiring `%S': %s]" feature nnimap-split-methods)
           (message "%s%s <from %s>... loaded"
                    prefix-close feature
                    (ignore-errors (file-name-base load-file-name)))))))

;;* Starting Gnus

  (message "Starting Gnus...")

  ;; Support for `.authinfo' file.
  (when (try-require 'auth-source)

    ;; Log debug messages.
    (setq auth-source-debug t))

  ;; Configure incoming mail.
  (setq gnus-select-method
        '(nnimap "mail"
                 (nnimap-address "mail")
                 (nnimap-server-port 993)
                 (nnimap-stream ssl)))

  ;; Using Gnus for news.
  (setq gnus-secondary-select-methods
        '((nntp "gmane"
                (nntp-address "news.gmane.org"))
          (nntp "eternal-september"
                (nntp-address "news.eternal-september.org"))))

;; Gnus will not check for new newsgroups at startup.
  (setq gnus-check-new-newsgroups nil)

  ;; Don't save the list of killed groups.
  (setq gnus-save-killed-list nil)

  ;; Don't save a `.newsrc' file (for using other newsreaders) on exit.
  (setq gnus-save-newsrc-file nil)      ; Speed-up.

  ;; Ignore the `.newsrc' file.
  (setq gnus-read-newsrc-file nil)      ; Speed-up.

  ;; My `.newsrc' file (and the derived .el/.eld files).
  (setq gnus-startup-file (concat gnus-directory ".newsrc"))

  ;; Enable showing of [Gmail]/* groups.
  (setq gnus-ignored-newsgroups "")

  ;; Unconditionally read the dribble file.
  (setq gnus-always-read-dribble-file t)

  ;;  Gnus will only know about the groups in my `.newsrc' file
  (setq gnus-read-active-file nil)  ; speed-up

  (message "Starting Gnus... Done")

;;* Select Methods

  (message "6 Select Methods...")

  ;; Name(s) of IMAP mailboxes to split mail from.
  (setq nnimap-inbox "INBOX")           ; Necessary for splitting under 24.5.

  ;; The first match in `nnmail-split-rule' found will be used.
  (setq nnmail-crosspost nil)

  ;; BBDB (Big Brother DataBase) is loaded from my `.emacs' file.
  (when (try-require 'bbdb-gnus)

    ;; Split function to use (sorting mails into groups using BBDB).
    (setq nnimap-split-methods 'nnimap-split-fancy)

    ;; Specify how to split mail.
    (setq nnimap-split-fancy            ; XXX vs `nnmail-split-fancy'?
          '(|                           ; Split to the *first* match.

              ;; Mailing lists (in To: or Cc:).
              (to "foo@bar\\.com" "list.foo")

              ;; Invoke BBDB.
              (: (lambda ()
                   (car (bbdb/gnus-split-method))))

              ;; Catch spam.
              ("X-Spam-Status" "[Yy]es"
               "INBOX.Spam")

              ;; Unmatched mail goes to the catch-all group (default mailbox).
              "INBOX"))                 ; Undecided.

    ;; For records which don't have `gnus-private' set, the rules in
    ;; `split-fancy' are invoked.
    (setq bbdb/gnus-split-default-group nil))
--8<---------------cut here---------------end--------------->8---


  parent reply	other threads:[~2015-07-24 12:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-19 12:40 bug#20610: 25.0.50; Gnus fancy mail splitting not working anymore Sebastien Vauban
2015-05-19 17:35 ` Stefan Monnier
     [not found]   ` <jwviobojwsf.fsf-monnier+emacsbugs-mXXj517/zsQ@public.gmane.org>
2015-05-19 17:57     ` Sebastien Vauban
2015-05-19 18:39       ` Stefan Monnier
2015-05-20  0:22         ` Katsumi Yamaoka
     [not found]         ` <mailman.3294.1432081389.904.bug-gnu-emacs@gnu.org>
     [not found]           ` <868uckoi50.fsf-hcDgGtZH8xNBDgjK7y7TUQ@public.gmane.org>
2015-05-21 11:51             ` Sebastien Vauban
2015-07-24 14:49             ` Sebastien Vauban
     [not found]           ` <mailman.3370.1432209128.904.bug-gnu-emacs@gnu.org>
     [not found]             ` <mailman.3370.1432209128.904.bug-gnu-emacs-mXXj517/zsQ@public.gmane.org>
2015-05-22 21:36               ` Sebastien Vauban
     [not found]             ` <mailman.3483.1432330630.904.bug-gnu-emacs@gnu.org>
2015-07-24 12:46               ` Sebastien Vauban [this message]
2016-10-14 10:33 ` bug#20610: 25.1.1 " Gijs Hillenius

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86pp3hvi31.fsf@missioncriticalit.com \
    --to=sva-news@mygooglest.com \
    --cc=bug-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).