Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Perl mode adds extra curly braces #1344

Open
isoboroff opened this issue Oct 20, 2021 · 4 comments
Open

Perl mode adds extra curly braces #1344

isoboroff opened this issue Oct 20, 2021 · 4 comments
Labels

Comments

@isoboroff
Copy link

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
Copy link
Owner

bbatsov commented Oct 25, 2021

Do this happen with smartparens-mode enabled?

@isoboroff
Copy link
Author

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
Copy link
Author

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
Copy link

stale bot commented Apr 16, 2022

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!

@stale stale bot added the stale label Apr 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants