Mercurial > hg > xemacs-beta
view man/lispref/dragndrop.texi @ 5634:2014ff433daf
Support hash COLLECTIONs, #'{all,try}-completion{s,}; add #'test-completion
src/ChangeLog addition:
2012-01-01 Aidan Kehoe <kehoea@parhasard.net>
Add #'test-completion, API from GNU.
Accept hash table COLLECTIONs in it and in the other
completion-oriented functions, #'try-completion,
#'all-completions, and those Lisp functions implemented in terms
of them.
* lisp.h: Update the prototype of map_obarray(), making FN
compatible with the FUNCTION argument of elisp_maphash();
* abbrev.c (abbrev_match_mapper):
* abbrev.c (record_symbol):
* doc.c (verify_doc_mapper):
* symbols.c (mapatoms_1):
* symbols.c (apropos_mapper):
Update these mapper functions to reflect the new argument to
map_obarray().
* symbols.c (map_obarray):
Call FN with two arguments, the string name of the symbol, and the
symbol itself, for API (mapper) compatibility with
elisp_maphash().
* minibuf.c (map_completion): New. Map a maphash_function_t across
a non function COLLECTION, as appropriate for #'try-completion and
friends.
* minibuf.c (map_completion_list): New. Map a maphash_function_t
across a pseudo-alist, as appropriate for the completion
functions.
* minibuf.c (ignore_completion_p): PRED needs to be called with
two args if and only if the collection is a hash table. Implement
this.
* minibuf.c (try_completion_mapper): New. The loop body of
#'try-completion, refactored out.
* minibuf.c (Ftry_completion): Use try_completion_mapper(),
map_completion().
* minibuf.c (all_completions_mapper): New. The loop body of
#'all-completions, refactored out.
* minibuf.c (Fall_completions): Use all_completions_mapper(),
map_completion().
* minibuf.c (test_completion_mapper): New. The loop body of
#'test-completion.
* minibuf.c (Ftest_completion): New, API from GNU.
* minibuf.c (syms_of_minibuf): Make Ftest_completion available.
tests/ChangeLog addition:
2012-01-01 Aidan Kehoe <kehoea@parhasard.net>
* automated/completion-tests.el: New.
Test #'try-completion, #'all-completion and #'test-completion with
list, vector and hash-table COLLECTION arguments.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Sun, 01 Jan 2012 15:18:52 +0000 |
parents | bc4f2511bbea |
children |
line wrap: on
line source
@c -*-texinfo-*- @c This is part of the XEmacs Lisp Reference Manual. @c Copyright (C) 1998 Oliver Graf <ograf@fga.de> @c Original reference is (c) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc. @c See the file lispref.texi for copying conditions. @setfilename ../../info/dragndrop.texi @node Drag and Drop, Modes, Scrollbars, Top @chapter Drag and Drop @cindex drag and drop @emph{WARNING}: the Drag'n'Drop API is still under development and the interface may change! The current implementation is considered experimental. Drag'n'drop is a way to transfer information between multiple applications. To do this several GUIs define their own protocols. Examples are CDE, Motif, KDE, MSWindows, GNOME, and many more. To catch all these protocols, XEmacs provides a generic API. One prime idea behind the API is to use a data interface that is transparent for all systems. The author thinks that this is best archived by using URL and MIME data, cause any internet enabled system must support these for email already. XEmacs also already provides powerful interfaces to support these types of data (tm and w3). @menu * Supported Protocols:: Which low-level protocols are supported. * Drop Interface:: How XEmacs handles a drop from another application. * Drag Interface:: Calls to initiate a drag from XEmacs. @end menu @node Supported Protocols @section Supported Protocols The current release of XEmacs only support a small set of Drag'n'drop protocols. Some of these only support limited options available in the API. @menu * CDE dt:: Common Desktop Environment used on suns. * MSWindows OLE:: Mr. Gates way of live. * Loose ends:: The other protocols. @end menu @node CDE dt @subsection CDE dt @cindex CDE dt CDE stands for Common Desktop Environment. It is based on the Motif widget library. It's drag'n'drop protocol is also an abstraction of the Motif protocol (so it might be possible, that XEmacs will also support the Motif protocol soon). CDE has three different types: file, buffer, and text. XEmacs only uses file and buffer drags. The API will disallow full URL drags, only file method URLs are passed through. Buffer drags are always converted to plain text. @node MSWindows OLE @subsection MSWindows OLE @cindex MSWindows OLE Only allows file drags and drops. @node Loose ends @subsection Loose ends The following protocols will be supported soon: Xdnd, Motif, Xde (if I get some specs). In particular Xdnd will be one of the protocols that can benefit from the XEmacs API, cause it also uses MIME types to encode dragged data. @node Drop Interface @section Drop Interface @cindex drop @cindex Drop API For each activated low-level protocol, an internal routine will catch incoming drops and convert them to a dragdrop-drop type misc-user-event. This misc-user-event has its function argument set to @code{dragdrop-drop-dispatch} and the object contains the data of the drop (converted to URL/MIME specific data). This function will search the variable @code{experimental-dragdrop-drop-functions} for a function that can handle the dropped data. To modify the drop behavior, the user can modify the variable @code{experimental-dragdrop-drop-functions}. Each element of this list specifies a possible handler for dropped data. The first one that can handle the data will return @code{t} and exit. Another possibility is to set a extent-property with the same name. Extents are checked prior to the variable. The customization group @code{drag-n-drop} shows all variables of user interest. @node Drag Interface @section Drag Interface @cindex drag @cindex Drag API This describes the drag API (not implemented yet).