{"action":"created","issue":{"url":"https://api.github.com/repos/magnars/multiple-cursors.el/issues/176","repository_url":"https://api.github.com/repos/magnars/multiple-cursors.el","labels_url":"https://api.github.com/repos/magnars/multiple-cursors.el/issues/176/labels{/name}","comments_url":"https://api.github.com/repos/magnars/multiple-cursors.el/issues/176/comments","events_url":"https://api.github.com/repos/magnars/multiple-cursors.el/issues/176/events","html_url":"https://github.com/magnars/multiple-cursors.el/issues/176","id":52761103,"node_id":"MDU6SXNzdWU1Mjc2MTEwMw==","number":176,"title":"Pasting same text to all active cursors from text copied within Emacs.","user":{"login":"lawlist","id":3762134,"node_id":"MDQ6VXNlcjM3NjIxMzQ=","avatar_url":"https://avatars2.githubusercontent.com/u/3762134?v=4","gravatar_id":"","url":"https://api.github.com/users/lawlist","html_url":"https://github.com/lawlist","followers_url":"https://api.github.com/users/lawlist/followers","following_url":"https://api.github.com/users/lawlist/following{/other_user}","gists_url":"https://api.github.com/users/lawlist/gists{/gist_id}","starred_url":"https://api.github.com/users/lawlist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lawlist/subscriptions","organizations_url":"https://api.github.com/users/lawlist/orgs","repos_url":"https://api.github.com/users/lawlist/repos","events_url":"https://api.github.com/users/lawlist/events{/privacy}","received_events_url":"https://api.github.com/users/lawlist/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2014-12-23T17:57:14Z","updated_at":"2018-08-29T09:55:45Z","closed_at":null,"author_association":"NONE","body":"I often have multiple cursors that are active and then I switch buffers to grab something like a name or address that needs to be pasted to every active cursor.  Then, I switch back and paste.  This works with a listp argument to `yank` when copying text from an external application, because you have already modified `current-kill` to handle that situation.  My suggestion would be to implement something similar for pasting between buffers within Emacs.\n\nI have not looked at the current Emacs Trunk version of `yank`, but the October 1, 2014 version of Emacs Trunk is missing `(unless arg (setq arg 1))` at the outset of `yank`.  Here is a sample modification that I put together last night to better explain the issue in this thread:\n\n```\n(defun lawlist-yank (&optional arg)\n  (interactive \"*P\")\n  (unless arg (setq arg 1))\n  (setq yank-window-start (window-start))\n  (setq this-command t)\n  (push-mark (point))\n  (insert-for-yank\n    (lawlist-current-kill\n      (cond\n        ((listp arg)\n          arg)\n        ((eq arg '-)\n          -2)\n        (t\n          (1- arg) ))))\n  (if (consp arg)\n      (goto-char (prog1 (mark t)\n       (set-marker (mark-marker) (point) (current-buffer)))))\n  (if (eq this-command t)\n      (setq this-command 'yank))\n  (when (region-active-p)\n    (setq mark-active nil))\n  nil)\n\n(defun lawlist-current-kill (n &optional do-not-move)\n  (let ((interprogram-paste\n          (and\n            (equal n '(4))\n            interprogram-paste-function\n            (funcall interprogram-paste-function))))\n    (cond\n      (interprogram-paste\n        (let ((interprogram-cut-function nil))\n          (if (listp interprogram-paste)\n            (mapc 'kill-new (nreverse interprogram-paste))\n            (kill-new interprogram-paste)))\n        (mc/for-each-fake-cursor\n          (let* (\n              (kill-ring (overlay-get cursor 'kill-ring))\n              (kill-ring-yank-pointer (overlay-get cursor 'kill-ring-yank-pointer)) )\n            (if (listp interprogram-paste)\n                (mapc 'kill-new (nreverse interprogram-paste))\n              (kill-new interprogram-paste))\n            (overlay-put cursor 'kill-ring kill-ring)\n            (overlay-put cursor 'kill-ring-yank-pointer kill-ring-yank-pointer)))\n        (car kill-ring))\n      ((and (equal n '(4)) (not interprogram-paste))\n        (mc/for-each-fake-cursor\n          (let* (\n              (original-kill-ring (copy-list kill-ring))\n              (kill-ring (overlay-get cursor 'kill-ring))\n              (kill-ring-yank-pointer (overlay-get cursor 'kill-ring-yank-pointer)) )\n            (if (listp original-kill-ring)\n                (mapc 'kill-new (nreverse original-kill-ring))\n              (kill-new original-kill-ring))\n            (overlay-put cursor 'kill-ring kill-ring)\n            (overlay-put cursor 'kill-ring-yank-pointer kill-ring-yank-pointer)))\n        (car kill-ring))\n      (t\n            (or kill-ring \n              (let ((debug-on-quit nil))\n                (signal 'quit `(\"The kill-ring is empty.\"))))\n            (let ((ARGth-kill-element\n             (nthcdr (mod (- n (length kill-ring-yank-pointer))\n              (length kill-ring))\n               kill-ring)))\n        (unless do-not-move\n          (setq kill-ring-yank-pointer ARGth-kill-element)\n          (when (and yank-pop-change-selection\n               (> n 0)\n               interprogram-cut-function)\n            (funcall interprogram-cut-function (car ARGth-kill-element))))\n        (car ARGth-kill-element))))))\n```\n"},"comment":{"url":"https://api.github.com/repos/magnars/multiple-cursors.el/issues/comments/416895985","html_url":"https://github.com/magnars/multiple-cursors.el/issues/176#issuecomment-416895985","issue_url":"https://api.github.com/repos/magnars/multiple-cursors.el/issues/176","id":416895985,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNjg5NTk4NQ==","user":{"login":"magnars","id":265785,"node_id":"MDQ6VXNlcjI2NTc4NQ==","avatar_url":"https://avatars3.githubusercontent.com/u/265785?v=4","gravatar_id":"","url":"https://api.github.com/users/magnars","html_url":"https://github.com/magnars","followers_url":"https://api.github.com/users/magnars/followers","following_url":"https://api.github.com/users/magnars/following{/other_user}","gists_url":"https://api.github.com/users/magnars/gists{/gist_id}","starred_url":"https://api.github.com/users/magnars/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magnars/subscriptions","organizations_url":"https://api.github.com/users/magnars/orgs","repos_url":"https://api.github.com/users/magnars/repos","events_url":"https://api.github.com/users/magnars/events{/privacy}","received_events_url":"https://api.github.com/users/magnars/received_events","type":"User","site_admin":false},"created_at":"2018-08-29T09:55:45Z","updated_at":"2018-08-29T09:55:45Z","author_association":"OWNER","body":"Please check your `~/.emacs.d/.mc-lists.el` file for the command in question. At some point you have probably answered \"no\" to the question \"Do this for all cursors?\", landing the command in the `mc/cmds-to-run-once`-list. Move the command to the `mc/cmds-to-run-for-all` and evaluate the buffer to resolve this issue."}}
{"actor":{"display_login":"magnars"}}