Re: how to make return follow hyperlink?

2015-08-27 Thread Mark Walters

 How do I make it so that hitting RET on a hyperlink follows it? Is there a
 setting analogous to org-return-follows-link? I often have links in
 incoming emails, and I'd like to be able to open them in my browser with
 one keystroke.

A long time ago I posted a patch to do this: I don't know if it still
applies or how easy it is to update (nor do I remember how I got on with
the difficulties bremner mentioned in the the quoted bit of irc
conversation in the third message of that thread).

id:1377240695-825-1-git-send-email-markwalters1...@gmail.com

Incidentally, pressing RET on id: links already overrides the use of RET
to collapse a message so I don't see it as problematic to do the same
for http links.

Best wishes

Mark

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


Re: notmuch-show-toggle-message behavior

2015-08-27 Thread Tomi Ollila
On Fri, Aug 28 2015, Bart Bunting b...@bunting.net.au wrote:

 Hi,

Hi Bart


 Following the discussion in: id:874mjk614c@qmul.ac.uk regarding the
 behavior of notmuch-show-toggle-message and following hyperlinks, I
 wanted to chime in on a similar but not exactly the same topic.

 I am blind and use emacspeak (a speech subsystem for emacs) to do all of
 my emacs work including reading email with notmuch.

 I often arrow down to a part and hit enter only to find that
 notmuch-show-toggle-message hides all of the message body because the
 point is at the beginning of the line and the part I'm actually trying
 to toggle is indented.

I think that is PITA too...

 Would it make sense to have notmuch-show-toggle-message activate any
 item on the same line rather than take the generic action of hiding all
 the message text.

In your case perhaps disabling indentation could be a good first aid ?

In customize-group notmuch-show there is entry 
Notmuch Show Indent Messages Width defaulting to 1 -- setting that to 0
would disable indentation -- (setq notmuch-show-indent-messages-width 0)
do the same.

 I would also like it if for example there was an id or hyperlink on the
 line that it was activated.  In the case that there was more than one
 then activating the first one unless point is on the second or
 subsiquent link sounds like predictable behavior to me.
 .

Hmm, In text/plain content I have id: -links active -- and pressing TAB
moves me to next id (or part) button. What kind of feedback do you get
when pressing TAB in notmuch-show buffer?


 The implication of the current behaviour for me is that when this
 happens i need to unhide the message and then move to the part I want to
 expand makeing sure I move off the empty space at the beginning of the
 line before triggering notmuch-show-toggle-message.

 Is this behaviour annoying to anyone else?

It is. that *should* work in the beginning of line, at least with part
buttons. 

Tomi


 If not I'm sure I can work around it using advice or something.


 Kind regards
 Bart
 -- 

 Bart Bunting
 ___
 notmuch mailing list
 notmuch@notmuchmail.org
 http://notmuchmail.org/mailman/listinfo/notmuch
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: how to make return follow hyperlink?

2015-08-27 Thread Tomi Ollila
On Wed, Aug 26 2015, Peter Salazar cycleofs...@gmail.com wrote:

 How do I make it so that hitting RET on a hyperlink follows it? Is there a
 setting analogous to org-return-follows-link? I often have links in
 incoming emails, and I'd like to be able to open them in my browser with
 one keystroke.

BTW: the interesting thing is that in text/plain content id: links already
do something -- and e.g. https?: do not. in text/html content I get
'No usable browser found'(*) when pressing RET on top of http: link so it
must be doing something ;)

Tomi

(*) Note to self: hack something to show the link using (message ...) in this 
case.


 Thanks!
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: how to make return follow hyperlink?

2015-08-27 Thread Suvayu Ali
On Thu, Aug 27, 2015 at 09:35:26AM +0100, David Edmondson wrote:
 On Wed, Aug 26 2015, Peter Salazar cycleofs...@gmail.com wrote:
  How do I make it so that hitting RET on a hyperlink follows it? Is there a
  setting analogous to org-return-follows-link? I often have links in
  incoming emails, and I'd like to be able to open them in my browser with
  one keystroke.
 
 Having that binding would conflict badly with the existing binding for
 `notmuch-show-toggle-message' (which has been in place for a long
 time!).
 
 Perhaps not what you want, but for me, clicking on the link with the
 mouse opens the link.

I think you can hack around by advicing notmuch-show-toggle-message and
making it context sensitive.  I don't really know the best way to
determine the context, but a quick hack would be to look at the
face-at-point.  Of course this requires font-lock-mode be active.

I once did something like this to expand abbreviations (below).  Of
course you will have to use a defadvice instead of a defun.

Hope this helps,


(defun sa-expand-abbrev-in-context (expand)
  Expands abbreviations according to the context. Determines
whether within comments or source by looking at the face name. If
within comments the `basic-text-mode-abbrev-table' is used, the
major mode abbrev-table is used otherwise.

Expansion is done by the function passed as the argument. This is
controlled by the \abnormal\ hook `abbrev-expand-functions'.
;; backward-char checks if end-of-buffer as when point at e-o-b face is `nil'
;; the function call expand does the expansion, usually `expand-abbrev'
  (if (save-excursion
(string-match comment\\|string
  (symbol-name (if ( (point) (point-max))
   (face-at-point)
 (backward-char)
 (face-at-point)
  (let ((local-abbrev-table basic-text-mode-abbrev-table))
(funcall expand))
(funcall expand)))


-- 
Suvayu

Open source is the future. It sets us free.
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: how to make return follow hyperlink?

2015-08-27 Thread David Edmondson
On Wed, Aug 26 2015, Peter Salazar cycleofs...@gmail.com wrote:
 How do I make it so that hitting RET on a hyperlink follows it? Is there a
 setting analogous to org-return-follows-link? I often have links in
 incoming emails, and I'd like to be able to open them in my browser with
 one keystroke.

Having that binding would conflict badly with the existing binding for
`notmuch-show-toggle-message' (which has been in place for a long
time!).

Perhaps not what you want, but for me, clicking on the link with the
mouse opens the link.
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch