工作日志

9.16

修复报错字体大小bug 补充日志

TeXmacs/progs/debug/debug-widgets.scm

修改build-message 为以下

(define (build-message m)
  (let* ((k (tm->stree (tm-ref m 0)))
         (s (utf8->cork (tm->stree (tm-ref m 1))))
         (t (tm->stree (tm-ref m 2))))
    (cond ((string-ends? k "-error")
           `(with "color" "#e02020" "font-size" "2.5" "font-weight" "bold" (concat "Error: " ,s)))
          ((and (!= t "") (== (get-preference "console details") "detailed"))
           `(document ,(build-message `(tuple ,(tm-ref m 0) ,(tm-ref m 1) ""))
                      (indent (small ,t))))
           ((string-ends? k "-warning")
           `(with "color" "dark magenta" "font-size" "2.5" "font-weight" "bold" (concat "Warning: " ,s)))
          
          ((string-ends? k "-bench")
           `(with "color" "dark blue" ,s))
          (else s))))

日志内容

# 202_44:报错信息过小

## 如何测试

1. 直接拖入图片
2. 点击左上方的插入`scheme` 输入 `(debug-message "std-error" "file not found ")`可复现

## 2025/09/15

### What

修改实际报错调用`TeXmacs/progs/debug/debug-widgets.scm`的字体大小即可

实际上会输出到控制台的根据以下代码可以确认为`error`和`warning` 两种类型 ,`bench`类型不会输出到控制台
修改了对`error`和 `warning` 类型字体的正常大小

```scheme
(tm-define (notify-debug-message channel)
  (when (string-ends? channel "-error")
    (set! console-errors? #t))
  (when (string-ends? channel "-warning")
    (set! console-warnings? #t))
  (when (not console-updating?)
    (set! console-updating? #t)
    (delayed
      (:idle 1)
      (update-consoles))))




pr内容

```txt
1. !666 [202_44]修复报错信息过小的问题

resolved #ICXOM4 

![输入图片说明](https://foruda.gitee.com/images/1758080894226340811/a4ec6f4c_14826644.png "屏幕截图")

9.17

关闭未保存文件 导致运行崩溃

Launching build/linux/x86_64/release/moganstem
Installing internal plug-ins...
Opening display...
Screen extents: 1404 x 790
Starting server...
Benchmark 1
832040
Time: 10
Booting TeXmacs kernel functionality

;apply's last argument should be a proper list: recent-buffer
;    (lambda (form arg) (with a (or...
;    /home/phrink/work/code/mogan/TeXmacs/progs/kernel/texmacs/tm-dialogue.scm, line 347, position: 13007
; decode-old: ((let* ((r (ahash-table->list... ; t: (hash-table 'symbol (("#<lambda...
; (primitive-load file (if (null? env) *cur...
; ((load *module-file* (curlet)))            ; *module-file*: "/home/phrink/work/code/mogan/T...

Creating 'no name' buffer...
TeXmacs] debug-std, Use MuPDF render(1.25.1)
TeXmacs] std-bench, Task 'tt_font_exists Mogan-NotoColorEmoji' took 21 ms
TeXmacs] With linked TrueType support
TeXmacs] debug-std, Redefined color dark slate
TeXmacs] debug-std, #2F4F4F replaced by #483D8B
TeXmacs] debug-std, Redefined color light slate
TeXmacs] debug-std, #778899 replaced by #8470FF
TeXmacs] debug-std, Redefined color light goldenrod
TeXmacs] debug-std, #FAFAD2 replaced by #EEDD82

;unbound variable buffer-missing-style? in (buffer-missing-style?)
;    (buffer-missing-style?)
;    /home/phrink/work/code/mogan/TeXmacs/progs/init-buffer.scm, line 15, position: 627
; (buffer-missing-style?)
; ((buffer-set-default-style))
; decode-old: ((let* ((r (ahash-table->list... ; t: (hash-table 'symbol (("#<lambda...
; (primitive-load file (if (null? env) *cur...

Throwing widget should be attached
-------------------------------------------------

-------------------------------------------------
terminate called after throwing an instance of 'string'
error: execv(build/linux/x86_64/release/moganstem -d) failed(-1)
warning: You are working in the project directory(/home/phrink/work/code/mogan) and you can also
force to build in current directory via run `xmake -P .`
warning: add -v for getting more warnings ..

解决方法: 放弃寻找未保存文件

TeXmacs/progs/kernel/texmacs/tm-dialogue.scm

;前346保持不变 注释掉最后两行
;(on-entry (retrieve-learned))
;(on-exit (save-learned))

9.18

修复控制台字体大小

TeXmacs/progs/debug/debug-widgets.scm

 (define (get-message-text m)
  (let* ((k (tm->stree (tm-ref m 0)))
         (s (utf8->cork (tm->stree (tm-ref m 1))))
         (t (tm->stree (tm-ref m 2))))
    (cond ((and (!= t "") (== (get-preference "console details") "detailed"))
           (string-append (get-message-text `(tuple ,(tm-ref m 0) ,(tm-ref m 1) "")) "\n" t))
          ((string-ends? k "-error")
           (string-append "Error: " s))
          ((string-ends? k "-warning")
           (string-append "Warning: " s))
          ((string-ends? k "-bench")
           s)
          (else s))))

(define (messages->text kind selected)
  (let* ((n (or (string->number (get-preference "console size")) 100))
         (sel-ms (list-filter all-ms (cut message-among? <> selected))))
         (all-ms (tree-children (get-debug-messages kind n)))
    (string-join (map get-message-text sel-ms) "\n")))
(with "language" "verbatim" "font-family" "tt" "font-size" "2.0" "par-par-sep" "0fn"
	;(with "language" "verbatim" "font-family" "tt" "par-par-sep" "0fn"
// //
("Copy" (clipboard-set "primary" (messages->text kind (ahash-ref console-selected kind))))
# 202_45: 调试控制台里面的日志无法复制

## 如何测试

1. `工具` 勾选调试工具
2. `调试`打开控制台

## 2025/09/18

### What

1. 修复了控制台字体大小问题
2. 添加了右下角点击`复制`按钮 对 控制台的所有内容进行复制

posted @ 2025-09-16 17:45  phrink  阅读(11)  评论(0)    收藏  举报