"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "TeXmacs/progs/texmacs/texmacs/tm-view.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.

tm-view.scm  (TeXmacs-1.99.4-src):tm-view.scm  (TeXmacs-1.99.5-src)
skipping to change at line 45 skipping to change at line 45
(define (notify-status-bar var val) (define (notify-status-bar var val)
(show-footer (== val "on"))) (show-footer (== val "on")))
(define (notify-side-tools var val) (define (notify-side-tools var val)
(cond ((== var "side tools") (cond ((== var "side tools")
(show-side-tools 0 (== val "on"))))) (show-side-tools 0 (== val "on")))))
(define (notify-zoom-factor var val) (define (notify-zoom-factor var val)
(with z (string->number val) (with z (string->number val)
(set! z (max (min z 10.0) 0.1)) (set! z (max (min z 25.0) 0.04))
(set-default-zoom-factor z) (set-default-zoom-factor z)
(set-window-zoom-factor z))) (set-window-zoom-factor z)))
(define (notify-remote-control var val) (define (notify-remote-control var val)
(ahash-set! remote-control-remap val var)) (ahash-set! remote-control-remap val var))
(define-preferences (define-preferences
("header" "on" notify-header) ("header" "on" notify-header)
("main icon bar" (main-icon-bar-default) notify-icon-bar) ("main icon bar" (main-icon-bar-default) notify-icon-bar)
("mode dependent icons" "on" notify-icon-bar) ("mode dependent icons" "on" notify-icon-bar)
skipping to change at line 128 skipping to change at line 128
(define saved-informative-flags "default") (define saved-informative-flags "default")
(tm-define (toggle-full-screen-mode) (tm-define (toggle-full-screen-mode)
(:synopsis "Toggle full screen mode.") (:synopsis "Toggle full screen mode.")
(:check-mark "v" full-screen?) (:check-mark "v" full-screen?)
(if (full-screen?) (if (full-screen?)
(begin (begin
(init-env "info-flag" saved-informative-flags) (init-env "info-flag" saved-informative-flags)
(full-screen-mode #f #f) (full-screen-mode #f #f)
(fit-to-screen)) (restore-zoom (get-init-page-rendering)))
(begin (begin
(save-zoom (get-init-page-rendering))
(set! saved-informative-flags (get-init-env "info-flag")) (set! saved-informative-flags (get-init-env "info-flag"))
(init-env "info-flag" "none") (init-env "info-flag" "none")
(full-screen-mode #t #f) (full-screen-mode #t #f)
(fit-to-screen-width)))) (fit-to-screen-width))))
(tm-define (toggle-full-screen-edit-mode) (tm-define (toggle-full-screen-edit-mode)
(:synopsis "Toggle full screen edit mode.") (:synopsis "Toggle full screen edit mode.")
(:check-mark "v" full-screen-edit?) (:check-mark "v" full-screen-edit?)
(full-screen-mode (not (full-screen-edit?)) (not (full-screen-edit?)))) (let* ((old (full-screen?))
(new (not (full-screen-edit?))))
(when (and (not old) new)
(save-zoom (get-init-page-rendering)))
(full-screen-mode new new)
(when (and old (not new))
(restore-zoom (get-init-page-rendering)))))
(define panorama-revert (make-ahash-table))
(define (panorama-mode?) (== (get-init-page-rendering) "panorama"))
(tm-define (toggle-panorama-mode)
(:synopsis "Toggle panorama screen rendering.")
(:check-mark "v" panorama-mode?)
(if (panorama-mode?)
(with old (or (ahash-ref panorama-revert (current-buffer)) "paper")
(init-page-rendering old))
(with old (get-init-page-rendering)
(ahash-set! panorama-revert (current-buffer) old)
(init-page-rendering "panorama"))))
(tm-define (toggle-remote-control-mode) (tm-define (toggle-remote-control-mode)
(:synopsis "Toggle remote keyboard control mode.") (:synopsis "Toggle remote keyboard control mode.")
(:check-mark "v" remote-control-mode?) (:check-mark "v" remote-control-mode?)
(set! remote-control-flag? (not remote-control-flag?))) (set! remote-control-flag? (not remote-control-flag?)))
(define (test-zoom-factor? z) (define (test-zoom-factor? z)
(<= (abs (- (get-window-zoom-factor) (eval z))) 0.01)) (<= (abs (- (get-window-zoom-factor) (eval z))) 0.01))
(tm-define (change-zoom-factor z) (tm-define (change-zoom-factor z)
(:check-mark "*" test-zoom-factor?) (:check-mark "*" test-zoom-factor?)
(set! z (max (min z 10.0) 0.1)) (set! z (max (min z 25.0) 0.04))
(if (== (windows-number) 1) (when (and (== (windows-number) 1)
(set-preference "zoom factor" (number->string z)) (in? (get-init "page-packet") (list "1" "2")))
(set-window-zoom-factor z))) (set-preference "zoom factor" (number->string z)))
(set-window-zoom-factor z)
(notify-page-change)
(notify-change 1))
(tm-define (other-zoom-factor s) (tm-define (other-zoom-factor s)
(:argument s "Zoom factor") (:argument s "Zoom factor")
(if (string-ends? s "%") (if (string-ends? s "%")
(with p (string->number (string-drop-right s 1)) (with p (string->number (string-drop-right s 1))
(change-zoom-factor (* 0.01 p))) (change-zoom-factor (* 0.01 p)))
(change-zoom-factor (string->number s)))) (change-zoom-factor (string->number s))))
(define zoom-table (make-ahash-table))
(tm-define (save-zoom mode)
(with key (list (current-buffer) mode (full-screen?))
(ahash-set! zoom-table key (get-window-zoom-factor))))
(tm-define (restore-zoom mode)
(with key (list (current-buffer) mode (full-screen?))
(and-with zf (ahash-ref zoom-table key)
(when (!= zf (get-window-zoom-factor))
(change-zoom-factor zf)))))
(define (normalize-zoom-sub zoom l) (define (normalize-zoom-sub zoom l)
(cond ((null? l) zoom) (cond ((null? l) zoom)
((< (abs (- zoom (car l))) (* 0.02 zoom)) (car l)) ((< (abs (- zoom (car l))) (* 0.02 zoom)) (car l))
(else (normalize-zoom-sub zoom (cdr l))))) (else (normalize-zoom-sub zoom (cdr l)))))
(define (normalize-zoom zoom) (define (normalize-zoom zoom)
(with std-zooms (map (lambda (x) (exp (* x (/ (log 2.0) 4.0)))) (with std-zooms (map (lambda (x) (exp (* x (/ (log 2.0) 4.0))))
(.. -10 10)) (.. -10 10))
(normalize-zoom-sub zoom std-zooms))) (normalize-zoom-sub zoom std-zooms)))
(tm-define (zoom-in x) (tm-define (zoom-in x)
(let* ((old (get-window-zoom-factor)) (let* ((old (get-window-zoom-factor))
(new (normalize-zoom (* x old)))) (new (normalize-zoom (* x old))))
(change-zoom-factor new))) (change-zoom-factor new)))
(tm-define (zoom-out x) (tm-define (zoom-out x)
(zoom-in (/ 1.0 x))) (zoom-in (/ 1.0 x)))
(tm-define (fit-all-to-screen)
(let* ((zf (get-window-zoom-factor))
(ww (get-window-width))
(tw (get-total-width #f))
(dw (- (get-total-width #t) tw))
(wf (/ (- ww (* zf dw)) tw))
(wh (get-window-height))
(th (get-total-height #f))
(dh (- (get-total-height #t) th))
(hf (/ (- wh (* zf dh)) th))
(f (min wf hf)))
(change-zoom-factor (- f 0.0001))))
(tm-define (fit-to-screen) (tm-define (fit-to-screen)
(let* ((wf (/ (* 1.0 (get-window-width)) (get-page-width))) (let* ((zf (get-window-zoom-factor))
(hf (/ (* 1.0 (get-window-height)) (get-page-height))) (ww (get-window-width))
(pw (get-pages-width #f))
(dw (- (get-pages-width #t) pw))
(wf (/ (- ww (* zf dw)) pw))
(wh (get-window-height))
(ph (get-page-height #f))
(dh (- (get-page-height #t) ph))
(hf (/ (- wh (* zf dh)) ph))
(f (min wf hf))) (f (min wf hf)))
(change-zoom-factor (- f 0.0001)))) (change-zoom-factor (- f 0.0001))))
(tm-define (fit-to-screen-width) (tm-define (fit-to-screen-width)
(with f (/ (* 1.0 (get-window-width)) (get-page-width)) (let* ((zf (get-window-zoom-factor))
(ww (get-window-width))
(pw (get-pages-width #f))
(dw (- (get-pages-width #t) pw))
(f (/ (- ww (* zf dw)) pw)))
(change-zoom-factor (- f 0.0001)))) (change-zoom-factor (- f 0.0001))))
(tm-define (fit-to-screen-height) (tm-define (fit-to-screen-height)
(with f (/ (* 1.0 (get-window-height)) (get-page-height)) (let* ((zf (get-window-zoom-factor))
(wh (get-window-height))
(ph (get-page-height #f))
(dh (- (get-page-height #t) ph))
(f (/ (- wh (* zf dh)) ph)))
(change-zoom-factor (- f 0.0001)))) (change-zoom-factor (- f 0.0001))))
 End of changes. 10 change blocks. 
11 lines changed or deleted 73 lines changed or added

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