unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* Notmuch shared library
@ 2010-03-11 22:37 Ben Gamari
  2010-03-11 22:37 ` [PATCH] Build and link against notmuch " Ben Gamari
                   ` (5 more replies)
  0 siblings, 6 replies; 28+ messages in thread
From: Ben Gamari @ 2010-03-11 22:37 UTC (permalink / raw)
  To: notmuch

Hey all,

Here's a rebased version of my shared library patch. It's pretty similar to the
last version and should build against a clean tree (I'd recommend git clean -fxd).
Let me know if you have any build issues.

In the eyes of the powers that be, what is the long-term status of this patch?
It's been pretty painless to rebase, but it would be nice to merge at some
point. Then perhaps we could focus a bit on the bindings situation. Just a
thought.

Cheers,

- Ben

^ permalink raw reply	[flat|nested] 28+ messages in thread
* [PATCH] emacs: do not modify subject in search or show
@ 2012-04-15  0:08 Jameson Graef Rollins
  2012-04-15  2:17 ` [PATCH v2] " Jameson Graef Rollins
  0 siblings, 1 reply; 28+ messages in thread
From: Jameson Graef Rollins @ 2012-04-15  0:08 UTC (permalink / raw)
  To: Notmuch Mail

A previous patch [0] replaced blank subject lines with '[No Subject]'
in search and show mode.  Apparently this was needed to circumvent
some bug in the printing code, but there was no need for it search or
show, and it is definitely not desirable, so we undo it here (a revert
is no longer feasible).  We should not be modifying strings in the
original message without good reason, or without a clear indication
that we are doing so, neither of which apply in this case.  For
further discussion see [0].

[0] id:"1327918561-16245-3-git-send-email-dme@dme.org"
---
 emacs/notmuch-print.el |    4 ++--
 emacs/notmuch-show.el  |    5 +----
 emacs/notmuch.el       |    5 ++---
 3 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/emacs/notmuch-print.el b/emacs/notmuch-print.el
index 6653d97..81b2ef0 100644
--- a/emacs/notmuch-print.el
+++ b/emacs/notmuch-print.el
@@ -60,7 +60,7 @@ Optional OUTPUT allows passing a list of flags to muttprint."
 
 (defun notmuch-print-ps-print (msg)
   "Print a message buffer using the ps-print package."
-  (let ((subject (notmuch-prettify-subject
+  (let ((subject (notmuch-print-prettify-subject
 		  (plist-get (notmuch-show-get-prop :headers msg) :Subject))))
     (rename-buffer subject t)
     (ps-print-buffer)))
@@ -68,7 +68,7 @@ Optional OUTPUT allows passing a list of flags to muttprint."
 (defun notmuch-print-ps-print/evince (msg)
   "Preview a message buffer using ps-print and evince."
   (let ((ps-file (make-temp-file "notmuch"))
-	(subject (notmuch-prettify-subject
+	(subject (notmuch-print-prettify-subject
 		  (plist-get (notmuch-show-get-prop :headers msg) :Subject))))
     (rename-buffer subject t)
     (ps-print-buffer ps-file)
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 30b26d1..1e55099 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -1075,7 +1075,7 @@ function is used."
       (run-hooks 'notmuch-show-hook))
 
     ;; Set the header line to the subject of the first message.
-    (setq header-line-format (notmuch-show-strip-re (notmuch-show-get-pretty-subject)))))
+    (setq header-line-format (notmuch-show-strip-re (notmuch-show-get-subject)))))
 
 (defun notmuch-show-capture-state ()
   "Capture the state of the current buffer.
@@ -1375,9 +1375,6 @@ current thread."
 (defun notmuch-show-get-depth ()
   (notmuch-show-get-prop :depth))
 
-(defun notmuch-show-get-pretty-subject ()
-  (notmuch-prettify-subject (notmuch-show-get-subject)))
-
 (defun notmuch-show-set-tags (tags)
   "Set the tags of the current message."
   (notmuch-show-set-prop :tags tags)
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index ba833e6..326645d 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -507,7 +507,7 @@ Complete list of currently available key bindings:
   "Display the currently selected thread."
   (interactive)
   (let ((thread-id (notmuch-search-find-thread-id))
-	(subject (notmuch-prettify-subject (notmuch-search-find-subject))))
+	(subject (notmuch-search-find-subject)))
     (if (> (length thread-id) 0)
 	(notmuch-show thread-id
 		      (current-buffer)
@@ -877,8 +877,7 @@ non-authors is found, assume that all of the authors match."
 		      ;; We currently just throw away excluded matches.
 		      (unless (eq (aref count 1) ?0)
 			(let ((beg (point)))
-			  (notmuch-search-show-result date count authors
-						      (notmuch-prettify-subject subject) tags)
+			  (notmuch-search-show-result date count authors subject tags)
 			  (notmuch-search-color-line beg (point) tag-list)
 			  (put-text-property beg (point) 'notmuch-search-thread-id thread-id)
 			  (put-text-property beg (point) 'notmuch-search-authors authors)
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 28+ messages in thread
* Re: (no subject)
@ 2010-03-12 18:46 ingmar
  2010-03-15 16:22 ` Sebastian Spaeth
  0 siblings, 1 reply; 28+ messages in thread
From: ingmar @ 2010-03-12 18:46 UTC (permalink / raw)
  To: notmuch

> ubuntu 9.10 and I don't have LDPATH set at all. Thanks, I will try to
> fix that.

Oh, nevermind what I said earlier.

Verify that  /usr/local/lib is in /etc/ld.so.conf. If not add it there. Then run ldconfig
after installing notmuch, then it should work. Doing everything with the package manager makes
you forget the basics.

Regards,
Ingmar

^ permalink raw reply	[flat|nested] 28+ messages in thread
* Re: (no subject)
@ 2010-03-12 15:43 ingmar
  2010-03-12 16:06 ` Sebastian Spaeth
  0 siblings, 1 reply; 28+ messages in thread
From: ingmar @ 2010-03-12 15:43 UTC (permalink / raw)
  To: notmuch

> Ben Gamaris original patch gives me an "-lnotmuch" not found failure
> during compilation.
> Your patchset compiles fine and installs /usr/local/bin/notmuch and
> /usr/local/lib/libnotmuch.so.1. However, it doesn't find it when running
> and exits saying libnotmuch.so not found.

Right, that was the error the second patch fixes. Sorry, honestly couldn't
remember, thanks for testing!

> I don't know anything about LD_LIBRARY_PATH and friends, but using the
> default Makefile options (which use /usr/local as prefix) a standard
> install should still work :-).

What's the value of LDPATH in your environment? It should contain /usr/local/lib.
If it doesn't that's not an issue with the patch, but with your installation/distro
afaik.

^ permalink raw reply	[flat|nested] 28+ messages in thread
* [PATCH] notmuch.el: add a submap (on "z" for "ztash") to stash things.
@ 2009-12-25 19:53 david
  2009-12-27  3:51 ` (no subject) david
  0 siblings, 1 reply; 28+ messages in thread
From: david @ 2009-12-25 19:53 UTC (permalink / raw)
  To: notmuch; +Cc: David Bremner

From: David Bremner <bremner@unb.ca>

Provide key bindings for stuffing everything with a notmuch-show-get-foo
function into the emacs kill-ring as text.

Currently this is just message-id, filename, and tags.
---

One thing I find myself doing often is going into raw message mode in
order to grab a message-id. This patch automates that by letting you
stash the message id in the emacs kill-ring (and X clipboard, if
running under X).  It also allows the same for filename and tags.
It would be pretty trivial to add other similar commands for stashing 
other headers and parts of a message given a corresponding 
notmuch-show-get-foo function.

 notmuch.el |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/notmuch.el b/notmuch.el
index 97914f2..53eb5a3 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -51,6 +51,17 @@
 (require 'mm-view)
 (require 'message)
 
+(defvar notmuch-show-stash-map 
+  (let ((map (make-sparse-keymap)))
+    (define-key map "m" 'notmuch-show-stash-message-id)
+    (define-key map "F" 'notmuch-show-stash-filename)
+    (define-key map "T" 'notmuch-show-stash-tags)
+    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)
@@ -78,6 +89,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)
@@ -920,6 +932,22 @@ 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-message-id ()
+  (interactive)
+  (notmuch-show-do-stash (notmuch-show-get-message-id)))
+
+(defun notmuch-show-stash-filename ()
+  (interactive)
+  (notmuch-show-do-stash (notmuch-show-get-filename)))
+
+(defun notmuch-show-stash-tags ()
+  (interactive)
+  (notmuch-show-do-stash (mapconcat 'identity (notmuch-show-get-tags) ",")))
+
 ; Make show mode a bit prettier, highlighting URLs and using word wrap
 
 (defun notmuch-show-pretty-hook ()
-- 
1.6.5.7

^ permalink raw reply related	[flat|nested] 28+ messages in thread
* (no subject)
@ 2009-11-25  2:03 Bart Trojanowski
  0 siblings, 0 replies; 28+ messages in thread
From: Bart Trojanowski @ 2009-11-25  2:03 UTC (permalink / raw)
  To: notmuch

Hi,

I find this patch useful for searching my mail.  I realize that the
option is horrendously long, and I would take any suggestions to shorten
it or to use a short op, like -m.

-Bart

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2012-04-15 17:23 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-11 22:37 Notmuch shared library Ben Gamari
2010-03-11 22:37 ` [PATCH] Build and link against notmuch " Ben Gamari
2010-03-12 13:41 ` (no subject) Ingmar Vanhassel
2010-03-15 17:58   ` Ben Gamari
2010-03-12 13:47 ` Ingmar Vanhassel
2010-03-12 15:02   ` Sebastian Spaeth
2010-03-15 16:20     ` Sebastian Spaeth
2010-04-01  7:54   ` Notmuch shared library Carl Worth
2010-04-01  9:10     ` Sebastian Spaeth
2010-04-01 11:10     ` Michal Sojka
2010-04-01 11:24       ` martin f krafft
2010-04-01 11:41         ` martin f krafft
2010-04-01 12:12         ` Carl Worth
2010-04-01 12:44           ` Michal Sojka
2010-04-01 22:09             ` Carl Worth
2010-04-01 11:47     ` [PATCH] Makefile: Create include directory when installing headers Michal Sojka
2010-04-01 12:13       ` Carl Worth
2010-03-12 13:47 ` [PATCH 1/3] Build and link against notmuch shared library, install notmuch.h Ingmar Vanhassel
2010-03-28  2:44   ` Ben Gamari
2010-03-12 13:47 ` [PATCH 2/3] Fix target dependencies for multiple jobs Ingmar Vanhassel
2010-03-12 13:47 ` [PATCH 3/3] Add a --libdir option to ./configure Ingmar Vanhassel
  -- strict thread matches above, loose matches on Subject: below --
2012-04-15  0:08 [PATCH] emacs: do not modify subject in search or show Jameson Graef Rollins
2012-04-15  2:17 ` [PATCH v2] " Jameson Graef Rollins
2012-04-15 17:23   ` [No Subject] Tomi Ollila
2010-03-12 18:46 (no subject) ingmar
2010-03-15 16:22 ` Sebastian Spaeth
2010-03-12 15:43 ingmar
2010-03-12 16:06 ` Sebastian Spaeth
2009-12-25 19:53 [PATCH] notmuch.el: add a submap (on "z" for "ztash") to stash things david
2009-12-27  3:51 ` (no subject) david
2009-11-25  2:03 Bart Trojanowski

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).