From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thorsten Jolitz Newsgroups: gmane.emacs.help Subject: Re: Basic emacs lisp question Date: Tue, 09 Sep 2014 21:52:32 +0200 Message-ID: <87sik0y3jz.fsf@gmail.com> References: <87egvkvb6o.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1410292404 23566 80.91.229.3 (9 Sep 2014 19:53:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 9 Sep 2014 19:53:24 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Sep 09 21:53:18 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 1XRRTU-0007DT-Q8 for geh-help-gnu-emacs@m.gmane.org; Tue, 09 Sep 2014 21:53:12 +0200 Original-Received: from localhost ([::1]:51621 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XRRTU-0001So-BW for geh-help-gnu-emacs@m.gmane.org; Tue, 09 Sep 2014 15:53:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50190) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XRRTB-0001Rq-Ll for help-gnu-emacs@gnu.org; Tue, 09 Sep 2014 15:53:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XRRT4-0003Kk-50 for help-gnu-emacs@gnu.org; Tue, 09 Sep 2014 15:52:53 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:36188) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XRRT3-0003Kf-V7 for help-gnu-emacs@gnu.org; Tue, 09 Sep 2014 15:52:46 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XRRT1-0006vW-Na for help-gnu-emacs@gnu.org; Tue, 09 Sep 2014 21:52:43 +0200 Original-Received: from e178059041.adsl.alicedsl.de ([85.178.59.41]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 09 Sep 2014 21:52:43 +0200 Original-Received: from tjolitz by e178059041.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 09 Sep 2014 21:52:43 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 42 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: e178059041.adsl.alicedsl.de User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:N/Bvgm5dt9xH9Rhc0bK/FO96ANY= 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:99743 Archived-At: Ken writes: > I want to capture whatever is at point in a file into a variable > something like the following, but it doesn't seem to work. Can any one > suggest what I an doing wrong. It is probably a silly mistake I am > unable to see. I am just learning Emacs lisp. > > (defun process-diary-file () > "Perform some manipulation of the diary file" > (interactive) > (find-file "~/diary") > (goto-char 1) > (set a (thing-at-point)) > (message a)) try #+BEGIN_SRC emacs-lisp (defun process-diary-file () "Perform some manipulation of the diary file" (interactive) (find-file (expand-file-name "~/diary")) (goto-char (point-min)) (setq a (thing-at-point)) (message "%s" a)) #+END_SRC > > Thanks in advance for your assistance, > Ken > > > -- > Q: What do you call a WASP who doesn't work for his father, isn't a > lawyer, and believes in social causes? > A: A failure. > > -- cheers, Thorsten