From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.devel Subject: Re: Proposal: `buffer-offer-save' be made a permanent-local Date: Fri, 18 Jun 2010 02:33:58 +0200 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1276821275 24312 80.91.229.12 (18 Jun 2010 00:34:35 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 18 Jun 2010 00:34:35 +0000 (UTC) Cc: kevin.d.rodgers@gmail.com, emacs-devel@gnu.org To: MON KEY Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jun 18 02:34:34 2010 connect(): No such file or directory Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OPPXV-00006w-Pd for ged-emacs-devel@m.gmane.org; Fri, 18 Jun 2010 02:34:34 +0200 Original-Received: from localhost ([127.0.0.1]:36611 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OPPXU-0001NX-Ve for ged-emacs-devel@m.gmane.org; Thu, 17 Jun 2010 20:34:33 -0400 Original-Received: from [140.186.70.92] (port=47882 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OPPXP-0001KJ-09 for emacs-devel@gnu.org; Thu, 17 Jun 2010 20:34:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OPPXN-0001U2-J6 for emacs-devel@gnu.org; Thu, 17 Jun 2010 20:34:26 -0400 Original-Received: from mail-yw0-f177.google.com ([209.85.211.177]:61610) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OPPXN-0001Tx-Ec for emacs-devel@gnu.org; Thu, 17 Jun 2010 20:34:25 -0400 Original-Received: by ywh7 with SMTP id 7so595659ywh.26 for ; Thu, 17 Jun 2010 17:34:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=M+eq4VbL+66oFAFguqDcwJXSyqkrMwutE3fUuVLXSCU=; b=ezDF8giUgU/8ctxP6LWWElOzNb9JHtD2WZPGM57sVk+wW7T2/KO6J1Qk2UKPokq4f8 hkK+nJb8NKpn0H2ng6Xpm6e5+y6teA6BFVRLyUmKJpYHj4w9L+vY0w80psOqGV9PfLfr bQc1CyfH7SzQgo1S/63ea47qRCYB+JWptl6gY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=KXGXiW0ZEdVEh7bsIQ/naLNUWJu5him/QUbEsNcL7+zsyNHyeudLfDDz9rZvot8LgZ fmWkYNcb1/5RKuKfoQCabU+lPVw1GjIgpa4W6nldM+kJ1n6fgOVjmgzQCI6P1EU2wWhO WQv5gjbHm9xjikeGlUsUnRVlayboCqzCXGyvw= Original-Received: by 10.101.172.1 with SMTP id z1mr230683ano.235.1276821258232; Thu, 17 Jun 2010 17:34:18 -0700 (PDT) Original-Received: by 10.100.154.15 with HTTP; Thu, 17 Jun 2010 17:33:58 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:126117 Archived-At: On Fri, Jun 18, 2010 at 2:13 AM, MON KEY wrote: > On Thu, Jun 17, 2010 at 6:25 PM, Lennart Borgman > wrote: >> >> Is not this just a misuse of a feature? You can misuse any feature. >> > > NO! If the elisp API exposes permanent-local it isn't a misuse it is > to be expected that people will use it (whether you or I agree with > such use or not). For an OS I would agree. But this is a developing environment. There are lot of things in Emacs you can use but you should not use unless you know what you are doing. So there is nothing special with permanent-local in this regard. > The `misuse' of permanent-local is the ad hoc elevation of only _some_ > symbols to permanent local status. > > Let all symbols be permanent permanent local by default or stop adding > them arbitrarily to satisfy a kludge. It would not work. You would just add another non-backward complexity. It is beyond me why you are suggesting something like that. >> And this has nothing to do with the change I proposed. > > It most certainly does. > > Kevin's query illustrates that where persisting state in a buffer is > merely a matter of putting some permanent property on the buffer this > is trivially accomplished. Sorry, I can see nothing here that has anything to do with my proposal. >> Instead, as I said before (a bit less explicit) it rather has to do >> with complexity. > > Nonsense, the complexity is an outcome of a series of simplistic > solution being thrown at the problem. You seem to be sure of that. Why? To me it just looks like you are overlooking the complexity of the question. Sure there are cases like where your answer what be sensible. But that does not mean it is it here. >> Your major mode is simply not expected to to this kind of things. > > This is exactly my point. They will do it. =C2=A0And your proposal is to > have this behaviour explicitly blessed. Then just don't use libraries from authors that do not know what they are d= oing. >> And this has nothing to do with the change I proposed. >> > Why not? There is nothing in the change I propose that makes the behavior or possibility of other developers different. If you think differently it suggest to me you have misunderstood the situat= ion. > Couldn't you accomplish a major-moded state change by doing > something like this: Yes. So what. What are you trying to prove? > (put 'dead-weight-unless-you-look-for-me 'permanent-local t) > > (with-current-buffer (current-buffer) > =C2=A0(set (make-local-variable 'dead-weight-unless-you-look-for-me) t)) > > ;; (unintern 'dead-weight-unless-you-look-for-me) > (setplist 'dead-weight-unless-you-look-for-me > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0`(,(get-buffer (current-buffer)) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(:buffer-offer-save t))) > > (with-current-buffer (get-buffer (other-buffer)) > =C2=A0(buffer-local-value > =C2=A0 (intern-soft "dead-weight-unless-you-look-for-me") > =C2=A0 (current-buffer))) > ;; =3D> void over there > > (buffer-local-value > =C2=A0(intern-soft "dead-weight-unless-you-look-for-me") > =C2=A0(current-buffer)) > ;; =3D> t over here > > (get > =C2=A0(intern-soft "dead-weight-unless-you-look-for-me") > =C2=A0(get-buffer (current-buffer))) > ;; =3D> (:buffer-offer-save t) > > (get (intern-soft "dead-weight-unless-you-look-for-me") > =C2=A0 =C2=A0 (get-buffer (current-buffer))) > ;=3D> (:buffer-offer-save t) > > (plist-get > =C2=A0(get (intern-soft "dead-weight-unless-you-look-for-me") > =C2=A0(get-buffer (current-buffer))) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 :buffer-offer-save) > ;=3D> (:buffer-offer-save t) > > (fundamental-mode) > > (plist-get > =C2=A0(get (intern-soft "dead-weight-unless-you-look-for-me") > =C2=A0 =C2=A0 =C2=A0(get-buffer (current-buffer))) > =C2=A0:buffer-offer-save) > ; =3D> t > > (emacs-lisp-mode) > > (plist-get > =C2=A0(get (intern-soft "dead-weight-unless-you-look-for-me") > =C2=A0 =C2=A0 =C2=A0(get-buffer (current-buffer))) > =C2=A0:buffer-offer-save) > ;=3D> t > > (fundamental-mode) > > (plist-get > =C2=A0(get (intern-soft "dead-weight-unless-you-look-for-me") > =C2=A0 =C2=A0 =C2=A0(get-buffer (current-buffer))) > =C2=A0:buffer-offer-save) > ;=3D> t > > (with-current-buffer (get-buffer (other-buffer)) > =C2=A0(buffer-local-value > =C2=A0 (intern-soft "dead-weight-unless-you-look-for-me") > =C2=A0 (current-buffer))) > ;=3D> still void. > > -- > /s_P\ >