Skip to main content

Questions tagged [clipboard]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
2 answers
46 views

How do I write a function to copy a region to the MacOS clipboard?

I'd like to be able to mark a region in a text buffer, hit an F-key, and have the contents of the region copied into the MacOS clipboard. From the shell you can do this by piping the text into the ...
Chap's user avatar
  • 187
2 votes
2 answers
80 views

Copy mu4e link to clipboard

I would like to be able to copy a link from an mu4e email message to my system's clipboard. There seem to be two types of links in mu4e messages: messages where the URLs are numbered [1] etc.; ...
AstroFloyd's user avatar
0 votes
1 answer
67 views

(Org mode) Copy to clipboard without asterisks and tags?

Do you know any "easy" way to copy to clipboard a region from an org-mode document without asterisks and tags: * Header :tag1: text so it would appear in the clipboard as: Header text
Daniel Krajnik's user avatar
0 votes
1 answer
166 views

How can I get the org-roam ID and title/headline into clipboard?

I take content from nodes of my org-roam database and paste this into e.g. an email. For backtracing the content I would like to have certain information copied to my clipboard to insert it into the ...
lukascbossert's user avatar
0 votes
1 answer
59 views

Is there a cross platform way of accessing the GUI clipboard from emacs lisp?

I run emacs with a common configuration on osx and linux. I have some custom functions that need to get access to the GUI clipboard. I find interacting with the clipboard a bit of pain - so I've ...
Att Righ's user avatar
  • 775
0 votes
1 answer
24 views

Does kill-new take some time to put a string on the system clipboard?

I have an emacs function which calls kill-new to put a string onto the Windows system clipboard and then immediately invokes an external script to paste that string from the clipboard to an other ...
Tom's user avatar
  • 1,270
0 votes
1 answer
153 views

pasting screenshots into org, on Windows

I've got the following code, which creates a filename, inserts a link to it at point, and should also save the current image in clipboard to disk at that filename/location. It used to work, but ...
Jonathan Sahar's user avatar
0 votes
1 answer
147 views

How do I send docx formatted text from org-mode to the clipboard with pandoc?

I'd like to use send highlighted text from .org documents to the clipboard in the docx format. I've tried the following: (defun region-to-clip () "Copies region between point and ...
Matt Nolan's user avatar
0 votes
1 answer
869 views

How can I copy the text to the clipboard while using spacemacs?

I know that on emacs I can install the xclip package in order to be able to copy text to the system clipboard... With the xclip package installed and adding the following to my .emacs file, I can copy ...
raylight's user avatar
  • 237
2 votes
0 answers
479 views

emacs-pgtk for WSL2 - identification and clipboard issues

I installed emacs-pgtk version 29.0.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.16.0) from the git repo following these instructions with ./configure --with-native-...
hatmatrix's user avatar
  • 1,096
0 votes
2 answers
247 views

How to paste all images into emacs org-mode running in WSL in one directory

I got How to paste images into Emacs org-mode running in Windows Subsystem for Linux running, so I can paste images in emacs org-mode, but I would like to get all images in the same directory, f.e. ~/...
KenDJMN's user avatar
0 votes
2 answers
108 views

How to add a hook to save things on kill-ring (or clipboard ring) before a frame is deleted?

Context: I have been using an interesting software called Emacs Anywhere. It helps me bring emacs keybindings for stuff like this (editing text for a question on Stack Exchange). Overall, the software ...
Pedro Delfino's user avatar
0 votes
1 answer
111 views

Get MIME file-type of current temporary buffer without using a temporary file

