From 37990e53236fa18a70152fa740f6ffcec35807de Mon Sep 17 00:00:00 2001 From: Gabriel Santos <172639817+gs-101@users.noreply.github.com> Date: Sun, 1 Dec 2024 10:03:29 +0000 Subject: [PATCH] Add meow-pop-to-global-mark (#679) --- meow-command.el | 10 ++++++++++ meow-var.el | 3 +++ 2 files changed, 13 insertions(+) diff --git a/meow-command.el b/meow-command.el index 448b59d..9120ca0 100644 --- a/meow-command.el +++ b/meow-command.el @@ -1564,6 +1564,16 @@ Before jump, a mark of current location will be created." (setq mark-ring (append mark-ring (list (point-marker))))) (pop-to-mark-command)) +(defun meow-pop-to-global-mark () + "Alternative command to `pop-global-mark'. + +Before jump, a mark of current location will be created." + (interactive) + (meow--cancel-selection) + (unless (member last-command '(meow-pop-to-global-mark meow-pop-to-mark meow-unpop-to-mark)) + (setq global-mark-ring (append global-mark-ring (list (point-marker))))) + (meow--execute-kbd-macro meow--kbd-pop-global-mark)) + (defun meow-back-to-indentation () "Back to indentation." (interactive) diff --git a/meow-var.el b/meow-var.el index 2debe76..922cb23 100644 --- a/meow-var.el +++ b/meow-var.el @@ -533,6 +533,9 @@ Allows support of modes that define their own equivalent of `insert'.") Has a structure of (sel-type point mark).") +(defvar meow--kbd-pop-global-mark "C-x C-@" + "KBD macro for command `pop-global-mark'.") + ;;; Hooks (defvar meow-switch-state-hook nil