]> git.earman.xyz Git - emacsinit.git/commitdiff
Cleanup interactive calls
authorrearman <rearman@r717.net>
Tue, 14 Oct 2025 14:20:50 +0000 (10:20 -0400)
committerrearman <rearman@r717.net>
Tue, 14 Oct 2025 14:20:50 +0000 (10:20 -0400)
Get rid of 'call-interactively' where possible.

re/re-editing-defuns.el

index e17665cd63f22cd205f420600b5f6a2d65524b16..4a7098502a006d420cce7c01776fbac55494ba1e 100644 (file)
@@ -14,7 +14,7 @@
   (interactive "*p")
   (end-of-line)
   (open-line n)
-  (call-interactively (next-line))
+  (next-line 1)
   (indent-for-tab-command))
 
 (defun re/open-line-above (n)
@@ -56,12 +56,12 @@ Arg works on `mark-defun'."
   (mark-defun arg)
   (kill-region (region-beginning) (region-end)))
 
-(defun re/kill-bword-or-region ()
-  "Kill region if active, otherwise kill back one word."
-  (interactive)
-  (if (use-region-p)
-      (call-interactively 'kill-region)
-    (call-interactively 'backward-kill-word)))
+(defun re/kill-bword-or-region (&optional arg)
+"Kill region if active, otherwise kill back one word."
+(interactive "p")
+(if (use-region-p)
+    (kill-region (region-beginning) (region-end))
+  (backward-kill-word arg)))
 
 (defun re/smart-beginning-of-line ()
   "Move point to first non-whitespace character or `beginning-of-visual-line'.
@@ -113,7 +113,7 @@ If in org-mode, call `org-end-of-line' first."
     (add-to-history 'search-ring
                    (buffer-substring (region-beginning) (region-end)))
     (deactivate-mark))
-  (call-interactively 'isearch-forward))
+  (isearch-forward))
 
 (defun re/isearch-backward-use-region ()
   "Search text in region if active, otherwise normal backward search."
@@ -122,7 +122,7 @@ If in org-mode, call `org-end-of-line' first."
     (add-to-history 'search-ring
                    (buffer-substring (region-beginning) (region-end)))
     (deactivate-mark))
-  (call-interactively 'isearch-backward))
+  (isearch-backward))
 
 (defun Tab (width)
   "Give me a function analagous to the Acme `Tab' command"