#3144: Parent and child match pattern modifier --------------------------+---------------------- Reporter: jlh | Owner: mutt-dev Type: enhancement | Status: new Priority: minor | Milestone: Component: mutt | Version: Resolution: | Keywords: --------------------------+----------------------
Comment (by vinc17): Replying to [comment:11 kevin8t8]: > The behavior of "not" (!) is unclear and even contradictory in the patch. Should it apply to the pattern or to the parent/child operator? Should there be a difference between > > {{{ > !>~f foo.com > !>(~f foo.com) > !(>~f foo.com) > >!~f foo.com > >(!~f foo.com) > }}} IMHO, the first three should be equivalent (just as they are equivalent without {{{>}}}): this should be all the messages for which {{{>~f foo.com}}} is false. And indeed, the current behavior is incorrect. The last two should be equivalent: all the messages that have at least a child for which {{{~f foo.com}}} is false. And currently, {{{>(!~P)}}} and {{{>(!~P !~P)}}} return different results! > Other notes: > > * Does it make sense for a parent/child operator to be applied to ~() operator? Right now the code is, but this seems a bad idea. It may be strange to use this, but I don't see any reason to forbid this unless this makes the code too complex. {{{>~(PATTERN)}}} would mean: all the messages that have at least a child for which {{{~(PATTERN)}}} is true. So, if I understand correctly, compared to {{{~(PATTERN)}}}, this would eliminate leaf messages (messages with no children). > * Vincent: an important correction to your version of the patch. Note that the pattern_cache_t applies to a single header: it doesn't deal with threads. So inside the mutt_pattern_exec(), the first two calls to pattern_exec() should pass NULL for the cache because they are looking at parent/children. Only the third call should actually pass the cache through. Thanks! -- Ticket URL: <https://dev.mutt.org/trac/ticket/3144#comment:12> Mutt <http://www.mutt.org/> The Mutt mail user agent