Re: how to make return follow hyperlink?

2015-08-28 Thread Peter Salazar
Thanks for all the responses! Mark, where could we find the patch you
mentioned? I wouldn't know how to test/update it, but maybe someone else on
the list has the requisite hacking skills...

On Fri, Aug 28, 2015 at 1:55 AM, Tomi Ollila tomi.oll...@iki.fi 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.

 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 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: 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


how to make return follow hyperlink?

2015-08-26 Thread Peter Salazar
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.

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