bbatsov / prelude

Prelude is an enhanced Emacs 25.1+ distribution that should make your experience with Emacs both more pleasant and more powerful.
https://prelude.emacsredux.com
5.1k stars 1.85k forks source link

Perl mode adds extra curly braces #1344

Open isoboroff opened 2 years ago

isoboroff commented 2 years ago

Expected behavior

When typing an open curly brace, it should automatically add the closing brace.

Actual behavior

It adds two closing braces.

Steps to reproduce the problem

Edit a Perl script. Type an open curly brace.

Frankly, it would be nice if the additional punctuation looked to see if the closing punctuation was already there before adding it. This is a problem for quotes and parens as well as square brackets and curly braces. The current behavior makes writing new code fast at the expense of making editing existing code harder. I find I edit a lot more code than I write.

This is extremely important! Providing us with a reliable way to reproduce a problem will expedite its solution.

Environment & Version information

Emacs version

E.g. 24.5 (use M-x emacs-version to check it if unsure)

Operating system

E.g. Fedora 23, OS X 10.11 "El Capitan", Windows 10, etc

bbatsov commented 2 years ago

Do this happen with smartparens-mode enabled?

isoboroff commented 2 years ago

Yes, I confirmed by loading a Perl script to edit, then doing C-h m:

Enabled minor modes: Anzu Auto-Composition Auto-Compression
Auto-Encryption Column-Number Company Delete-Selection Diff-Hl
Display-Line-Numbers Editorconfig Electric-Indent File-Name-Shadow
Flycheck Flyspell Font-Lock Global-Anzu Global-Auto-Revert
Global-Company Global-Diff-Hl Global-Display-Line-Numbers Global-Eldoc
Global-Flycheck Global-Font-Lock Global-Hl-Line Global-Hl-Todo
Global-Undo-Tree Hl-Todo Line-Number Menu-Bar Mouse-Wheel Prelude
Projectile Pyvenv Recentf Save-Place Savehist Shell-Dirtrack
Show-Smartparens Show-Smartparens-Global Size-Indication Smartparens
Super-Save Tex-Pdf Tooltip Transient-Mark Undo-Tree
Volatile-Highlights Which-Function Which-Key Whitespace Winner
isoboroff commented 2 years ago

I don't know if this is related, but when editing LaTeX files, typing a double-quote inserts two backquotes and a single-quote: `` '. Disabling smartparens-mode causes it to just insert a double-quote. I like the way "normal" Emacs automatically substitutes LaTeX-quotes and matches them correctly.

stale[bot] commented 2 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. Thank you for your contribution and understanding!