Re:Emacs Info Expressions
by submeta on Monday April 15, 2024 @11:40AM
(#40042029)
This is interesting. Just yesterday I asked myself how I can embed links to info nodes in a markdown file. I realized it's easiest to just put the expression in my file like so:
Then I asked myself how I can run it without going to the last parenthesis and then hitting C-x C-e, so I wrote a function:
;;;; eval expression at point in text / markdown
(defun ugt-eval-expression-at-point ()
"Evaluate the expression at the current point."
(interactive)
(save-excursion
(while (ignore-errors (backward-up-list) t)) ; Move to the beginning of the outermost sexp
(let ((end (point)))
(forward-sexp) ; Move to the end of this sexp
(eval-region end (point)))))
(global-set-key (kbd "C-s-e") 'ugt-eval-outermost-sexp-at-point)
So now I can be in between the parentheses and hit C-s-e (Control-Command-e), and it will be evaluated.
I even embed search expressions in my documents:
(ugt-search "French Revolution")
So be able to just click those expressions, I created another function:
I even embed search expressions in my documents:
So be able to just click those expressions, I created another function: ## EditEmacs just rocks!