Skip to content

Should (STREAM CHARPOS) by the generic \OUTCHAR ? #401

Closed
@rmkaplan

Description

@rmkaplan

The common behavior is that CHARPOS is set to 0 on an EOL and otherwise incremented by 1. This controls the behavior of the linelength-sensitive printing functions; they check to see whether this goes over the stream's LINELENGTH (if not infinite), and go to a newline if there would be overflow.

Currently the update to CHARPOS has been a responsibility of the different outchar implementation functions, but I noticed some cases where this little wrinkle has been neglected.

This behavior could be moved up to the generic \OUTCHAR and removed from where it appears in the existing format-implementation functions. Which would guarantee that CHARPOSITION would always be updated in the same way no matter what the format--it would then be the LINELENGTH setting of the stream that would affect how PRIN1 etc. behave

It seems better to me in principle to make CHARPOSITION-updating as a generic property of outing a character, and that the CHARPOSITION manipulations should be removed where it exists in current functions. Versus making sure that each outchar implement does the right thing.

Is there a reason not to make it generic?

(Note: this is different than the rightmargin calculations for display streams, which appears to deal with overflowing of individual character images. CHARPOS/LINELENGTH are trying to keep atoms/strings intact.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions