HEX
Server: Apache
System: Linux iad1-shared-b8-33 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User: samfetchero1 (10301780)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/share/doc/libtext-autoformat-perl/examples/config.emacs
;; Add  these  lines  to  your  .emacs  and  you  will  be   happy   with
;; p5-Text-Autoformat. 
;; Use ctrl-c k to reformat a region.

;; Set a global key for autoformat region
(global-set-key (kbd "C-c k") (lambda () (interactive)
 (shell-command-on-region (region-beginning) (region-end)
  "perl -MText::Autoformat -e \"{autoformat{all=>1};}\"" 
  (current-buffer) t)))