[PATCH] [RFC] emacs: merge overhauled `notmuch-cycle-notmuch-buffers' into `notmuch'

2012-01-16 Thread Pieter Praet
On Mon, 16 Jan 2012 11:47:03 +, David Edmondson  wrote:
> On Mon, 16 Jan 2012 12:28:06 +0100, Pieter Praet  wrote:
> > Perhaps we could use `ido-completion-help', like Org-mode does with
> > `org-iswitchb' ?  OTOH, that would require an extra [RET].  Bah...
> 
> I'm a no-ido person.
> 
> > > Hmm, yes, that seems reasonable.
> > > 
> > > > FYI: causes 2 compile warnings due to requiring the cl package at 
> > > > runtime.
> > > 
> > > `cl' is still `eval-when-compile' though - won't that break?
> > 
> > Haven't noticed any issues here, apart from the complaints @ compilation.
> 
> If you load the compiled lisp into 'emacs -Q' and then attempt to call
> the function, it doesn't complain? (I haven't tested.)

Good call !  No joy:
  Debugger entered--Lisp error: (void-function remove-if-not)

Should've known.

So let's just get rid of that cl requirement, shall we :)

Patch follows.


Peace

-- 
Pieter


[PATCH] [RFC] emacs: merge overhauled `notmuch-cycle-notmuch-buffers' into `notmuch'

2012-01-16 Thread Pieter Praet
On Mon, 16 Jan 2012 12:28:06 +0100, Pieter Praet  wrote:
> On Mon, 16 Jan 2012 11:06:25 +, David Edmondson  wrote:
> > On Mon, 16 Jan 2012 11:42:31 +0100, Pieter Praet  
> > wrote:
> > > CLisp'ier version of `notmuch-cycle-notmuch-buffers', merged into 
> > > `notmuch',
> > > eliminating the need to hog yet another keybind.
> > 
> > The lisp-ier-ness changes are good.
> > 
> > I'm less sure about the functional change. Sometimes I want to go back
> > to where I was, other times I want to go to `notmuch-hello'. [...]
> 
> Hmmm, true.  The path of least resistance is elusive.
> 
> > [...] I suppose
> > that I can replace my binding for `notmuch' with one for
> > `notmuch-hello'.
> > 
> 
> Perhaps we could use `ido-completion-help', like Org-mode does with
> `org-iswitchb' ?  OTOH, that would require an extra [RET].  Bah...
> 

s/ido-completion-help/ido-completing-read

> > Hmm, yes, that seems reasonable.
> > 
> > > FYI: causes 2 compile warnings due to requiring the cl package at runtime.
> > 
> > `cl' is still `eval-when-compile' though - won't that break?
> 
> Haven't noticed any issues here, apart from the complaints @ compilation.
> 
> 
> Peace
> 
> -- 
> Pieter


Peace

-- 
Pieter


[PATCH] [RFC] emacs: merge overhauled `notmuch-cycle-notmuch-buffers' into `notmuch'

2012-01-16 Thread Pieter Praet
On Mon, 16 Jan 2012 11:06:25 +, David Edmondson  wrote:
> On Mon, 16 Jan 2012 11:42:31 +0100, Pieter Praet  wrote:
> > CLisp'ier version of `notmuch-cycle-notmuch-buffers', merged into `notmuch',
> > eliminating the need to hog yet another keybind.
> 
> The lisp-ier-ness changes are good.
> 
> I'm less sure about the functional change. Sometimes I want to go back
> to where I was, other times I want to go to `notmuch-hello'. [...]

Hmmm, true.  The path of least resistance is elusive.

> [...] I suppose
> that I can replace my binding for `notmuch' with one for
> `notmuch-hello'.
> 

Perhaps we could use `ido-completion-help', like Org-mode does with
`org-iswitchb' ?  OTOH, that would require an extra [RET].  Bah...

> Hmm, yes, that seems reasonable.
> 
> > FYI: causes 2 compile warnings due to requiring the cl package at runtime.
> 
> `cl' is still `eval-when-compile' though - won't that break?

Haven't noticed any issues here, apart from the complaints @ compilation.


Peace

-- 
Pieter


[PATCH] [RFC] emacs: merge overhauled `notmuch-cycle-notmuch-buffers' into `notmuch'

2012-01-16 Thread David Edmondson
On Mon, 16 Jan 2012 12:28:06 +0100, Pieter Praet  wrote:
> Perhaps we could use `ido-completion-help', like Org-mode does with
> `org-iswitchb' ?  OTOH, that would require an extra [RET].  Bah...

I'm a no-ido person.

> > Hmm, yes, that seems reasonable.
> > 
> > > FYI: causes 2 compile warnings due to requiring the cl package at runtime.
> > 
> > `cl' is still `eval-when-compile' though - won't that break?
> 
> Haven't noticed any issues here, apart from the complaints @ compilation.

If you load the compiled lisp into 'emacs -Q' and then attempt to call
the function, it doesn't complain? (I haven't tested.)
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: 



[PATCH] [RFC] emacs: merge overhauled `notmuch-cycle-notmuch-buffers' into `notmuch'

