[notmuch] [PATCH 2/2] notmuch.el: add a submap (on "z" for "ztash") to stash things.

2010-02-20 Thread Carl Worth
On Thu, 11 Feb 2010 23:01:08 -0400, david at tethera.net wrote:
> From: David Bremner 
> 
> Provide key bindings for stuffing various RFC822 header fields and other 
> metadata
> into the emacs kill-ring as text. The bindings are as follows:

A fantastic feature, David! Thanks so much!

I've now applied this, (and pushed it out). As we discussed in IRC, I
also changed the keybinding from 'z' to 'c'.

So, for everyone who didn't pick up on this feature, you can now use the
keybinding 'c i' to copy a message ID when viewing a message within
emacs. Then, if using X, you can immediately use the middle-mouse button
(or similar) to paste that message into an application of choice. It's
very convenient.

There are also similar keybindings for copying out other portions of the
message header. Enjoy!

-Carl
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: 



Re: [notmuch] [PATCH 2/2] notmuch.el: add a submap (on z for ztash) to stash things.

2010-02-20 Thread Carl Worth
On Thu, 11 Feb 2010 23:01:08 -0400, da...@tethera.net wrote:
 From: David Bremner brem...@unb.ca
 
 Provide key bindings for stuffing various RFC822 header fields and other 
 metadata
 into the emacs kill-ring as text. The bindings are as follows:

A fantastic feature, David! Thanks so much!

I've now applied this, (and pushed it out). As we discussed in IRC, I
also changed the keybinding from 'z' to 'c'.

So, for everyone who didn't pick up on this feature, you can now use the
keybinding 'c i' to copy a message ID when viewing a message within
emacs. Then, if using X, you can immediately use the middle-mouse button
(or similar) to paste that message into an application of choice. It's
very convenient.

There are also similar keybindings for copying out other portions of the
message header. Enjoy!

-Carl


pgp4J8RrcDsy3.pgp
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[notmuch] [PATCH 2/2] notmuch.el: add a submap (on "z" for "ztash") to stash things.

2010-02-12 Thread Michal Sojka
On Thu, 11 Feb 2010 23:01:08 -0400, david at tethera.net wrote:
> From: David Bremner 
> 
> Provide key bindings for stuffing various RFC822 header fields and other 
> metadata
> into the emacs kill-ring as text. The bindings are as follows:
> 
> z F   notmuch-show-stash-filename
> z T   notmuch-show-stash-tags
> z c   notmuch-show-stash-cc
> z d   notmuch-show-stash-date
> z f   notmuch-show-stash-from
> z m   notmuch-show-stash-message-id
> z s   notmuch-show-stash-subject
> z t   notmuch-show-stash-to

Great! I've always wished to have this.

Michal


Re: [notmuch] [PATCH 2/2] notmuch.el: add a submap (on z for ztash) to stash things.

2010-02-12 Thread Michal Sojka
On Thu, 11 Feb 2010 23:01:08 -0400, da...@tethera.net wrote:
 From: David Bremner brem...@unb.ca
 
 Provide key bindings for stuffing various RFC822 header fields and other 
 metadata
 into the emacs kill-ring as text. The bindings are as follows:
 
 z F   notmuch-show-stash-filename
 z T   notmuch-show-stash-tags
 z c   notmuch-show-stash-cc
 z d   notmuch-show-stash-date
 z f   notmuch-show-stash-from
 z m   notmuch-show-stash-message-id
 z s   notmuch-show-stash-subject
 z t   notmuch-show-stash-to

Great! I've always wished to have this.

Michal
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[notmuch] [PATCH 2/2] notmuch.el: add a submap (on "z" for "ztash") to stash things.

2010-02-11 Thread da...@tethera.net
From: David Bremner 

Provide key bindings for stuffing various RFC822 header fields and other 
metadata
into the emacs kill-ring as text. The bindings are as follows:

z F notmuch-show-stash-filename
z T notmuch-show-stash-tags
z c notmuch-show-stash-cc
z d notmuch-show-stash-date
z f notmuch-show-stash-from
z m notmuch-show-stash-message-id
z s notmuch-show-stash-subject
z t notmuch-show-stash-to
---
 notmuch.el |   61 
 1 files changed, 61 insertions(+), 0 deletions(-)

diff --git a/notmuch.el b/notmuch.el
index 60ef592..faca26d 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -51,6 +51,22 @@
 (require 'mm-view)
 (require 'message)

+(defvar notmuch-show-stash-map
+  (let ((map (make-sparse-keymap)))
+(define-key map "c" 'notmuch-show-stash-cc)
+(define-key map "d" 'notmuch-show-stash-date)
+(define-key map "F" 'notmuch-show-stash-filename)
+(define-key map "f" 'notmuch-show-stash-from)
+(define-key map "m" 'notmuch-show-stash-message-id)
+(define-key map "s" 'notmuch-show-stash-subject)
+(define-key map "T" 'notmuch-show-stash-tags)
+(define-key map "t" 'notmuch-show-stash-to)
+map)
+  "Submap for stash commands"
+  )
+
+(fset 'notmuch-show-stash-map notmuch-show-stash-map)
+
 (defvar notmuch-show-mode-map
   (let ((map (make-sparse-keymap)))
 (define-key map "?" 'notmuch-help)
@@ -80,6 +96,7 @@
 (define-key map "n" 'notmuch-show-next-message)
 (define-key map (kbd "DEL") 'notmuch-show-rewind)
 (define-key map " " 'notmuch-show-advance-marking-read-and-archiving)
+(define-key map "z" 'notmuch-show-stash-map)
 map)
   "Keymap for \"notmuch show\" buffers.")
 (fset 'notmuch-show-mode-map notmuch-show-mode-map)
@@ -1074,6 +1091,50 @@ All currently available key bindings:
   :options '(hl-line-mode)
   :group 'notmuch)

+(defun notmuch-show-do-stash (text)
+(kill-new text)
+(message (concat "Saved: " text)))
+
+(defun notmuch-show-stash-cc ()
+  "Copy CC field of current message to kill-ring."
+  (interactive)
+  (notmuch-show-do-stash (notmuch-show-get-cc)))
+
+(defun notmuch-show-stash-date ()
+  "Copy date of current message to kill-ring."
+  (interactive)
+  (notmuch-show-do-stash (notmuch-show-get-date)))
+
+(defun notmuch-show-stash-filename ()
+  "Copy filename of current message to kill-ring."
+  (interactive)
+  (notmuch-show-do-stash (notmuch-show-get-filename)))
+
+(defun notmuch-show-stash-from ()
+  "Copy From address of current message to kill-ring."
+  (interactive)
+  (notmuch-show-do-stash (notmuch-show-get-from)))
+
+(defun notmuch-show-stash-message-id ()
+  "Copy message-id of current message to kill-ring."
+  (interactive)
+  (notmuch-show-do-stash (notmuch-show-get-message-id)))
+
+(defun notmuch-show-stash-subject ()
+  "Copy Subject field of current message to kill-ring."
+  (interactive)
+  (notmuch-show-do-stash (notmuch-show-get-subject)))
+
+(defun notmuch-show-stash-tags ()
+  "Copy tags of current message to kill-ring as a comma separated list."
+  (interactive)
+  (notmuch-show-do-stash (mapconcat 'identity (notmuch-show-get-tags) ",")))
+
+(defun notmuch-show-stash-to ()
+  "Copy To address of current message to kill-ring."
+  (interactive)
+  (notmuch-show-do-stash (notmuch-show-get-to)))
+
 ; Make show mode a bit prettier, highlighting URLs and using word wrap

 (defun notmuch-show-pretty-hook ()
-- 
1.6.5



[notmuch] [PATCH 2/2] notmuch.el: add a submap (on "z" for "ztash") to stash things.

2010-02-11 Thread Jameson Rollins
On Thu, 11 Feb 2010 23:01:08 -0400, david at tethera.net wrote:
> From: David Bremner 
> 
> Provide key bindings for stuffing various RFC822 header fields and other 
> metadata
> into the emacs kill-ring as text. The bindings are as follows:
> 
> z F   notmuch-show-stash-filename
> z T   notmuch-show-stash-tags
> z c   notmuch-show-stash-cc
> z d   notmuch-show-stash-date
> z f   notmuch-show-stash-from
> z m   notmuch-show-stash-message-id
> z s   notmuch-show-stash-subject
> z t   notmuch-show-stash-to

Great new emacs UI feature.  Love it.

jamie.
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: 



Re: [notmuch] [PATCH 2/2] notmuch.el: add a submap (on z for ztash) to stash things.

2010-02-11 Thread Jameson Rollins
On Thu, 11 Feb 2010 23:01:08 -0400, da...@tethera.net wrote:
 From: David Bremner brem...@unb.ca
 
 Provide key bindings for stuffing various RFC822 header fields and other 
 metadata
 into the emacs kill-ring as text. The bindings are as follows:
 
 z F   notmuch-show-stash-filename
 z T   notmuch-show-stash-tags
 z c   notmuch-show-stash-cc
 z d   notmuch-show-stash-date
 z f   notmuch-show-stash-from
 z m   notmuch-show-stash-message-id
 z s   notmuch-show-stash-subject
 z t   notmuch-show-stash-to

Great new emacs UI feature.  Love it.

jamie.


pgpAU5k5Rz2bT.pgp
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch