File: test8.scm

package info (click to toggle)
gimp 3.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 222,880 kB
  • sloc: ansic: 870,914; python: 10,965; lisp: 10,857; cpp: 7,355; perl: 4,536; sh: 1,753; xml: 972; yacc: 609; lex: 348; javascript: 150; makefile: 42
file content (39 lines) | stat: -rw-r--r-- 1,427 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env gimp-script-fu-interpreter-3.0

; Test mismatch between name of defined run function and name for PDB procedure
; Not a high priority: a rare syntax error in a plugin text.
; If authors follow a template, they won't make this mistake.

; The names must match exactly.
; Here, "mismatch" the name of the defined run function
; does not match "script-fu-test8" the name of the PDB proc.

; Expect a warning in the text console as the plugin text is queried:
; script-fu: WARNING: Run function not defined, or does not match PDB procedure name: script-fu-test8.
; Expect the PDB procedure to not exist

; If we don't detect this syntax error:
; A PDB procedure is created.
; When invoked from Test>Test SF interpreter 8"
; the interpreter enters an infinite loop.
; There is no harm to the GIMP app, but the interpreter process can only be killed.
; During the run phase, the "(define foo)"
; should re-define an existing definition in the interpreter state.
; Instead, since the name is mismatched,
; the foo function remains defined to be a call to the PDB procedure named foo.
; So script-fu-script-proc instead calls the PDB again, an infinite loop.

(define (mismatch)
  (gimp-message "mismatch")
)

(script-fu-register "script-fu-test8"
  "Test SF interpreter 8"
  "Just gives a message from Gimp"
  "lkk"
  "lkk"
  "2022"
  ""  ; all image types
)

(script-fu-menu-register "script-fu-test8" "<Image>/Test")