all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Adding hypertlink buttons
@ 2018-10-26  0:16 Davin Pearson
  2018-10-29  1:13 ` Davin Pearson
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Davin Pearson @ 2018-10-26  0:16 UTC (permalink / raw)
  To: help-gnu-emacs

I have written a drop in replacement for speedbar,el called d-speedbar.el
and I want to get left mouse button hyperlinks online instead of pressing ENTER on the function browser window to take you to the corresponding line for that function in the code browser window.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Adding hypertlink buttons
  2018-10-26  0:16 Adding hypertlink buttons Davin Pearson
@ 2018-10-29  1:13 ` Davin Pearson
  2018-10-29 12:51   ` Stefan Monnier
       [not found]   ` <mailman.3002.1540817518.1284.help-gnu-emacs@gnu.org>
  2018-10-31 14:36 ` mail
       [not found] ` <mailman.3164.1540996581.1284.help-gnu-emacs@gnu.org>
  2 siblings, 2 replies; 9+ messages in thread
From: Davin Pearson @ 2018-10-29  1:13 UTC (permalink / raw)
  To: help-gnu-emacs

On Friday, October 26, 2018 at 1:16:59 PM UTC+13, Davin Pearson wrote:
> I have written a drop in replacement for speedbar,el called d-speedbar.el
> and I want to get left mouse button hyperlinks online instead of pressing ENTER on the function browser window to take you to the corresponding line for that function in the code browser window.

Please could someone please help me getting hyperlinks online.

What code do I need to write to enable hyperlinks in my function browser window?


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Adding hypertlink buttons
  2018-10-29  1:13 ` Davin Pearson
@ 2018-10-29 12:51   ` Stefan Monnier
       [not found]   ` <mailman.3002.1540817518.1284.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 9+ messages in thread
From: Stefan Monnier @ 2018-10-29 12:51 UTC (permalink / raw)
  To: help-gnu-emacs

> Please could someone please help me getting hyperlinks online.

I don't know what that means.  Maybe if you describe in more details
what you're trying to do and what you're getting now instead, more people
will be able to help you,


        Stefan




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Adding hypertlink buttons
       [not found]   ` <mailman.3002.1540817518.1284.help-gnu-emacs@gnu.org>
@ 2018-10-30  3:38     ` Davin Pearson
  2018-10-30  5:44       ` Yuri Khan
       [not found]       ` <mailman.3070.1540878268.1284.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 9+ messages in thread
From: Davin Pearson @ 2018-10-30  3:38 UTC (permalink / raw)
  To: help-gnu-emacs

On Tuesday, October 30, 2018 at 1:52:01 AM UTC+13, Stefan Monnier wrote:
> > Please could someone please help me getting hyperlinks online.
> 
> I don't know what that means.  Maybe if you describe in more details
> what you're trying to do and what you're getting now instead, more people
> will be able to help you,


> I don't know what that means.  Maybe if you describe in more details
> what you're trying to do and what you're getting now instead, more
> people will be able to help you,

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.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Adding hypertlink buttons
  2018-10-30  3:38     ` Davin Pearson
@ 2018-10-30  5:44       ` Yuri Khan
       [not found]       ` <mailman.3070.1540878268.1284.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 9+ messages in thread
From: Yuri Khan @ 2018-10-30  5:44 UTC (permalink / raw)
  To: Davin Pearson; +Cc: help-gnu-emacs

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.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Adding hypertlink buttons
       [not found]       ` <mailman.3070.1540878268.1284.help-gnu-emacs@gnu.org>
@ 2018-10-31  2:31         ` Davin Pearson
  2018-10-31  5:22           ` Yuri Khan
  0 siblings, 1 reply; 9+ messages in thread
From: Davin Pearson @ 2018-10-31  2:31 UTC (permalink / raw)
  To: help-gnu-emacs

On Tuesday, October 30, 2018 at 6:44:31 PM UTC+13, Yuri Khan wrote:
> On Tue, Oct 30, 2018 at 10:40 AM Davin Pearson  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.

How do I go about setting properties in PLists?  Can you give an example?

How do I create a plist?



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Adding hypertlink buttons
  2018-10-31  2:31         ` Davin Pearson
@ 2018-10-31  5:22           ` Yuri Khan
  0 siblings, 0 replies; 9+ messages in thread
From: Yuri Khan @ 2018-10-31  5:22 UTC (permalink / raw)
  To: Davin Pearson; +Cc: help-gnu-emacs

On Wed, Oct 31, 2018 at 9:35 AM Davin Pearson <davin.pearson@gmail.com> wrote:

> How do I go about setting properties in PLists?  Can you give an example?
> How do I create a plist?

(info "(elisp) Property Lists") answers these questions.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Adding hypertlink buttons
  2018-10-26  0:16 Adding hypertlink buttons Davin Pearson
  2018-10-29  1:13 ` Davin Pearson
@ 2018-10-31 14:36 ` mail
       [not found] ` <mailman.3164.1540996581.1284.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 9+ messages in thread
From: mail @ 2018-10-31 14:36 UTC (permalink / raw)
  To: Davin Pearson, help-gnu-emacs@gnu.org

   A

   A

   26.10.2018, 08:21, "Davin Pearson" <davin.pearson@gmail.com>:

   > I have written a drop in replacement for speedbar,el called
   d-speedbar.el

   > and I want to get left mouse button hyperlinks online instead of
   pressing ENTER on the function browser window to take you to the
   corresponding line for that function in the code browser window.

   A

   After consultingA (info "(elisp) Clickable Text") yesterday, IA wrote
   the following to insert a link to the init file, I can click or press
   RET onA the link to open the file.

   A

   (insert
   A (propertize user-init-file
   A  A  A  A  A  A  A 'mouse-face 'highlight
   A  A  A  A  A  A  A 'help-echo "mouse-2: visit this file"
   A  A  A  A  A  A  A 'follow-link t
   A  A  A  A  A  A  A 'keymap
   A  A  A  A  A  A  A (let ((map (make-sparse-keymap))
   A  A  A  A  A  A  A  A  A  A (cmd (lambda ()
   A  A  A  A  A  A  A  A  A  A  A  A  A  (interactive)
   A  A  A  A  A  A  A  A  A  A  A  A  A  (find-file user-init-file))))
   A  A  A  A  A  A  A  A (define-key map [mouse-2] cmd)
   A  A  A  A  A  A  A  A (define-key map [?\C-m] cmd)
   A  A  A  A  A  A  A  A map))
   A ?\n)
   A
   I am not sure if `:follow-link t` is correct, but it seems it is
   required because I remember click won't work without it.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Adding hypertlink buttons
       [not found] ` <mailman.3164.1540996581.1284.help-gnu-emacs@gnu.org>
@ 2018-11-02 13:34   ` Davin Pearson
  0 siblings, 0 replies; 9+ messages in thread
From: Davin Pearson @ 2018-11-02 13:34 UTC (permalink / raw)
  To: gnu.emacs.help; +Cc: help-gnu-emacs

The code you sent me works just fine.  Thanking you for your time and energy
involved in constructing a reply to my original email message.

On Thu, 1 Nov 2018 at 03:36, <mail@xuchunyang.me> wrote:

>    A
>
>    A
>
>    26.10.2018, 08:21, "Davin Pearson" <davin.pearson@gmail.com>:
>
>    > I have written a drop in replacement for speedbar,el called
>    d-speedbar.el
>
>    > and I want to get left mouse button hyperlinks online instead of
>    pressing ENTER on the function browser window to take you to the
>    corresponding line for that function in the code browser window.
>
>    A
>
>    After consultingA (info "(elisp) Clickable Text") yesterday, IA wrote
>    the following to insert a link to the init file, I can click or press
>    RET onA the link to open the file.
>
>    A
>
>    (insert
>    A (propertize user-init-file
>    A  A  A  A  A  A  A 'mouse-face 'highlight
>    A  A  A  A  A  A  A 'help-echo "mouse-2: visit this file"
>    A  A  A  A  A  A  A 'follow-link t
>    A  A  A  A  A  A  A 'keymap
>    A  A  A  A  A  A  A (let ((map (make-sparse-keymap))
>    A  A  A  A  A  A  A  A  A  A (cmd (lambda ()
>    A  A  A  A  A  A  A  A  A  A  A  A  A  (interactive)
>    A  A  A  A  A  A  A  A  A  A  A  A  A  (find-file user-init-file))))
>    A  A  A  A  A  A  A  A (define-key map [mouse-2] cmd)
>    A  A  A  A  A  A  A  A (define-key map [?\C-m] cmd)
>    A  A  A  A  A  A  A  A map))
>    A ?\n)
>    A
>    I am not sure if `:follow-link t` is correct, but it seems it is
>    required because I remember click won't work without it.
>


-- 
Sincerely and kindest regards, Davin.
Davin Pearson    http://davin.50webs.com


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-11-02 13:34 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-26  0:16 Adding hypertlink buttons Davin Pearson
2018-10-29  1:13 ` Davin Pearson
2018-10-29 12:51   ` Stefan Monnier
     [not found]   ` <mailman.3002.1540817518.1284.help-gnu-emacs@gnu.org>
2018-10-30  3:38     ` Davin Pearson
2018-10-30  5:44       ` Yuri Khan
     [not found]       ` <mailman.3070.1540878268.1284.help-gnu-emacs@gnu.org>
2018-10-31  2:31         ` Davin Pearson
2018-10-31  5:22           ` Yuri Khan
2018-10-31 14:36 ` mail
     [not found] ` <mailman.3164.1540996581.1284.help-gnu-emacs@gnu.org>
2018-11-02 13:34   ` Davin Pearson

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.