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.67k stars 4.89k forks source link

Can't paste from clipboard over a visual selection #13554

Closed JonatanSahar closed 3 years ago

JonatanSahar commented 4 years ago

Hi, Whenever I copy text from outside of spacemacs and then visual-select a word and hit "p", I get a message saying "indenting region....done", and the visual selection disappears - but the text is not pasted. If I press "p" again, the text that was visually-selected before gets pasted... Any Ideas on how to address it? Here is my .spacemacs (minus the parts that are unaltered from the template):

;; -*- mode: emacs-lisp; lexical-binding: t -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.

(defun dotspacemacs/layers ()
  "Layer configuration:
This function should only modify configuration layer settings."
  (setq-default
   ;; Base distribution to use. This is a layer contained in the directory
   ;; `+distribution'. For now available distributions are `spacemacs-base'
   ;; or `spacemacs'. (default 'spacemacs)
   dotspacemacs-distribution 'spacemacs

   ;; Lazy installation of layers (i.e. layers are installed only when a file
   ;; with a supported type is opened). Possible values are `all', `unused'
   ;; and `nil'. `unused' will lazy install only unused layers (i.e. layers
   ;; not listed in variable `dotspacemacs-configuration-layers'), `all' will
   ;; lazy install any layer that support lazy installation even the layers
   ;; listed in `dotspacemacs-configuration-layers'. `nil' disable the lazy
   ;; installation feature and you have to explicitly list a layer in the
   ;; variable `dotspacemacs-configuration-layers' to install it.
   ;; (default 'unused)
   dotspacemacs-enable-lazy-installation 'unused

   ;; If non-nil then Spacemacs will ask for confirmation before installing
   ;; a layer lazily. (default t)
   dotspacemacs-ask-for-lazy-installation t

   ;; List of additional paths where to look for configuration layers.
   ;; Paths must have a trailing slash (i.e. `~/.mycontribs/')
   dotspacemacs-configuration-layer-path '()

   ;; List of configuration layers to load.
   dotspacemacs-configuration-layers
   '(
     ;; ----------------------------------------------------------------
     ;; Example of useful layers you may want to use right away.
     ;; Uncomment some layer names and press `SPC f e R' (Vim style) or
     ;; `M-m f e R' (Emacs style) to install them.
     ;; ----------------------------------------------------------------
     helm
     (auto-completion :variables
                      auto-completion-return-key-behavior 'complete
                      auto-completion-tab-key-behavior 'cycle
                      auto-completion-complete-with-key-sequence nil
                      auto-completion-complete-with-key-sequence-delay 0.1
                      auto-completion-idle-delay 0.1
                      auto-completion-private-snippets-directory nil
                      auto-completion-enable-snippets-in-popup nil
                      auto-completion-enable-help-tooltip 'manual
                      auto-completion-use-company-box t
                      :config (ac-flyspell-workaround))
     better-defaults
     emacs-lisp
     git
     markdown
     org
     (shell :variables
            shell-default-height 30
            shell-default-position 'bottom)
     ;; spell-checking
     syntax-checking
     ;; version-control
     (python :variables
             python-fill-column 99
             python-formatter 'yapf
             python-format-on-save t
             python-sort-imports-on-save t
             python-pipenv-activate nil)

     ipython-notebook
     multiple-cursors
     treemacs
     )

.
.
.

(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."

  (defun my-push-mark-command()
    "Push a mark at current location"
    (interactive)
    (push-mark (point))
    )

  (spacemacs/set-leader-keys "jj" 'avy-goto-char-timer)
  (spacemacs/set-leader-keys "jp" 'my-push-mark-command)
  (define-key evil-normal-state-map (kbd "C-f") 'avy-goto-char-timer)

  (define-key evil-normal-state-map (kbd "a") 'evil-goto-mark)

  ;; set df to be the global escape sequence
  (setq-default evil-escape-key-sequence "df")
  (setq-default evil-escape-delay 0.4)

  ;;  prevent pasted-over text from gettin into the kill-ring
  ;; (setq save-interprogram-paste-before-kill t)
  ;; (setq-default evil-kill-on-visual-paste nil)

  ;; Org mode
  (add-hook 'org-mode-hook '(lambda () (setq fill-column 80)))
  (add-hook 'org-mode-hook 'turn-on-auto-fill)

  ;; map SCP-i-c/a to add/append a single char from normal mode
  (defun my/insert-char (char count)
    (interactive "c\np")
    (insert-char char count))

  (defun my/append-char (char count)
    (interactive "c\np")
    (save-excursion
      (unless (eolp)
        (forward-char))
      (insert-char char count)))

  (spacemacs/set-leader-keys (kbd "ii") 'my/insert-char)
  (spacemacs/set-leader-keys (kbd "ia") 'my/append-char)

  ;; Completion
  (spacemacs|add-company-backends
    :backends company-anaconda
    :modes ein:notebook-mode)

  (global-company-mode t)

  (global-set-key (kbd "C-SPC") 'company-complete)
  ;; (global-set-key (kbd "C-SPC") #'company-indent-or-complete-common)

  ;; Python
  (setq flycheck-python-flake8-executable "python3")
  (setq flycheck-python-flake8-executable "flake8")
  (setq python-indent-guess-indent-offset-verbose nil)

  ;;Juputer notebooks
  (load "/home/jonathan/nxhtml/autostart.el")
  (setq mumamo-background-colors nil)
  (setq python-saved-check-command nil)
  (setq ein:output-area-inlined-images t)
  (setq ein:worksheet-enable-undo t)
  ;; (use-package elpy
  ;;   ;; emacs.stackexchange.com/questions/10065
  ;;   :commands elpy-enable
  ;;   :init (with-eval-after-load 'python (elpy-enable))
  ;;   :config
  ;;   (setq elpy-rpc-backend "jedi"
  ;;         elpy-rpc-project-specific 't)
  ;;   (delete 'elpy-module-highlight-indentation elpy-modules)
;;   (delete 'elpy-module-flymake elpy-modules))
)

;; Do not write anything past this comment. This is where Emacs will
;; auto-generate custom variable definitions.

Thanks!

duianto commented 4 years ago

Could you provide your system info, press SPC h d s to copy it to the clipboard.

Do you have some reproduction steps so that we are testing the same thing.

This is what I'm seeing:

Can't paste from clipboard over a visual selection

That's observed in both:

PopOS 20.04 (click to expand)
#### System Info :computer:
- OS: gnu/linux
- Emacs: 26.3.50
- Spacemacs: 0.300.0
- Spacemacs branch: develop (rev. 5fcd84d84)
- Graphic display: t
- Distribution: spacemacs
- Editing style: vim
- Completion: helm
- Layers:
```elisp
(auto-completion command-log emacs-lisp fasd git helm lsp markdown multiple-cursors
                 (org :variables org-agenda-files
                      '("~/org/notes.org"))
                 ranger
                 (shell :variables shell-default-height 30 shell-default-position 'bottom)
                 spell-checking syntax-checking themes-megapack treemacs version-control)
```
- System configuration features: XPM JPEG TIFF GIF PNG SOUND DBUS GSETTINGS GLIB NOTIFY LIBSELINUX GNUTLS FREETYPE XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS

Windows 1903 (click to expand)
#### System Info :computer:
- OS: windows-nt
- Emacs: 26.3
- Spacemacs: 0.300.0
- Spacemacs branch: develop (rev. 5fcd84d84)
- Graphic display: t
- Distribution: spacemacs
- Editing style: vim
- Completion: helm
- Layers:
```elisp
(autohotkey
 (auto-completion :variables auto-completion-enable-help-tooltip t auto-completion-enable-snippets-in-popup t)
 emacs-lisp git helm html javascript lsp
 (markdown :variables markdown-live-preview-engine 'vmd markdown-command "vmd")
 multiple-cursors
 (org :variables org-agenda-files
      '("~/org/notes.org" "~/temp/org-tags-view_broken._13509.org"))
 (python :variables)
 ranger
 (shell :variables shell-default-shell 'eshell shell-default-height 30)
 spell-checking
 (syntax-checking :variables syntax-checking-enable-by-default nil)
 treemacs version-control)
```
- System configuration features: XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS THREADS LCMS2

JonatanSahar commented 4 years ago

Hi, I've pasted my system info below. with your scenario I get "abc def ghi".

Thanks!

System Info :computer:

  • OS: gnu/linux
  • Emacs: 26.3
  • Spacemacs: 0.300.0
  • Spacemacs branch: develop (rev. 1f6e39ea8)
  • Graphic display: t
  • Distribution: spacemacs
  • Editing style: vim
  • Completion: helm
  • Layers:
    (auto-completion better-defaults emacs-lisp git helm
                 (org :variables org-enable-org-journal-support t)
                 org-roam ipython-notebook
                 (python :variables python-backend 'lsp)
                 (shell :variables shell-default-height 30 shell-default-shell 'vterm shell-default-position 'bottom)
                 spell-checking syntax-checking pdf treemacs multiple-cursors)
  • System configuration features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS GLIB NOTIFY LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS XWIDGETS LIBSYSTEMD LCMS2
github-actions[bot] commented 3 years 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!