No such thing as a small change | |
PerlMonks |
Re^2: How would you indent this?by no longer just digit (Beadle) |
on Mar 19, 2021 at 03:29 UTC ( [id://11129942]=note: print w/replies, xml ) | Need Help?? |
Generally speaking I don't indent code, so I use mark-whole-buffer and then indent-region. In Go code I actually use
instead so the whole buffer is formatted for me. I haven't been able to do that with Perl because of numerous oddities in cperl-mode. Probably the most annoying one is that it turns }; into } ; So, if you don't need CPerl mode to reformat your code like this, then I suggest you just turn off that variable as a workaround (and, if you like, write a bug report). Thanks. I have reported bugs in cperl-mode in the past but things don't seem to have improved, and in at least one case things have got much worse, the case where it immediately throws an error about unbalanced parentheses whenever one presses the m or s keys. That used to be annoying when it was just an error message, but with recent Emacs it also scrolls the window, so in cperl-mode each time I press "m" or "s" the Emacs window scrolls in a random direction. It is truly exhausting when reading a piece of code in one place and then writing in another, and then the Emacs suddenly scrolls due to typing my or sub What I'm trying to do is to set up my own version of cperl-mode with better defaults and fewer bugs. In the case of this hash reference case, I wasn't sure what sort of indentation to use, although I was pretty sure I was going to use something other than the default behaviour, so I thought I'd ask here what people thought. It's been very interesting to get feedback from everyone, so thank you to all participants.
Thank you, that is extremely useful to know about. This page has more.
In Section
Seekers of Perl Wisdom
|
|