Re: [PATCH 1/1] Make buttons for attachments allow viewing as well as saving

Subject: Re: [PATCH 1/1] Make buttons for attachments allow viewing as well as saving

Date: Mon, 16 Jan 2012 21:44:51 +0000

To: notmuch@notmuchmail.org

Cc:

From: Mark Walters


(My apologies, owing to various errors on my part the patch has ended up
in a separate thread:
id:"1326749910-30437-1-git-send-email-markwalters1009@gmail.com")

On Mon, 16 Jan 2012 11:31:16 -0800, Jameson Graef Rollins <jrollins@finestructure.net> wrote:
> > Keymap on a button is: s for save, v for view and o for view with
> > other program. Default (i.e. enter or mouse button) is save but is
> > easily configurable e.g. set to view with
> > (setq notmuch-show-part-button-default-action 'notmuch-show-part-view-action)
> 
> Actually, this should really be a defcustom.  Maybe something like this:
> 
> (defcustom notmuch-show-part-button-default-action 'notmuch-show-part-button-save
>   "Default part header button action (on ENTER or mouse click)."
>   :group 'notmuch
>   :type '(choice (function :tag "Save part"
>                           :value notmuch-show-part-button-save)
>                 (function :tag "View part"
>                           :value notmuch-show-part-button-view)
>                 (function :tag "View interactively"
>                           :value notmuch-show-part-button-interactively-view))
> 
> Unfortunately this isn't quite working right, since it's not setting the
> default properly, but if someone can help me figure out what I'm doing
> wrong, I think this is at least the right idea.

This did not work for me, nor did Austin's suggestion but the following
does
+(defcustom notmuch-show-part-button-default-action 'notmuch-show-part-save-action
+  "Default part header button action (on ENTER or mouse click)."
+  :group 'notmuch
+  :type '(choice (const :tag "Save part"
+                       notmuch-show-part-save-action)
+                (const :tag "View part"
+                       notmuch-show-part-view-action)
+                (const :tag "View interactively"
+                       notmuch-show-part-interactively-view-action)))

I wonder if the "problem" comes from me doing things in a non-lispy
fashion (I am completely new to lisp). Thus
notmuch-show-part-button-default-action is a variable that gets passed
around rather than a function.

> There's a white space at the end of this line, which produces the
> following git warning:
> 
>   Applying: Make buttons for attachments allow viewing as well as saving
>   /home/jrollins/src/notmuch/git/.git/rebase-apply/patch:96: trailing whitespace.
>   (defvar notmuch-show-part-button-default-action 'notmuch-show-part-save-action)
>   warning: 1 line adds whitespace errors.
> 
> So if you go with (an improved version of) my defcustom suggestion above
> you can kill two birds with one stone:

Right I have fixed this as above and think the whitespace is ok now (it
passes git diff --check). I intended to send the patch as a reply to
this email but it has ended up here:
id:"1326749910-30437-1-git-send-email-markwalters1009@gmail.com"

Best wishes

Mark


Thread: