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

meow--select: don't spam mark-ring #589

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 7 additions & 2 deletions meow-command.el
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@
(meow--cancel-selection))
(let ((sel-type (car selection))
(mark (cadr selection))
(pos (caddr selection)))
(pos (caddr selection))
to-push)
(if meow--selection
(unless (equal meow--selection (car meow--selection-history))
(push meow--selection meow--selection-history))
Expand All @@ -73,7 +74,11 @@
meow--selection-history))
(goto-char (if backward mark pos))
(when sel-type
(push-mark (if backward pos mark) t t)
(setq to-push (if backward pos mark))
;; set the mark; push it to the mark ring only if we're moving it
(if (eq to-push (mark t))
(set-mark to-push)
(push-mark to-push t t))
(setq meow--selection selection))))

(defun meow--select-without-history (selection)
Expand Down Expand Up @@ -256,7 +261,7 @@
(meow--with-selection-fallback
(cond
((equal '(expand . join) (meow--selection-type))
(delete-indentation nil (region-beginning) (region-end)))

Check warning on line 264 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 @@ -271,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)
(let ((s (buffer-substring-no-properties (region-beginning) (region-end))))
Expand Down Expand Up @@ -1314,7 +1319,7 @@
;;; VISIT and SEARCH
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defun meow-search (arg)

Check warning on line 1322 in meow-command.el

View workflow job for this annotation

GitHub Actions / check (28.2, true)

docstring wider than 80 characters
" Search and select with the car of current `regexp-search-ring'.

If the contents of selection doesn't match the regexp, will push it to `regexp-search-ring' before searching.
Expand Down Expand Up @@ -1377,7 +1382,7 @@
(or (funcall func text nil t 1)
(funcall func-2 text nil t 1)))))

(defun meow-visit (arg)

Check warning on line 1385 in meow-command.el

View workflow job for this annotation

GitHub Actions / check (28.2, true)

docstring wider than 80 characters
"Read a string from minibuffer, then find and select it.

The input will be pushed into `regexp-search-ring'. So
Expand Down Expand Up @@ -1779,8 +1784,8 @@
(cmd (key-binding key)))
(if-let ((dispatch (and (commandp cmd)
(get cmd 'meow-dispatch))))
(describe-key (kbd dispatch) buffer up-event)

Check warning on line 1787 in meow-command.el

View workflow job for this annotation

GitHub Actions / check (27.1, true)

describe-key called with 3 arguments, but accepts only 1-2
(describe-key key-list buffer up-event)))

Check warning on line 1788 in meow-command.el

View workflow job for this annotation

GitHub Actions / check (27.1, true)

describe-key called with 3 arguments, but accepts only 1-2

Check warning on line 1788 in meow-command.el

View workflow job for this annotation

GitHub Actions / check (27.1, true)

describe-key called with 3 arguments, but accepts only 1-2
;; for mouse events
(describe-key key-list buffer up-event)))

Expand Down Expand Up @@ -1811,3 +1816,3 @@

(provide 'meow-command)
;;; meow-command.el ends here