[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: filter message display in 'summary'?



David Maus wrote:
>Looking at the source (tm) of elmo-imap4.el suggests that a negated
>search for messages is not (yet) supported.

>Can anyone confirm this?

Yes, it's right there in elmo-imap4.el:

,----
| (defun elmo-imap4-search-internal-primitive (folder session filter from-msgs)
|   (let ((search-key (elmo-filter-key filter))
| 	(imap-search-keys '("bcc" "body" "cc" "from" "subject" "to"
| 			    "larger" "smaller" "flag"))
| 	(total 0)
| 	(length (length from-msgs))
| 	charset set-list end results)
|     (cond
|     [...]
|      ((string= "flag" search-key)
|       (elmo-imap4-folder-list-flagged
|        folder (intern (elmo-filter-value filter))))
|     [...]
`----

Only the filter value (i.e. the flag) is passed to
`elmo-imap4-folder-list-flagged', the filter type ('unmatch for a
negated search) is silenty dropped.

Attached fixes this glitch by

 - modifying `elmo-imap4-folder-list-flagged' to take a optional
   argument TYPE for the filter type and prefixes the search condition
   with a "not " if TYPE is 'unmatch.

 - passing the filter type to `elmo-imap4-folder-list-flagged' in
   `elmo-imap4-search-internal-primitive'

HTH
 -- David
--
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... dmjena@jabber.org
Email..... dmaus@ictsoc.de

Attachment: fix-573726.diff
Description: Binary data

Attachment: pgp7gJO6_ebvP.pgp
Description: PGP signature