From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Reynaldo Newsgroups: gmane.emacs.help Subject: commenting trouble Date: Fri, 09 Jan 2009 16:12:47 -0500 Message-ID: <4967BDCF.4080103@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1231543873 7851 80.91.229.12 (9 Jan 2009 23:31:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 9 Jan 2009 23:31:13 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Jan 10 00:32:24 2009 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 1LLQpv-0008W3-M1 for geh-help-gnu-emacs@m.gmane.org; Sat, 10 Jan 2009 00:32:20 +0100 Original-Received: from localhost ([127.0.0.1]:55426 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LLQof-00052L-LP for geh-help-gnu-emacs@m.gmane.org; Fri, 09 Jan 2009 18:31:01 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LLOnh-0007dw-Kh for help-gnu-emacs@gnu.org; Fri, 09 Jan 2009 16:21:53 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LLOne-0007dS-1P for help-gnu-emacs@gnu.org; Fri, 09 Jan 2009 16:21:53 -0500 Original-Received: from [199.232.76.173] (port=48148 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LLOnd-0007dP-S4 for help-gnu-emacs@gnu.org; Fri, 09 Jan 2009 16:21:49 -0500 Original-Received: from nf-out-0910.google.com ([64.233.182.185]:60950) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LLOnd-0000Lq-HM for help-gnu-emacs@gnu.org; Fri, 09 Jan 2009 16:21:49 -0500 Original-Received: by nf-out-0910.google.com with SMTP id c7so1436739nfi.26 for ; Fri, 09 Jan 2009 13:21:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:content-type :content-transfer-encoding; bh=ekmWQcp6AI1g7iyDsPzzd++gp3qL8RckrYplXa91cr4=; b=k56dJKRN/09XTh3+ECT0Q+VBzRLgtxOxJUHkJnraN0uDNrOV63DUWSBqT2UPIx+IAO Ajx6dIw9P5RnUzZYgXEqAvYrmMd5kraP4kyf4b2yawsP5xAaIjx+Ot4fe9qex2hZscmO P2+uQhMAJ+P4NtMx38XbBEdOql0diaR0eQypg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=nNBthz0Hd6HjILhKi1YHarNVpzgSwwtaVmYvq9jKBOTuNETIxiym1KRajaRYUx3ihL WHsSFSva1SCczQxVAFrTLbmD3QqS4upa7AtTD2gzClQ2ifGfomgNxhWWC4Vi4Wi5VHds Ztq6R7jdGDV6AEOqlAUeVcYiFIF+aenkhaNRA= Original-Received: by 10.210.57.5 with SMTP id f5mr5265691eba.57.1231536107668; Fri, 09 Jan 2009 13:21:47 -0800 (PST) Original-Received: from ?192.168.1.3? ([190.43.64.100]) by mx.google.com with ESMTPS id f3sm78641536nfh.74.2009.01.09.13.21.45 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 09 Jan 2009 13:21:46 -0800 (PST) User-Agent: Thunderbird 2.0.0.17 (X11/20080914) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-Mailman-Approved-At: Fri, 09 Jan 2009 18:29:40 -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:61227 Archived-At: Hello, Recently I wrote this (my first lines of Emacs Lisp) (defun comentar (&optional beg end) (interactive "r") (save-excursion (if (and beg end) (comment-region beg end) (let ((beg (progn (beginning-of-line) (point))) (end (progn (end-of-line) (point)))) (comment-region beg end))))) And my purpose was to use the same function to comment a line without having to select a region, or comment a region (selecting it, of course) but it doesn't work as expected. If for once I delete the if condition then it works fine when I comment a line, but i wanted to extend it to comment a region. Is this possible? Or does one need to have separate command (and key bindings) to work on a line or on a region as with kill-line and kill-region Regards, Reynaldo