hyperbole-users
[Top][All Lists]
Advanced

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

Re: Creating many explicit buttons (each pointing to a file)


From: Robert Weiner
Subject: Re: Creating many explicit buttons (each pointing to a file)
Date: Sun, 8 Oct 2023 10:10:35 +0100

Just call the ebut:program function with point at the location for the button 
and you are done.  This is also documented in the manual under programmatically 
creating buttons.

(defun    ebut:program (label actype &rest args)
  "Programmatically create an explicit Hyperbole button at point.
Create button from LABEL, ACTYPE (action type), and optional actype ARGS.
Insert LABEL text at point surrounded by <( )> delimiters, adding any
necessary instance number of the button after the LABEL.  ACTYPE may
be a Hyperbole action type name (from defact) or an Emacs Lisp
function, followed by a list of arguments for the actype, aside from
the button LABEL which is automatically provided as the first argument.

For interactive creation, use `hui:ebut-create' instead.")

-- Bob

> On Oct 8, 2023, at 3:49 AM, LdBeth <andpuke@foxmail.com> wrote:
> 
> 
> There a various approaches I can think of.
> 
> Check the .hypb file which contains the button data, it is easy to guess
> the format and programmically generate many buttons.
> 
> OR
> 
>> (also, I could not make hyperbole to recognize a local variable in an
>> org-mode file)
> 
> Use the standard Emacs buffer local variable format
> 
> ;;; Local Variables: ***
> ;;; mode:lisp ***
> ;;; comment-column:0 ***
> ;;; comment-start: ";;; "  ***
> ;;; comment-end:"***" ***
> ;;; End: ***
> 
> LdBeth
> 
>>>>>> In 
>>>>>> <bYgJTz6gkXHiYKlpXHvNvdhI8ADOjU42FCMwsBTt9mu57BrZmmt11jjmgLhhVVNwr6mtUEpVjmcNiW7lbIuxAED4SCeIYc2MoLTlJ7CPqAY=@proton.me>
>>>>>>  
>>>>>>    Alexis Praga <alexis.praga@proton.me> wrote:
> Alexis> [1  <multipart/mixed (7bit)>]
> Alexis> [1.1  <text/plain; utf-8 (quoted-printable)>]
> Alexis> Hi,
> 
> Alexis> I'm trying to integrate Hyperbole in my workflow. After
> Alexis> watching RWS's videos, it does look like a powerful tool.
> 
> Alexis> However, I could not figure out how to make efficiently many explicit 
> buttons, each pointing to a file. In org-mode, it's rather easy to convert 
> the output of "ls" into as many links.
> 
> Alexis> In hyperbole: 
> 
> Alexis> - dragging for a dired buffer does not seem to work on my
> Alexis>   setup, it does not work (no mouse support + Doom emacs)
> Alexis> - creating a link manually is too tedious to do it 20 times
> Alexis> - implicit links works but there are quite ugly for long paths.
> Alexis> - using a variable to shorten the path is a workaround but I
> Alexis>   would prefer an explicit button (also, I could not make
> Alexis>   hyperbole to recognize a local variable in an org-mode file)
> 
> Alexis> Any advice would be appreciated. Thanks !
> 
> 



reply via email to

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