ultra-group / skalpel

A type error slicer for Standard ML
GNU General Public License v3.0
10 stars 1 forks source link

Hiding of material in basis.sml. #33

Open jpirie opened 10 years ago

jpirie commented 10 years ago

Hiding of material in basis.sml: After skipping forward to start of next dec/spec, skip backward over whitespace/newlines to avoid including extra blank lines.

jpirie commented 10 years ago

(From bugzilla) Scott Fotheringham: Solve problem where display text property that hides material behind a newline character can inherit background color of overlay that includes the character at the start of the display text property. (Maybe can go wrong in some other similar circumstances also. Solve them all.)

jpirie commented 10 years ago

(From bugzilla) Scott Fotheringham: Hiding of material in basis.sml: This should not be done with text properties but instead with overlays. The problem is that Emacs considers the text properties to be part of the text in the sense that modifying text properties requires modification permission, marks the text as modified, and enters the change into the undo history.

The best solution is to use an existing package for managing folding display of part of a buffer, so that the existing package's keybindings and user interface would be available to the end user for browsing the full basis. Or maybe the basis file should simply be copied into a fresh buffer every time it needs to be displayed differently?

jpirie commented 10 years ago

(From bugzilla) Joe Wells: This is 3 bugs that are only related by all being about the hiding we do in the basis. 2 of the bugs should be split off into their own bug reports.

Here are some additional comments on the bug in comment 1 above. Emacs's magic “display” property can either be a property of an overlay, or a text property, and in both cases it has the same effect. Similarly for the magic “face” property. Here are the details. Suppose there is an overlay O that begins at position 57 and ends at position 63. Suppose O has the face property (:background "red"). Suppose that from position 62 through position 75 the text of the buffer has the display property of "\n" (which means show the single newline in place of whatever is in the buffer). Then the newline gets a background color of "red", which has the effect that the blank space from the end of the text line to the right edge of the Emacs window gets colored red.