Skip to content

Conversation

@MattHeffron
Copy link
Contributor

This addresses issue #2306.

There might be cases where a MENU is constructed incrementally, starting with an empty ITEMS list. This change will break that situation!

(My first thought was to default the ITEMS to (LIST "*** Empty MENU!! ***"). That felt like a hack solution.)

There might be cases where a MENU is constructed incrementally, starting with an empty ITEMS list. This change will break that situation!

(My first thought was to default the ITEMS to (LIST "*** Empty MENU!! ***"). That felt like a hack solution.)
@MattHeffron MattHeffron self-assigned this Oct 2, 2025
@MattHeffron MattHeffron added the fixed-not-verified Fixed but not verified or released label Oct 2, 2025
@MattHeffron MattHeffron linked an issue Oct 2, 2025 that may be closed by this pull request
@pamoroso
Copy link
Contributor

pamoroso commented Oct 2, 2025

When building Medley on Linux Mint 22.1 Cinnamon I get this error:

INTERLISP-ERROR
In ERROR:
MENU ITEMS list is empty
medley-loadup-error
paolo@lispmachine:~/medley/medley$ ./scripts/loadup-all.sh -apps
>>>>> START loadup-init
"/home/paolo/bin/lde" "/home/paolo/medley/medley/internal/loadups/starter.sysout" -id "loadup_init_1" -title "Medley::loadup_init_1" -g 1024x768 -sc 1024x768 -noscroll
MEDLEYDIR: "/home/paolo/medley/medley"
LOGINDIR: "/home/paolo/medley/medley/loadups/build/logindir"
GREET FILE: "/home/paolo/medley/medley/loadups/build/loadup-init.init"
REM.CM FILE: ""
VMEM FILE: "/home/paolo/medley/medley/loadups/build/logindir/vmem/lisp_loadup_init_1.virtualmem"
+++++ SUCCESS +++++
[...]
+++++ SUCCESS +++++
..... files created .....
-rw-rw-r-- 1 paolo paolo 10030 Oct  2 10:59 /home/paolo/medley/medley/loadups/build/full.dribble
-rw-rw-r-- 1 paolo paolo 10889728 Oct  2 10:59 /home/paolo/medley/medley/loadups/build/full.sysout
<<<<< END loadup-full-from-lisp

>>>>> START loadup-apps-from-full
"/home/paolo/bin/lde" "/home/paolo/medley/medley/loadups/build/full.sysout" -id "loadup_apps_from_full_1" -title "Medley::loadup_apps_from_full_1" -g 1024x768 -sc 1024x768 -noscroll
MEDLEYDIR: "/home/paolo/medley/medley"
LOGINDIR: "/home/paolo/medley/medley/loadups/build/logindir"
GREET FILE: "/home/paolo/medley/medley/greetfiles/NOGREET"
REM.CM FILE: "/home/paolo/medley/medley/loadups/build/loadup-apps-from-full.cm"
VMEM FILE: "/home/paolo/medley/medley/loadups/build/logindir/vmem/lisp_loadup_apps_from_full_1.virtualmem"

This is the directory loadups/build: build.zip

Copy link
Member

@masinter masinter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

building incrementally and starting with a invalid structure until built is a common usage pattern and should be accomodated.
(create MENU) should return. It MIGHT be better to avoid the divide-by-zero error, BUT I don't think that makes anything more stable or fixes any problems with backward compatibility or portability. The manual doesn't say what (MENU (craete MENU)) does, but it doesn't say what (MENU (create MENU ITEMS _
'JUNK)) does either.

@MattHeffron
Copy link
Contributor Author

Closing this PR as the strategy is wrong.

@MattHeffron MattHeffron closed this Oct 2, 2025
@github-project-automation github-project-automation bot moved this to Done in system Oct 2, 2025
@rmkaplan
Copy link
Contributor

rmkaplan commented Oct 2, 2025 via email

@MattHeffron
Copy link
Contributor Author

MattHeffron commented Oct 2, 2025

An error with a meaningful message that happens later, when the menu is actually displayed would be OK.

That was going to be my next approach.
It could check for an empty ITEMS list on the call to (MENU ...), but how should it assert the error? Calling (ERROR m1 m2) ?
Attached menus also should check. It's easy when attaching, but what about if the ITEMS list has been modified?
Does modifying the ITEMS of an attached menu even work (without detaching, modifying, then re-attaching)?

@pamoroso pamoroso linked an issue Oct 3, 2025 that may be closed by this pull request
@MattHeffron MattHeffron deleted the mth50--create-MENU-error-if-empty-ITEMS branch October 29, 2025 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fixed-not-verified Fixed but not verified or released

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants