unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH 0/3] Use global keymap for pick entry.
@ 2013-09-15 14:35 Mark Walters
  2013-09-15 14:35 ` [PATCH 1/3] contrib: pick: remove some superfluous quotes Mark Walters
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Mark Walters @ 2013-09-15 14:35 UTC (permalink / raw)
  To: notmuch

This uses the recently added global keymap for pick entry. Adding this
showed a couple of historical anomalies: first that we don't need to
quote the keymap in define-key, and secondly that the
notmuch-pick-from-hello function is no longer needed.

Thus we remove the superfluous quotes and we remove the unneeded
function.

All tests pass and all key bindings still seem to work.

Best wishes

Mark


Mark Walters (3):
  contrib: pick: remove some superfluous quotes
  contrib: pick: use the new notmuch-common-keymap for pick entry
  contrib: pick: remove unused notmuch-pick-from-hello

 contrib/notmuch-pick/notmuch-pick.el |   21 ++++-----------------
 1 files changed, 4 insertions(+), 17 deletions(-)

-- 
1.7.9.1

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

* [PATCH 1/3] contrib: pick: remove some superfluous quotes
  2013-09-15 14:35 [PATCH 0/3] Use global keymap for pick entry Mark Walters
@ 2013-09-15 14:35 ` Mark Walters
  2013-09-15 14:35 ` [PATCH 2/3] contrib: pick: use the new notmuch-common-keymap for pick entry Mark Walters
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Mark Walters @ 2013-09-15 14:35 UTC (permalink / raw)
  To: notmuch

Pick adds some keybindings to keymaps for other modes (for entry to
pick). These quoted the keymaps which appears to be unnecessary and to
rely on the fact that these keymaps have the same entry in the
function cell as the value cell (perhaps for historical reasons?)

Remove these quotes.
---
 contrib/notmuch-pick/notmuch-pick.el |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el
index ad85d03..2deee42 100644
--- a/contrib/notmuch-pick/notmuch-pick.el
+++ b/contrib/notmuch-pick/notmuch-pick.el
@@ -966,12 +966,12 @@ The arguments are:
 
 
 ;; Set up key bindings from the rest of notmuch.
-(define-key 'notmuch-search-mode-map "z" 'notmuch-pick)
-(define-key 'notmuch-search-mode-map "Z" 'notmuch-pick-from-search-current-query)
-(define-key 'notmuch-search-mode-map (kbd "M-RET") 'notmuch-pick-from-search-thread)
-(define-key 'notmuch-hello-mode-map "z" 'notmuch-pick-from-hello)
-(define-key 'notmuch-show-mode-map "z" 'notmuch-pick)
-(define-key 'notmuch-show-mode-map "Z" 'notmuch-pick-from-show-current-query)
+(define-key notmuch-search-mode-map "z" 'notmuch-pick)
+(define-key notmuch-search-mode-map "Z" 'notmuch-pick-from-search-current-query)
+(define-key notmuch-search-mode-map (kbd "M-RET") 'notmuch-pick-from-search-thread)
+(define-key notmuch-hello-mode-map "z" 'notmuch-pick-from-hello)
+(define-key notmuch-show-mode-map "z" 'notmuch-pick)
+(define-key notmuch-show-mode-map "Z" 'notmuch-pick-from-show-current-query)
 (notmuch-pick-setup-show-out)
 (message "Initialised notmuch-pick")
 
-- 
1.7.9.1

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

* [PATCH 2/3] contrib: pick: use the new notmuch-common-keymap for pick entry
  2013-09-15 14:35 [PATCH 0/3] Use global keymap for pick entry Mark Walters
  2013-09-15 14:35 ` [PATCH 1/3] contrib: pick: remove some superfluous quotes Mark Walters
@ 2013-09-15 14:35 ` Mark Walters
  2013-09-15 14:35 ` [PATCH 3/3] contrib: pick: remove unused notmuch-pick-from-hello Mark Walters
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Mark Walters @ 2013-09-15 14:35 UTC (permalink / raw)
  To: notmuch

Austin recently added a global keymap: use this for pick
entry.
---
 contrib/notmuch-pick/notmuch-pick.el |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el
index 2deee42..386fef5 100644
--- a/contrib/notmuch-pick/notmuch-pick.el
+++ b/contrib/notmuch-pick/notmuch-pick.el
@@ -966,11 +966,9 @@ The arguments are:
 
 
 ;; Set up key bindings from the rest of notmuch.
