From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.help Subject: Re: how to store a elisp procedure in a file and recall it typing a key Date: Wed, 03 Sep 2014 23:09:22 -0600 Message-ID: References: <069edcf2-9cff-44cb-ac09-010733fe9ceb@googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1409807412 10220 80.91.229.3 (4 Sep 2014 05:10:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 4 Sep 2014 05:10:12 +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 04 07:10:06 2014 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 1XPPJ7-0007vR-T7 for geh-help-gnu-emacs@m.gmane.org; Thu, 04 Sep 2014 07:10:06 +0200 Original-Received: from localhost ([::1]:48775 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPPJ7-0002js-9M for geh-help-gnu-emacs@m.gmane.org; Thu, 04 Sep 2014 01:10:05 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36337) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPPIo-0002ja-VF for help-gnu-emacs@gnu.org; Thu, 04 Sep 2014 01:09:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XPPIh-0007uw-FN for help-gnu-emacs@gnu.org; Thu, 04 Sep 2014 01:09:46 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:59987) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPPIh-0007up-8F for help-gnu-emacs@gnu.org; Thu, 04 Sep 2014 01:09:39 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XPPIg-0007fN-6M for help-gnu-emacs@gnu.org; Thu, 04 Sep 2014 07:09:38 +0200 Original-Received: from 71-215-77-225.hlrn.qwest.net ([71.215.77.225]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 04 Sep 2014 07:09:38 +0200 Original-Received: from kevin.d.rodgers by 71-215-77-225.hlrn.qwest.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 04 Sep 2014 07:09:38 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 25 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 71-215-77-225.hlrn.qwest.net User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 In-Reply-To: <069edcf2-9cff-44cb-ac09-010733fe9ceb@googlegroups.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:99658 On 9/3/14 4:05 AM, renato.pontefice@gmail.com wrote: > Hi, > I would store, the piece of code made in elisp, and recall it by pressing a some special key: > i.e. > my elisp procedure does a control on the file where it is executed, so if I open a text file, I would made that control on that file. > How can i recall it? > I do not find the way, asking togoogle :-( Try the Emacs documentation itself first -- in this case, the "Writing Defuns" node of the Emacs Lisp Intro manual seems to be the best place to start. Here's a starting point (in case it's not obvious, you would store this in your ~/.emacs file): (defun my-command () "Does a control on the current buffer." (some-elisp-function) (some-other-elisp-function and-its-argument and-its-other-argument)) (global-set-key "\C-ca" 'my-command) -- Kevin Rodgers Denver, Colorado, USA