hyperbole-users
[Top][All Lists]
Advanced

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

Re: implicit links


From: Dr. Erich Ruff
Subject: Re: implicit links
Date: Wed, 19 May 2021 08:26:26 +0200
User-agent: mu4e 1.4; emacs 27.2

Hello Bob,

thank you very much for the patch. Now it works!!

Appreciate your help!



On Mi 19 Mai 2021 at 03:27, Robert Weiner <rsw@gnu.org> wrote:

> Here is the fix/patch for your problem.  -- Bob
>
> Copy all of the following lines to the *scratch* buffer in your Emacs
> and follow the directions:
>
> Activate the following link with M-RETURN:   <link-to-string-match
> "link-to-ebut" 1 "${hyperb:dir}/hactypes.el">
> Replace the defact you see in the file with
>   the one defined below.
> Then byte-compile and reload the file
> by activating the following key series:      {C-x b hactypes.el RET M-:
> (byte-compile-buffer t) RET}
>
>
> (defact link-to-ebut (key &optional key-file)
>   "Perform action given by an explicit button, specified by KEY and
> optional KEY-FILE.
> Interactively, KEY-FILE defaults to the current buffer's file name."
>   (interactive
>    (let (but-lbl
>          but-file)
>      (while (cond ((setq but-file
>                          (read-file-name
>                           "File of button to link to: " nil nil t))
>                    (if (string-equal but-file "")
>                        (progn (beep) t)))
>                   ((not (file-readable-p but-file))
>                    (message "(link-to-ebut): You cannot read `%s'."
>                             but-file)
>                    (beep) (sit-for 3))))
>      (list (progn
>              (find-file-noselect but-file)
>              (while (string-equal "" (setq but-lbl
>                                            (hargs:read-match
>                                             "Button to link to: "
>                                             (ebut:alist but-file)
>                                             nil nil nil 'ebut)))
>                (beep))
>              (ebut:label-to-key but-lbl))
>            but-file)))
>   (let (but
>         normalized-file)
>     (if key-file
>         (setq normalized-file (hpath:normalize key-file))
>       (setq normalized-file buffer-file-name))
>
>     (if (setq but (when normalized-file (ebut:get key nil normalized-file)))
>         (hbut:act but)
>       (hypb:error "(link-to-ebut): No button `%s' in `%s'"
>                   (ebut:key-to-label key)
>                   key-file))))



reply via email to

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