Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions TeXmacs/progs/kernel/texmacs/tm-define-test.scm
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
(test "glue procedure" system 'system)
(test "tm-defined" exec-interactive-command
'exec-interactive-command)
(test "anonymous function" (lambda (x) (+ x 1)) #f)
(test "invalid input" 1 #f)))


Expand Down
7 changes: 4 additions & 3 deletions TeXmacs/progs/kernel/texmacs/tm-define.scm
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,10 @@
(define-public (procedure-symbol-name fun)
(cond ((symbol? fun) fun)
((string? fun) (string->symbol fun))
((procedure? fun)
(with s-fun (ahash-ref tm-defined-name fun)
(if (symbol? s-fun) s-fun (string->symbol (object->string fun)))))
((and (procedure? fun) (ahash-ref tm-defined-name fun))
(ahash-ref tm-defined-name fun))
((and (procedure? fun) (string-alpha? (object->string fun)))
(string->symbol (object->string fun)))
(else #f)))

(define-public (procedure-string-name fun)
Expand Down