From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: John Bokma Newsgroups: gmane.emacs.help Subject: Re: Writing a script to add comments to a python file Date: Sun, 15 Jul 2012 20:26:21 -0500 Organization: Castle Amber Message-ID: <87d33wmr7m.fsf@castleamber.com> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1342402215 20667 80.91.229.3 (16 Jul 2012 01:30:15 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 16 Jul 2012 01:30:15 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jul 16 03:30:15 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Sqa8b-0005VT-9U for geh-help-gnu-emacs@m.gmane.org; Mon, 16 Jul 2012 03:30:13 +0200 Original-Received: from localhost ([::1]:50506 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sqa8a-0006NL-9f for geh-help-gnu-emacs@m.gmane.org; Sun, 15 Jul 2012 21:30:12 -0400 Original-Path: usenet.stanford.edu!fu-berlin.de!newsfeed101.telia.com!starscream.dk.telia.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 36 Injection-Info: mx04.eternal-september.org; posting-host="66958c45055a40aeb7e2448cff333f06"; logging-data="5044"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+J/l29e4jRG8qdqMJqkWB7UX/13Fi7mJM=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) X-Url: http://johnbokma.com/ Cancel-Lock: sha1:jv0wXGix6Gc1AvqvR3lXiovbTCg= sha1:RX6ZX6tYsh9lyPcucJPYHx5qpas= Original-Xref: usenet.stanford.edu gnu.emacs.help:193491 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:85874 Archived-At: Joshua Moore writes: > Hi gnu.emacs.help > > I've been using the basic features of emacs for a while now, and would > like to add my own functions to it. > > What would be a good way to implement a command that adds a comment > symbol (#) to a selected region in a python file? It's already there. Maybe it's a better idea to find out what's all available? A few times I wanted to add something to Emacs only to find out (often via Google) it's already there. Anyway: M x comment-dwim bound here (default) to: M ; > I can read and write a little bit of lisp-like languages, but I don't > know how to access the region of selected text, edit the lines or > where to save the script. > > Any help is appreciated. Buy "An introduction into programming Lisp" or read it online: http://www.gnu.org/software/emacs/emacs-lisp-intro/ -- John Bokma j3b Blog: http://johnbokma.com/ Perl Consultancy: http://castleamber.com/ Perl for books: http://johnbokma.com/perl/help-in-exchange-for-books.html