You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
Damien Cassou d5fc55bc82
* Makefile: Use released package-lint
4 years ago
.gitignore Use makel 4 years ago
.gitlab-ci.yml Upgrade Emacs requirement to at least 25 4 years ago
COPYING Initial version 5 years ago
Makefile * Makefile: Use released package-lint 4 years ago
NEWS * NEWS: Add file 4 years ago Add a global minor mode (idea from Stefan Monnier) 4 years ago
gpastel.el * gpastel.el: Release v0.5.0 4 years ago


<p> <a href=""> <img alt="MELPA Stable" src=""/> </a>

<a href=""> <img alt="MELPA" src=""/> </a>

<a href=""> <img alt="pipeline status" src="" /> </a> </p>


GPaste is a clipboard management system. The Emacs package gpastel makes sure that every copied text in GPaste is also in the Emacs kill-ring.

Emacs has built-in support for synchronizing the system clipboard with the kill-ring (see the variables interprogram-paste-function and save-interprogram-paste-before-kill). This support is not optimal because it makes the kill-ring only contain the last text of consecutive copied texts. In other words, a user cannot copy multiple pieces of text from an external application without going back to Emacs in between.

On the contrary, gpastel supports this scenario by hooking into the GPaste clipboard manager. This means that the kill-ring will always contain everything the user copies in external applications, not just the last piece of text.

Additionally, when using EXWM (the Emacs X Window Manager), gpastel makes it possible for the user to use the kill-ring from external applications.


Add the following to your initialization file:

  (add-to-list 'load-path "~/.emacs.d/lib/gpastel/")

You also have to tell gpastel to start listening for GPaste events. If you are using EXWM, add gpastel-mode to exwm-init-hook. Otherwise, just add this line to your initialization file:



There is nothing more to do than copying text the normal way. All copied texts should appear in the Emacs kill-ring now.

For EXWM users

If you use EXWM and you want to access the kill-ring from any application (instead of the less powerful system clipboard), I recommend you either install and configure counsel or browse-kill-ring. Then, you can add one of the following two configuration snippets to your initialization file.

For EXWM+counsel users

Add the following to your initialization file:

  (exwm-input-set-key (kbd "M-y") #'my/exwm-counsel-yank-pop)

  (defun my/exwm-counsel-yank-pop ()
    "Same as `counsel-yank-pop' and paste into exwm buffer."
    (let ((inhibit-read-only t)
          ;; Make sure we send selected yank-pop candidate to
          ;; clipboard:
          (yank-pop-change-selection t))
      (call-interactively #'counsel-yank-pop))
    (when (derived-mode-p 'exwm-mode)
      (exwm-input--set-focus (exwm--buffer->id (window-buffer (selected-window))))
      (exwm-input--fake-key ?\C-v)))
For EXWM+browse-kill-ring users

Ram Krishnan gives us the following piece of code for browse-kill-ring users:

  (define-advice browse-kill-ring-insert-and-highlight
      (:around (old-function str) exwm-paste)
    "Paste the selection appropriately in exwm mode buffers."
    (if (not (derived-mode-p 'exwm-mode))
        (funcall old-function str)
      (kill-new str)
      (exwm-input--fake-key ?\C-v)))


See COPYING. Copyright (c) 2018 Damien Cassou.

<a href=""> <img alt="Donate using Liberapay" src=""> </a>