FG
šŸ’» Software

How can I write a emacs command that inserts a text with a variable string at the current cursor position?

Fresh5 days ago
Mar 15, 20265753 views
Confidence Score0%
0%

Problem

I would like to write an elisp emacs command that inserts a fixed string that contains a variable part at the current cursor position: where the command should query for and insert the whole text.

Error Output

\label{$STRING} \index{\nameref{$STRING}}

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: How can I write a emacs command that inserts a text with a variable string at the current cursor position?

Low Risk

Elisp Here is a simple elisp function for it: This function queries in the minibuffer for the string and then inserts it all at point. To use it you can put it in your .emacs and then invoke it via M-x or bind it to a key. YASnippet If you want to u…

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment