From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: frame-local variables weirdness Date: Wed, 17 Oct 2007 23:03:28 +0200 Message-ID: <85fy09e9nj.fsf@lola.goethe.zz> References: <858x65lh4m.fsf@lola.goethe.zz> <2bfd4e060710171029g30a62313naf31c5363d85d6ca@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1192654990 13764 80.91.229.12 (17 Oct 2007 21:03:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 17 Oct 2007 21:03:10 +0000 (UTC) Cc: lekktu@gmail.com, emacs-devel@gnu.org, Stefan Monnier , rms@gnu.org To: "Stephen J. Turnbull" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 17 23:03:10 2007 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.50) id 1IiG2V-0001K6-Mz for ged-emacs-devel@m.gmane.org; Wed, 17 Oct 2007 23:02:52 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IiG2O-0002oO-Im for ged-emacs-devel@m.gmane.org; Wed, 17 Oct 2007 17:02:44 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IiG2M-0002oH-2i for emacs-devel@gnu.org; Wed, 17 Oct 2007 17:02:42 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IiG2K-0002o5-Jw for emacs-devel@gnu.org; Wed, 17 Oct 2007 17:02:40 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IiG2K-0002o2-Dv for emacs-devel@gnu.org; Wed, 17 Oct 2007 17:02:40 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IiG2K-0003SS-02 for emacs-devel@gnu.org; Wed, 17 Oct 2007 17:02:40 -0400 Original-Received: from localhost ([127.0.0.1] helo=lola.goethe.zz) by fencepost.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IiG2D-0004fP-OE; Wed, 17 Oct 2007 17:02:34 -0400 Original-Received: by lola.goethe.zz (Postfix, from userid 1002) id AAAC41C4D4B3; Wed, 17 Oct 2007 23:03:28 +0200 (CEST) In-Reply-To: <2bfd4e060710171029g30a62313naf31c5363d85d6ca@mail.gmail.com> (Stephen J. Turnbull's message of "Wed\, 17 Oct 2007 10\:29\:15 -0700") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) 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:81097 Archived-At: "Stephen J. Turnbull" writes: > FWIW, let me remind you that XEmacs has specifiers, which allow > rather flexible mix and match of buffer-local, window-local, and > frame-local properties. The point is that specifiers have a > separate API, no unmarked magic. And terminal-local and other stuff. > This has been a workable compromise for me in those cases where I > want to use it (eg, faces, where specifiers implement flexibility > very similar to Emacs's defface; XEmacs's faces are implemented as a > wrapper around a set of specifiers containing display properties). > There are a few other cases where I've enjoyed the flexibility > (usually controlling behavior of functions associated with active > regions in a display, and in controlling display elements such as > toolbars, tabs, and scrollbars). > > David Kastrup may have an informative opinion, since he found > XEmacs's glyph (~ Emacs image) API, uh, "annoying" (and even its > author admits it's probably excessively complex and detailed). But > I'm not sure whether he objects to the idea of such an API, or > merely to XEmacs's implementation in glyphs. You should use quote marks only around things you actually quote. I don't think I called them "annoying". I certainly was quite annoyed when I fought with understanding them, but my annoyance was more directed against their creators. "incomprehensible" would more likely be a word I would have used to describe them. My main problem with specifiers and locales and instantiators was (I am using the past tense here not because I have by now understood them, but because I have stopped investing any more time into them) that they more or less magically change from one form to another, and it is rather incomprehensible when they do which. I hear that the documentation is supposed to be more comprehensive by now, but the point is that the documentation needs to be (and is) all over the place. In contrast, the *-local variables of Emacs need just a single place in the manual to explain, giving all the _additional_ story while working like a normal bindings otherwise. And that is something which can be used and understood by non-magicians. It may be considered sort of amusing that the opaque frame/terminal variable mechanisms are used in the we-don't-want-opaque-data-structures Emacs and the all-internals-open specifiers in XEmacs. But the main problem in my book with the open XEmacs data structures actually is that there is no reasonably complete and actually employed API for accessing them. So one needs to acquire an understanding of the internal structure of them if one hopes to understand existing code, and mostly also for writing code of one's own. We have in preview-latex code like the following for XEmacs: ;;; [Courtesy Stephen J. Turnbull, with some modifications ;;; Message-ID: <87el9fglsj.fsf@tleepslib.sk.tsukuba.ac.jp> ;;; I could not have figured this out for the world] ;;; Hm, there really ought to be a way to get the spec that would be ;;; instantiated in a given domain (when preview-tb-icon (let ((tb (cdadar (or (specifier-spec-list default-toolbar (current-buffer)) (specifier-spec-list default-toolbar 'global))))) (unless (member preview-tb-icon tb) (set-specifier default-toolbar (append tb (list preview-tb-icon)) (current-buffer))))) There were actually quite a few more ugly examples with regard to images in earlier times, but I have rewritten the general functionality/API for the Emacs parts in order to make the worst XEmacs counterparts be cleaner. So basically my opinion is that one needs too many complex details in order to write or understand code involving specifiers. While the state of the documentation might have improved to a point where this information is no longer generally lacking or distributed across a maze of by-the-way entries, the main problem of the unavoidable complexity one needs to understand for doing simple tasks remains. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum