- Add perspective-rename-buffer interactive function - Add configurable delimiter for buffer names - Add perspective-rename-auto-create-mode for automatic buffer creation - Add customizable variables for auto-creation behavior - Add README with usage and configuration examples Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> |
||
|---|---|---|
| perspective-rename.el | ||
| README.md | ||
perspective-rename
An Emacs package that provides functions to rename buffers using a prefix combined with the active perspective workspace name.
Installation
Manual
Clone this repository and add it to your load path:
(add-to-list 'load-path "/path/to/perspective-rename")
(require 'perspective-rename)
use-package
(use-package perspective-rename
:load-path "/path/to/perspective-rename"
:after perspective
:config
(perspective-rename-auto-create-mode 1))
Usage
Interactive Renaming
Use M-x perspective-rename-buffer to rename the current buffer. You'll be prompted for a prefix, and the buffer will be renamed to:
<delimiter><prefix>-<perspective-name><delimiter>
For example, with the default delimiter *, prefix eat, and perspective shared-channels, the buffer becomes *eat-shared-channels*.
Auto-creation of Buffers
Enable perspective-rename-auto-create-mode to automatically create and rename buffers when a new perspective is created:
(perspective-rename-auto-create-mode 1)
By default, this creates two eat terminal buffers (*eat-<persp>* and *eat2-<persp>*) for each new perspective.
Customization
All variables can be customized via M-x customize-group RET perspective-rename RET.
perspective-rename-delimiter
String to surround the renamed buffer name. Default: "*"
(setq perspective-rename-delimiter "*") ; *eat-mypersp*
(setq perspective-rename-delimiter "") ; eat-mypersp
(setq perspective-rename-delimiter "=") ; =eat-mypersp=
perspective-rename-auto-create-buffers
List of buffer prefixes to create when a new perspective is created. Default: '("eat" "eat2")
(setq perspective-rename-auto-create-buffers '("shell" "shell2" "shell3"))
perspective-rename-auto-create-function
Function to call to create a new buffer. Must take no arguments. Default: #'eat
(setq perspective-rename-auto-create-function #'vterm)
(setq perspective-rename-auto-create-function #'eshell)
perspective-rename-auto-create-excluded-perspectives
List of perspective names to exclude from auto buffer creation. Default: '("main")
(setq perspective-rename-auto-create-excluded-perspectives '("main" "scratch" "org"))
Example Configuration
(use-package perspective-rename
:after perspective
:custom
(perspective-rename-delimiter "*")
(perspective-rename-auto-create-buffers '("term" "term2"))
(perspective-rename-auto-create-function #'eat)
(perspective-rename-auto-create-excluded-perspectives '("main" "emacs"))
:config
(perspective-rename-auto-create-mode 1))
License
GPL-3.0-or-later