help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cperl-indent-for-comment


From: LanX
Subject: Re: cperl-indent-for-comment
Date: Wed, 5 May 2010 17:17:49 -0700 (PDT)
User-agent: G2/1.0

Hi

this is my first approach to question 1...

Any suggestions?

-----------------------------------------------------------
(defun dwim-indent-for-comment (arg)
 "Indent comment after \; { ( [ otherwise insert #"
 (interactive "p")
 (if (and (memq (preceding-char)  '( ?\; ?{ ?\( ?\[ ) )
           (not   (get-text-property (point) 'face))
          )
                (indent-for-comment)
                (insert "#"))
  )

(local-set-key (kbd "#") 'dwim-indent-for-comment)
-----------------------------------------------------------


reply via email to

[Prev in Thread] Current Thread [Next in Thread]