Skip to content

Commit

Permalink
Add meow-pop-to-global-mark (#679)
Browse files Browse the repository at this point in the history
  • Loading branch information
gs-101 authored Dec 1, 2024
1 parent 74fc0e5 commit 37990e5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
10 changes: 10 additions & 0 deletions meow-command.el
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions meow-var.el
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 37990e5

Please sign in to comment.