0

I can add hyperlinks to webpages in the docstring. But is it possible to do the same when writing text in a named buffer?

(defvar msg "URL `https://www.gnu.org/proprietary/proprietary.html'")
(get-buffer-create bufname)
(insert msg)
Dilna
  • 1
  • 3
  • 11
  • Depends on the buffer's mode. – NickD Jul 28 '22 at 16:08
  • What would you suggest if I want to make an "about" buffer for a package? – Dilna Jul 28 '22 at 16:12
  • Org mode perhaps? – NickD Jul 28 '22 at 19:28
  • I would need to know how to set the mode of the buffer after making it. – Dilna Jul 28 '22 at 19:30
  • You call the mode function in the context of the buffer. Something like (with-current-buffer some-buffer (org-mode)) where some-buffer is the buffer you created. – NickD Jul 29 '22 at 00:35
  • Is it good that I use (with-current-buffer to make a new buffer? I did as suggested and the major mode took effect as instructed. – Dilna Jul 29 '22 at 00:48
  • 1
    Sorry, this site is not for discussions in the comments. You are supposed to ask a question that is answerable. "Is it good..." is not such a question (it invites opinions, rather than facts, which is explicitly frowned upon). And if the question needs many comments to clarify what you are asking, then it did not contain enough detail to begin with. – NickD Jul 29 '22 at 02:15
  • 1
    When I voted to close, I meant to say that the question needs details and clarity, not that it lacks focus (although I do think it lacks focus as well, but that's mostly because it veered into a different question in the comments). – NickD Jul 29 '22 at 02:18

1 Answers1

2

Package hyperbole automatically turns plain-text URLs into hyperlinks everywhere in Emacs.

Phil Hudson
  • 1,741
  • 10
  • 13