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 00:44:07 -0700 (PDT) Message-ID: <502fc1bf-a994-4ad5-9c8d-2f90d1ca66a9@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> 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 1410507926 30564 80.91.229.3 (12 Sep 2014 07:45:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 12 Sep 2014 07:45:26 +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 09:45:20 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 1XSLXj-0002Sb-FC for geh-help-gnu-emacs@m.gmane.org; Fri, 12 Sep 2014 09:45:19 +0200 Original-Received: from localhost ([::1]:43173 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XSLXj-0004pG-5a for geh-help-gnu-emacs@m.gmane.org; Fri, 12 Sep 2014 03:45:19 -0400 X-Received: by 10.236.138.19 with SMTP id z19mr3446788yhi.45.1410507847255; Fri, 12 Sep 2014 00:44:07 -0700 (PDT) X-Received: by 10.140.96.9 with SMTP id j9mr5832qge.13.1410507847208; Fri, 12 Sep 2014 00:44:07 -0700 (PDT) Original-Path: usenet.stanford.edu!news.glorb.com!m5no503553qaj.0!news-out.google.com!q8ni9qal.1!nntp.google.com!s7no222814qap.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help In-Reply-To: <87sijxtwuu.fsf@debian.uxu> 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 07:44:07 +0000 Original-Xref: usenet.stanford.edu gnu.emacs.help:207572 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:99848 Archived-At: Il giorno venerd=EC 12 settembre 2014 04:07:37 UTC+2, Emanuel Berg ha scrit= to: > Michael Heerdegen writes: >=20 >=20 >=20 > > You may argue that you can avoid destructive >=20 > > operations like `nconc' in your code to prevent that >=20 > > problem. >=20 >=20 >=20 > I was just about to say that - almost. While I don't >=20 > think side effects are bad by definition, and I >=20 > disklike the whole functional paradigm crusade with the >=20 > Haskell hysteria and all, in practise it makes sense >=20 > most of the time. >=20 >=20 >=20 > But that is more related to your specific example than >=20 > to the problem, right? >=20 >=20 >=20 > > But that isn't enough either: when you pass your list >=20 > > to some function you didn't define yourself (e.g. a >=20 > > function that is part of Emacs), it is passed as >=20 > > reference (as usual in Lisp), and it may be modified >=20 > > by that function by side effect, so that your program >=20 > > "changes" too. >=20 > > >=20 > > If you are not aware of that problem, it probably >=20 > > won't bite you often, but when it does, you'll need a >=20 > > lot of time to find out what's actually going on. >=20 > > >=20 > > BTW, this "effect" can also be used constructively, >=20 > > it's not "harmful" per se. >=20 >=20 >=20 > No, I have lots of quoted, and even backquoted stuff, >=20 > which would have showed its harmful side by now, so I >=20 > suppose I have been using it either "constructively" or >=20 > where it doesn't matter which. >=20 >=20 >=20 > By the way - computer science silly buzzword: >=20 > idempotence, or "referential transparency". >=20 >=20 >=20 > --=20 >=20 > underground experts united Hi, I've read he most part of the thread, but,=20 as one who does not know elisp,I got lost in the debate :-( wich is the prob on the execution of my (your) code, pressing the key: (global-set-key (kbd "M-A") 'backward-word) ; Alt+Shift+a (while (and (not (eobp)) (search-forward "[-" nil 'move)) (skip-chars-forward "A-Z") (unless (looking-at "-]") (message "Problem found, please fix and hit C-M-c to continue") (recursive-edit)))) ? thank you Renato