Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/oantolin/epithet
Emacs package to rename buffers with descriptive names
https://github.com/oantolin/epithet
Last synced: 30 days ago
JSON representation
Emacs package to rename buffers with descriptive names
- Host: GitHub
- URL: https://github.com/oantolin/epithet
- Owner: oantolin
- License: gpl-3.0
- Created: 2020-04-21T20:39:01.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-07-09T23:07:34.000Z (over 1 year ago)
- Last Synced: 2024-08-07T18:31:14.642Z (5 months ago)
- Language: Emacs Lisp
- Size: 43.9 KB
- Stars: 41
- Watchers: 2
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.org
- License: LICENSE
Awesome Lists containing this project
README
/epithet (noun) ep⸱i⸱thet |ˈe-pə-ˌthet also -thət/
1. a characterizing word or phrase accompanying or occurring in place
of the name of a person or thing.* Overview
This package provides a function =epithet-rename-buffer= to rename
the current buffer with a descriptive name. The name suggestion is
governed by the =epithet-suggesters= hook variable: each hook
should return either a name suggestion or nil, they are called in
turn and the first non-nil suggestion is taken.A cute trick is too add =buffer-file-name= to =epithet-suggesters=: this
has the effect of suggesting the full path for buffers associated with
files.There are currently suggestion functions for eww, info, help and occur
buffers. For eww there are two, in fact, one that suggests the page
title and one that suggests the URL (the title is the default).The =epithet-rename-buffer= function can be called interactively or
added to appropriate hooks to rename automatically. If called
interactively you can use the universal prefix argument to get a
prompt where you can choose a different name, and the suggested
name is available as the default value.If you want to always rename info, eww, help or occur buffers without
manual intervention, use:#+begin_src emacs-lisp
(add-hook 'Info-selection-hook #'epithet-rename-buffer)
(add-hook 'eww-after-render-hook #'epithet-rename-buffer)
(add-hook 'help-mode-hook #'epithet-rename-buffer)
(add-hook 'occur-hook #'epithet-rename-buffer) ; not occur-mode-hook
(add-hook 'shell-mode-hook #'epithet-rename-buffer)
(add-hook 'compilation-start-hook #'epithet-rename-buffer-ignoring-arguments)
(add-hook 'compilation-finish-functions #'epithet-rename-buffer-ignoring-arguments)
#+end_srcDue to a quirk in =describe-bindings=, even though it produces a help
mode buffer, having =epithet-rename-buffer= in the =help-mode-hook= will
not rename the buffer it creates. If you want those buffers renamed
automatically too, you should also add this to your configuration:#+begin_src emacs-lisp
(defun rename-describe-bindings (&rest _)
(with-current-buffer (help-buffer)
(epithet-rename-buffer)))(advice-add 'describe-bindings :after #'rename-describe-bindings)
#+end_src