diff options
author | Christian Cunningham <cc@localhost> | 2024-05-28 11:19:22 -0700 |
---|---|---|
committer | Christian Cunningham <cc@localhost> | 2024-05-28 11:19:22 -0700 |
commit | f14c2d3fe50de3c55e7c9684e93cdf5608a00b89 (patch) | |
tree | a8ea3bdb68779ecdce6d7be8b7d8f56a9ff3b4c1 /nemacs-functions.el |
Initial Commit
Diffstat (limited to 'nemacs-functions.el')
-rw-r--r-- | nemacs-functions.el | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/nemacs-functions.el b/nemacs-functions.el new file mode 100644 index 0000000..5513fae --- /dev/null +++ b/nemacs-functions.el @@ -0,0 +1,10 @@ +(defun nemacs/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 'nemacs-functions) |