Code Monkey home page Code Monkey logo

Comments (2)

titaniumbones avatar titaniumbones commented on June 15, 2024

I have a sort of partial solution, which is to parse the query before sending it to the mu find shell process. I just wrap the query let-binding in the function below. I use the built-in mu4e-bookmarks variable and the abbreviation bm: to identify a bookmark, though the user will need to customize the variable and add a new :nickname property to each bookmark. So far I like it; it makes it quite easy, for instance, to add AND flag:unread to an existing bookmark. Needs to be cleaned up a bit, and my own code right now is a bit of a jumble, but if you're interested I could provide a patch. So far I believe it does work.

(defun mu4e-dashboard-expand-bm (q)
  (let* ((bookmark-re "bm:\\(\\w+\\)")
         (match (string-match bookmark-re q))
         (nickname (match-string 1 q))
         (bms mu4e-bookmarks )
         (bookmark (if nickname (--first (equal (plist-get it :nick) nickname) bms )))
         (expansion (if bookmark (plist-get bookmark :query) ))  )
    (if expansion  
        (replace-regexp-in-string bookmark-re expansion  q)
      q)))

from mu4e-dashboard.

rougier avatar rougier commented on June 15, 2024

Many thanks for the code. There was also a discussion on the mu mailing list and Matt Price propose some code. Is your code more or less equivalent ?

from mu4e-dashboard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.