0

Is there a package or a feature in emacs that will let me use an alias for a slug of text? The way I'd like to use it is to make an alias and everywhere in the text the alias is placed the value of the alias is shown instead of the name of the alias. Possibly through some kind of markup.

I'd like to be able toggle editing between seeing the value and seeing the name. Or it could behave a lot like org-hide-emphasis-markers does by hiding the extra markup but carrying out emphasis.

Perhaps this is also easy to construct an elisp function for that I'm just unaware of the right combination of features to use.

An example the plain text might look like this:

#+alias: ProductName "Super Toaster"

 * Features:
 The $ProductName has slots for 32 slices of bread.

The edited view would look like this (not just for/upon export):

 * Features:
 The Super Toaster has slots for 32 slices of bread.

When view in emacs the $ProductName would be Super Toaster but I could either edit the variable or the name in-place.

2
  • 1
    I am not aware of such functionality, but maybe you could use the answer here Feb 5 at 22:43
  • 1
    Yeah, I gave the snippet in the reference a shot. It worked well. I'll just have to incorporate it a bit. Thanks.
    – lucidquiet
    Feb 6 at 17:56

1 Answer 1

0

There are several snippets mode in emacs that lets you create your own snippets. I use yas-mode.

2
  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - From Review Feb 6 at 16:29
  • Also this isn't a snippet. A snippet replaces the text as permanent (give or take undo). The original question is about having multiple views of the buffer in a sense. Like org-hide-emphasis-markers.
    – lucidquiet
    Feb 6 at 17:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.