-(define-key notmuch-search-mode-map "z" 'notmuch-pick)
+(define-key notmuch-common-keymap "z" 'notmuch-pick)
 (define-key notmuch-search-mode-map "Z" 'notmuch-pick-from-search-current-query)
 (define-key notmuch-search-mode-map (kbd "M-RET") 'notmuch-pick-from-search-thread)
-(define-key notmuch-hello-mode-map "z" 'notmuch-pick-from-hello)
-(define-key notmuch-show-mode-map "z" 'notmuch-pick)
 (define-key notmuch-show-mode-map "Z" 'notmuch-pick-from-show-current-query)
 (notmuch-pick-setup-show-out)
 (message "Initialised notmuch-pick")
-- 
1.7.9.1

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

* [PATCH 3/3] contrib: pick: remove unused notmuch-pick-from-hello
  2013-09-15 14:35 [PATCH 0/3] Use global keymap for pick entry Mark Walters
  2013-09-15 14:35 ` [PATCH 1/3] contrib: pick: remove some superfluous quotes Mark Walters
  2013-09-15 14:35 ` [PATCH 2/3] contrib: pick: use the new notmuch-common-keymap for pick entry Mark Walters
@ 2013-09-15 14:35 ` Mark Walters
  2013-09-16 20:31 ` [PATCH 0/3] Use global keymap for pick entry Tomi Ollila
  2013-09-23 10:39 ` David Bremner
  4 siblings, 0 replies; 6+ messages in thread
From: Mark Walters @ 2013-09-15 14:35 UTC (permalink / raw)
  To: notmuch

This function was used for pick entry from hello but isn't needed
anymore. It was modelled on notmuch-hello-search which is now only
used non-interactively (and notmuch-pick does now add to the
recent-search history correctly).
---
 contrib/notmuch-pick/notmuch-pick.el |   11 -----------
 1 files changed, 0 insertions(+), 11 deletions(-)

diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el
index 386fef5..69bea2a 100644
--- a/contrib/notmuch-pick/notmuch-pick.el
+++ b/contrib/notmuch-pick/notmuch-pick.el
@@ -428,17 +428,6 @@ Does NOT change the database."
     (notmuch-pick-close-message-window)
     (notmuch-pick query)))
 
-;; This function should be in notmuch-hello.el but we are trying to
-;; minimise impact on the rest of the codebase.
-(defun notmuch-pick-from-hello (&optional search)
-  "Run a query and display results in experimental notmuch-pick mode"
-  (interactive)
-  (unless (null search)
-    (setq search (notmuch-hello-trim search))
-    (let ((history-delete-duplicates t))
-      (add-to-history 'notmuch-search-history search)))
-  (notmuch-pick search))
-
 ;; This function should be in notmuch-show.el but be we trying to
 ;; minimise impact on the rest of the codebase.
 (defun notmuch-pick-from-show-current-query ()
-- 
1.7.9.1

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

* Re: [PATCH 0/3] Use global keymap for pick entry.
  2013-09-15 14:35 [PATCH 0/3] Use global keymap for pick entry Mark Walters
                   ` (2 preceding siblings ...)
  2013-09-15 14:35 ` [PATCH 3/3] contrib: pick: remove unused notmuch-pick-from-hello Mark Walters
@ 2013-09-16 20:31 ` Tomi Ollila
  2013-09-23 10:39 ` David Bremner
  4 siblings, 0 replies; 6+ messages in thread
From: Tomi Ollila @ 2013-09-16 20:31 UTC (permalink / raw)
  To: Mark Walters, notmuch

On Sun, Sep 15 2013, Mark Walters <markwalters1009@gmail.com> wrote:

> This uses the recently added global keymap for pick entry. Adding this
> showed a couple of historical anomalies: first that we don't need to
> quote the keymap in define-key, and secondly that the
> notmuch-pick-from-hello function is no longer needed.
>
> Thus we remove the superfluous quotes and we remove the unneeded
> function.
>
> All tests pass and all key bindings still seem to work.

This series LGTM. I don't fully understand this (fset 'kmap kmap)
business but everywhere I looked (define-key uses the non-symbol-reference
to the keymap (were there fsets or not))

>
> Best wishes
>
> Mark

Tomi


>
>
> Mark Walters (3):
>   contrib: pick: remove some superfluous quotes
>   contrib: pick: use the new notmuch-common-keymap for pick entry
>   contrib: pick: remove unused notmuch-pick-from-hello
>
>  contrib/notmuch-pick/notmuch-pick.el |   21 ++++-----------------
>  1 files changed, 4 insertions(+), 17 deletions(-)
>
> -- 
> 1.7.9.1
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch

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

* Re: [PATCH 0/3] Use global keymap for pick entry.
  2013-09-15 14:35 [PATCH 0/3] Use global keymap for pick entry Mark Walters
                   ` (3 preceding siblings ...)
  2013-09-16 20:31 ` [PATCH 0/3] Use global keymap for pick entry Tomi Ollila
@ 2013-09-23 10:39 ` David Bremner
  4 siblings, 0 replies; 6+ messages in thread
From: David Bremner @ 2013-09-23 10:39 UTC (permalink / raw)
  To: Mark Walters, notmuch

Mark Walters <markwalters1009@gmail.com> writes:

> This uses the recently added global keymap for pick entry. Adding this
> showed a couple of historical anomalies: first that we don't need to
> quote the keymap in define-key, and secondly that the
> notmuch-pick-from-hello function is no longer needed.

series pushed,

d

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

end of thread, other threads:[~2013-09-23 10:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-15 14:35 [PATCH 0/3] Use global keymap for pick entry Mark Walters
2013-09-15 14:35 ` [PATCH 1/3] contrib: pick: remove some superfluous quotes Mark Walters
2013-09-15 14:35 ` [PATCH 2/3] contrib: pick: use the new notmuch-common-keymap for pick entry Mark Walters
2013-09-15 14:35 ` [PATCH 3/3] contrib: pick: remove unused notmuch-pick-from-hello Mark Walters
2013-09-16 20:31 ` [PATCH 0/3] Use global keymap for pick entry Tomi Ollila
2013-09-23 10:39 ` David Bremner

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).