emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: face-remapping patch


From: David Kastrup
Subject: Re: face-remapping patch
Date: Fri, 30 May 2008 00:15:55 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

"Stephen J. Turnbull" <address@hidden> writes:

> David Kastrup writes:
>
>  > However, I don't think the price for the generality of specifiers is
>  > worth the complexity in the particular implementation and documentation
>  > state of XEmacs.  I did not understand them after trying for a
>  > considerable amount of time,
>
> AFAIK David never did review the documentation after it was revised to
> address his problem report.  Specifiers really are not that
> complicated for most uses.

preview-latex contains the following in prv-xemacs.el (and yes, this was
quite after the documentation had been "revised" and I wasted several
hours again):

    (when preview-tb-icon
      (setq preview-tb-icon
            (vector
             (list preview-tb-icon)
             #'preview-at-point
             t
             "Preview on/off at point"))))
;;; [Courtesy Stephen J. Turnbull, with some modifications
;;;  Message-ID: <address@hidden>
;;;  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)))))

Sorry, but that is just not what I see as an API people with my
stupidity level can be considered to be able to work with.  The
corresponding passage for Emacs reads:

  (when preview-tb-icon
    (define-key LaTeX-mode-map [tool-bar preview]
      `(menu-item "Preview at point" preview-at-point
                  :image ,preview-tb-icon
                  :help "Preview on/off at point")))

That is something that I can actually not only read, but which I could
also write.  Yes, it helped that Emacs documentation was useful, all in
one place and with actual examples.  But even supposing that the XEmacs
documentation might have caught up, the code you have to write is still
a incoherent mess for someone like me.  Documenting the incoherent mess
is only taking me so far forward.  My eyes still glaze over when I have
to look at something like that.  And having, say, three convenience
functions for covering the most important applications of this general
mechanism would be only helping somewhat.

I don't want stuff like that in package code when the code is not
explicitly strictly meddling in internals of the package itself.  This
is wizard-level code which has no place whatsoever in straightforward
application coding.

The stuff for Emacs, in contrast, is a straightforward keymap menu
entry.  Yes, XEmacs programmers will all sneer at the "unclean" way
Emacs uses keymaps for toolbars, menus and whatnot.  But it keeps the
complexity manageable.  For the programmer.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum




reply via email to

[Prev in Thread] Current Thread [Next in Thread]