[notmuch] modifying emacs keymap

2009-12-28 Thread Tassilo Horn
Jameson Graef Rollins  writes:

Hi Jameson,

> (add-hook 'notmuch-search-mode
>   (define-key notmuch-search-mode-map "A" 
> 'notmuch-show-mark-read-then-archive-thread)
> )

`notmuch-search-mode' is no hook, and even if it was, you couldn't add
what you like, because that's no function.  You would need to define a
function that doesn that or wrap it in a lambda function.

Anyway, this should do the trick:

(define-key notmuch-search-mode-map "A" 
'notmuch-show-mark-read-then-archive-thread)

Bye,
Tassilo


[notmuch] Building xapian+kanru patch on Debian stable

2009-12-28 Thread David Bremner

Here is a script of commands that I ran to get xapian built with
Kan-Ru's patch on Debian Lenny.  There is less goofing around if you are
running Sid.  I keep a git mirror of the xapian svn, with the patch
already applied. I have been running this version of xapian for a week
or so with no obvious ill effects. I'm sure this can be tidied up; I
more or less just hacked my way through the process.

Note that this installs some packages from unstable onto your system,
which in some sense voids your warranty.  But you can remove them
afterwards. I have no idea why the foolishness with update-alternatives
is required.

git clone git://pivot.cs.unb.ca/git/xapian.git
cd xapian
git checkout -b kan-ru origin/kan-ru
sudo apt-get install build-essential m4 perl python zlib1g-dev 
sudo apt-get install uuid-dev wget 
# versions in lenny are too old
sudo apt-get -t unstable install autoconf automake libtool
sudo update-alternatives --set aclocal /usr/bin/aclocal-1.11
sudo update-alternatives --set automake /usr/bin/automake-1.11
sh bootstrap --without-autotools
./configure --disable-documentation
make 
sudo make install
sudo ldconfig
cd /usr/local/bin && sudo ln -s xapian-config-1.1 xapian-config
cd $HOME/projects/notmuch
make
ldd ./notmuch | grep xapian
# should say something like
# libxapian-1.1.so.3 => /usr/local/lib/libxapian-1.1.so.3 (0x7fe2a3dd1000)


[notmuch] modifying emacs keymap

2009-12-28 Thread Jameson Graef Rollins
On Mon, Dec 28, 2009 at 11:27:30PM +0100, Tassilo Horn wrote:
> > (add-hook 'notmuch-search-mode
> >   (define-key notmuch-search-mode-map "A" 
> > 'notmuch-show-mark-read-then-archive-thread)
> > )
> 
> `notmuch-search-mode' is no hook, and even if it was, you couldn't add
> what you like, because that's no function.  You would need to define a
> function that doesn that or wrap it in a lambda function.

Thanks for the response, Tassilo.  I should have explained that the
command I used above did work in so far as it did make the new key
available in the correct mode (notmuch-search-mode), as I could tell
through the notmuch-help in the notmuch-search-mode.  The command I
used above has worked for me in other contexts, as I've found
documented in a couple of different place on the net.  I'm completely
an elisp n00b, though, and I can't claim to understand why it worked.

> Anyway, this should do the trick:
> 
> (define-key notmuch-search-mode-map "A" 
> 'notmuch-show-mark-read-then-archive-thread)

As far as I can tell, this command works the same as the one I used
above.  It produces identical results.

I realize now that the problem is that the
notmuch-show-mark-read-then-archive-thread function is meant for
notmuch-show-mode (as should have been clear to me via the name) and
not for notmuch-search-mode.  I manually created a new function for
the appropriate mode, and that worked.  Below is the code that I used
that worked.

Thanks for the help, and sorry for the spam.

jamie.


(defun notmuch-search-mark-read-then-archive-thread ()
  "Mark thread as read (remove \"unread\" tag) and then archive (remove 
\"inbox\" tag).
This function advances to the next thread when finished."
  (interactive)
  (notmuch-search-remove-tag "inbox")
  (notmuch-search-remove-tag "unread")
  (forward-line))
(define-key notmuch-search-mode-map "A" 
'notmuch-search-mark-read-then-archive-thread)
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: 
<http://notmuchmail.org/pipermail/notmuch/attachments/20091228/6466a2eb/attachment.pgp>


[notmuch] modifying emacs keymap

2009-12-28 Thread Jameson Graef Rollins
Hey, folks.  This is the first in what is surely to be a long line of
requests for help customizing the notmuch emacs UI.

In this episode, I'm trying to add a function to the default keymap in
notmuch-search-mode.  Here's what I tried to do:

(add-hook 'notmuch-search-mode
  (define-key notmuch-search-mode-map "A" 
'notmuch-show-mark-read-then-archive-thread)
)

However, when I tried to use it, I got the following error (from *Messages*):

notmuch-show-get-tags: Search failed: "^Lmessage{"

Does anyone know where this error is coming from, and how to get
around it?  I could just be going about modifying the keymap the wrong
way, so if anyone has better suggestions about how to do it, I would
love to hear it.  If there's a different way to *modify* a keymap, as
opposed to adding a key to the map, I would be interested in seeing
that as well.

Thanks for the help.

jamie.
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: 
<http://notmuchmail.org/pipermail/notmuch/attachments/20091228/5e358a6a/attachment.pgp>


[notmuch] modifying emacs keymap

2009-12-28 Thread Jameson Graef Rollins
Hey, folks.  This is the first in what is surely to be a long line of
requests for help customizing the notmuch emacs UI.

In this episode, I'm trying to add a function to the default keymap in
notmuch-search-mode.  Here's what I tried to do:

(add-hook 'notmuch-search-mode
  (define-key notmuch-search-mode-map A 
'notmuch-show-mark-read-then-archive-thread)
)

However, when I tried to use it, I got the following error (from *Messages*):

notmuch-show-get-tags: Search failed: ^Lmessage{

Does anyone know where this error is coming from, and how to get
around it?  I could just be going about modifying the keymap the wrong
way, so if anyone has better suggestions about how to do it, I would
love to hear it.  If there's a different way to *modify* a keymap, as
opposed to adding a key to the map, I would be interested in seeing
that as well.

Thanks for the help.

jamie.


signature.asc
Description: Digital signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [notmuch] modifying emacs keymap

2009-12-28 Thread Jameson Graef Rollins
On Mon, Dec 28, 2009 at 11:27:30PM +0100, Tassilo Horn wrote:
  (add-hook 'notmuch-search-mode
(define-key notmuch-search-mode-map A 
  'notmuch-show-mark-read-then-archive-thread)
  )
 
 `notmuch-search-mode' is no hook, and even if it was, you couldn't add
 what you like, because that's no function.  You would need to define a
 function that doesn that or wrap it in a lambda function.

Thanks for the response, Tassilo.  I should have explained that the
command I used above did work in so far as it did make the new key
available in the correct mode (notmuch-search-mode), as I could tell
through the notmuch-help in the notmuch-search-mode.  The command I
used above has worked for me in other contexts, as I've found
documented in a couple of different place on the net.  I'm completely
an elisp n00b, though, and I can't claim to understand why it worked.

 Anyway, this should do the trick:
 
 (define-key notmuch-search-mode-map A 
 'notmuch-show-mark-read-then-archive-thread)

As far as I can tell, this command works the same as the one I used
above.  It produces identical results.

I realize now that the problem is that the
notmuch-show-mark-read-then-archive-thread function is meant for
notmuch-show-mode (as should have been clear to me via the name) and
not for notmuch-search-mode.  I manually created a new function for
the appropriate mode, and that worked.  Below is the code that I used
that worked.

Thanks for the help, and sorry for the spam.

jamie.


(defun notmuch-search-mark-read-then-archive-thread ()
  Mark thread as read (remove \unread\ tag) and then archive (remove 
\inbox\ tag).
This function advances to the next thread when finished.
  (interactive)
  (notmuch-search-remove-tag inbox)
  (notmuch-search-remove-tag unread)
  (forward-line))
(define-key notmuch-search-mode-map A 
'notmuch-search-mark-read-then-archive-thread)


signature.asc
Description: Digital signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch