help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Adding hypertlink buttons


From: Yuri Khan
Subject: Re: Adding hypertlink buttons
Date: Tue, 30 Oct 2018 12:44:06 +0700

On Tue, Oct 30, 2018 at 10:40 AM Davin Pearson <davin.pearson@gmail.com> wrote:

> When I execute the following command
>
> (display-splash-screen nil)
>
> It comes up with a screen of hyperlinks.  By default Emacs
> shows the splash screen with an extra image and a hyperlink button
> that takes your Web browser to gnu.org, although I have turned
> this feature off and I cannot remember what command to use to
> re-enable a fancy splash screen.
>
> It seems that font lock should be used to add a hyperlink to
> your Elisp code.

Since you know what function does what you want, and you approximately
know the thing to look for, what is stopping you from reading the code
of that function looking for that thing?

Specifically, the buffer text of the startup screen is built by
function ‘fancy-splash-insert’ in startup.el, from data in variable
‘fancy-startup-text’ in the same file.

What it’s doing is invoke ‘insert-button’, with the property 'face
specifying 'link (in addition to the current face), 'help-echo setting
a description string displayed in the echo area when point is within
the button, 'follow-link to make it clickable with the mouse, and
'action specifying a lambda function that invokes ‘browse-url’ with
the appropriate link address. You could create a button with its
'action set to a function that does something else, such as visiting a
specific file and moving point to a specific position.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]