From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Decebal Newsgroups: gmane.emacs.help Subject: Making callable function of a macro Date: Thu, 25 Sep 2008 00:07:23 -0700 (PDT) Organization: http://groups.google.com Message-ID: <19cc8ee3-7dbc-47ac-bee9-bf233b42a0eb@j22g2000hsf.googlegroups.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 1222335784 14056 80.91.229.12 (25 Sep 2008 09:43:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 25 Sep 2008 09:43:04 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Sep 25 11:44:02 2008 connect(): Connection refused 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 1KinOB-0006or-JZ for geh-help-gnu-emacs@m.gmane.org; Thu, 25 Sep 2008 11:43:59 +0200 Original-Received: from localhost ([127.0.0.1]:48087 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KinN9-00019z-DF for geh-help-gnu-emacs@m.gmane.org; Thu, 25 Sep 2008 05:42:55 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!j22g2000hsf.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 51 Original-NNTP-Posting-Host: 80.79.97.145 Original-X-Trace: posting.google.com 1222326443 6913 127.0.0.1 (25 Sep 2008 07:07:23 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Thu, 25 Sep 2008 07:07:23 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: j22g2000hsf.googlegroups.com; posting-host=80.79.97.145; posting-account=K-cdeAoAAAD_0d505kUtHXJaT5LFIu-3 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1,gzip(gfe),gzip(gfe) X-HTTP-Via: 1.1 proxy-25:8080 (squid/2.5.STABLE8) Original-Xref: news.stanford.edu gnu.emacs.help:162697 X-Mailman-Approved-At: Thu, 25 Sep 2008 05:42:00 -0400 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:58045 Archived-At: I made the following macro to process some files: ##### Macro: ESC < ;; beginning-of-buffer C-SPC ;; set-mark-command ESC C-s ;; isearch-forward-regexp ^ = ;; self-insert-command * 2 RET ;; newline C-a ;; beginning-of-line 2*C-n ;; next-line C-w ;; kill-region ESC > ;; end-of-buffer C-SPC ;; set-mark-command ESC < ;; beginning-of-buffer ESC C-s ;; isearch-forward-regexp ^ = ;; self-insert-command * 2 RET ;; newline C-a ;; beginning-of-line C-w ;; kill-region ESC < ;; beginning-of-buffer ESC C-% ;; query-replace-regexp C-q ;; quoted-insert LFD ;; newline-and-indent ESC 5 ;; digit-argument SPC ;; self-insert-command RET ;; newline C-q ;; quoted-insert TAB ;; indent-relative RET ;; newline ! ;; self-insert-command ESC < ;; beginning-of-buffer RET ;; newline C-p ;; previous-line Probleem ;; self-insert-command * 8 C-q ;; quoted-insert TAB ;; indent-relative Referentie ;; self-insert-command * 10 C-q ;; quoted-insert TAB ;; indent-relative Oplossing ;; self-insert-command * 9 C-a ;; beginning-of-line ##### Now other people like the functionality that I made. ;-} But they do not use Emacs. So I would like to change the macro to a function. In this way the script that is used to generate the input files, could call Emacs and process them directly. Is this possible? If so: how would I do this? I have worked with Emacs, but not really with the Lisp capabilities. More as an editor.