From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Henrik Enberg Newsgroups: gmane.emacs.help Subject: Re: Tab within comments in C/C++ mode Date: Wed, 30 Oct 2002 22:34:15 +0100 Organization: Le Petomane Appreciation Society Sender: help-gnu-emacs-admin@gnu.org Message-ID: <878z0fa9wo.fsf@enberg.org> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1036014128 23648 80.91.224.249 (30 Oct 2002 21:42:08 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 30 Oct 2002 21:42:08 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1870bH-00069I-00 for ; Wed, 30 Oct 2002 22:42:07 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 1870bC-0001pT-00; Wed, 30 Oct 2002 16:42:02 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!uni-berlin.de!h47n2fls32o1112.telia.COM!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 24 Original-NNTP-Posting-Host: h47n2fls32o1112.telia.com (213.65.65.47) Original-X-Trace: fu-berlin.de 1036013815 4043740 213.65.65.47 (16 [125297]) User-Agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.3.50 (i686-pc-linux-gnu) Cancel-Lock: sha1:fuWRMKn8XOOvsICpvA/0EEOIwFo= Original-Xref: shelby.stanford.edu gnu.emacs.help:106591 Original-To: help-gnu-emacs@gnu.org Errors-To: help-gnu-emacs-admin@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.help:3141 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:3141 "Chris Hobbs" writes: > I am looking for a way to allow the tab key while inside comments in C and > C++ mode. Currently, the mode will not allow a tab (let alone multiple > tabs) to be placed while in a comment. It seems to insist on formatting > the contents of the comment. Not really formatting per se, mainly just > disallowing any format I want to put in there. `C-q TAB' should do what you want. C-q runs `quoted-insert' which insets the next thing you type verbatim. If you think that is annoying you could try putting this (untested) code in ~/.emacs.el (add-hook 'post-command-hook (lambda () (when (memq major-mode '(c-mode c++-mode java-mode)) (if (eq (get-text-property (point) 'face) 'font-lock-comment-face) (local-set-key (kbd "") 'tab-to-tab-stop) (local-set-key (kbd "") 'c-indent-command))))) -- Booting... /vmemacs.el