From 7c39432564d45137eae605851285ae2823807fb3 Mon Sep 17 00:00:00 2001 From: Laurens Miers Date: Tue, 24 Sep 2024 21:00:23 +0200 Subject: [PATCH] Move sudo to myrmi/sudo-current-buffer It's a new function, use the custom prefix to make that clear. --- config.org | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/config.org b/config.org index 90bcdd7..d2fe38c 100644 --- a/config.org +++ b/config.org @@ -161,21 +161,6 @@ Display number of matches: Reference that might be interesting for later: https://endlessparentheses.com/leave-the-cursor-at-start-of-match-after-isearch.html -** Sudo file - -#+begin_src emacs-lisp -(defun sudo () - "Use TRAMP to `sudo' the current buffer." - (interactive) - (when buffer-file-name - (find-alternate-file - (concat "/sudo:root@localhost:" - buffer-file-name) - ) - ) -) -#+end_src - ** Abbrev #+begin_src emacs-lisp @@ -866,6 +851,22 @@ Preserve indentation in SRC blocks * Custom +** Sudo current buffer + +#+BEGIN_SRC emacs-lisp +(defun myrmi/sudo-current-buffer () + "Use TRAMP to `sudo' the current buffer." + (interactive) + (when buffer-file-name + (find-alternate-file + (concat "/sudo:root@localhost:" + buffer-file-name) + ) + ) +) +#+END_SRC + + ** Save symbol at point #+BEGIN_SRC emacs-lisp