EDIT(4)

πŸ“¦
version 2.5.3 Β· 2 versions
, in nixos 26.05

πŸ’Œ NAME πŸ’Œ

Okay bestie, this is the Edit(special file) manual page, and the request itself is Edit β€” it's for composing or editing a document. That's the name section, short and iconic.


✨ SYNOPSIS ✨

[file] Edit([out|inout] mediaType contents
        [in title docName]);

πŸŽ€ DESCRIPTION πŸŽ€

The Edit request causes the handler to edit a document and reply with the new contents when the editing is completed. Slay.

It is up to the handler to decide issues such as:

  • when the editing operation can be deemed completed
  • what user gesture signals the completion of the editing
  • what the handling tool should do with itself after replying

If the handling tool supports some form of intermediate save operation during editing, it must send a Deposit request back to the tool that requested the Edit. No ghosting the requester, periodt.

The contents argument is the contents of the document. If this argument is unset (in other words, has a value of (char *)0), then the contents of the document are in the file named in the message's file attribute. The data type (mediaType) of the contents argument should be string, unless nulls are valid in the given media type, in which case the data type must be bytes.

If the contents argument is of mode out, then a new document must be composed and its contents returned in this argument. New-doc energy.

The docName argument contains the name of the document. If the docName argument is absent and the file attribute is set, the file name is considered to be the title of the document. This string would be suitable for display in a window title bar, for example. Cute.


🌸 APPLICATION USAGE 🌸

The ttmedia_ptype_declare(3) function can be used to register for, and help process, this message.

This message can be sent with the ttmedia_load(3) function. Very demure, very useful.


πŸ¦‹ EXAMPLES πŸ¦‹

To edit an X11 XBM bitmap, the application can send an Edit request with a first argument whose vtype is XBM, and whose value is a string such as:

#define foo_width 440define foo_height 940fR

The 0fP in the example represents the newline character. The notation is the same as in the ISO C standard.

To edit an X11 XBM bitmap contained in a file, the application can send an Edit request naming that file in its file attribute, with a first argument whose vtype is XBM, and whose value is not set.


πŸ’€ ERRORS πŸ’€

The ToolTalk service may return one of the following errors in processing the Edit request:

  • TT_DESKTOP_ECANCELED β€” the user overrode the Edit request. When an Edit request is failed with TT_DESKTOP_ECANCELED, the document should not be updated as a result, but rather should remain as it was before the failure reply was received. Respect the cancel, bestie.
  • TT_DESKTOP_ENOENT β€” the file that was alleged to contain the document does not exist.
  • TT_DESKTOP_ENODATA β€” the in-mode contents argument had no value and the file attribute of the message was not set.
  • TT_MEDIA_ERR_FORMAT β€” the document is not a valid instance of the media type.

🫢 SEE ALSO 🫢

ttmedia_ptype_declare(3), ttmedia_load(3); Intro, Display requests.


Sign-off tea: the last line of this page is just the manual name Edit(special file) β€” there's no extra source/version or date line in the original footer, so that's the whole wrap-up vibe. Bye bestie, go edit something iconic πŸ’…πŸ’–

πŸ“¦ where this page comes from