Giter VIP home page Giter VIP logo

notmuch-x's Introduction

notmuch-x

This package provides a set of custom extensions for the notmuch Emacs-based interface.

Installation

Clone this repo and add it to your load-path:

(add-to-list 'load-path "/path/to/notmuch-x")
(require 'notmuch-x)

Or, with use-package + straight.el:

(use-package notmuch-x
  :straight (notmuch-x :host github :repo "bcardoso/notmuch-x"))

Usage

Start notmuch with notmuch-x-run-notmuch: it will enable both the notmuch-x-auto-update-mode, to periodically find and import any new messages, and the mode-line indicator notmuch-x-indicator-mode. The relevant customizable variables are accessible through the customize interface:

  • M-x customize-group RET notmuch-x

Example configuration

Below are my current notmuch-x configuration and keybindings.

(use-package notmuch-x
  :straight (notmuch-x :host github :repo "bcardoso/notmuch-x")
  :after notmuch
  :bind (("C-c m"            . notmuch-x-run-notmuch)
         ("C-c M"            . notmuch-x-update-dwim)
         ("C-x m"            . notmuch-mua-new-mail)
         (:map notmuch-search-mode-map
               ("G"          . notmuch-x-update-dwim)
               ("Q"          . notmuch-x-kill-all-search-buffers)
               ("S"          . notmuch-x-edit-current-search)
               ("U"          . notmuch-unthreaded)
               ("u"          . my/notmuch-tag-toggle-unread)
               ("f"          . my/notmuch-tag-toggle-flagged)
               ("a"          . my/notmuch-tag-archived)
               ("T"          . my/notmuch-tag-todo)
               ("i"          . my/notmuch-tag-inbox)
               ("d"          . my/notmuch-tag-trash))
         (:map notmuch-show-mode-map
               ("<C-return>" . notmuch-x-toggle-thread-visibility)
               ("<RET>"      . notmuch-x-toggle-message-or-browse-url)
               ("<tab>"      . notmuch-x-next-button-or-link)
               ("<backtab>"  . notmuch-x-previous-button-or-link)
               ("n"          . notmuch-show-next-message)
               ("N"          . notmuch-show-next-open-message)
               ("p"          . notmuch-show-previous-message)
               ("P"          . notmuch-show-previous-open-message)
               ("o"          . notmuch-x-view-part-in-browser)
               ("u"          . my/notmuch-tag-toggle-unread)
               ("f"          . my/notmuch-tag-toggle-flagged)
               ("a"          . my/notmuch-tag-archived)
               ("T"          . my/notmuch-tag-todo)
               ("i"          . my/notmuch-tag-inbox)
               ("d"          . my/notmuch-tag-trash)))
  :config
  ;; Alternate format for notmuch-search fields
  (setq notmuch-x-search-date-format "%F %R")
  (setq notmuch-x-search-truncate-subject-width 68)
  (notmuch-x-search-alt-format-mode +1)

  (defun my/notmuch-tag-toggle-unread ()
    "Toggle 'unread' tag."
    (interactive)
    (notmuch-x-tag-toggle "unread"))

  (defun my/notmuch-tag-toggle-flagged ()
    "Toggle 'flagged' tag."
    (interactive)
    (notmuch-x-tag-toggle "flagged"))

  (defun my/notmuch-tag-archived ()
    "Tag thread as 'archived'."
    (interactive)
    (notmuch-x-tag-thread '("+archived" "-inbox" "-todo" "-trash" "-unread") t))

  (defun my/notmuch-tag-todo ()
    "Tag selected message(s) as 'todo'."
    (interactive)
    (notmuch-x-tag '("+todo" "+inbox" "-archived" "-trash")))

  (defun my/notmuch-tag-inbox ()
    "Tag selected message(s) as 'inbox'."
    (interactive)
    (notmuch-x-tag '("+inbox" "-trash" "-archived")))

  (defun my/notmuch-tag-trash ()
    "Tag selected message(s) as 'trash'."
    (interactive)
    (notmuch-x-tag '("+trash" "-inbox" "-archived" "-todo" "-unread"))))

notmuch-x's People

Contributors

bcardoso avatar

Watchers

 avatar

notmuch-x's Issues

Customization to disable the update timer

Hi:

Thank you for a great addition to notmuch in emacs.

I am running "notmuch new" in a cronjob (sometimes I do not have Emacs open 🙈).

Because of that sometimes the notmuch-x-update fails, because my cronjob is running together with notmuch-x-update.

I can disable this behavior by setting (setq notmuch-x--update-timer t) in my configuration.

However, it would be more intuitive if there was a customization to enable/disable the internal "notmuch new".

Let me know what you think. Thanks.

BR,
Soren

Notmuch-x-run-notmuch fails if display-time-mode is not set.

Hi:

Thanks for a great addition to notmuch :-)

When I start notmuch-x-run-notmuch without (display-time-mode 1) in my configuration, notmuch-x-run-notmuch fails with:
notmuch-x-mode-line-indicator: Symbol’s value as variable is void: display-time-mail-icon

On the second start it works.

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.