问题
Possible Duplicate:
How to make org syntax links in any emacs buffer look like in org-mode?
I would not mind using org-mode, but with non-asterisk headings. I asked that question in How can I use other heading styles like twiki ---+ or mediawiki == h2 == in org-mode?
But the main thing I want is to "linkify" a buffer - a probably non-org-mode buffer.
E.g. make links such as [[file:/some/long/path][display name]] show just as something like "display name", and clickable. Or just [[file:/some/path]], or the other link types org-mode supports.
Q: is there a way to get such link functionality in emacs, outside org-mode?
回答1:
I've just created an emacs minor mode that enables org style links in non-org-mode buffers. Still a work-in-progress but you can find it here: https://github.com/seanohalpin/org-link-minor-mode
BTW, this question is a duplicate of How to make org syntax links in any emacs buffer look like in org-mode?
回答2:
I think text properties are what you are seeking. The Elisp info file even includes an entry on "Clickable Text", Text -> Text Properties -> Clickable Text. That section actually includes a pretty detailed example on how to achieve just the sort of thing you mention.
来源:https://stackoverflow.com/questions/11697111/how-can-i-linkify-a-non-org-mode-buffer-in-emacs