Fuco1 / smartparens

Minor mode for Emacs that deals with parens pairs and tries to be smart about it.
GNU General Public License v3.0
1.8k stars 193 forks source link

remove action from global pair #1187

Open astholkohtz opened 4 months ago

astholkohtz commented 4 months ago

Expected behavior

Executing at least one of these commands should remove the insert action from the "(" pair

(sp-pair "(" ")" :actions '(:rem insert)
;; or 
(sp-pair "(" nil :actions '(:rem insert)
;; or
(sp-pair "(" ")" :actions '(wrap navigate autoskip))
;; or 
(sp-pair "(" nil :actions '(wrap navigate autoskip))
;; I've also tried this (and similar)
(sp-pair "(" nil :actions :rem)
(sp-pair "(" ")" :actions '(wrap navigate autoskip))

Actual behavior

All actions are retained by the pairs. I can tell from inspecting the global and local pair variables.

Steps to reproduce the problem

Try the above

Environment & version information

In recent enough smartparens you can call M-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.

A working solution

This works

  (sp-pair "(" ")" :actions nil)

  (add-hook 'prog-mode-hook (lambda ()
                              (sp-local-pair major-mode "(" ")" :actions '(wrap autoskip navigate))