Is it possible to provide an alias (e.g. m
or mes
) for a name like *Messages*
?
Ideally, I'd like to be able to write some kind of hook that gets called when a buffer doesn't exist and resolves to another name. Transferring control to an arbitrary function lets the user write interesting behavior like bailing out when presented with an ambiguous abbreviation.
Strawman code:
(defun messages-abbrev (ignored-string)
"*Messages*")
(install-buffer-abbreviation '("m" "mes") #'messages-abbrev)
Ideally, I'd like something that works at a lower level than ido
or helm
or equivalent, so it can be composed with either of them or none of them. But it is also interesting if those libraries provide a solution to this problem.
An emacs configuration option that globally enables some kind of fuzzy buffer resolution would also be neat if such a thing exists.
install-buffer-abbreviation
, if it were defined. (BTW, you need to close your first string.) Please consider describing the actual problem that you want to solve, more clearly.*Messages*
*eshell*
,*eshell*<2>
,*shell*
,*shell2*
usingswitch-to-buffer
orlist-buffers
or similar with a short name that's customizable without affecting how the name is displayed. I like the*name*
convention for non-file buffers. As a stretch goal, I'd also like to be able to navigate to associated files (e.g.C-x b .h C-m
for navigating to the corresponding header file). I guess I'm just wondering what hooks are available for making a file-navigation DSL. There might not be any. It is a strange question.