In my emacs setup, if I have smartparens-mode enabled with smartparens-latex and I open a latex document, type some text then select it and type any latex special command (such as $, ", \{, etc...) the text gets surrounded by these symbols as expected.

However, if I have delete-selection-mode enabled, then the text is deleted instead. Other symbols like {, (, [ still work as expected even when delete-selection-mode is enabled.

The weird thing is that this used to work flawlessly before a recent update that I cannot quite track. In fact a question was posted here in 2016 and an update to AUCTeX was supposed to fix this issue.

Below is the minimum init.el code that produces this problem

(require 'package)
(add-to-list 'package-archives
         '("melpa" . "https://melpa.org/packages/") t)

(defun require-package (package)
  "Install PACKAGE unless already installed."
  (unless (package-installed-p package)
    (package-install package))

(require-package 'auctex)
(require-package 'smartparens)
(require 'smartparens)
(require 'smartparens-latex)

(delete-selection-mode t)

(defun latex-mode-defaults ()

(add-hook 'LaTeX-mode-hook 'latex-mode-defaults)
  • Sounds like an AUCTex bug. If you don't get a definitive answer here, please consider filing a bug report. – Drew Feb 20 '18 at 15:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.