summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordefanor <defanor@uberspace.net>2017-12-26 06:17:21 +0300
committerdefanor <defanor@uberspace.net>2017-12-26 06:17:21 +0300
commit5d53b9a572de78968d09b29da77d1bcf5c8f7236 (patch)
treed18b13670ac5dd08eb040a742bc54f884b38dfe6
parentf2b4e89f6a78ee0ee933612955b8d36c985c9e70 (diff)
downloadpancake-5d53b9a572de78968d09b29da77d1bcf5c8f7236.zip
pancake-5d53b9a572de78968d09b29da77d1bcf5c8f7236.tar.gz
pancake-5d53b9a572de78968d09b29da77d1bcf5c8f7236.tar.bz2
Use relative #fragment links in Emacs
Don't reload a document on those.
-rw-r--r--pancake.el5
1 files changed, 4 insertions, 1 deletions
diff --git a/pancake.el b/pancake.el
index e759cb1..199121c 100644
--- a/pancake.el
+++ b/pancake.el
@@ -212,7 +212,10 @@ interactively."
(defun pancake-button-action (button)
"An action to be invoked on button activation."
- (funcall 'browse-url (button-get button 'pancake-absolute-uri)))
+ (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)))))
(defun pancake-print-elem (element)
"Translate ELEMENT into a string."