minput_config_variable(3m17n)

πŸ“¦
version 1.8.4 Β· 2 versions
, in debian trixie, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– minput_config_variable πŸ’–

okay bestie, so this one lives in the m17n Library manual (section 3m17n, if you're keeping track), and it's literally the function that lets you set an input method variable to whatever you want. no cap. let's get into it 🫢


✨ NAME ✨

minput_config_variable β€” the configure-the-value-of-an-input-method-variable girlie


🌸 SYNOPSIS 🌸

int minput_config_variable (MSymbol language, MSymbol name, MSymbol
       variable, MPlist * value)

πŸ¦‹ DESCRIPTION πŸ¦‹

so the whole point of minput_config_variable() is: you're configuring the value of an input method variable. it assigns value to the variable variable of the input method that language and name are pointing at. simple. iconic. periodt. πŸ’…

if value is a non-empty plist, it has to be a plist of one element, and that element's key must be Minteger, Msymbol, or Mtext, with the value being of the corresponding type. that value gets assigned to the variable. that's the vibe check. ✨

if value is an empty plist, then any configuration and customization of the variable gets canceled, and the default value is assigned to the variable instead. we love a reset arc. 😌

if value is NULL, then the configuration of the variable is canceled and the original value is assigned to the variable β€” and by original value we mean whatever was saved in the per-user customization file, or the default value. your fave is back from the group chat hiatus. πŸ’–

in those last two cases (empty plist / NULL), variable can be Mnil, which makes all the variables of the input method the target of the operation. not one variable, ALL of them. main character behavior fr fr. πŸ‘‘

if name is Mnil, this function configures the value of a global variable, not that of a specific input method. so it's not about one IM, it's about everybody. 🌈

okay and here's the part you need to remember, no cap: the configuration takes effect for input methods that get opened or re-opened later in the current session. if you want it to stick around for the future session, you gotta save it in a per-user customization file using the function minput_save_config(). don't skip this step bestie, or your config is giving temporary 😭


πŸ”₯ RETURN VALUE πŸ”₯

if everything worked out, this function returns 0. if not, it returns -1. and bestie, the operation fails in these cases:

  • value is not in a valid form, the type does not match the definition, or the value is out of range.
  • variable is not available for the input method.
  • language and name do not specify an existing input method.

so yeah, three ways to get humbled πŸ’€ but at least now you know why.


πŸŽ€ SEE ALSO πŸŽ€

  • minput_get_variable()
  • minput_save_config()

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!! Version 1.8.4, dated Mon Sep 25 2023 🌟 tysm for reading, go configure something cute, and don't forget to call minput_save_config() or it won't last πŸ’œπŸ§šβ€β™€οΈπŸ“

πŸ“¦ where this page comes from