Where is the programmable setting corresponding to the Live Editor default view?

The settings UI panel for MATLAB -> Editor/Debugger -> Display includes this control:
Where can I find the corresponding programmable setting in the MATLAB settings API? I would expect to see it here, but I don't:
s = settings;
s.matlab.editor.displaysettings
ans =
SettingsGroup 'matlab.editor.displaysettings' with properties: ShowOpenAsLiveScriptBanner: [1x1 Setting] ShowWelcomeToLiveEditorBanner: [1x1 Setting] DataTipsInEditMode: [1x1 Setting] DisableResetZoomKeyboardShortcut: [1x1 Setting] EnableInlineOutputFocus: [1x1 Setting] EnableZoomOnScroll: [1x1 Setting] HighlightCurrentLine: [1x1 Setting] HighlightCurrentLineColor: [1x1 Setting] ShowLineNumbers: [1x1 Setting] linelimit: [1x1 SettingsGroup]

 Accepted Answer

We currently do not offer a programmable setting to control the Live Editor default view. However, we will consider adding one in a future release. Could you let us know if you're simply noting this absence, or if you have a specific use case for controlling this setting programmatically? Thanks!

3 Comments

My specific use case is to set my preferred MATLAB behavior in my startup.m file, which is located on a cloud storage drive (such as Dropbox or OneDrive). I do that so that I can achieve consistent MATLAB behavior on several different computers running several different versions of MATLAB, without manually updating MATLAB preference settings on every computer.
Another category of use case is for people who are giving presentations or teaching courses using MATLAB and who want to automatically set up the same MATLAB environment and behavior each time they begin.
More generally, though, given current MATLAB designs, I think it is a design error to to fail to make a preference setting programmatically available through the MATLAB settings mechanism. You can see in the output of my code that some editor preferences are available through settings, and some are not. This is an unnecessary and undesirable inconsistency in the design. I believe MathWorks should make this a design standard instead arguing about the significance of use cases one at a time.
Thanks, Steve. I agree strongly with this general approach.
I learned that our one hesitation here is that we have some planned changes to the editors over the next handful of releases that might require us to refactor and otherwise change some of the settings, so there's concern about documenting an API that we know will likely change in a small number of releases. This is a general risk with settings, which are often quite coupled to the UI, and we'd like the UI to be able to evolve without major concern about programmatic compatibility.
Some ideas that could help mitigate this:
  • We could document that settings don't have the same level of expected compatbility as other documented interfaces. The use cases for customizing settings may be less sensitive to code compatibility than other code
  • We could potentially support aliasing settings so that settings could be renamed, or mapped to other settings
Reactions?
Thanks for providing that extra context, @Michelle Hirsch. I support the goal of not impeding needed UI evolution, and I understand how that might have driven some decisions about settings.
I already have some try-catch branching in my startup.m code related to settings changes, related to when matlab.keyboard.suggestions.ShowAutomatically became matlab.editor.suggestions.ShowAutomatially. The next time that happens, I may be tempted to write function wrappers for setting/getting a settings value in a more fail-safe fashion.
In principle, I don't object to the idea of a category of programmable APIs that might have a different compatibility expectation. However, I can imagine that might get tricky to navigate in actual design situations.
I will noodle more on that and follow up with you.

Sign in to comment.

More Answers (0)

Categories

Find more on Graphics Performance in Help Center and File Exchange

Products

Release

R2024b

Tags

Asked:

on 16 Feb 2025

Commented:

on 24 Feb 2025

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!