diff options
author | defanor <defanor@uberspace.net> | 2017-12-31 10:51:17 +0300 |
---|---|---|
committer | defanor <defanor@uberspace.net> | 2017-12-31 10:51:17 +0300 |
commit | 39149cc8566de4e64617c0546c80509e93165d03 (patch) | |
tree | 0640464994acd328f2d9991181a7e0b57fa91ae2 | |
parent | 0d4303a888fc8da52d6d9f92ae8748dd5b6b865f (diff) |
Open links in a new session on C-u RET
-rw-r--r-- | pancake.el | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -212,11 +212,17 @@ kill ring when called interactively." uri)) (defun pancake-button-action (button) - "An action to be invoked on button activation." + "An action to be invoked on button activation: follows +#fragment links in pancake, opens other links with `browse-url', +and in a new session if `current-prefix-arg' is non-nil." (let ((pancake-uri (button-get button 'pancake-link))) - (if (and pancake-uri (string-prefix-p "#" pancake-uri)) - (pancake pancake-uri) - (funcall 'browse-url (button-get button 'pancake-absolute-uri))))) + (if (and pancake-uri + (string-prefix-p "#" pancake-uri) + (not current-prefix-arg)) + (pancake pancake-uri) + (funcall 'browse-url + (button-get button 'pancake-absolute-uri) + current-prefix-arg)))) (defun pancake-print-elem (element) "Translate ELEMENT into a string." |