Project

General

Profile

Feature #781

Option to "fold" long lines?

Added by John Abbott over 8 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
EmacsUI
Target version:
Start date:
28 Sep 2015
Due date:
% Done:

100%

Estimated time:
0.66 h
Spent time:

Description

Emacs becomes very slow when there are long lines in the output.

Consier adding a "fold"-like facility which breaks long lines into shorter ones (possibily inserting a given string just before the inserted newline?)


Related issues

Related to CoCoA-5 - Slug #875: Interpreter is too slow reading a big polynomialIn Progress2016-05-03

Related to CoCoA-5 - Slug #1363: Emacs UI: slow with long linesIn Progress2019-11-13

Related to CoCoA-5 - Feature #1431: Juxtaposition of string literalsRejected2020-03-03

History

#1 Updated by John Abbott over 8 years ago

I am thinking of the Unix command "fold".

This output option would certainly be useful when running CoCoA inside Emacs, and it may be helpful in other cases...?

There should be the possibility of not folding (e.g. setting the width to 0?)

#2 Updated by John Abbott almost 8 years ago

  • Related to Slug #875: Interpreter is too slow reading a big polynomial added

#3 Updated by John Abbott about 4 years ago

  • Status changed from New to Resolved
  • Assignee set to John Abbott
  • Target version changed from CoCoA-5.?.? to CoCoA-5.3.0
  • % Done changed from 0 to 50

There is now a fold function for strings which simply inserts a newline every N characters (it does not (currently) check if there are newlines already in the string).

#4 Updated by John Abbott about 4 years ago

  • Related to Slug #1363: Emacs UI: slow with long lines added

#5 Updated by John Abbott about 4 years ago

  • Related to Feature #1431: Juxtaposition of string literals added

#6 Updated by John Abbott about 4 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 50 to 100
  • Estimated time set to 0.66 h

The current impl fits the KISS philosophy. Since I expect the main use to be fold(sprint(value), width), it is not important to check for newlines inside the string.

If at some later stage it happens that people need fold to work "nicely" with strings containing newlines then we can revisit the defn and impl.

The current impl is simple, quick and easy to describe (and probably does what it wanted in practically every case).
Closing.

NOTE I do wonder whether it might make sense to have a FoldSprint function, or even just extend fold so that it accepts any type arg1 and uses sprint to make it into a string... again KISS suggests waiting to see how people use fold.

Also available in: Atom PDF