Add support for imenu

classic Classic list List threaded Threaded
15 messages Options
Damien Cassou-2 Damien Cassou-2
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Add support for imenu

Please find attached a patch adding imenu support in both search
and show modes.

--
Damien Cassou
http://damiencassou.seasidehosting.st

"Success is the ability to go from one failure to another without
losing enthusiasm." --Winston Churchill

_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch

0001-Add-imenu-support-in-notmuch-show-and-notmuch-search.patch (3K) Download Attachment
Jani Nikula Jani Nikula
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Add support for imenu

On Tue, 23 May 2017, Damien Cassou <[hidden email]> wrote:
> Please find attached a patch adding imenu support in both search
> and show modes.

I would appreciate a commit message explaining what the patch is about,
written to someone who doesn't know what imenu is, or how it could be
applicable in search and show modes.

Please also look into using git send-email if possible, instead of
attaching the patch.

BR,
Jani.


>
> --
> Damien Cassou
> http://damiencassou.seasidehosting.st
>
> "Success is the ability to go from one failure to another without
> losing enthusiasm." --Winston Churchill
> From aa29c3e4227ad95e940a047494ef5367eaa57596 Mon Sep 17 00:00:00 2001
> From: Damien Cassou <[hidden email]>
> Date: Tue, 23 May 2017 17:19:57 +0200
> Subject: [PATCH] Add imenu support in notmuch-show and notmuch-search
>
> ---
>  emacs/notmuch-show.el | 22 +++++++++++++++++++++-
>  emacs/notmuch.el      | 27 ++++++++++++++++++++++++---
>  2 files changed, 45 insertions(+), 4 deletions(-)
>
> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
> index c670160..b7d6429 100644
> --- a/emacs/notmuch-show.el
> +++ b/emacs/notmuch-show.el
> @@ -1516,7 +1516,11 @@
>  \\{notmuch-show-mode-map}"
>    (setq notmuch-buffer-refresh-function #'notmuch-show-refresh-view)
>    (setq buffer-read-only t
> - truncate-lines t))
> + truncate-lines t)
> +  (setq imenu-prev-index-position-function
> +        #'notmuch-show-imenu-prev-index-position-function)
> +  (setq imenu-extract-index-name-function
> +        #'notmuch-show-imenu-extract-index-name-function))
>  
>  (defun notmuch-tree-from-show-current-query ()
>    "Call notmuch tree with the current query"
> @@ -2455,6 +2459,22 @@    (list (completing-read "Mime type to use (default text/plain): "
>    (mailcap-mime-types) nil nil nil nil "text/plain")))
>    (notmuch-show-apply-to-current-part-handle #'notmuch-show--mm-display-part mime-type))
>  
> +(defun notmuch-show-imenu-prev-index-position-function ()
> +  "Move point to previous message in notmuch-show buffer.
> +This function is used as a value for
> +`imenu-prev-index-position-function'."
> +  (if (bobp)
> +      nil
> +    (notmuch-show-previous-message)
> +    t))
> +
> +(defun notmuch-show-imenu-extract-index-name-function ()
> +  "Return imenu name for line at point.
> +This function is used as a value for
> +`imenu-extract-index-name-function'.  Point should be at the
> +beginning of the line."
> +  (buffer-substring-no-properties (line-beginning-position) (line-end-position)))
> +
>  (provide 'notmuch-show)
>  
>  ;;; notmuch-show.el ends here
> diff --git a/emacs/notmuch.el b/emacs/notmuch.el
> index 40b9fab..90af68e 100644
> --- a/emacs/notmuch.el
> +++ b/emacs/notmuch.el
> @@ -374,7 +374,11 @@   (setq notmuch-buffer-refresh-function #'notmuch-search-refresh-view)
>    (set (make-local-variable 'scroll-preserve-screen-position) t)
>    (add-to-invisibility-spec (cons 'ellipsis t))
>    (setq truncate-lines t)
> -  (setq buffer-read-only t))
> +  (setq buffer-read-only t)
> +  (setq imenu-prev-index-position-function
> +        #'notmuch-search-imenu-prev-index-position-function)
> +  (setq imenu-extract-index-name-function
> +        #'notmuch-search-imenu-extract-index-name-function))
>  
>  (defun notmuch-search-get-result (&optional pos)
>    "Return the result object for the thread at POS (or point).
> @@ -1094,8 +1098,8 @@       (bury-buffer))
>  
>      ;; Find the first notmuch buffer.
>      (setq first (loop for buffer in (buffer-list)
> -     if (notmuch-interesting-buffer buffer)
> -     return buffer))
> +      if (notmuch-interesting-buffer buffer)
> +      return buffer))
>  
>      (if first
>   ;; If the first one we found is any other than the starting
> @@ -1104,6 +1108,23 @@ (unless (eq first start)
>    (switch-to-buffer first))
>        (notmuch))))
>  
> +;;;; Imenu Support
> +
> +(defun notmuch-search-imenu-prev-index-position-function ()
> +  "Move point to previous message in notmuch-search buffer.
> +This function is used as a value for
> +`imenu-prev-index-position-function'."
> +  (notmuch-search-previous-thread))
> +
> +(defun notmuch-search-imenu-extract-index-name-function ()
> +  "Return imenu name for line at point.
> +This function is used as a value for
> +`imenu-extract-index-name-function'.  Point should be at the
> +beginning of the line."
> +  (let ((subject (notmuch-search-find-subject))
> + (author (notmuch-search-find-authors)))
> +    (format "%s (%s)" subject author)))
> +
>  (setq mail-user-agent 'notmuch-user-agent)
>  
>  (provide 'notmuch)
> --
> 2.9.4
>
> _______________________________________________
> notmuch mailing list
> [hidden email]
> https://notmuchmail.org/mailman/listinfo/notmuch
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
Damien Cassou-2 Damien Cassou-2
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[PATCH] Add Emacs' imenu support in notmuch-show and notmuch-search

In reply to this post by Damien Cassou-2
Emacs' major modes can facilitate navigation in their buffers by
supporting Imenu. In such major modes, launching Imenu (M-x imenu)
makes Emacs display a list of items (e.g., function definitions in a
code buffer). Selecting an item from this list moves point to this
item.

This patch adds Imenu support to both notmuch-show and notmuch-search
buffers:

* in notmuch-show, Imenu will present a list of all messages in the
  currently visible thread;

* in notmuch-search, Imenu will present a list of all messages in the
  search buffer.
---
 emacs/notmuch-show.el | 22 +++++++++++++++++++++-
 emacs/notmuch.el      | 27 ++++++++++++++++++++++++---
 2 files changed, 45 insertions(+), 4 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index c670160..b7d6429 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -1516,7 +1516,11 @@
 \\{notmuch-show-mode-map}"
   (setq notmuch-buffer-refresh-function #'notmuch-show-refresh-view)
   (setq buffer-read-only t
- truncate-lines t))
+ truncate-lines t)
+  (setq imenu-prev-index-position-function
+        #'notmuch-show-imenu-prev-index-position-function)
+  (setq imenu-extract-index-name-function
+        #'notmuch-show-imenu-extract-index-name-function))
 
 (defun notmuch-tree-from-show-current-query ()
   "Call notmuch tree with the current query"
@@ -2455,6 +2459,22 @@    (list (completing-read "Mime type to use (default text/plain): "
   (mailcap-mime-types) nil nil nil nil "text/plain")))
   (notmuch-show-apply-to-current-part-handle #'notmuch-show--mm-display-part mime-type))
 
+(defun notmuch-show-imenu-prev-index-position-function ()
+  "Move point to previous message in notmuch-show buffer.
+This function is used as a value for
+`imenu-prev-index-position-function'."
+  (if (bobp)
+      nil
+    (notmuch-show-previous-message)
+    t))
+
+(defun notmuch-show-imenu-extract-index-name-function ()
+  "Return imenu name for line at point.
+This function is used as a value for
+`imenu-extract-index-name-function'.  Point should be at the
+beginning of the line."
+  (buffer-substring-no-properties (line-beginning-position) (line-end-position)))
+
 (provide 'notmuch-show)
 
 ;;; notmuch-show.el ends here
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 40b9fab..90af68e 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -374,7 +374,11 @@   (setq notmuch-buffer-refresh-function #'notmuch-search-refresh-view)
   (set (make-local-variable 'scroll-preserve-screen-position) t)
   (add-to-invisibility-spec (cons 'ellipsis t))
   (setq truncate-lines t)
-  (setq buffer-read-only t))
+  (setq buffer-read-only t)
+  (setq imenu-prev-index-position-function
+        #'notmuch-search-imenu-prev-index-position-function)
+  (setq imenu-extract-index-name-function
+        #'notmuch-search-imenu-extract-index-name-function))
 
 (defun notmuch-search-get-result (&optional pos)
   "Return the result object for the thread at POS (or point).
@@ -1094,8 +1098,8 @@       (bury-buffer))
 
     ;; Find the first notmuch buffer.
     (setq first (loop for buffer in (buffer-list)
-     if (notmuch-interesting-buffer buffer)
-     return buffer))
+      if (notmuch-interesting-buffer buffer)
+      return buffer))
 
     (if first
  ;; If the first one we found is any other than the starting
@@ -1104,6 +1108,23 @@ (unless (eq first start)
   (switch-to-buffer first))
       (notmuch))))
 
+;;;; Imenu Support
+
+(defun notmuch-search-imenu-prev-index-position-function ()
+  "Move point to previous message in notmuch-search buffer.
+This function is used as a value for
+`imenu-prev-index-position-function'."
+  (notmuch-search-previous-thread))
+
+(defun notmuch-search-imenu-extract-index-name-function ()
+  "Return imenu name for line at point.
+This function is used as a value for
+`imenu-extract-index-name-function'.  Point should be at the
+beginning of the line."
+  (let ((subject (notmuch-search-find-subject))
+ (author (notmuch-search-find-authors)))
+    (format "%s (%s)" subject author)))
+
 (setq mail-user-agent 'notmuch-user-agent)
 
 (provide 'notmuch)
--
2.9.4

_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
Damien Cassou-2 Damien Cassou-2
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Add support for imenu

In reply to this post by Jani Nikula
Jani Nikula <[hidden email]> writes:
> I would appreciate a commit message explaining what the patch is
> about, written to someone who doesn't know what imenu is, or how
> it could be applicable in search and show modes.

done

> Please also look into using git send-email if possible, instead
> of attaching the patch.

done.

--
Damien Cassou
http://damiencassou.seasidehosting.st

"Success is the ability to go from one failure to another without
losing enthusiasm." --Winston Churchill
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
David Bremner-2 David Bremner-2
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [PATCH] Add Emacs' imenu support in notmuch-show and notmuch-search

In reply to this post by Damien Cassou-2
Damien Cassou <[hidden email]> writes:

> Emacs' major modes can facilitate navigation in their buffers by
> supporting Imenu. In such major modes, launching Imenu (M-x imenu)
> makes Emacs display a list of items (e.g., function definitions in a
> code buffer). Selecting an item from this list moves point to this
> item.
>
> This patch adds Imenu support to both notmuch-show and notmuch-search
> buffers:
>
> * in notmuch-show, Imenu will present a list of all messages in the
>   currently visible thread;
>
> * in notmuch-search, Imenu will present a list of all messages in the
>   search buffer.

In show mode the chosen imenu index function seems less useful to me; it
treats indentation level as significant, so in threads with many levels
of reply, one has to type many periods. It's also not clear to me that
the information on the header line is very helpful for navigation, even
without indentation.

d

_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
Damien Cassou-2 Damien Cassou-2
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [PATCH] Add Emacs' imenu support in notmuch-show and notmuch-search

David Bremner <[hidden email]> writes:
> In show mode the chosen imenu index function seems less useful
> to me; it treats indentation level as significant, so in threads
> with many levels of reply, one has to type many periods. It's
> also not clear to me that the information on the header line is
> very helpful for navigation, even without indentation.
 
I guess you are using the default imenu frontend which is both
ugly and inefficient. I also guess few people care about adding
imenu support to packages for this exact reason.   The counsel's
version is quite good though (see attached screenshot). The
indentation is respected making the imenu content a visual
overview of the thread (and you don't have to type any periods).
I can still get rid of indentation if you confirm you don't want
it. For example, I understand that it would be nice to have better
integration with the original imenu frontend (even though the
default frontend is so bad I doubt anyone not having a better
version ever uses imenu at all). You also say the information on
the header line is not very helpful. Do you have any other
suggestion? I'm open to trying several different alternatives and
see what people prefer.

Bye

--
Damien Cassou
http://damiencassou.seasidehosting.st

"Success is the ability to go from one failure to another without
losing enthusiasm." --Winston Churchill
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
David Bremner-2 David Bremner-2
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [PATCH] Add Emacs' imenu support in notmuch-show and notmuch-search

Damien Cassou <[hidden email]> writes:

> David Bremner <[hidden email]> writes:
>> In show mode the chosen imenu index function seems less useful
>> to me; it treats indentation level as significant, so in threads
>> with many levels of reply, one has to type many periods. It's
>> also not clear to me that the information on the header line is
>> very helpful for navigation, even without indentation.
>  
> I guess you are using the default imenu frontend which is both
> ugly and inefficient. I also guess few people care about adding
> imenu support to packages for this exact reason.   The counsel's
> version is quite good though (see attached screenshot). The
> indentation is respected making the imenu content a visual
> overview of the thread (and you don't have to type any periods).

I am indeed using the default. I think you forgot the screen shot.

> I can still get rid of indentation if you confirm you don't want
> it.

I think so, although to be honest I never tried imenu before testing
your patches, perhaps we should wait for other opinions.

> You also say the information on
> the header line is not very helpful. Do you have any other
> suggestion? I'm open to trying several different alternatives and
> see what people prefer.

I guess I don't really understand how the matching is supposed to
work. If the user has to type from the beginning of the index string,
then I guess putting either the date or the subject first might be
helpful.  It's probably true that there is no one good order for all
threads. Some threads change subject often, others author, and one I'm
looking at right now has 25 messages with two authors and one subject.

d
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
Damien Cassou-2 Damien Cassou-2
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [PATCH] Add Emacs' imenu support in notmuch-show and notmuch-search

David Bremner <[hidden email]> writes:
> I am indeed using the default. I think you forgot the screen
> shot.


indeed. Attached to this email.


>> I can still get rid of indentation if you confirm you don't
>> want  it.
>
> I think so, although to be honest I never tried imenu before
> testing your patches, perhaps we should wait for other opinions.


I advise you to install counsel at least for that (I don't use it
for anything else).


>> You also say the information on the header line is not very
>> helpful. Do you have any other suggestion? I'm open to trying
>> several different alternatives and see what people prefer.
>
> I guess I don't really understand how the matching is supposed
> to work. If the user has to type from the beginning of the index
> string, then I guess putting either the date or the subject
> first might be helpful.


That depends on the frontend. For example, with counsel-imenu, I
can type "attach" to filter by emails in the thread with the
attachment tag.


> It's probably true that there is no one good order for all
> threads. Some threads change subject often, others author, and
> one I'm looking at right now has 25 messages with two authors
> and one subject.


--
Damien Cassou
http://damiencassou.seasidehosting.st

"Success is the ability to go from one failure to another without
losing enthusiasm." --Winston Churchill

_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch

Screenshot from 2017-06-10 22-24-26.png (398K) Download Attachment
David Bremner-2 David Bremner-2
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [PATCH] Add Emacs' imenu support in notmuch-show and notmuch-search

Damien Cassou <[hidden email]> writes:

> David Bremner <[hidden email]> writes:
>> I am indeed using the default. I think you forgot the screen
>> shot.
>
>
> indeed. Attached to this email.
>
>
>>> I can still get rid of indentation if you confirm you don't
>>> want  it.
>>
>> I think so, although to be honest I never tried imenu before
>> testing your patches, perhaps we should wait for other opinions.
>
>
> I advise you to install counsel at least for that (I don't use it
> for anything else).
>

OK, I see with counsel-imenu the current indexing by header lines is
reasonable. It might be improvable by adding the subject, but I'm not
sure about line lengths.

- maybe the docstrings should recomment counsel-imenu?
- I think the indentation should probably go to make it more
  usable with the builtin imenu


_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
Damien Cassou-2 Damien Cassou-2
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

(no subject)


> OK, I see with counsel-imenu the current indexing by header lines is
> reasonable. It might be improvable by adding the subject, but I'm
> not sure about line lengths.
> - maybe the docstrings should recomment counsel-imenu?

I'm not sure as the function
`notmuch-show-imenu-extract-index-name-function` is private and there
are other imenu frontends available. What about a NEWS entry instead
along those lines:

    * Add Emacs' imenu support in notmuch-show and notmuch-search

    Emacs' major modes can facilitate navigation in their buffers by
    supporting Imenu. In such major modes, launching Imenu (M-x imenu)
    makes Emacs display a list of items (e.g., function definitions in
    a code buffer). Selecting an item from this list moves point to
    this item.

    This release adds Imenu support to both notmuch-show and
    notmuch-search buffers:

       * in notmuch-show, Imenu will present a list of all messages in
         the currently visible thread;

       * in notmuch-search, Imenu will present a list of all messages in the
         search buffer.

    We recommand an external imenu frontend, such as counsel-imenu,
    which will make the experience much better that the default `M-x
    imenu`.

> I think the indentation should probably go to make it more usable
> with the builtin imenu

I did that in the patch even though I liked it with indentation better.
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
Damien Cassou-2 Damien Cassou-2
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[PATCH] Add Emacs' imenu support in notmuch-show and notmuch-search

Emacs' major modes can facilitate navigation in their buffers by
supporting Imenu. In such major modes, launching Imenu (M-x imenu)
makes Emacs display a list of items (e.g., function definitions in a
code buffer). Selecting an item from this list moves point to this
item.

This patch adds Imenu support to both notmuch-show and notmuch-search
buffers:

* in notmuch-show, Imenu will present a list of all messages in the
  currently visible thread;

* in notmuch-search, Imenu will present a list of all messages in the
  search buffer.
---
 emacs/notmuch-show.el | 23 ++++++++++++++++++++++-
 emacs/notmuch.el      | 27 ++++++++++++++++++++++++---
 2 files changed, 46 insertions(+), 4 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index e7c22da..0f157ec 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -1516,7 +1516,11 @@
 \\{notmuch-show-mode-map}"
   (setq notmuch-buffer-refresh-function #'notmuch-show-refresh-view)
   (setq buffer-read-only t
- truncate-lines t))
+ truncate-lines t)
+  (setq imenu-prev-index-position-function
+        #'notmuch-show-imenu-prev-index-position-function)
+  (setq imenu-extract-index-name-function
+        #'notmuch-show-imenu-extract-index-name-function))
 
 (defun notmuch-tree-from-show-current-query ()
   "Call notmuch tree with the current query"
@@ -2465,6 +2469,23 @@    (list (completing-read "Mime type to use (default text/plain): "
   (mailcap-mime-types) nil nil nil nil "text/plain")))
   (notmuch-show-apply-to-current-part-handle #'notmuch-show--mm-display-part mime-type))
 
+(defun notmuch-show-imenu-prev-index-position-function ()
+  "Move point to previous message in notmuch-show buffer.
+This function is used as a value for
+`imenu-prev-index-position-function'."
+  (if (bobp)
+      nil
+    (notmuch-show-previous-message)
+    t))
+
+(defun notmuch-show-imenu-extract-index-name-function ()
+  "Return imenu name for line at point.
+This function is used as a value for
+`imenu-extract-index-name-function'.  Point should be at the
+beginning of the line."
+  (back-to-indentation)
+  (buffer-substring-no-properties (point) (line-end-position)))
+
 (provide 'notmuch-show)
 
 ;;; notmuch-show.el ends here
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 40b9fab..90af68e 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -374,7 +374,11 @@   (setq notmuch-buffer-refresh-function #'notmuch-search-refresh-view)
   (set (make-local-variable 'scroll-preserve-screen-position) t)
   (add-to-invisibility-spec (cons 'ellipsis t))
   (setq truncate-lines t)
-  (setq buffer-read-only t))
+  (setq buffer-read-only t)
+  (setq imenu-prev-index-position-function
+        #'notmuch-search-imenu-prev-index-position-function)
+  (setq imenu-extract-index-name-function
+        #'notmuch-search-imenu-extract-index-name-function))
 
 (defun notmuch-search-get-result (&optional pos)
   "Return the result object for the thread at POS (or point).
@@ -1094,8 +1098,8 @@       (bury-buffer))
 
     ;; Find the first notmuch buffer.
     (setq first (loop for buffer in (buffer-list)
-     if (notmuch-interesting-buffer buffer)
-     return buffer))
+      if (notmuch-interesting-buffer buffer)
+      return buffer))
 
     (if first
  ;; If the first one we found is any other than the starting
@@ -1104,6 +1108,23 @@ (unless (eq first start)
   (switch-to-buffer first))
       (notmuch))))
 
+;;;; Imenu Support
+
+(defun notmuch-search-imenu-prev-index-position-function ()
+  "Move point to previous message in notmuch-search buffer.
+This function is used as a value for
+`imenu-prev-index-position-function'."
+  (notmuch-search-previous-thread))
+
+(defun notmuch-search-imenu-extract-index-name-function ()
+  "Return imenu name for line at point.
+This function is used as a value for
+`imenu-extract-index-name-function'.  Point should be at the
+beginning of the line."
+  (let ((subject (notmuch-search-find-subject))
+ (author (notmuch-search-find-authors)))
+    (format "%s (%s)" subject author)))
+
 (setq mail-user-agent 'notmuch-user-agent)
 
 (provide 'notmuch)
--
2.9.4

_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
David Bremner-2 David Bremner-2
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re:

In reply to this post by Damien Cassou-2
Damien Cassou <[hidden email]> writes:

>> OK, I see with counsel-imenu the current indexing by header lines is
>> reasonable. It might be improvable by adding the subject, but I'm
>> not sure about line lengths.
>> - maybe the docstrings should recomment counsel-imenu?
>
> I'm not sure as the function
> `notmuch-show-imenu-extract-index-name-function` is private and there
> are other imenu frontends available. What about a NEWS entry instead
> along those lines:
>
>     * Add Emacs' imenu support in notmuch-show and notmuch-search
>
>     Emacs' major modes can facilitate navigation in their buffers by
>     supporting Imenu. In such major modes, launching Imenu (M-x imenu)
>     makes Emacs display a list of items (e.g., function definitions in
>     a code buffer). Selecting an item from this list moves point to
>     this item.
>
>     This release adds Imenu support to both notmuch-show and
>     notmuch-search buffers:
>
>        * in notmuch-show, Imenu will present a list of all messages in
>          the currently visible thread;
>
>        * in notmuch-search, Imenu will present a list of all messages in the
>          search buffer.
>
>     We recommand an external imenu frontend, such as counsel-imenu,
>     which will make the experience much better that the default `M-x
>     imenu`.

That sounds fine.

>> I think the indentation should probably go to make it more usable
>> with the builtin imenu
>
> I did that in the patch even though I liked it with indentation better.

I haven't had a chance to test the new version yet, but I think I know
what you mean from testing counsel-imenu. Is it worth adding a
customization variable so that the user can choose indentation if they
have a more sophisticated imenu front end?

d
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
David Bremner-2 David Bremner-2
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re:

David Bremner <[hidden email]> writes:

>> I did that in the patch even though I liked it with indentation better.
>
> I haven't had a chance to test the new version yet, but I think I know
> what you mean from testing counsel-imenu. Is it worth adding a
> customization variable so that the user can choose indentation if they
> have a more sophisticated imenu front end?

So this version is ok with both builtin and counsel imenu front
ends. It's up to you. Do you want to leave the question of controllable
indentation for a later commit or add it now?

d
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
Damien Cassou-2 Damien Cassou-2
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re:

David Bremner <[hidden email]> writes:

> David Bremner <[hidden email]> writes:
>
>>> I did that in the patch even though I liked it with
>>> indentation better.
>>
>> I haven't had a chance to test the new version yet, but I think
>> I know what you mean from testing counsel-imenu. Is it worth
>> adding a customization variable so that the user can choose
>> indentation if they have a more sophisticated imenu front end?
>
> So this version is ok with both builtin and counsel imenu front
> ends. It's up to you. Do you want to leave the question of
> controllable indentation for a later commit or add it now?

if you are ok to merge that right now, that would be perfect for
me. Thanks.

--
Damien Cassou
http://damiencassou.seasidehosting.st

"Success is the ability to go from one failure to another without
losing enthusiasm." --Winston Churchill
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
David Bremner-2 David Bremner-2
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

imenu support

Damien Cassou <[hidden email]> writes:

> David Bremner <[hidden email]> writes:
>
>> David Bremner <[hidden email]> writes:
>>
>>>> I did that in the patch even though I liked it with
>>>> indentation better.
>>>
>>> I haven't had a chance to test the new version yet, but I think
>>> I know what you mean from testing counsel-imenu. Is it worth
>>> adding a customization variable so that the user can choose
>>> indentation if they have a more sophisticated imenu front end?
>>
>> So this version is ok with both builtin and counsel imenu front
>> ends. It's up to you. Do you want to leave the question of
>> controllable indentation for a later commit or add it now?
>
> if you are ok to merge that right now, that would be perfect for
> me. Thanks.

OK, done.

By the way, I notice a certain overlap of functionality between
counsel-imenu support and the way I use tree-view (Z) from show mode.
Given the small amount of code I think it's fine to support imenu as
well, but I thought I'd mention it.

d
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
Loading...