1. |
GNU Hyperbole Full Demo/Tutorial by Bob Weiner Send an email or a testimonial if you like Hyperbole to <rsw@gnu.org>. Table of Contents ----------------- * Introduction * Smart Keys * Koutliner * HyControl * HyRolo * History * Implicit Buttons * Explicit Buttons * Button Files * Global Buttons * Smart Mouse Keys * Epilog * References |
8c6. |
Remote Paths If you use the standard Emacs library "tramp.el" for working with remote files and directories, then remote pathnames of the form: /protocol:user@host.domain:/path will be recognized by Hyperbole. Once you have Tramp configured for loading and are on the Internet, you can press on any of the following to jump to the ftp site of Hyperbole tarball distributions: /ftp:anonymous@ftp.gnu.org:/pub/gnu/hyperbole/ For Tramp pathnames, Hyperbole recognizes them with or without double quote delimiters. If you enable the Hyperbole option to use URLs when finding files with the {C-x C-f} (find-file) command via the {C-h h c f} key sequence, then you can also use paths of the form: ftp://ftp.gnu.org/pub/ |
8f. |
World Wide Web URL Buttons You can browse URLs (universal resource locators) from within any buffer once Hyperbole is loaded. Hyperbole's Cust (Customization) menu allows you to set the web browser used for display (this is turn sets the standard Emacs "browse-url.el" library settings). Try using the Action Key on: "http://www.gnu.org". Full and abbreviated web and ftp URLs, e.g. www.gnu.org, are recognized with or without quotes. |
8g. |
Email Addresses An Action Key press on an email address of any common domain name will start composing an email message to that name within Emacs. This is limited to major modes listed in the variable, mail-address-mode-list. If that variable is nil, then email addresses are active in every buffer. Try composing a message to <hyperbole-users@gnu.org> and tell us what you think of Hyperbole. Even better, a press of or on {C-h h m c} composes mail to the list that includes your system information. |
8h2. |
Defining New Action Button Types You can do many things with existing Action Button types but sometimes you may want to define your own types for more advanced usage. Hyperbole lets you easily create your own Action Button link types without knowing Elisp, if you understand basic regular expression-based pattern replacement. In your Emacs initialization file, e.g. ~/.emacs, you will add a line of the form: (defal TYPE LINK-EXPR &optional DOC) where: TYPE is the name of the new type you want to create; LINK-EXPR is a regular expression containing a %s replacement string into which Hyperbole will substitute the button text following the TYPE from each button activated of this type; alternatively, LINK-EXPR may be the name of a function of one argument, the button text sans the function name; Hyperbole automatically creates a doc string for the type but you can override this by providing an optional DOC string. When a button of this new type is activated, the button text following the type is substituted into LINK-EXPR. After which, the button is activated as one of these 4 kinds: (1) a brace-delimited key series; (2) a URL/web link; (3) a path (possibly with trailing colon-separated line and column numbers); (4) or a function or action type of one argument, the button text sans the function name. Let's try an example. If you use Python and have a PYTHONLIBPATH environment variable, then pressing {C-x C-e} after this expression: (defal pylib "${PYTHONLIBPATH}/%s") defines a new action button link type called 'pylib’ whose buttons take the form of: <pylib PYTHON-LIBRARY-FILENAME> and display the associated Python libraries (typically Python source files). Optional colon separated line and column numbers may be given as well. Now press the Action Key press within: <pylib string.py:5:7> This will display the source for "string.py" (wherever it is installed on your system) from the Python standard library with point on the fifth line at the seventh character. ---- As another example, suppose you want to do a web search for Emacs Lisp libraries whose names may be very generic, like hyperbole. For this, you can use a Google filetype-specific search. Define an action link type with: (defal elsearch "https://www.google.com/search?q=%s+filetype:el" "Find Elisp libraries via a Google file type search") Then, an Action Key press on: <elsearch burly> will find major links to that library which makes window configurations and framesets persistent across Emacs sessions. This search is actually built in to the Hyperbole menus, so you could have defined it more simply (and sans docstring) with a key series definition: (defal elsearch "{C-hhfwe %s RET}") as well. ---- For more advanced and flexible regular expression-based link type creation, see the 'defil' expression in "(hyperbole)Implicit Button Link Types". For any type of implicit button type creation using ELisp, see 'defib' in "(hyperbole)Programmatic Implicit Button Types". |
18. |
References [FSF 19] Free Software Foundation, Inc. GNU Emacs Manual. Free Software Foundation, Cambridge: MA, 2019. "(emacs)Top" |
19. |
THE END |