From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Newsgroups: gmane.emacs.help Subject: Re: about auto indentation Date: Sat, 7 Aug 2010 16:57:05 +0200 Organization: Golden Department of Tramps, Ministry of Rising Message-ID: <20100807165705.04e89ba8@bir-tawil.nul> References: <20100807132238.5f45b605@bir-tawil.nul> <87k4o2sk0r.fsf@mithlond.arda> <20100807151110.5a60f768@bir-tawil.nul> <87eieasfau.fsf@mithlond.arda> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1291947342 13531 80.91.229.12 (10 Dec 2010 02:15:42 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 10 Dec 2010 02:15:42 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Dec 10 03:15:37 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PQsWG-0007as-GZ for geh-help-gnu-emacs@m.gmane.org; Fri, 10 Dec 2010 03:15:36 +0100 Original-Received: from localhost ([127.0.0.1]:34974 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQsP2-0007QR-3c for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Dec 2010 21:08:08 -0500 Original-Path: usenet.stanford.edu!postnews.google.com!news3.google.com!feeder.news-service.com!feeder.visyn.net!visyn.net!aioe.org!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 52 Original-NNTP-Posting-Host: 3T2lILXfPy3HtX7pFicTew.user.speranza.aioe.org Original-X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 X-Newsreader: Claws Mail 3.7.6 (GTK+ 2.20.1; x86_64-unknown-linux-gnu) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAAOVBMVEX/+xJXVERdYGEDAwI+PzXQzZL//gBESk6fn4kqKyrr5jQJDQ8FBwsYHSRubXWdnk0SExCEhYP/+wDCPhsGAAACSklEQVRIiZWWWYLjIAxEMWFfDfc/7JSEJ2OI6c4oX2nroSpJpiPMEh0RQqUIva9PjRGf+aEWq5T3XtWwPv4AuglVUrL3GeFbWIusgKiKk0+OnI+VmAHIsSM9xoRPPLPSs5MFqBYFMqWnV0KAOILpG6AbTW5RAPkAgFCNuqvQyYC6DJCk1wsIRIUdYAIXwPkvjnSJ2gIdijj/AhiCqLoDBFqU2fENSOc5aboDQQ7H8XY+D2MDwAK1dPR0RPwFUOz5fLuOBGBD0Nj+BIymnv9cx1HBV/EIiKLUpSi9W0ST8/6m6QYEa6+teHdpANnfNnACFA8tzQRp2gDSk/yYPcznrC479IfbuzcDmMBJrVIYORqgIBIVp22aJGXk0/neSkkdHq9SinYDyJhIDc6VzdFa0UuKSjE/A6JFJSUOl6U5J63li8DaA/v6aLrXJFsprbXitC7SXtUKKjyaJsDhbFek0+VACYt8W0rcTbqmw3E+uCILERDYyrlb75rUyC8FaWgU+3FFiQ0QotKukWdKtxwAZNjcGl0orzXZdq6RXQaa1mIHmJC1hiYA5bDUYABuzp/vJVG1QwlWdAU6PN+VE4B7AwA8/O0QjTz07c2HBwImqJMcki2IfQVCYKJwBcl9YkU/XMbGAGgNvR1bQQ WWhIcKtB5sAgNcLe+Axh2liWjz4z+UNzBcY3H1UuAZ4BjIV4D7O7j/BuSvQDdDUilfAmYB5BeS3AL8MgdzAfJLoJtZkWzB/Ajgu76AQx6HrB8/NT4AvNnsG0h7+jFj/gDeNURqmvPEXAAAAABJRU5ErkJggg== Original-Xref: usenet.stanford.edu gnu.emacs.help:180492 X-Mailman-Approved-At: Thu, 09 Dec 2010 20:09:19 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:77170 Archived-At: 2010-08-07 16:50 +0300, Teemu Likonen wrote: | * 2010-08-07 15:11 (+0200), fgr@bir-tawil.nul.invalid wrote: | | > 2010-08-07 15:08 +0300, Teemu Likonen wrote: | >> I guess you want command c-indent-new-comment-line which, by | default, >> is bound to M-j key in c-mode. | > | > That command does an indentation but doesn't add any "*" | character. | | Did you use M-j at the end of a comment line? The command should | add a newline, indent and then add a comment character. That's | what it does in my Emacs. Command's description: | | M-j runs the command c-indent-new-comment-line, which is an | interactive compiled Lisp function in `cc-cmds.el'. | | It is bound to M-j, C-M-j. | | (c-indent-new-comment-line &optional SOFT ALLOW-AUTO-FILL) [...] Well, you can take a look at the following: ,---- | ~ % locate cc-cmds.el | /usr/share/emacs/24.0.50/lisp/progmodes/cc-cmds.el.gz | /usr/share/emacs/24.0.50/lisp/progmodes/cc-cmds.elc `---- Maybe some setting influences the command in question. I don't know. What follows is an extract of my ~/emacs.d/init.el: (global-set-key (kbd "RET") 'newline-and-indent) (setq comment-auto-fill-only-comments t) (add-hook 'c-mode-common-hook '(lambda () (c-toggle-auto-state 1))) (add-hook 'c-mode-common-hook '(lambda () (c-toggle-hungry-state 1))) (add-hook 'c-mode-common-hook '(lambda () (c-subword-mode 1))) (c-set-offset 'case-label '+) ; see Emacs FAQ, 5.22 ;; To automatically fill comments but not code in ProgrammingModes (add-hook 'c-mode-common-hook (lambda () (auto-fill-mode 1) (set (make-local-variable 'fill-nobreak-predicate) (lambda () (not (eq (get-text-property (point) 'face) 'font-lock-comment-face))))))