summaryrefslogtreecommitdiff
path: root/elchemy-functions.el
diff options
context:
space:
mode:
authorChristian Cunningham <cc@localhost>2024-06-01 16:11:59 -0700
committerChristian Cunningham <cc@localhost>2024-06-01 16:11:59 -0700
commit5c1b2a5da3c11f8b2d946219b2afeac526e6627d (patch)
tree2c7ac2846dc0afd1092aded47be928cd10fbe7ef /elchemy-functions.el
parentc5a06aa3b3c6954b806db030900b89428fc05143 (diff)
Rename Config
Diffstat (limited to 'elchemy-functions.el')
-rw-r--r--elchemy-functions.el10
1 files changed, 10 insertions, 0 deletions
diff --git a/elchemy-functions.el b/elchemy-functions.el
new file mode 100644
index 0000000..296e1e9
--- /dev/null
+++ b/elchemy-functions.el
@@ -0,0 +1,10 @@
+(defun elchemy/replace-in-buffer ()
+ (interactive)
+ (save-excursion
+ (if (equal mark-active nil) (mark-word))
+ (setq nm/rib/current-word (buffer-substring-no-properties (mark) (point)))
+ (setq nm/rib/old-string (read-string "OLD string:\n" nm/rib/current-word))
+ (setq nm/rib/new-string (read-string "NEW string:\n" nm/rib/old-string))
+ (query-replace nm/rib/old-string nm/rib/new-string nil (point-min) (point-max))))
+
+(provide 'elchemy-functions)