Skip to content

Instantly share code, notes, and snippets.

@mokrates
Created May 10, 2023 19:22
Show Gist options
  • Save mokrates/6dd6b5c2ba7817c44eb34f99ea571549 to your computer and use it in GitHub Desktop.
Save mokrates/6dd6b5c2ba7817c44eb34f99ea571549 to your computer and use it in GitHub Desktop.
(defun mo-compare-killring ()
"copy some text to kill-ring, set point to the beginning of similar looking text, run this function.
The cursor will be set to the first difference"
(interactive)
(let ((s (current-kill 0 t))
(pos 0))
(while (and (< pos (length s))
(equal (aref s pos) (char-after (point))))
(forward-char)
(incf pos))
(if (< pos (length s))
(message "clipboard NOT completely found!")
(message "clipboard equal to text"))))
@knollet
Copy link

knollet commented May 11, 2023

cl-incf statt incf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment