Index: src/System/Boot/init_texmacs.cpp
===================================================================
--- src/System/Boot/init_texmacs.cpp	(revision 3876)
+++ src/System/Boot/init_texmacs.cpp	(working copy)
@@ -136,6 +136,7 @@
   make_dir ("$TEXMACS_HOME_PATH/styles");
   make_dir ("$TEXMACS_HOME_PATH/system");
   make_dir ("$TEXMACS_HOME_PATH/system/bib");
+  make_dir ("$TEXMACS_HOME_PATH/system/prefgroups");
   make_dir ("$TEXMACS_HOME_PATH/system/cache");
   make_dir ("$TEXMACS_HOME_PATH/system/tmp");
   make_dir ("$TEXMACS_HOME_PATH/texts");
Index: TeXmacs/progs/kernel/texmacs/tm-preferences.scm
===================================================================
--- TeXmacs/progs/kernel/texmacs/tm-preferences.scm	(revision 3876)
+++ TeXmacs/progs/kernel/texmacs/tm-preferences.scm	(working copy)
@@ -125,6 +125,15 @@
 	 (comp? (lambda (l1 l2) (string<=? (car l1) (car l2)))))
     (list-sort unsorted comp?)))
 
+(define (preferences->list-some selected table)
+  (let* ((mapper (lambda (key) (list key (ahash-ref table key))))
+	 (unsorted (map mapper selected))
+	 (comp? (lambda (l1 l2) (string<=? (car l1) (car l2)))))
+    (list-sort unsorted comp?)))
+
+(define-public (preferences->list-some-default selected)
+  (preferences->list-some selected preferences-table))
+
 (define (save-preferences)
   (set! user-preferences (preferences->list preferences-table))
   (if (!= user-preferences saved-preferences)
@@ -140,5 +149,13 @@
 	    (load-object "$TEXMACS_HOME_PATH/system/preferences.scm")))
   (fill-dictionary preferences-table saved-preferences))
 
+(define-public (load-preferences-from-list l)
+  (do ((p l (cdr p))) ((null? p))
+    (let ((which (caar p)) (what (cadar p)))
+      (ahash-set! preferences-table which what)
+      ((get-call-back which) which (get-preference which))
+  (save-preferences))))
+
+
 (retrieve-preferences)
 (notify-preferences-loaded)
