Open DrWaleedAYousef opened 5 years ago
I can not reproduce this. I'm on emacs -nw -q
26.1 with loading just dash and smartparens and smartparens-latex, enabling smartparens and delete-selection-mode. Both wrapping and delete selection works.
Can you try to reproduce this with a minimal setup?
If you have cask you can clone this repo, then cask install
and cask emacs -nw -q
then load the necessary packages.
Thanks so much; I, as well, have 26.1. Please find the minimal setup for reproducing the problem. Just highlight any word in a .tex
file and press $
it will be deleted not wrapped. Another issue related to the tag wrapping; it does not work even when commenting the delete-selection-mode
.
(package-initialize)
(delete-selection-mode 1)
(require 'smartparens-config)
(require 'smartparens-latex)
(add-hook 'js-mode-hook #'smartparens-mode)
(smartparens-global-mode t)
(show-smartparens-global-mode t)
(setq sp-base-key-bindings (quote sp))
;; Also, the following line does not wrap a selection even when commenting the delete-selection-mode
(sp-local-tag '(tex-mode plain-tex-mode latex-mode LaTeX) "\\b" "\\begin{_}" "\\end{_}")
(define-key smartparens-mode-map (kbd "<delete>") 'sp-delete-char)
(define-key smartparens-mode-map (kbd "M-<delete>") 'sp-kill-word)
(define-key smartparens-mode-map (kbd "C-<delete>") 'sp-unwrap-sexp)
(define-key smartparens-mode-map (kbd "C-M-<delete>") 'sp-kill-sexp)
(define-key smartparens-mode-map (kbd "C-k") 'sp-kill-hybrid-sexp)
(define-key smartparens-mode-map (kbd "C-S-<delete>") 'sp-splice-sexp-killing-forward)
(define-key smartparens-mode-map (kbd "<backspace>") 'sp-backward-delete-char)
(define-key smartparens-mode-map (kbd "M-<backspace>") 'sp-backward-kill-word)
(define-key smartparens-mode-map (kbd "C-<backspace>") 'sp-backward-unwrap-sexp)
(define-key smartparens-mode-map (kbd "C-M-<backspace>") 'sp-backward-kill-sexp)
(define-key smartparens-mode-map (kbd "C-S-<backspace>") 'sp-splice-sexp-killing-backward)
(bind-key "M-s r" 'sp-rewrap-sexp smartparens-mode-map)
(bind-key "M-s s" 'sp-split-sexp smartparens-mode-map)
(bind-key "M-s j" 'sp-join-sexp smartparens-mode-map)
(define-key smartparens-mode-map (kbd "C-<right>") 'sp-forward-slurp-sexp)
(define-key smartparens-mode-map (kbd "C-<left>") 'sp-forward-barf-sexp)
(define-key smartparens-mode-map (kbd "C-M-<left>") 'sp-backward-slurp-sexp)
(define-key smartparens-mode-map (kbd "C-M-<right>") 'sp-backward-barf-sexp)
(define-key smartparens-mode-map (kbd "C-M-f") 'sp-forward-sexp)
(define-key smartparens-mode-map (kbd "C-M-b") 'sp-backward-sexp)
(define-key smartparens-mode-map (kbd "C-M-e") 'sp-up-sexp)
(define-key smartparens-mode-map (kbd "C-M-a") 'sp-backward-up-sexp)
(use-package auctex
:defer t
:ensure t)
Tags no longer work. I did not load auctex so I think that's where the problem is.
You are right; I commented the auctex
load and kept all of my .emacs
configuration, and the problem gone. So, what do you suggest now? Are you planing to fix this in smartparens
?
Yes I think we need to fix it, auctex is pretty much the only sane way to author latex in emacs.
By the way thanks for narrowing this down, good job! Makes it a lot easier to find a fix.
Thanks so much for your support.
On Thu, Sep 6, 2018, 11:56 AM Matus Goljer notifications@github.com wrote:
By the way thanks for narrowing this down, good job! Makes it a lot easier to find a fix.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Fuco1/smartparens/issues/926#issuecomment-419036213, or mute the thread https://github.com/notifications/unsubscribe-auth/ALpbzXfs6e2mjf4HvpGJNbWIx_4dkiBFks5uYPFGgaJpZM4WZ_oe .
There was a super nasty bug with some caching I've fixed this morning. Can you try the latest master to see if the issue persists?
Thanks so much for your efforts, unfortunately, the problem is the same!
@DrWaleedAYousef Thanks for confirming. I'm sure we'll figure it out eventually /shrug
I confirm that the issue is still present.
Expected behavior
wrapping even if I do
(delete-selection-mode 1)
in the.emacs
fileActual behavior
the selection is deleted
Steps to reproduce the problem
just select any word and do, e.g., $ or \
Backtraces if necessary (
M-x toggle-debug-on-error
)Environment & version information
In recent enough
smartparens
you can callM-x sp-describe-system
to generate this report. Please fill manually what we could not detect automatically. Edit the output as you see fit to protect your privacy.smartparens
version:Active major-mode: LaTeX
Emacs version (
M-x emacs-version
): GNU Emacs 26.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30) of 2018-07-05Spacemacs/Evil/Other starterkit (specify which)/Vanilla: The three appear when pressing sp-describe-system
OS: ArchLinux last update (as today)