From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: William Case Newsgroups: gmane.emacs.help Subject: Re: newbie elisp help ?? Date: Wed, 15 Aug 2007 22:30:17 -0400 Message-ID: <1187231417.17619.39.camel@CASE> References: <87k5rwimrm.fsf@W0053328.mgh.harvard.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1187231427 12511 80.91.229.12 (16 Aug 2007 02:30:27 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 16 Aug 2007 02:30:27 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: "Joel J. Adamson" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Aug 16 04:30:26 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 1ILV7x-0002C1-G7 for geh-help-gnu-emacs@m.gmane.org; Thu, 16 Aug 2007 04:30:25 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ILV7w-00049o-Nl for geh-help-gnu-emacs@m.gmane.org; Wed, 15 Aug 2007 22:30:24 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ILV7g-00048y-Gj for help-gnu-emacs@gnu.org; Wed, 15 Aug 2007 22:30:08 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ILV7f-00048h-5O for help-gnu-emacs@gnu.org; Wed, 15 Aug 2007 22:30:07 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ILV7e-00048R-Vj for help-gnu-emacs@gnu.org; Wed, 15 Aug 2007 22:30:07 -0400 Original-Received: from smtp103.rog.mail.re2.yahoo.com ([206.190.36.81]) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1ILV7e-0001ep-Mi for help-gnu-emacs@gnu.org; Wed, 15 Aug 2007 22:30:06 -0400 Original-Received: (qmail 25403 invoked from network); 16 Aug 2007 02:30:06 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=rogers.com; h=Received:X-YMail-OSG:Subject:From:To:Cc:In-Reply-To:References:Content-Type:Date:Message-Id:Mime-Version:X-Mailer:Content-Transfer-Encoding; b=RjQP4oPergr2tbRLzJLxk8QSu9gBrIwvuJ5J5B3Nugwnvh47AYr2sVAQabPrjDYfueEAKnqazIYU4qrQyHGC2hQl3L0qjh3XOuHGE0j9y3VcIlneMBsW7LiIevV+5jN33Qa8Kthd180Zb5hNitX66fOrG5OM3mARAU4Qh47Z0xY= ; Original-Received: from unknown (HELO ?192.168.1.5?) (billlinux@rogers.com@74.104.51.86 with plain) by smtp103.rog.mail.re2.yahoo.com with SMTP; 16 Aug 2007 02:30:06 -0000 X-YMail-OSG: aS__nX4VM1nW7wtZ96lhMJ_6n886tomfYBfpTxrKDDuPU5mRVBPyaWakc5pkPbF7ZA-- In-Reply-To: <87k5rwimrm.fsf@W0053328.mgh.harvard.edu> X-Mailer: Evolution 2.10.3 (2.10.3-2.fc7) X-Detected-Kernel: Genre and OS details not recognized. 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:46590 Archived-At: Thanks for your comments Joel; On Wed, 2007-08-15 at 16:08 -0400, Joel J. Adamson wrote: > William Case writes: > > > I suppose I am asking for the programming equivalent of 'C-u n'. > > Well yeah: my question is "why do you want to program this?" Whenever > I want such a divider, I just enter "M-7 M-0 *", like this: > > ********************************************************************** > > That took three keystrokes. If you want to repeat it a bunch of > times, you can make it a macro, and name the macro. However, either > making it a macro and calling it by name, or programming it as an > interactive function takes more keystrokes (unless you give it a > one-letter name or bind it to a key, e.g., C-c *). > > If you want to call this from inside a function, or make it part of a > mode, I'd suggest looking at the code for major modes, such as sh-mode > or message-mode. To respond to your curiosity, I want to build a function that inserts lines as I have described for several reasons. 1. I called it a section a divider in my posts because there are file header programs in the emacs wiki and elsewhere. They are all too big and complex for what I need. They are more suited to a professional programmer who is building a major project with the expectation that those files will be widely distributed. Perhaps, one day I will need something like that. For now, I wanted to avoid debate and just create a simple header for files that are tantamount to practise or sample files, using 'C', elisp or bash. File name, Purpose of program, Author's name, programming date will do for me. 2. I have tried to use something like you suggest, but find the use of a solid line of characters too dense, drawing attention away from the actual programming, and, thus would like to alternate character with a space. 3. It seemed like building a function and sub-functions, was a good self-imposed exercise to practise some of the lisp I had picked up in the tutorial. 4. I wanted to avoid the need for variable arguments, parameters and hooks by writing a simple set of functions where I could copy and manually substitute ';' and '#' for '/* */' commenting out symbols. Hooks, buffer/file names, etc. might come later. 5. I did not ask for advice on the emacs mailing list lightly. I did my due diligence with manuals, info, wiki, archives, google and trial and error. I thought that after several hours of frustration it would be appropriate to ask for guidance. My understanding was that this emacs mailing list is for beginners and experienced people alike. -- Regards Bill, Emacs 22.0.990.1 Fedora 7