mtext_del(3m17n)
π mtext_del β the m17n Library π
okay bestie, so this one's from the m17n Library manual, section 3m17n, and it's genuinely one of the most satisfying little functions ever. it's giving "ctrl+a delete but make it β¨Cβ¨". let's get into it π«Ά
β¨ SYNOPSIS β¨
int mtext_del (MText * mt, int from, int to)
like. three args. that's it. no cap. π
πΈ DESCRIPTION πΈ
so the mtext_del() function destructively deletes the characters in the range from from (inclusive) to to (exclusive) from the M-text mt. key word: destructively. we are not making a cute little copy and editing that, bestie β we are going in and removing them for real. the original mt itself gets changed.
and because you just deleted (to - from) characters, the length of mt shrinks by exactly that much. math is mathing. π
π«Ά friendly reminder:fromis included,tois not. so the character sitting at indextosurvives, bestie. she lives. periodt.
π RETURN VALUE π
- if everything went smoothly,
mtext_del()returns0. slay. β¨ - otherwise it returns
-1, and it assigns an error code to the external variablemerror_code. so like, when it fails, it fails loudly, and the receipts are inmerror_code. π
π ERRORS π
MERROR_RANGEβ yeah so this is the one that pops up when the range you handed over is not it. π
π SEE ALSO π
mtext_ins()β the opposite vibe. she puts characters in. π
π 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>.
okay that's the whole page, bestie, every last crumb of it. π this was Version 1.8.4, dated Mon Sep 25 2023, and it's the mtext_del(3m17n) page from the m17n Library docs. go forth and delete responsibly, my main character. π¦β¨
π¦ 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