Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add meow-pop-to-global-mark #679

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions meow-command.el
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@
(meow--with-selection-fallback
(cond
((equal '(expand . join) (meow--selection-type))
(delete-indentation nil (region-beginning) (region-end)))

Check warning on line 279 in meow-command.el

View workflow job for this annotation

GitHub Actions / check (26.3, true)

delete-indentation called with 3 arguments, but accepts only 0-1
(t
(meow--prepare-region-for-kill)
(meow--execute-kbd-macro meow--kbd-kill-region)))))))
Expand All @@ -291,7 +291,7 @@
(meow--with-selection-fallback
(cond
((equal '(expand . join) (meow--selection-type))
(delete-indentation nil (region-beginning) (region-end)))

Check warning on line 294 in meow-command.el

View workflow job for this annotation

GitHub Actions / check (26.3, true)

delete-indentation called with 3 arguments, but accepts only 0-1
(t
(meow--prepare-region-for-kill)
(let ((s (buffer-substring-no-properties (region-beginning) (region-end))))
Expand Down Expand Up @@ -1564,6 +1564,16 @@
(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 Expand Up @@ -1885,3 +1895,3 @@

(provide 'meow-command)
;;; meow-command.el ends here
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
Loading