in reply to Re: [Golfing] Uncommenting a block
in thread [Golfing] Uncommenting a block

> Too inconspicuous.

in the context of emacs it's ok ¹ , but yes other editors might be in danger...

I could cite Moritz: "use the right tools!" ;-)

Cheers Rolf

¹)

  • org-mode is an emacs-feature
  • emacs visualizes trailing whitespaces
  • cperl-mode would instantly highlight an falsely extended here-doc
  • fly-make would complain about broken syntax
  • Replies are listed 'Best First'.
    Re^3: [Golfing] Uncommenting a block
    by KurtZ (Friar) on Apr 16, 2010 at 02:07 UTC
      emacs visualizes trailing whitespaces
      Sorry, I hate this feature, displaying underscores for whitespaces is very confusing.

      And IMHO there is no unavoidable situation in Perl where it matters if any blanks were unwillingly inserted.

      -Kurt

        > And IMHO there is no unavoidable situation in Perl where it matters if any blanks were unwillingly inserted.

        Not always, POD often demands completely empty lines !

        > displaying underscores for whitespaces is very confusing.

        I know what you mean, but it's not an underscore it's underlined! 8)

        You can either switch it off  (setq cperl-invalid-face nil)

        Or you are free to configure a new face¹ other than "underlined" to be used.

        I expanded this config which I found in emacswiki:cperl-mode to default to 98% grey background. It's in my .emacs just after loading cperl-mode.

        (defface cperl-my-trailing-spaces-face '((((class color)) ;; define your tastes (background, foreground) ( :background "grey98" ; :underline "grey" ) )) "My face for trailing spaces in cperl mode" :group 'cperl-mode) ; Here is the most important part. It says t +o add ; this face to the customizable group cperl- +mode ;; now you can "bind" this face to cperl-invalid-face (set-default 'cperl-invalid-face 'cperl-my-trailing-spaces-face)

        M-x customize-face cperl-my-trailing-spaces-face will show you a "GUI" to change these defaults, test and save all these face settings. Or you can click thru the menus to the customization-group "cperl-mode"

        HTH!

        Cheers Rolf

        FOOTNOTES:

        ¹) a face is roughly the correspondant of a CSS-class in emacs speak