]> git.earman.xyz Git - emacsinit.git/commitdiff
Remove unused defuns, cleanup point-mark exchange
authorrearman <rearman@r717.net>
Fri, 19 Sep 2025 16:06:38 +0000 (12:06 -0400)
committerrearman <rearman@r717.net>
Fri, 19 Sep 2025 16:06:38 +0000 (12:06 -0400)
No longer using transient-mark-mode, so no need to recreate the
functionality of it being disabled. Better defun for swappnig point
and mark when in transient-mark-mode.

re/re-bindings.el
re/re-editing-defuns.el

index f62a15c77222094d740c185842595acf2dfd0989..a1069da4bd0a34da2929b7a952b7b6d3a0522dad 100644 (file)
@@ -28,8 +28,6 @@
 (keymap-global-set "<remap> <downcase-word>" #'downcase-dwim) ; M-l
 (keymap-global-set "<remap> <upcase-word>" #'upcase-dwim) ; M-u
 (keymap-global-set "<remap> <keyboard-quit>" #'re/keyboard-quit) ; C-g works better
-(keymap-global-set "C-'" #'re/push-mark-no-activate)
-(keymap-global-set "M-'" #'re/jump-to-mark)
 (keymap-global-set "<remap> <exchange-point-and-mark>" #'re/exchange-point-and-mark-maybe-activate)
 
 ;; WayfindiƋ
index 3b79fd739310cfd4c67f5e8044369c4cc15a16e5..082316138568ac89779f300fe1a30d274aa58141 100644 (file)
@@ -135,28 +135,13 @@ If in org-mode, call `org-beginning-of-line' first."
   (save-some-buffers t)
   (kill-emacs nil t))
 
-(defun re/push-mark-no-activate ()
-  "Pushes `point' to `mark-ring' and does not activate the region.
-Equivalent to \\[set-mark-command] when \\[transient-mark-mode] is disabled.
-Taken from https://www.masteringemacs.org/article/fixing-mark-commands-transient-mark-mode"
-  (interactive)
-  (push-mark (point) t nil)
-  (message "Pushed mark to ring"))
-
-(defun re/jump-to-mark ()
-  "Jumps to the local mark, respecting the `mark-ring' order.
-This is the same as using \\[set-mark-command] with the prefix argument.
-Taken from https://www.masteringemacs.org/article/fixing-mark-commands-transient-mark-mode"
-  (interactive)
-  (set-mark-command 1))
-
-(defun re/exchange-point-and-mark-maybe-activate ()
+(defun re/exchange-point-and-mark-maybe-activate (arg)
   "Call `exchange-point-and-mark' but don't activate the region.
 Stolen from https://www.masteringemacs.org/article/fixing-mark-commands-transient-mark-mode"
-  (interactive)
-  (if (use-region-p)
-      (exchange-point-and-mark)
-    (exchange-point-and-mark t)))
+  (interactive "P")
+  (exchange-point-and-mark (if (and transient-mark-mode (not mark-active))
+                              (not arg)
+                            arg)))
 
 (defun re/keyboard-quit ()
   "Smarter version of `keyboard-quit'.