help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Basic emacs lisp question


From: Thorsten Jolitz
Subject: Re: Basic emacs lisp question
Date: Tue, 09 Sep 2014 21:52:32 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Ken <address@hidden> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]