From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Markus Grunwald Newsgroups: gmane.emacs.help Subject: Problem with removing comments Date: 18 Dec 2007 09:09:32 GMT Organization: Arcor Message-ID: <47678e4c$0$13119$9b4e6d93@newsspool2.arcor-online.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1197970884 27852 80.91.229.12 (18 Dec 2007 09:41:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 18 Dec 2007 09:41:24 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Dec 18 10:41:35 2007 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.50) id 1J4YxC-0003OE-Pg for geh-help-gnu-emacs@m.gmane.org; Tue, 18 Dec 2007 10:41:35 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J4Ywt-0006Xa-M5 for geh-help-gnu-emacs@m.gmane.org; Tue, 18 Dec 2007 04:41:15 -0500 Original-Path: shelby.stanford.edu!headwall.stanford.edu!newsfeed.news2me.com!newsfeed.icl.net!newsfeed.fjserv.net!colt.net!feeder.news-service.com!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: pan 0.119 (Karma Hunters) Original-Lines: 47 Original-NNTP-Posting-Date: 18 Dec 2007 10:09:32 CET Original-NNTP-Posting-Host: 48ab0ee7.newsspool2.arcor-online.net Original-X-Trace: DXC=ajNk\LR_o^8^8FBo0_81f>A9EHlD; 3Yc24Fo<]lROoR14nDHegD_]R53NiFC:; QQE071; S_5>aFm:LU[Nfgf@ 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:50172 Archived-At: Hello, my transition from xemacs to emacs virtually done, thanks to this group :) Now and then there is a minor problem that I can solve on my own, but this one here puzzles me: I can't uncomment single lines of code with any of the emacs functions... This is my setting: comment-start's value is "//" comment-padding's value is " " comment-end's value is "" ;; Function to uncomment a region or a line. Got that some time ago: (defun chb-uncomment-region-or-line () (interactive) (let ((beg 0) (end 0)) (if (region-exists-p) (setq beg (region-beginning) end (region-end)) (save-excursion (beginning-of-line) (setq beg (point)) (forward-line) (setq end (point)))) (comment-region beg end -1))) When I use this function on a commented line (no region marked) or a commented region, I only get this in the *messages* buffer: "uncomment-region: Beginning of buffer" and the comment is not changed. No debugger messages. So I thougt, maybe commenting works different in emacs and I read the info file, "21.5.1 Comment Commands". Ok, so there a numerous ways to COMMENT a line or a region and even a function to kill a comment (hmmm). Not much help. comment-dwim doesn't do what I mean ;) What helped a bit was the documentation for comment-region: Now I can uncomment a region with C-u M-x comment-region. But I don't know how to "simulate" the "C-u" part in the "chb-uncomment-region-or-line" function. If that worked, I think everything should be ok... Don't get me wrong: I know next to nothing about emacs and I willingly admit that there may be better ways to do this - that's where I need your help, please... cu Markus