From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Renato Pontefice Newsgroups: gmane.emacs.help Subject: Re: how to add button to emacs that play a elisp code Date: Fri, 12 Sep 2014 03:15:19 -0700 (PDT) Message-ID: <247815cd-dcae-4026-81cf-4582f2c5b3b0@googlegroups.com> References: <04dd6007-693a-4e56-9e2a-e930e51a9563@googlegroups.com> <21521.22678.640570.26495@mail.eng.it> <21521.24551.904371.551048@mail.eng.it> <21521.37886.262510.961741@mail.eng.it> <87vbotx3ht.fsf@debian.uxu> <87ioktn2qp.fsf@kuiper.lan.informatimago.com> <87d2b1vh2w.fsf@debian.uxu> <87wq99u0g1.fsf@debian.uxu> <87sijxtwuu.fsf@debian.uxu> <502fc1bf-a994-4ad5-9c8d-2f90d1ca66a9@googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1410517224 15908 80.91.229.3 (12 Sep 2014 10:20:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 12 Sep 2014 10:20: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 Fri Sep 12 12:20:19 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 1XSNxj-0004QG-0K for geh-help-gnu-emacs@m.gmane.org; Fri, 12 Sep 2014 12:20:19 +0200 Original-Received: from localhost ([::1]:43953 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XSNxi-0006N2-Jh for geh-help-gnu-emacs@m.gmane.org; Fri, 12 Sep 2014 06:20:18 -0400 X-Received: by 10.66.187.8 with SMTP id fo8mr4068178pac.32.1410516919834; Fri, 12 Sep 2014 03:15:19 -0700 (PDT) X-Received: by 10.140.20.83 with SMTP id 77mr130334qgi.0.1410516919783; Fri, 12 Sep 2014 03:15:19 -0700 (PDT) Original-Path: usenet.stanford.edu!r10no683903igi.0!news-out.google.com!q8ni9qal.1!nntp.google.com!s7no250395qap.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help In-Reply-To: <502fc1bf-a994-4ad5-9c8d-2f90d1ca66a9@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2.118.42.225; posting-account=u2YPPQoAAAD4EIiLgz2UEPmFMncWw22R Original-NNTP-Posting-Host: 2.118.42.225 User-Agent: G2/1.0 Injection-Date: Fri, 12 Sep 2014 10:15:19 +0000 Original-Xref: usenet.stanford.edu gnu.emacs.help:207577 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:99852 Archived-At: Il giorno venerd=EC 12 settembre 2014 09:44:07 UTC+2, Renato Pontefice ha s= critto: > Il giorno venerd=EC 12 settembre 2014 04:07:37 UTC+2, Emanuel Berg ha scr= itto: >=20 > > Michael Heerdegen writes: >=20 > >=20 >=20 > >=20 >=20 > >=20 >=20 > > > You may argue that you can avoid destructive >=20 > >=20 >=20 > > > operations like `nconc' in your code to prevent that >=20 > >=20 >=20 > > > problem. >=20 > >=20 >=20 > >=20 >=20 > >=20 >=20 > > I was just about to say that - almost. While I don't >=20 > >=20 >=20 > > think side effects are bad by definition, and I >=20 > >=20 >=20 > > disklike the whole functional paradigm crusade with the >=20 > >=20 >=20 > > Haskell hysteria and all, in practise it makes sense >=20 > >=20 >=20 > > most of the time. >=20 > >=20 >=20 > >=20 >=20 > >=20 >=20 > > But that is more related to your specific example than >=20 > >=20 >=20 > > to the problem, right? >=20 > >=20 >=20 > >=20 >=20 > >=20 >=20 > > > But that isn't enough either: when you pass your list >=20 > >=20 >=20 > > > to some function you didn't define yourself (e.g. a >=20 > >=20 >=20 > > > function that is part of Emacs), it is passed as >=20 > >=20 >=20 > > > reference (as usual in Lisp), and it may be modified >=20 > >=20 >=20 > > > by that function by side effect, so that your program >=20 > >=20 >=20 > > > "changes" too. >=20 > >=20 >=20 > > > >=20 > >=20 >=20 > > > If you are not aware of that problem, it probably >=20 > >=20 >=20 > > > won't bite you often, but when it does, you'll need a >=20 > >=20 >=20 > > > lot of time to find out what's actually going on. >=20 > >=20 >=20 > > > >=20 > >=20 >=20 > > > BTW, this "effect" can also be used constructively, >=20 > >=20 >=20 > > > it's not "harmful" per se. >=20 > >=20 >=20 > >=20 >=20 > >=20 >=20 > > No, I have lots of quoted, and even backquoted stuff, >=20 > >=20 >=20 > > which would have showed its harmful side by now, so I >=20 > >=20 >=20 > > suppose I have been using it either "constructively" or >=20 > >=20 >=20 > > where it doesn't matter which. >=20 > >=20 >=20 > >=20 >=20 > >=20 >=20 > > By the way - computer science silly buzzword: >=20 > >=20 >=20 > > idempotence, or "referential transparency". >=20 > >=20 >=20 > >=20 >=20 > >=20 >=20 > > --=20 >=20 > >=20 >=20 > > underground experts united >=20 >=20 >=20 > Hi, >=20 > I've read he most part of the thread, but,=20 >=20 > as one who does not know elisp,I got lost in the debate :-( >=20 > wich is the prob on the execution of my (your) code, pressing the key: >=20 >=20 >=20 > (global-set-key (kbd "M-A") 'backward-word) ; Alt+Shift+a >=20 > (while (and (not (eobp)) >=20 > (search-forward "[-" nil 'move)) >=20 > (skip-chars-forward "A-Z") >=20 > (unless (looking-at "-]") >=20 > (message "Problem found, please fix and hit C-M-c to continue") >=20 > (recursive-edit)))) >=20 >=20 >=20 > ? >=20 >=20 >=20 > thank you >=20 >=20 >=20 > Renato Hi, Ive found, that maybe, there is another parenthesis / maybe the last on= e, I-ve erased it and emacs start without error, but if I press Alt/Shift/ A, = nothing happens. What-s wrong?=20 Renato