all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: LanX <lanx.perl@googlemail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: cperl-indent-for-comment
Date: Wed, 5 May 2010 17:17:49 -0700 (PDT)	[thread overview]
Message-ID: <b9bd2e7f-192c-42c4-92e1-e120e6f1cb5a@r11g2000yqa.googlegroups.com> (raw)
In-Reply-To: d4afe7d8-6599-49ab-904d-3b789a5c7ba4@p2g2000yqh.googlegroups.com

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	other threads:[~2010-05-06  0:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-05 19:42 [cperl-mode] cperl-indent-for-comment LanX
2010-05-06  0:17 ` LanX [this message]
2010-05-06 20:01 ` Ilya Zakharevich
2010-05-06 21:39   ` cperl-indent-for-comment LanX
2010-05-09  0:21     ` cperl-indent-for-comment Ilya Zakharevich
2010-05-10 12:58       ` cperl-indent-for-comment LanX
2010-05-10 23:56         ` cperl-indent-for-comment Ilya Zakharevich
2010-05-14 16:08           ` [cperl] electric-backspace and variable-refactoring LanX
2010-05-07  2:35 ` [cperl-mode] cperl-indent-for-comment Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b9bd2e7f-192c-42c4-92e1-e120e6f1cb5a@r11g2000yqa.googlegroups.com \
    --to=lanx.perl@googlemail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.