kickingvegas / casual-info

Casual Info - An opinionated Transient porcelain for the Emacs Info reader.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

https://melpa.org/packages/casual-info-badge.svg

Casual Info

An opinionated Transient-based porcelain for the Emacs Info reader.

docs/images/casual-info-screenshot.png

Motivation

The Emacs Info reader (henceforth referred to as Info) has a rich command set that few care to learn. For such users, it is easy to be surprised by the Info command set behavior, particularly around navigation.

Casual Info endeavors to address the above by offering a keyboard-driven user interface (UI) to support discovery and recall. While menus are commonly associated with mouse-driven UI, the inclusion of Transient in Emacs core allows for a menu UI that is keyboard-driven.

Goals

  • To provide a keyboard-driven menu UI for the Info reader.
  • To organize commands to allow for casual usage of the Info reader.

Non-Goals

  • Full coverage of all Info commands. Casual Info is not intended to be a power user tool.
  • Strict adherence to default Info keybindings. That said, most Info keybindings are honored.
  • Strict adherence to Info command naming. While Casual Info is mostly in alignment with Info’s command naming, there are cases where it will make an opinionated change if the name is deemed too vague or idiomatic.
  • UX Stability (for now). Given that Casual Info is early in its life-cycle, expect changes to its user experience in terms of menu hierarchy and keybinding choices in future releases.

Requirements

Casual Info has been verified with the following configuration.

  • Emacs 29.3 (macOS 14.5, Ubuntu Linux 22.04.4 LTS)

Asks

As Casual Info is new, we are looking for early adopters! Your feedback is welcome as it will likely impact Casual Info’s evolution, particularly with regards to UI.

Install

If installed via MELPA then add these lines to your Emacs initialization file with your binding of preference.

(require 'casual-info) ;; optional
(keymap-set Info-mode-map "C-o" #'casual-info-tmenu)

If you use use-package, here is the recipe for installing it.

(use-package casual-info
  :ensure t
  :bind (:map Info-mode-map ("C-o" . 'casual-info-tmenu)))

Customization

While not required, adding this configuration to your Emacs initialization file will synchronize keybindings between Casual Info and the Info reader. A nice visual improvement is to use hl-line-mode to highlight the line where the cursor is at. Enabling scroll-lock-mode will enable scrolling the buffer for content that is larger than its window size with the navigation keys.

;; # Info
;; Use web-browser history navigation bindings
(keymap-set Info-mode-map "M-[" #'Info-history-back)
(keymap-set Info-mode-map "M-]" #'Info-history-forward)
;; Bind p and n to paragraph navigation
(keymap-set Info-mode-map "p" #'casual-info-browse-backward-paragraph)
(keymap-set Info-mode-map "n" #'casual-info-browse-forward-paragraph)
;; Bind h and l to navigate to previous and next nodes
;; Bind j and k to navigate to next and previous references
(keymap-set Info-mode-map "h" #'Info-prev)
(keymap-set Info-mode-map "j" #'Info-next-reference)
(keymap-set Info-mode-map "k" #'Info-prev-reference)
(keymap-set Info-mode-map "l" #'Info-next)
;; Bind / to search
(keymap-set Info-mode-map "/" #'Info-search)
;; Set Bookmark
(keymap-set Info-mode-map "B" #'bookmark-set)

(add-hook 'Info-mode-hook #'hl-line-mode)
(add-hook 'Info-mode-hook #'scroll-lock-mode)

Usage

  1. Invoke M-x info to launch the Info reader.
  2. When the point is in the Info window, invoke C-o (or a binding of your choosing) to launch the Casual Info menu.

Unicode Symbol Support

By enabling “Use Unicode Symbols” from the Settings menu, Casual Info will use Unicode symbols as appropriate in its menus.

Common Menu Actions

Casual Info is built using Transient menus and as such adopts much of its default behavior.

Each menu item has a key and a label. The key is what is typed by the user to select the menu item. A key can be prefixed with a meta (M-) or control (C-) key. Labels ending with a > character indicates that it will open another menu.

Dismissing a menu regardless of how deep you are in sub-menus can be done by entering C-q. A menu can also be dismissed by entering C-g, but this will return you to the parent menu.

If a mouse is available, a menu item can be selected by moving the mouse cursor over its label and pressing down button 1.

Pressing the ? key will toggle help for all the menu items. Press the key of interest to get help for it.

When a Transient menu is raised, a prefix argument (C-u) can be entered before selecting a menu item.

Menu item notation

The following conventions are used to denote menu items.

If the label ends with a , it is a sub-menu.

If the label ends with an , the command will prompt you for an input value.

Development

For users who wish to help contribute to Casual Info or personally customize it for their own usage, please read the developer documentation.

Sponsorship

If you enjoy using Casual Info, consider making a modest financial contribution to help support its development and maintenance.

docs/images/default-yellow.png

See Also

Casual Info is part of a suite of porcelains for different Emacs packages.

To get all current and future Casual porcelains, please install Casual Suite from MELPA.

Porcelains currently supported by Casual are listed below:

Users who prefer finer grained control over package installation can install each porcelain above individually.

Acknowledgments

A heartfelt thanks to all the contributors to the Info reader and Transient. Casual Info would not be possible without your efforts.

About

Casual Info - An opinionated Transient porcelain for the Emacs Info reader.

License:GNU General Public License v3.0


Languages

Language:Emacs Lisp 76.8%Language:Makefile 21.1%Language:Shell 2.1%