I have this function: (defun save-binary-content (binary path) (let ((coding-system-for-write 'no-conversion)) (with-temp-buffer (toggle-enable-multibyte-characters) (set-buffer-file-coding-system ...
cidra's user avatar
  • 139
9 votes
3 answers
7k views

Pasting images from clipboard into Orgmode

I have seen some posts on this but I decided to ask anyway since this is an important feature many users are requesting: the ability to copy an image from eg., Chrome and paste it into Emacs Orgmode ...
Emmanuel Goldstein's user avatar
1 vote
0 answers
73 views

How to copy displayed ellipsis when buffer content is folded?

I have JSON files in which I am folding away some subnodes with the hideshow mode. This works reasonably well. Now I want to create a new file or buffer with the folded content. For example, my ...
halloleo's user avatar
  • 1,345
3 votes
2 answers
343 views

Deleting words while preserving clipboard

Is there a way to keep the clipboard contents when deleting entire words with M-DEL? For instance, I'd like to delete a word (M-DEL) and then paste (C-y) what I had previously copied (with ctrl+c) ...
Ricky Robinson's user avatar
3 votes
1 answer
1k views

How to copy commit hash from Magit status buffer?

After I open a Magit status buffer and make a commit, I commonly also want to copy that commit's hash (the shortened version) to my clipboard to post somewhere else. I can't work out how this should ...
SLesslyTall's user avatar
1 vote
1 answer
322 views

Cannot use `pbpaste` in Emacs to paste Chinese characters

I'm using macOS. I tried using the following command to paste from clipboard in Emacs(started with emacs -Q) (call-process "/usr/bin/pbpaste" nil t nil) It works fine for English characters,...
Searene's user avatar
  • 499
4 votes
0 answers
1k views

Pasting images into Org

I'd like to paste images from the system clipboard into an Org file. Emacs should write the clipboard content to a suitable file (likely an attachment) and insert a suitable link (see https://orgmode....
Nova's user avatar
  • 1,119
0 votes
0 answers
154 views

How can I remove clipboard from being the default register?

I'm using emacs with evil keybindings (specifically spacemacs). The default behavior of the paste command p is to paste in the clipboard, and default behavior of the delete command d is to put the ...
Peeyush Kushwaha's user avatar
2 votes
2 answers
1k views

Possible to access the second-last clipboard contents (clipboard history)

Is there a way to access the second last value of the clipboard in Emacs? I assume it's possible to make this work within Emacs. Intercept the copy function. Read the clipboard and add it to a list. ...
ideasman42's user avatar
  • 8,856
2 votes
3 answers
557 views

How copy current line to the clipboard?

This Emacs Wiki page says: ‘C-a C-SPC C-e M-w’ copies the current line without the newline. But it doesn't work to me. I'm using Emacs 26. Is there some other shortcut? P.S. I use CUA keys in my ...
a_subscriber's user avatar
  • 4,174
0 votes
1 answer
306 views

Running Emacs through X2Go, the bidirectional clipboard does not work, even though it works for other programs

Being in home-office due to the Corona outbreak, I am using Emacs and other programs through X2Go. I am also running a terminal through GNU Screen in a MinTTY window, because scrolling the terminal ...
kdb's user avatar
  • 1,571
1 vote
1 answer
272 views

Copy to PRIMARY selection in command

I'm a novice in Lisp, so I feel like I'm missing something very basic here. My intention was to create a function/shortcut to remove all whitespace and newline chars from the selected text and copy ...
knusprjg's user avatar
2 votes
2 answers
1k views

How to save clipboard or (car kill-ring) as string

OS Debian GNU/Linux 7 emacs-24.3 I want to save the content of the clipboard or the last item of the kill-ring (depending whats newer) as a string so that I can do stuff with it in a eLisp function. ...
Peter_LE_82's user avatar
1 vote
1 answer
108 views

xclip-mode returns "Unknown upattern" and does not work

The command M-x xclip-mode returns the following info in *Messages*: Eager macro-expansion failure: (error "Unknown upattern `(quote pbpaste)'") [2 times] Xclip mode enabled I cannot yank text from ...
purplezzh's user avatar
0 votes
1 answer
130 views

xclip fails to set selection when using tramp

I use Emacs in the terminal (emacs -nw) and xclip.el for synchronising the kill ring with the X clipboard. Under normal circumstances this works fine, but when visiting buffers with tramp xclip is not ...
Ian Mackinnon's user avatar
2 votes
1 answer
435 views

"File error" when using xclip

To enable copy and paste between X11 and emacs in terminal, I installed xclip via M-x package-install. There is xclip-1.4 in ~/.emacs.d/ with the following files: xclip-autoloads.el xclip.el xclip....
purplezzh's user avatar
2 votes
1 answer
303 views

How to retrieve the date under the cursor in emacs calendar as the format day.month.year like 15.07.2018

Is there a way to retrieve the date under the cursor in emacs calendar as the format day.month.year like 05.07.2018 as a clipboard content?
Name's user avatar
  • 7,905
2 votes
3 answers
187 views

adhoc emacs Elisp command to send emacs clipboard text to osx clipboard

When you press 'y' (elfeed-search-yank) in an elfeed-search buffer, the selected entry's permalink url is copied to the emacs clipboard. I don't have any automatic clipboard sync packages installed, ...
american-ninja-warrior's user avatar
2 votes
1 answer
871 views

How to copy into mintty xterm clipboard from terminal emacs

My host machine is Windows, but I'm working in Linux virtualbox machine over ssh from mintty in MSYS2 environment. As you may know, in mintty you copy via C-insert and paste via C-S-insert. When I ssh ...
sandric's user avatar
  • 1,271
1 vote
0 answers
21 views

flyspell inserts clipboard on top of correction

for me flyspell is broken (or at least the default setup of it) in all versions of Emacs from 24.x - 25.x, running on OpenSuSE Leap 42.3 within KDE 5.8.7 Plasma Desktop. The behavior is as follows: ...
Mark's user avatar
  • 113
6 votes
1 answer
771 views

saving clipboard takes forever on quit

When closing spacemacs, I get the message "Saving clipboard to x clipboard manager...". The saving process ends up taking so much time that I have to kill emacs from the terminal. How can I disable ...
Piglet's user avatar
  • 156
0 votes
1 answer
207 views

evil "exchange-with-kill-ring"-operator?

I often find myself wanting to exchange some text object with whatever's currently in CLIPBOARD (not necessarily in Emacs' kill-ring, when I copy from other programs). But of course when I do ...
unhammer's user avatar
  • 1,169
3 votes
2 answers
1k views

Copying a rectangular selection to system clipboard

Does anyone know a command or somtething to copy an rectangular selection (as with C-x r M-w / copy-rectange-as-kill) and put the killed rectangle into the system clipboard like with the kill-ring-...
Pierre Téchoueyres's user avatar
1 vote
1 answer
342 views

How can I use magit to diff some text with my clipboard?

I see others doing this in there IDEs is there a way to highlight a file or some text in a file and diff it with whats in my clipboard/kill-ring ?
Oly's user avatar
  • 593
4 votes
0 answers
177 views

copy to clipboard without overwriting kill ring

I'm looking for a way to copy to clipboard from emacs without passing through the kill-ring, moving the marker or using the mouse. If I use x-select-enable-primary and x-select-enable-clipboard, I can ...
user2141046's user avatar
1 vote
1 answer
514 views

Handle long lines while pasting from clipboard without freezing emacs

I have a lengthy xml output from a rest endpoint, I copied if from chrome dev tools to clipboard and on pasting it into an org mode buffer inside an xml source block freezes emacs for a while. I ...
tutysara's user avatar
1 vote
2 answers
3k views

copy paste from/to GUI Emacs not working -- Windows 7

I have an issue with copy and paste from or to Emacs (GUI); as precised in the title, I'm using Windows 7. The Emacs version is 25.1.1 kill and yank are working properly though ; to copy or paste, I ...
loukios's user avatar
  • 835
2 votes
1 answer
950 views

How to send *shell* stdout directly to kill-ring?

Suppose that I have a *shell* buffer (i.e. a subordinate shell, started with M-x shell). Suppose also that at this shell's prompt, I can execute some command foo that sends some output to stdout. I ...
kjo's user avatar
  • 3,257
2 votes
2 answers
8k views

Paste Windows clipboard with Shift-Insert but not by yanking

I am using Emacs 24.4 on Windows 10. I only ever use it in -nw (no-window) mode. I would like Emacs to paste from the Windows clipboard only on Shift-Insert and not on yank (Ctrl-y). I have tried ...
rlandster's user avatar
  • 225
1 vote
1 answer
524 views

Clipboard sharing broken in OS X Sierra

Just upgraded to Sierra, and if I try to copy or paste text, nothing goes through. Has anyone else experienced this problem? Any way to debug the prolem? Apparently Sierra also broke copy/paste in ...
Amelio Vazquez-Reina's user avatar
2 votes
2 answers
201 views

How to avoid double M-y with system clipboard integration in the terminal

I added Mac clipboard integration to my emacs -nw using the following code, adapted from here: (defun copy-from-osx () (shell-command-to-string "pbpaste")) (defun paste-to-osx (text &optional ...
Resigned June 2023's user avatar
2 votes
1 answer
232 views

How to prevent the active region from setting the primary selection?

After switching to 24.5.11 from some ancient version, Emacs started to spam my primary selection: Whenever I mark a region, or even move the point using e.g. arrow keys when the mark is active, a new ...
maaartinus's user avatar
5 votes
0 answers
233 views

Emacs: mark contents as type image in copy to clipboard

When using pdf-tools (https://github.com/politza/pdf-tools) I'd like to be able to select and area and copy it to the clipboard as an image, so as to insert into other applications. Selecting is easy ...
Ramon Diaz-Uriarte's user avatar
4 votes
0 answers
955 views

Emacs takes a very long time to read/save to the clipboard

Sometimes emacs takes a very long time (+ 30 seconds) to read from or save to the system (Linux) clipboard. The entire emacs session hangs while it does this and I can't cancel it with C-g or ESC ESC ...
Alex's user avatar
  • 1,048
0 votes
1 answer
1k views

Copy-text-to-clipboard-link

I would like to copy a defined text-link to the clipboard by mouse-1 or C-c,C-o. Something like file+sys: that just does not open the file it should copy the following text to the clipboard. Is a ...
Jens Lange's user avatar
0 votes
3 answers
513 views

Change dd command in evil mode to not write to clipboard

I would like to use normal modes commands like d c x etc without the content being copied to clipboard. I want to make emacs so that only y command will write anything to the clipboard. Other ...
meain's user avatar
  • 103
4 votes
2 answers
800 views

Pasting Text from Clipboard - why ^M instead of linebreaks?

I'm using some VBA scripts which copy Text in MS Outlook from an e-mail message and send it to the clipboard. If I then paste the clipboard content with Ctrl-Y in Emacs 24.5.1 in Windows 7, the ...
p.m's user avatar
  • 153
3 votes
1 answer
2k views

Clipboard manager will not work in terminal Emacs

Emacs 25.1.50, GTK+ version 3.18.9 on GNU/Linux, version 4.4. Gnome-terminal as xterm terminal emulator. When using clipboard (as in, I copy some text from my operating system/browser), and paste it ...
ReneFroger's user avatar
  • 3,890