2012-01-16 Thread Pieter Praet
CLisp'ier version of `notmuch-cycle-notmuch-buffers', merged into `notmuch',
eliminating the need to hog yet another keybind.

FYI: causes 2 compile warnings due to requiring the cl package at runtime.
---
 emacs/notmuch.el |   34 --
 1 files changed, 8 insertions(+), 26 deletions(-)

diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index ef4dcc7..60ab0b2 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -1067,7 +1067,14 @@ current search results AND that are tagged with the 
given tag."
 (defun notmuch ()
   "Run notmuch and display saved searches, known tags, etc."
   (interactive)
-  (notmuch-hello))
+  (let* ((old-buffer (current-buffer))
+(interesting-buffers (remove-if-not #'notmuch-interesting-buffer 
(buffer-list)))
+(next-buffer (first (member-if-not #'(lambda (b) (eq old-buffer b)) 
interesting-buffers
+(if next-buffer
+   (progn
+ (switch-to-buffer next-buffer)
+ (bury-buffer old-buffer))
+  (notmuch-hello

 (defun notmuch-interesting-buffer (b)
   "Is the current buffer of interest to a notmuch user?"
@@ -1078,31 +1085,6 @@ current search results AND that are tagged with the 
given tag."
   message-mode

 ;;;###autoload
-(defun notmuch-cycle-notmuch-buffers ()
-  "Cycle through any existing notmuch buffers (search, show or hello).
-
-If the current buffer is the only notmuch buffer, bury it. If no
-notmuch buffers exist, run `notmuch'."
-  (interactive)
-
-  (let (start first)
-;; If the current buffer is a notmuch buffer, remember it and then
-;; bury it.
-(when (notmuch-interesting-buffer (current-buffer))
-  (setq start (current-buffer))
-  (bury-buffer))
-
-;; Find the first notmuch buffer.
-(setq first (loop for buffer in (buffer-list)
-if (notmuch-interesting-buffer buffer)
-return buffer))
-
-(if first
-   ;; If the first one we found is any other than the starting
-   ;; buffer, switch to it.
-   (unless (eq first start)
- (switch-to-buffer first))
-  (notmuch

 (setq mail-user-agent 'notmuch-user-agent)

-- 
1.7.8.1



[PATCH] [RFC] emacs: merge overhauled `notmuch-cycle-notmuch-buffers' into `notmuch'

2012-01-16 Thread David Edmondson
On Mon, 16 Jan 2012 11:42:31 +0100, Pieter Praet  wrote:
> CLisp'ier version of `notmuch-cycle-notmuch-buffers', merged into `notmuch',
> eliminating the need to hog yet another keybind.

The lisp-ier-ness changes are good.

I'm less sure about the functional change. Sometimes I want to go back
to where I was, other times I want to go to `notmuch-hello'. I suppose
that I can replace my binding for `notmuch' with one for
`notmuch-hello'.

Hmm, yes, that seems reasonable.

> FYI: causes 2 compile warnings due to requiring the cl package at runtime.

`cl' is still `eval-when-compile' though - won't that break?
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: 



Re: [PATCH] [RFC] emacs: merge overhauled `notmuch-cycle-notmuch-buffers' into `notmuch'

2012-01-16 Thread David Edmondson
On Mon, 16 Jan 2012 11:42:31 +0100, Pieter Praet pie...@praet.org wrote:
 CLisp'ier version of `notmuch-cycle-notmuch-buffers', merged into `notmuch',
 eliminating the need to hog yet another keybind.

The lisp-ier-ness changes are good.

I'm less sure about the functional change. Sometimes I want to go back
to where I was, other times I want to go to `notmuch-hello'. I suppose
that I can replace my binding for `notmuch' with one for
`notmuch-hello'.

Hmm, yes, that seems reasonable.

 FYI: causes 2 compile warnings due to requiring the cl package at runtime.

`cl' is still `eval-when-compile' though - won't that break?


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


Re: [PATCH] [RFC] emacs: merge overhauled `notmuch-cycle-notmuch-buffers' into `notmuch'

2012-01-16 Thread David Edmondson
On Mon, 16 Jan 2012 12:28:06 +0100, Pieter Praet pie...@praet.org wrote:
 Perhaps we could use `ido-completion-help', like Org-mode does with
 `org-iswitchb' ?  OTOH, that would require an extra [RET].  Bah...

I'm a no-ido person.

  Hmm, yes, that seems reasonable.
  
   FYI: causes 2 compile warnings due to requiring the cl package at runtime.
  
  `cl' is still `eval-when-compile' though - won't that break?
 
 Haven't noticed any issues here, apart from the complaints @ compilation.

If you load the compiled lisp into 'emacs -Q' and then attempt to call
the function, it doesn't complain? (I haven't tested.)


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


Re: [PATCH] [RFC] emacs: merge overhauled `notmuch-cycle-notmuch-buffers' into `notmuch'

2012-01-16 Thread Pieter Praet
On Mon, 16 Jan 2012 11:47:03 +, David Edmondson d...@dme.org wrote:
 On Mon, 16 Jan 2012 12:28:06 +0100, Pieter Praet pie...@praet.org wrote:
  Perhaps we could use `ido-completion-help', like Org-mode does with
  `org-iswitchb' ?  OTOH, that would require an extra [RET].  Bah...
 
 I'm a no-ido person.
 
   Hmm, yes, that seems reasonable.
   
FYI: causes 2 compile warnings due to requiring the cl package at 
runtime.
   
   `cl' is still `eval-when-compile' though - won't that break?
  
  Haven't noticed any issues here, apart from the complaints @ compilation.
 
 If you load the compiled lisp into 'emacs -Q' and then attempt to call
 the function, it doesn't complain? (I haven't tested.)

Good call !  No joy:
  Debugger entered--Lisp error: (void-function remove-if-not)

Should've known.

So let's just get rid of that cl requirement, shall we :)

Patch follows.


Peace

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