Hello Felix, I've started looking at how I could implement the "Import source..." command for the literate programming mode. It appears that it is much less obvious than I thought initially, especially because the comment style varies from one project to another.
Taking some examples in TeXmacs sources: * TeXmacs/progs/kernel/gui/menu-define.scm: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Preparation of menu entries ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define (menu-format-error where which) * src/Classes/Abstract/observer.cpp: /****************************************************************************** * Debugging facilities ******************************************************************************/ extern tree the_et; * another example: ./src/Data/Drd/tag_info.hpp:17:/****************************************************************************** ./src/Data/Drd/tag_info.hpp:18:* The parent_info class contains outer information about tags ./src/Data/Drd/tag_info.hpp:19:* ./src/Data/Drd/tag_info.hpp:20:* - The arity fields together with the child_mode determine the possible ./src/Data/Drd/tag_info.hpp:21:* arities and how to convert logical indices of children to It would need quite some heuristics to make an import mechanism that works across all languages and commenting habits. I'm wondering if it wouldn't be much more simple and efficient to only allow regular opening, in that case the whole source file would appear as a code block, and let the user "clean-up" the file with a few menu items: - merge two code blocks; - split a code block (at mouse or cursor point); - remove one or more character at the beginning or end of each line (much like rectangles in Emacs); - transform a code block into text block and vice-versa. What do you think of it? Best wishes, d. -- pub 1024D/A3AD7A2A 2004-10-03 David MENTRE <[EMAIL PROTECTED]> 5996 CC46 4612 9CA4 3562 D7AC 6C67 9E96 A3AD 7A2A _______________________________________________ Texmacs-dev mailing list [email protected] http://lists.gnu.org/mailman/listinfo/texmacs-dev
