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: Thien-Thi Nguyen
Subject: Re: Basic emacs lisp question
Date: Wed, 10 Sep 2014 16:06:12 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)

() address@hidden (Phillip Lord)
() Wed, 10 Sep 2014 14:12:33 +0100

   (defun process-diary-file ()
     "Perform some manipulation of the diary file"
     (interactive)
     (find-file "~/.signature")
     (goto-char 1)
     (message
      (thing-at-point 'word)))

   [...] However, if you can avoid or minimize using
   global state in this way, it will make your life
   easier.

Another piece of global state is the list of buffers.
The command above has a side effect that you can avoid
by using ‘with-temp-buffer’ and ‘insert-file-contents’.

-- 
Thien-Thi Nguyen
   GPG key: 4C807502
   (if you're human and you know it)
      read my lisp: (responsep (questions 'technical)
                               (not (via 'mailing-list)))
                     => nil

Attachment: signature.asc
Description: PGP signature


reply via email to

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