From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thien-Thi Nguyen Newsgroups: gmane.emacs.help Subject: Re: Basic emacs lisp question Date: Wed, 10 Sep 2014 16:06:12 +0200 Message-ID: <87oaunefjf.fsf@zigzag.favinet> References: <87egvkvb6o.fsf@gmail.com> <87egvjliv2.fsf@newcastle.ac.uk> Reply-To: help-gnu-emacs@gnu.org NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Trace: ger.gmane.org 1410357798 16483 80.91.229.3 (10 Sep 2014 14:03:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 10 Sep 2014 14:03:18 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Sep 10 16:03:11 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 1XRiU8-0007Mg-Mn for geh-help-gnu-emacs@m.gmane.org; Wed, 10 Sep 2014 16:03:00 +0200 Original-Received: from localhost ([::1]:56571 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XRiU8-0005cT-85 for geh-help-gnu-emacs@m.gmane.org; Wed, 10 Sep 2014 10:03:00 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53005) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XRiTl-0005Sn-Gp for help-gnu-emacs@gnu.org; Wed, 10 Sep 2014 10:02:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XRiTb-0006y4-EO for help-gnu-emacs@gnu.org; Wed, 10 Sep 2014 10:02:37 -0400 Original-Received: from smtp206.alice.it ([82.57.200.102]:9146) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XRiTb-0006xX-5H for help-gnu-emacs@gnu.org; Wed, 10 Sep 2014 10:02:27 -0400 Original-Received: from zigzag.favinet (87.8.230.140) by smtp206.alice.it (8.6.060.43) id 540D87F000974575 for help-gnu-emacs@gnu.org; Wed, 10 Sep 2014 16:02:22 +0200 Original-Received: from ttn by zigzag.favinet with local (Exim 4.80) (envelope-from ) id 1XRiXO-0006dl-88 for help-gnu-emacs@gnu.org; Wed, 10 Sep 2014 16:06:22 +0200 Mail-Followup-To: help-gnu-emacs@gnu.org In-Reply-To: <87egvjliv2.fsf@newcastle.ac.uk> (Phillip Lord's message of "Wed, 10 Sep 2014 14:12:33 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 82.57.200.102 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:99780 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable () phillip.lord@newcastle.ac.uk (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 =E2=80=98with-temp-buffer=E2=80=99 and =E2=80=98insert-file-conten= ts=E2=80=99. =2D-=20 Thien-Thi Nguyen GPG key: 4C807502 (if you're human and you know it) read my lisp: (responsep (questions 'technical) (not (via 'mailing-list))) =3D> nil --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlQQWtgACgkQZwMiJEyAdQIpjwCg36lakR0OX/YL5wZf3pI0vkCg t4YAoIDPHsp7fHNP13HpYQOa66Sfb+ml =wkiy -----END PGP SIGNATURE----- --=-=-=--