spacemacs icon indicating copy to clipboard operation
spacemacs copied to clipboard

lagging on close while saving clipboard

Open aurabindo opened this issue 7 years ago • 14 comments

Description :octocat:

gui lagging on close while saving clipboard

Reproduction guide :beetle:

  • Start Emacs
  • Do a clipboard operation (copy/paste)
  • Exit [SPACE q q]

I am using xfce4-clipman as the clipboard manager.

Someone already asked about the exact problem on SO:

https://stackoverflow.com/questions/45389618/spacemacs-gui-lagging-on-close-while-saving-clipboard

Observed behaviour: :eyes: :broken_heart:

Shows message Saving Clipboard to X Clipboard Manager and hangs.

Expected behaviour: :heart: :smile:

Close without much fuzz.

System Info :computer:

  • OS: Debian 9
  • Emacs: 25.1.1
  • Spacemacs: 0.200.9
  • Spacemacs branch: develop (rev. 0e06bba)
  • Graphic display: t
  • Distribution: spacemacs
  • Editing style: vim
  • Completion: helm
  • Layers:
(markdown helm emacs-lisp)
  • System configuration features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11

aurabindo avatar Oct 03 '17 11:10 aurabindo

I've also noticed this in the past but for some reason it magically went away. Nowadays I use the xclip package for clipboard support inside a terminal so you can try it out, maybe it affects GUI as well.

Install it from you package manager:

sudo apt install xclip

Have:

dotspacemacs-additional-packages '(xclip)

And in your dotspacemacs/user-config:

(xclip-mode 1)
(turn-on-xclip)

sdwolfz avatar Oct 03 '17 12:10 sdwolfz

@sdwolf Adding the configuration suggested actually makes it even worse - now spacemacs hangs when I do a block copy (Select multiple lines/characters and hit y). But single line copy's ( y y ) are working fine.

My modified my spacemacs user config to look like the below like you suggsted:

[snip]
   ;; packages, then consider creating a layer. You can also put the
   ;; configuration in `dotspacemacs/user-config'.
   dotspacemacs-additional-packages '(xclip)
   ;; A list of packages that cannot be updated.
   dotspacemacs-frozen-packages '()
[snip]
(defun dotspacemacs/user-config ()
  "Configuration for user code:
This function is called at the very end of Spacemacs startup, after layer
configuration.
Put your configuration code here, except for variables that should be set
before packages are loaded."
  (xclip-mode 1)
  (turn-on-xclip)
  )

aurabindo avatar Oct 04 '17 14:10 aurabindo

OK, never mind that, if it makes it worse for you then remove it.

You could try a newer version of emacs, I see you use 25.1.1 while the latest is 25.3. Debian does not have that version in the repositories but you can try installing from source:

# First remove the current installed emacs
sudo apt purge emacs

git clone https://github.com/emacs-mirror/emacs.git ~/Projects/emacs
cd ~/Projects/emacs
git checkout emacs-25.3
./autogen.sh
./autogen.sh git
./configure CFLAGS='-O2 -g3' --program-transform-name='s/^ctags$/ctags.emacs/'
make
sudo make install

If you need to install extra packages autogen.sh and configure will tell you what you need in the input. You just have to read it carefully.

I am using the emacs-26 branch, so if you feel adventurous you could try that.

sdwolfz avatar Oct 05 '17 06:10 sdwolfz

@sdwolf Just tried on emacs 25.3 and I'm glad to report that emacs manages to exit gracefully after a few seconds. Although it does wait some time (~3 seconds) trying to Saving Clipboard to X Clipboard Manager

aurabindo avatar Oct 06 '17 10:10 aurabindo

I am getting this problem on emacs 25.3.1, running in XWayland

fophillips avatar Dec 09 '17 17:12 fophillips

I also get this problem on emacs 25.3.1 on Manjaro XFCE (Arch). Id like to keep xfce clipboard manager. I get this problem with plain emacs and spacemacs

glor avatar Apr 12 '18 11:04 glor

(setq x-select-enable-clipboard-manager nil)

mfiano avatar May 14 '18 00:05 mfiano

The problem happened recently and has never happened before. I found emacs quit normally when clipman (xfce4 default clipboard manager) was closed before.

(setq x-select-enable-clipboard-manager nil) also solved my problem, but clipboard operation need additional settings.

extendswind avatar Sep 30 '18 13:09 extendswind

I see this with plain Emacs installed from Debian repo. and added MELPA htmlize ampl-theme installed without any other customization.

zoechi avatar Dec 13 '19 12:12 zoechi

I still have the same issue, and (setq x-select-enable-clipboard-manager nil) cannot solve the problem.

My system info is:

  • OS: gnu/linux
  • Emacs: 27.2
  • Spacemacs: 0.999.0
  • Spacemacs branch: develop (rev. cdf5045)

jia-j-chen avatar Oct 22 '22 10:10 jia-j-chen

I get this with emacs 26.3 on Ubuntu 20.04 LTS.

unhandyandy avatar Oct 24 '22 16:10 unhandyandy

Can confirm it still exists on Debian 11 Emacs 27.1 with develop rev cdf5045. Updated till rev 0acf65c still there.

viktorchukhantsev avatar Nov 11 '22 06:11 viktorchukhantsev

Upgraded till latest available version and this lag still exists. It's something with interactive function e.g.

(defun clipboard-copy ()
  "Copies selection to clipboard."
  (interactive)
    (if (region-active-p)
      (progn
        (shell-command-on-region
         (region-beginning) (region-end)
         ". ~/.zshrc; clipcopy")
        (message "Copied region to clipboard!")
        (deactivate-mark)
        )
      (message "No region active; can't copy to clipboard!")))

System Info :computer:

  • OS: gnu/linux
  • Emacs: 28.2
  • Spacemacs: 0.999.0
  • Spacemacs branch: develop (rev. be9b1c89b)
  • Graphic display: nil
  • Running in daemon: nil
  • Distribution: spacemacs
  • Editing style: vim
  • Completion: helm
  • Layers:
(auto-completion better-defaults emacs-lisp git helm lsp markdown multiple-cursors org spell-checking syntax-checking version-control treemacs latex plantuml go javascript prettier docker python yaml typescript ruby-on-rails yaml sql ruby html csv)
  • System configuration features: ACL DBUS GMP GNUTLS GPM JSON LCMS2 LIBXML2 NATIVE_COMP NOTIFY INOTIFY PDUMPER SECCOMP SOUND THREADS XIM ZLIB

viktorchukhantsev avatar Nov 29 '22 07:11 viktorchukhantsev

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!

github-actions[bot] avatar May 01 '24 16:05 github-actions[bot]