Index: TeXmacs/progs/kernel/texmacs/tm-prefgroups.scm
===================================================================
--- TeXmacs/progs/kernel/texmacs/tm-prefgroups.scm	(revision 0)
+++ TeXmacs/progs/kernel/texmacs/tm-prefgroups.scm	(revision 0)
@@ -0,0 +1,107 @@
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; MODULE      : tm-convert-styles.scm
+;; DESCRIPTION : Converting styles
+;; COPYRIGHT   : (C) 2010  Victor Porton
+;;
+;; This software falls under the GNU general public license version 3 or later.
+;; It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
+;; in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(texmacs-module (kernel texmacs tm-prefgroups)
+  (:use (kernel texmacs tm-preferences)))
+
+(define prefgroups-hash (make-ahash-table))
+
+(define (get-prefgroup-as-list group)
+  (let ((l (ahash-ref prefgroups-hash group)))
+    (if (== l #f)
+      (let* ((file (string-concatenate (list "$TEXMACS_HOME_PATH/system/prefgroups/" group ".scm")))
+             (l2 (if (url-exists? file) (load-object file) '())))
+	  (ahash-set! prefgroups-hash group l2)
+	  l2)
+      l)))
+
+; It may modify @l
+(define (update-pref-list! prefgroup name value)
+  (let ((found #f))
+    (let ((p prefgroup))
+      (while (not (null? p))
+	(when (== (caar p) name)
+	  (set-car! (cdar p) value)
+	  (set! found #t)
+	  (break))
+	(set! p (cdr p))))
+    (if found
+      prefgroup
+      (append! prefgroup (list (list name value))))))
+
+(define (save-prefgroup group name selected)
+    (let ((l (preferences->list-some-default selected))
+	  (prefgroup (get-prefgroup-as-list group)))
+      (let ((new-prefgroup (update-pref-list! prefgroup name l)))
+	(ahash-set! prefgroups-hash group new-prefgroup)
+	(let ((file (string-concatenate (list "$TEXMACS_HOME_PATH/system/prefgroups/" group ".scm"))))
+	  (save-object file new-prefgroup)))))
+
+(define (map-pairs func l)
+  (if (null? l)
+    '()
+    (cons (func l) (map-pairs func (cdr l)))))
+
+; I made a menu in a wrong way. Indeed it works.
+; However when you will correct it, mail me (porton@narod.ru)
+; so that I will know what is the right way.
+(define (prefgroup-menu group op)
+  (let ((l (get-prefgroup-as-list group)))
+    (map-pairs (lambda (pair) (list (caar pair) (lambda () (op pair group))))
+      l)))
+
+(define (prefgroup-load pair group)
+  (load-preferences-from-list (cadar pair)))
+
+; May return a list with common tail
+(define (my-list-remove-pair! l p)
+  (if (null? l)
+    '()
+    (if (eq? p l)
+      (cdr p)
+      (cons (car l) (my-list-remove-pair! (cdr l) p)))))
+
+(define (do-prefgroup-remove pair group)
+  (let ((new-prefgroup (my-list-remove-pair! (get-prefgroup-as-list group) pair)))
+    (ahash-set! prefgroups-hash group new-prefgroup)
+    (let ((file (string-concatenate (list "$TEXMACS_HOME_PATH/system/prefgroups/" group ".scm"))))
+      (save-object file new-prefgroup))))
+
+(define (prefgroup-remove pair group)
+  (dialogue
+    (when (dialogue-confirm? (string-concatenate (list "Remove option set \"" (caar pair) "\"?")) #f)
+      (do-prefgroup-remove pair group))))
+
+;; Definitions of specific groups follow
+
+(tm-define (prefgroup-choose-menu:latex)
+  (prefgroup-menu "to-latex" prefgroup-load))
+(tm-define (prefgroup-remove-menu:latex)
+  (prefgroup-menu "to-latex" prefgroup-remove))
+
+(define (do-save-prefgroup group props)
+  (interactive
+    (lambda (name)
+      (save-prefgroup group name props)
+      "Name of the preferences group")))
+
+(tm-define (save-prefgroup:latex)
+  (:interactive #t)
+  (do-save-prefgroup
+    "to-latex"
+    '("texmacs->latex:replace-style"
+      "texmacs->latex:expand-macros"
+      "texmacs->latex:expand-user-macros"
+      "texmacs->latex:indirect-bib"
+      "texmacs->latex:use-catcodes"
+      "texmacs->latex:use-macros")))
Index: TeXmacs/progs/texmacs/menus/preferences-menu.scm
===================================================================
--- TeXmacs/progs/texmacs/menus/preferences-menu.scm	(revision 3876)
+++ TeXmacs/progs/texmacs/menus/preferences-menu.scm	(working copy)
@@ -18,7 +18,8 @@
     (texmacs texmacs tm-view)
     (texmacs texmacs tm-print)
     (texmacs keyboard config-kbd)
-    (convert latex init-latex)))
+    (convert latex init-latex)
+    (kernel texmacs tm-prefgroups)))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Preferred scripting language
@@ -139,6 +140,11 @@
 	    (toggle ("Use MathML" "texmacs->html:mathml"))
 	    (toggle ("Export formulas as images" "texmacs->html:images")))
 	(-> "TeXmacs -> LaTeX"
+	    ("Save conversion style" (save-prefgroup:latex))
+	    (-> "Load conversion style" (link prefgroup-choose-menu:latex))
+	    (-> "Remove conversion style" (link prefgroup-remove-menu:latex))
+
+	    ---
 	    (toggle ("Replace unrecognized styles"
 		     "texmacs->latex:replace-style"))
 	    (toggle ("Expand unrecognized macros"
