syl20bnr / spacemacs

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!
http://spacemacs.org
GNU General Public License v3.0
23.57k stars 4.9k forks source link

lagging on close while saving clipboard #9691

Open aurabindo opened 6 years ago

aurabindo commented 6 years ago

Description :octocat:

gui lagging on close while saving clipboard

Reproduction guide :beetle:

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:

sdwolfz commented 6 years ago

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)
aurabindo commented 6 years ago

@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)
  )
sdwolfz commented 6 years ago

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.

aurabindo commented 6 years ago

@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

fophillips commented 6 years ago

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

glor commented 6 years ago

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

mfiano commented 6 years ago

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

extendswind commented 5 years ago

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.

zoechi commented 4 years ago

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

jia-j-chen commented 1 year ago

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

My system info is:

unhandyandy commented 1 year ago

I get this with emacs 26.3 on Ubuntu 20.04 LTS.

viktorchukhantsev commented 1 year ago

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

viktorchukhantsev commented 1 year ago

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:

github-actions[bot] commented 2 months ago

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!