"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "TeXmacs/progs/generic/document-part.scm" between
TeXmacs-1.99.4-src.tar.gz and TeXmacs-1.99.5-src.tar.gz

About: GNU TeXmacs is a what-you-see-is-what-you-get scientific text editor, which was both inspired by TeX and GNU Emacs.

document-part.scm  (TeXmacs-1.99.4-src):document-part.scm  (TeXmacs-1.99.5-src)
skipping to change at line 45 skipping to change at line 45
(with l (map (lambda (x) (expand-includes-one x r)) (tree-children t)) (with l (map (lambda (x) (expand-includes-one x r)) (tree-children t))
(cons 'document (apply append l)))) (cons 'document (apply append l))))
(else (else
(with l (map (lambda (x) (expand-includes x r)) (tree-children t)) (with l (map (lambda (x) (expand-includes x r)) (tree-children t))
(cons (tree-label t) l))))) (cons (tree-label t) l)))))
(tm-define (buffer-expand-includes) (tm-define (buffer-expand-includes)
(with t (buffer-tree) (with t (buffer-tree)
(tree-assign! t (expand-includes (buffer-tree) (buffer-master))))) (tree-assign! t (expand-includes (buffer-tree) (buffer-master)))))
(define (buffer-master?) (== (get-init "project-flag") "true"))
(tm-define (buffer-toggle-master)
(:synopsis "Toggle using current buffer as master file of project.")
(:check-mark "v" buffer-master?)
(init-env "project-flag"
(if (== (get-init "project-flag") "true") "false" "true")))
(define (project-attach* u)
(with name (url->unix (url-delta (current-buffer) u))
(project-attach name)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Main internal representations for document parts: ;; Main internal representations for document parts:
;; :preamble -> (document (show-preamble preamble) (ignore body)) ;; :preamble -> (document (show-preamble preamble) (ignore body))
;; :one, :several -> (document [optional (hide-preamble pre)] hide-show-list) ;; :one, :several -> (document [optional (hide-preamble pre)] hide-show-list)
;; :all -> (document [optional (hide-preamble preamble)] body) ;; :all -> (document [optional (hide-preamble preamble)] body)
;; In the case of :one and :several, the hide-show-list contains items ;; In the case of :one and :several, the hide-show-list contains items
;; (show-part id body alt-body) ;; (show-part id body alt-body)
;; (hide-part id body alt-body) ;; (hide-part id body alt-body)
;; Here id is an identifier for referencing purposes ;; Here id is an identifier for referencing purposes
;; The alt-body is evaluated in the background in the case of hidden parts ;; The alt-body is evaluated in the background in the case of hidden parts
skipping to change at line 264 skipping to change at line 275
(and-with t (list-find (tree-children (buffer-tree)) search?) (and-with t (list-find (tree-children (buffer-tree)) search?)
(tree-show-hidden t) (tree-show-hidden t)
#t))) #t)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Buffer with included files ;; Buffer with included files
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (tm-include? t) (define (tm-include? t)
(and (tm-func? t 'include 1) (and (tm-func? t 'include 1)
(tm-atomic? (tm-ref t 0)) (tm-atomic? (tm-ref t 0))))
(not (string-starts? (tm->string (tm-ref t 0)) ".."))))
(tm-define (tm-get-includes doc) (tm-define (tm-get-includes doc)
(cond ((tm-func? doc 'with) (cond ((tm-func? doc 'with)
(tm-get-includes (tm-ref doc :last))) (tm-get-includes (tm-ref doc :last)))
((tm-func? doc 'document) ((tm-func? doc 'document)
(append-map tm-get-includes (tm-children doc))) (append-map tm-get-includes (tm-children doc)))
((tm-include? doc) ((tm-include? doc)
(list (tm->string (tm-ref doc 0)))) (list (tm->string (tm-ref doc 0))))
(else (list)))) (else (list))))
(tm-define (buffer-get-includes) (tm-define (buffer-get-includes)
(tm-get-includes (buffer-tree))) (tm-get-includes (buffer-tree)))
(tm-define (buffer-contains-includes?) (tm-define (buffer-contains-includes?)
(and (nnull? (buffer-get-includes)) (nnull? (buffer-get-includes)))
(url-rooted-protocol? (current-buffer) "default")))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; The dynamic document part menu ;; The dynamic document part menu
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(tm-menu (document-parts-menu) (tm-menu (document-parts-menu)
(let* ((all (buffer-parts-list #t)) (let* ((all (buffer-parts-list #t))
(active (buffer-parts-list #f)) (active (buffer-parts-list #f))
(make (lambda (id) (document-parts-menu-entry id (in? id active))))) (make (lambda (id) (document-parts-menu-entry id (in? id active)))))
(for (id all) (for (id all)
((check (eval (upcase-first id)) "v" (in? id active)) ((check (eval (upcase-first id)) "v" (in? id active))
(if (== (buffer-get-part-mode) :one) (if (== (buffer-get-part-mode) :one)
(buffer-show-part id) (buffer-show-part id)
(buffer-toggle-part id)))))) (buffer-toggle-part id))))))
(menu-bind preamble-menu
(if (buffer-has-preamble?)
("Show preamble" (buffer-set-part-mode :preamble)))
(if (not (buffer-has-preamble?))
("Create preamble" (buffer-make-preamble)))
("Show main document" (buffer-set-part-mode :all)))
(menu-bind document-part-menu (menu-bind document-part-menu
(if (buffer-has-preamble?) (if (buffer-has-preamble?)
("Show preamble" (buffer-set-part-mode :preamble))) ("Show preamble" (buffer-set-part-mode :preamble)))
(if (not (buffer-has-preamble?)) (if (not (buffer-has-preamble?))
("Create preamble" (buffer-make-preamble))) ("Create preamble" (buffer-make-preamble)))
("Show one part" (buffer-set-part-mode :one)) ("Show one part" (buffer-set-part-mode :one))
("Show several parts" (buffer-set-part-mode :several)) ("Show several parts" (buffer-set-part-mode :several))
("Show all parts" (buffer-set-part-mode :all)) ("Show all parts" (buffer-set-part-mode :all))
(if (or (in? (buffer-get-part-mode) '(:one :several)) (if (or (in? (buffer-get-part-mode) '(:one :several))
(!= (get-init-tree "sectional-short-style") (tree 'macro "false"))) (!= (get-init-tree "sectional-short-style") (tree 'macro "false")))
--- ---
(when (in? (buffer-get-part-mode) '(:one :several)) (when (in? (buffer-get-part-mode) '(:one :several))
(link document-parts-menu)))) (link document-parts-menu))))
(menu-bind document-part-menu (menu-bind document-part-menu
(:require (buffer-contains-includes?)) (:require (buffer-contains-includes?))
(link document-master-menu)) (link document-master-menu))
(menu-bind project-manage-menu (menu-bind project-manage-menu
(group "Upgrade") (when (buffer-contains-includes?)
("Expand inclusions" (buffer-expand-includes)) (if (!= (url-suffix (current-buffer)) "tp")
("Use as master" (buffer-toggle-master)))
("Expand inclusions" (buffer-expand-includes)))
--- ---
(group "Old style")
(when (not (project-attached?)) (when (not (project-attached?))
("Attach master" (interactive project-attach))) ("Attach master"
(choose-file project-attach* "Attach master file for project" "texmacs")))
(when (project-attached?) (when (project-attached?)
("Detach master" (project-detach)))) ("Detach master" (project-detach))))
 End of changes. 7 change blocks. 
8 lines changed or deleted 26 lines changed or added

Home  |  About  |  All  |  Newest  |  Fossies Dox  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTPS