Git Product home page Git Product logo

cl-ansi-text's People

Contributors

euandreh avatar guicho271828 avatar hyotang666 avatar pnathan avatar taksatou avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cl-ansi-text's Issues

CCL: No MAKE-LOAD-FORM method is defined for #S(CL-COLORS:RGB :RED 38/51 :GREEN 38/51 :BLUE 38/51)

I often see this error:

 No COMMON-LISP:MAKE-LOAD-FORM method is defined for #S(CL-COLORS:RGB :RED 38/51 :GREEN 38/51 :BLUE 38/51)

Example log: http://cl-test-grid.appspot.com/blob?key=em5wzi7bnx

Many more examples can be found in this report:
https://common-lisp.net/project/cl-test-grid/ql/quicklisp-2015-06-08-diff2.html

As you see from the log, the error happens not when cl-ansi-text is compiled, but when another library depending on it is compiled, file quicklisp/dists/quicklisp/software/prove-20150113-git/src/reporter/list.lisp

Probably CCL tries to inline the gray constant in the client code. It's difficult to reproduce, I don't know how CCL makes the decision to inline. Maybe it's even non-deterministic, on this page - http://trac.clozure.com/ccl/wiki/DeclareOptimize - we read: "If the lisp kernel profile shows a lot of time spent in _SPspecrefcheck, it might help to spend less time doing special variable references inline." Does it mean the compiler decides when to optimize depending on some profile statistics lisp kernel accumulates on runtime? I don't know.

But anyway, just from the fact that the error happens when a dependent library is compiled, I suggest to
add :load-toplevel :execute to the eval-when here:

#+ccl(common-lisp:eval-when (:compile-toplevel)

hex representation does not work.

README says

These are CSS-style color strings such as "#FF0000".

but it does not work.

(with-color ("#ff0000") (princ :hoge)) => error

(with-color ("ff0000") (princ :hoge)) => works

If documentation is expected one, cl-colors2:parse-hex-rgb should be used rather than cl-colors2:hex-to-rgb in the method RGB-COLOR-CODE.

If current behavior is expected one, the readme should be fixed.

Add cl-test-grid support

Add cl-test-grid support so that we can recognize when our code breaks on a certain implementation.

Regrettably, I do not know of a way to verify correct color displays from a terminal without picture-based comparisons.

Introduce style-sheets and some other stuff

Current API can be improved. Imagine that we could have some style table, so you could associate a keyword with collection of parameters: color, effects, etc. Once it's done, we could use these keywords to control style of output. Even more: this should be the only one way to color output. This way you don't repeat yourself if you have to follow some consistent style through your program. Every item in such a style table can be easily edited that will result in different rendering of all text that uses this style.

More interesting functions may be added. For example, something that sets fill-column, although it's nothing to do with ANSI terminals.

It's interesting what you can say about these ideas, because I see that your library is not bad. If you don't want to include these features, I will write my own library that is based on the idea of style-sheets.

Add "tty-p" command to allow analysis

https://twitter.com/jschauma/status/309781450398507010

"Unix tool writers: it'd be swell if you could not print ^[[0;33color code^[[0m escape sequences if output does not in fact go to a tty."

This indicates that a TTY-P needs to be implemented to allow library users to not output ansi-codes if they do not want to.

OSX 10.8 tty command has this definition:

The tty utility exits 0 if the standard input is a terminal, 1 if the standard input is not a terminal, and >1 if an error occurs.

Adding external-program as a dependency and invoking tty should gather the requisite information.

Feature Request: ansi2html

Just brainstorming a project here:

Do you think cl-ansi-text can be used to implement ansi2html in CL?

ansi2html is used by SourceHut's CI/CD.

If you were to implement it what other CL libraries would you use?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.