minput_get_variable(3m17n)
minput_get_variable π
okay bestie, welcome to the minput_get_variable(3m17n) page β yes it lives in The m17n Library and no you don't have to be scared of it, I promise. sit down, grab a strawberry π, and let's get into it.
β¨ NAME β¨
minput_get_variable β literally just. getting the tea on input method variables. that's it, that's the whole name π«Ά
β¨ SYNOPSIS β¨
MPlist* minput_get_variable (MSymbol language, MSymbol name, MSymbol variable)
three symbols walk into a function. no cap. π
β¨ DESCRIPTION β¨
@brief Get information about input method variable(s). (yes the original said @brief, we love a documentation-generator moment π)
so. the way that minput_get_variable() works is it hands you back information about the variable variable of the input method that language and name are pointing at. and like, an input method variable is exactly what it sounds like β it controls the behavior of an input method. it's the little knob that decides how your IM acts. π₯
there are two kinds of variables, and this is the part where people get confused so pay attention bestie:
- global β a global variable has a global definition, and its description and its value may be inherited by a local variable. iconic inheritance behavior, we love to see it π
- local β every input method defines a local variable, and that local variable has a local value. it may also declare a local variable that inherits the definition of a global variable of the same name. so it's like "I have my own thing but also I'm borrowing yours" energy fr fr.
here's the routing logic, and it's giving very clean if/else:
- if
languageis#Mtandnameis#Mnil, you get information about a global variable. - otherwise? information about a local variable. periodt.
and then:
- if
variableis#Mnil, you get information about all the variables. all of them. the whole group chat. π
the return value is a well-formed plist (that's a m17nPlist β see m17nPlist) shaped exactly like this:
((NAME DESCRIPTION STATUS VALUE [VALID-VALUE ...]) ...)
okay let's decode every single field because I refuse to let you skim:
NAMEβ a symbol representing the variable name. the name. the identifier. the whole point.DESCRIPTIONβ an M-text describing the variable, orMnilif the variable has no description. no description? valid. we've all been there πSTATUSβ a symbol representing how the value got decided. and there are options:Mnilβ that's the default valueMcustomizedβ the value got customized by a per-user customization fileMconfiguredβ the value was set by the call ofminput_config_variable()- and for a local variable only, it may also be
Minheritedβ meaning the value was inherited from the corresponding global variable π
VALUEβ the initial value of the variable. but here's the twist: if the key of this element isMt, then the variable has no initial value. otherwise, the key isMinteger,Msymbol, orMtext, and the value is of the corresponding type. β¨VALID-VALUEs (if any) β these specify which values the variable is actually allowed to have. they have the same type (i.e. the same key) asVALUE, except for the case whereVALUEis an integer. in that case,VALID-VALUEmay be a plist of two integers specifying the range of possible values. π
and if there's noVALID-VALUE? then the variable can have any value, as long as the type is the same asVALUE. free-spirited variable. main character energy. π
one last thing: if variable is not Mnil, then the first element of the returned plist contains the information about variable. boom.
β¨ RETURN VALUE β¨
if the requested information was found, you get a pointer to a non-empty plist. π
but listen β the plist is kept in the library. so the caller must not modify it and must not free it. hands off. do not touch. I am so serious. π«
otherwise β meaning the specified input method doesn't exist, or the specified variable doesn't exist β you get NULL. and that's just how it is sometimes. π
β¨ COPYRIGHT β¨
Copyright (C) 2001 Information-technology Promotion Agency (IPA)
Copyright (C) 2001-2011 National Institute of Advanced Industrial Science and Technology (AIST)
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License <http://www.gnu.org/licenses/fdl.html>.
and that's the whole page bestie!! π this was Version 1.8.4, dated Mon Sep 25 2023 β yes she's a 2023 girlie and she still ate. go forth and query your variables, ily, bye!! π β¨π¦πΈ
π¦ where this page comes from
- debian trixie: m17n-docs 1.8.4-1
- ubuntu noble: m17n-docs 1.8.4-1
- ubuntu questing: m17n-docs 1.8.4-1
- ubuntu resolute: m17n-docs 1.8.4-1build1
- ubuntu stonking: m17n-docs 1.8.4-1build1
- Copyright (C) 2001 Information-technology Promotion Agency (IPA)
- Copyright (C) 2001-2011 National Institute of Advanced Industrial Science and Technology (AIST)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms