Git Product home page Git Product logo

casual-info's Introduction

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.

casual-info's People

Contributors

kickingvegas avatar

Stargazers

Dilip avatar Brit Butler avatar modula t. avatar Ravioli avatar David Wright avatar Siavash Askari Nasr avatar Colin Fraizer avatar DC avatar  avatar Kenny Ballou avatar Dan Drake avatar JunghanKim avatar  avatar stardiviner avatar

Watchers

 avatar

Forkers

emacsmirror

casual-info's Issues

Conform Info Navigation to Transient Conventions

IMO the key used to "dismiss" the current transient menu should be the same used elsewhere in Emacs to abort the current "incomplete" (or otherwise "stuck") action: C-g.

All transient already bind C-g to the appropriate command1, so there is no need to bind another key, and/or to use a non-trivial suffix definition (such as your ("q" "Dismiss" ignore :transient transient--do-exit)).

My recommendation would be to just drop that altogether and relay on the existing C-g binding. But the argument could be made that to users new to transient, that is not obvious, so the suffix should be displayed. My counter argument is that C-g is used all across Emacs, without a visual hint that in any given context it is available too, just like in nearly all other contexts.

Also see A.7 at https://magit.vc/manual/transient/How-can-I-autoload-prefix-and-suffix-commands_003f.html#Why-does-q-not-quit-popups-anymore_003f-1. I.e. in this menu q should quit the info buffer (and maybe also (not only) the info transient menu).

Footnotes

  1. transient-quit-one; though in certain special contexts another command is bound, but you don't have to worry about that.

Add Shift-Space for Next/Down

Discussed in #11

Originally posted by Rolly-GitHub June 5, 2024
The Transient menu has bound to Info-scroll-up:
<space> Next/Down

Suggest you follow that item next with:
<S-space> Prev/Up

bound to Info-scroll-down.

Note: Maybe it would be "S-<space>" rather than "<S-space>" to represent Shift-Space.
... Not sure what the "best" or correct way to list that key sequence.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.