Questions tagged [clipboard]
The clipboard tag has no usage guidance.
51
questions
0
votes
1
answer
24
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 ...
1
vote
2
answers
83
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 ...
1
vote
0
answers
25
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 ...
2
votes
2
answers
112
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) ...
1
vote
1
answer
347
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 ...
1
vote
1
answer
228
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,...
4
votes
0
answers
507
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....
0
votes
0
answers
73
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 ...
0
votes
2
answers
416
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.
...
2
votes
3
answers
229
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 ...
0
votes
1
answer
210
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 ...
1
vote
1
answer
137
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 ...
1
vote
2
answers
635
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. ...
1
vote
1
answer
83
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 ...
0
votes
1
answer
114
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 ...
2
votes
1
answer
266
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....
2
votes
1
answer
184
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?
2
votes
3
answers
173
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, ...
2
votes
1
answer
742
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 ...
1
vote
0
answers
20
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: ...
5
votes
1
answer
587
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 ...
0
votes
1
answer
173
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 ...
3
votes
2
answers
694
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-...
1
vote
1
answer
257
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 ?
4
votes
0
answers
122
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 ...
1
vote
1
answer
465
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 ...
1
vote
2
answers
2k
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 ...
2
votes
1
answer
670
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 ...
1
vote
2
answers
7k
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 ...
1
vote
1
answer
516
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 ...
2
votes
2
answers
186
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 ...
2
votes
1
answer
177
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 ...
5
votes
0
answers
166
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 ...
4
votes
0
answers
849
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 ...
0
votes
1
answer
981
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 ...
0
votes
3
answers
429
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 ...
3
votes
2
answers
669
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 ...
2
votes
1
answer
1k
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 ...
7
votes
1
answer
580
views
Yank a column of text copied from the clipboard
I often seem to want to copy paste multiple columns, for example, I paste one column
line one
line two
line three
Now I'd like to be able to yank another column behind it. Assuming my kill buffer ...
0
votes
1
answer
44
views
One directional access to the clipboard (OS to Emacs: no, Emacs to OS: yes)
Is it possible that Emacs ignores the system clipboard?
I mean when outside of Emacs I copy something, Emacs ignores it.
But not vice-versa, i.e., I would like to be able to have the access to the ...
21
votes
1
answer
5k
views
evil-mode visual selection copies text to clipboard automatically
Setup:
GUI version GNU Emacs 25.0.50.1 (x86_64-w64-mingw32) of 2015-07-25 on KAEL
Compiled from EmacsW64.
Package Evil, using the latest version of Evil from MELPA
Windows 7 x64 bit.
Situation:
...
3
votes
0
answers
652
views
disabling evil auto copying of selection to clipboard on frame focus
I'm seeing interesting behavior when I try to copy text between other applications and emacs on arch linux, when using evil-mode.
Whenever I have a region selected in emacs, and then click to focus ...
8
votes
3
answers
810
views
How to push system clipboards to kill ring contents at real-time when I copy outside emacs?
I noticed that when I copy thing outside of Emacs, the thing does not appear to kill ring immediately except I yank it to Emacs. If I copy twice, only the last copy can be got by yank.
Sometimes, I ...
4
votes
2
answers
974
views
how to push kill-ring contents onto system pasteboard (clipboard)?
I use the brilliant answer from my previous question to copy selected regions of text from Emacs onto my system pasteboard (i.e. the OSX clipboard).
But some functions (e.g. gist-buffer) push output ...
18
votes
2
answers
12k
views
Completely disable all auto-indentation
How do I completely disable all auto-indentation in Emacs? I need to disable it at least for Fundamental mode, but I'm fine with it being disabled globally for the current session.
Please read the ...
2
votes
0
answers
47
views
Pasting unicode from external applications with mouse wheel on Unix
On upgrade from Emacs 24.3.1 to Emacs 25.0.50 pasting unicode from external applications with mouse wheel appears broken.
I start emacs -Q and select e.g. title of https://en.wikipedia.org/wiki/...
6
votes
1
answer
523
views
How can I clear the contents of the clipboard before calling clipboard-kill-region?
I use clipboard-kill-region to copy contents from Emacs to other programs. But sometimes, it copies the same content twice into the clipboard.
It looks like,
/home/user/.emacs/home/user/.emacs
when ...
2
votes
1
answer
155
views
How to add killed region to X Window primary selection
I use Emacs in a terminal window on Linux, using the --no-window-system option.
Prior to version 24, if I clicked the middle mouse button in another application window, it would paste the last-killed ...
0
votes
0
answers
509
views
Kill ring not synchronizing with clipboard in Windows
I have been using Emacs 24 on Windows 7 for almost a year without any issues. But recently, kill-ring in my Emacs has stopped synchronizing with clipboard (actually whatever I copy from within Emacs ...
26
votes
2
answers
4k
views
Add operating system clipboard to kill ring
Often I find myself copying a code snippet into my operating system's clipboard from the internet. Then, I take the following simple steps:
Switch to my Emacs window
Find the place where I want to ...