auctex-devel
[Top][All Lists]
Advanced

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

[AUCTeX-devel] [Stephen J. Turnbull] Re: tiny inefficieny in `beginning-


From: David Kastrup
Subject: [AUCTeX-devel] [Stephen J. Turnbull] Re: tiny inefficieny in `beginning-of-defun-raw', lisp.el
Date: Fri, 09 Oct 2009 09:07:37 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)

Do we have people using XEmacs who would like to test these improved
proposals?  I don't really like leaving ugly code like the original in.

--- Begin Message --- Subject: Re: tiny inefficieny in `beginning-of-defun-raw', lisp.el Date: Fri, 09 Oct 2009 12:05:36 +0900
David Kastrup writes:

 > prv-xemacs.el:
 > 
 > ;;; [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)))))

David, when you later showed me the actual code, I realized that you
didn't need that, and I told you that `specifier-instance' was
sufficient.  I guess that

(when preview-tb-icon
  (set-specifier default-toolbar
                 (append (remove preview-tb-icon
                                 (specifier-instance default-toolbar))
                         (list preview-tb-icon))
                 (current-buffer)
                 nil
                 'remove-locale))

which is much more intelligible, would DTRT.  It's probably possible
to simplify it even further, to

(when preview-tb-icon
  (set-specifier default-toolbar
                 (cons preview-tb-icon (specifier-instance default-toolbar))
                 (current-buffer))

which is suddenly looking almost civilized.

You should also consider that it's not surprising that the original
version was clumsy.  I went from knowing nothing about specifiers *or*
toolbars to knowing almost as much as I do now in the space of two or
three days, including rewriting the whole Info node on specifiers.[1]
As far as I know, you still have never read the improved version. :-(

 > >  > I think it is still impossible to use a :file specification for
 > >  > image specifiers of binary formats (jpg, png and binary pnm
 > >  > formats) in XEmacs once you have loaded dired.el.
 > >
 > > Could be.  I don't recall it specifically, but dired does install a
 > > bunch of handlers so it sounds plausible.  If you recall about when
 > > and where you previously reported it that would help.
 > 
 > Basically about 2005 or so.
 > 
 > The original reports on xemacs-beta seem to be under the subject "Coding
 > bug in insert-file-contents-internal".

IIRC some bug was identified and fixed as a result of that thread.
But I think the relevant API is `insert-file-contents-literally', not
`insert-file-contents-internal', so it's quite possible a bug
involving use of the wrong API was involved too.  Ie, the original
problem was not solved by the bugfix applied.  Anyway, thank you for
the reference!

Footnotes: 
[1]  And in case you're tempted to take that as a putdown, don't.  I
just happened to have time and interest to do the work then.




--- End Message ---

-- 
David Kastrup

reply via email to

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