How can I “linkify” a non-org-mode buffer in emacs [duplicate]

别来无恙 提交于 2019-12-20 02:57:16

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!