[PATCH] emacs: Mention race condition safety in user visible documentation

Pieter Praet pieter at praet.org
Thu Mar 1 09:13:27 PST 2012


On Wed, 29 Feb 2012 22:49:46 -0400, David Bremner <david at tethera.net> wrote:
> On Tue, 21 Feb 2012 10:15:08 +0100, Michal Sojka <sojkam1 at fel.cvut.cz> wrote:
> > -- >8 --
> > Subject: [PATCH] emacs: Clarify description of thread manipulating functions
> > 
> > It is not clear whether the term "thread" refers to the thread in the
> > database or to the thread currently shown in a buffer. Those two
> > meanings may refer to different sets of messages, e.g. when a new email
> > is added to the database while the buffer shows the state before the new
> > email arrived.
> 
> (will be) pushed.
> 
> For future reference, it's slightly inconvenient for me to use "git am
> -c". Not a big deal, but a sequence of those would make me cry...
>

Something like this might help save you some time:
(assuming you'd rather not leave Emacs to apply patches)

  #+begin_src emacs-lisp
    (defvar praet/projects
      '(("notmuch at notmuchmail.org" . "~/src/dev/notmuch/")
        ("foo at bar.org" . "~/src/dev/foobar/")))

    (defun praet/notmuch-patch-apply (&optional all-open)
      "Apply a patch from `notmuch-show-mode' using git-am(1).
    If ALL-OPEN is non-nil, (try to) apply all open messages."
      (interactive "P")
      (let* ((msg (notmuch-show-get-message-id t))
             (rcpts (concat (notmuch-show-get-to)
                            (notmuch-show-get-cc)))
             (projs (loop for project in praet/projects
                          if (string-match (car project) rcpts)
                          collect (cdr project)))
             (proj (if (> (length projs) 1)
                       (ido-completing-read "Apply in: " projs)
                     (car projs)))
             (cmd "git am --abort ; git am")
             (optargs '("--signoff" "--3way" "--scissors"))
             (args (read-string "Args: " nil '(optargs . 0))))
        (message "Applying in '%s': '%s' (using '%s %s')"
                 proj msg cmd args)
        (notmuch-show-pipe-message all-open
         (concat "(cd " proj " && (" cmd " " args ")" ")"))))

    (define-key notmuch-show-mode-map (kbd "C-c p a")
      'praet/notmuch-patch-apply)
  #+end_src


> d
> _______________________________________________
> notmuch mailing list
> notmuch at notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch


Peace

-- 
Pieter


More information about the notmuch mailing list