emacs-devel
[Top][All Lists]
Advanced

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

Rationale for add-to-ordered-list


From: Kim F. Storm
Subject: Rationale for add-to-ordered-list
Date: Tue, 14 Jun 2005 16:33:05 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

The following change:

2005-06-13  Kim F. Storm  <address@hidden>

        * subr.el (add-to-ordered-list): New defun.

        * emulation/cua-base.el (cua-mode): Use add-to-ordered-list to
        add cua--keymap-alist to emulation-mode-map-alists.


was installed as a preparation for allowing cua-mode and viper-mode
to co-exist and co-operate seamlessly, when viper-mode has been
changed to use emulation-mode-map-alists.

The benefit of the change is that it becomes trivial to ensure that
the viper and cua entries in emulation-mode-map-alists are always in
the proper order (viper first), if future modes need to use the list
too.

The reason why at present only symbol elements can be ordered is a
practical one for the up-coming release -- it is sufficient for the
specific case of emulation-mode-map-alists.

A general solution is non-trivial, as there is a potential risk of memory
leaks, as associating ordering information with arbitrary lisp objects
means that we must store a pointer to such objects somewhere, and thus
may leave references to otherwise unused data.

So IMHO it was better to choose the trivial implementation now and
leave enhancements for after the release.

--
Kim F. Storm <address@hidden> http://www.cua.dk





reply via email to

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