Giter Club home page Giter Club logo

e2ansi's People

Contributors

lindydancer 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

e2ansi's Issues

Hangs on large files (and user interaction in general, probably)

I'm using e2ansi as a filter for less. When I try to page a very large file, nothing seems to happen. But if I hit ^C, I get output that looks like this:

File goreham.log is large (10.6M), really open? (y or n)

So I believe that e2ansi is hanging because emacs is prompting for user input. I'm launching emacs with a --batch option, so I'd have thought that prompts for user input would be turned off, but apparently not. I'd argue that, if possible, Emacs variables should be twiddled so that prompts of this kind are disabled, and that the answer to this particular question ("open large file?") should be "yes".

Error: "Args out of range"

I'm using e2ansi on this file. It is not the largest file, but this error pops up:

$ e2ansi-cat hydrogen.cc
Args out of range: #<buffer hydrogen.cc>, 22542, 495376

$ emacs --version
GNU Emacs 24.3.93.1

Better command line option handling

Note, due to how Emacs parses options, some options passed to e2ansi-cat is parsed by Emacs. Most notably, passing the option --help to e2ansi-cat displays help for Emacs itself.

You can fix this, via the -- argument to Emacs.

There's a good overview in this article:

http://www.lunaryorn.com/2014/08/12/emacs-script-pitfalls.html#processing-command-line-arguments

With everything combined, you end up with this:

#!/bin/sh
":"; exec emacs --quick --script "$0" -- "$@" # -*- mode: emacs-lisp; lexical-binding: t; -*-

(message "Hello: %S" argv)
(kill-emacs 0)

Where the -- means Emacs doesn't try to interpret the options it recognises, and the explicit kill-emacs ensures that Emacs doesn't try to visit any remaining arguments as files (you can also set argv to nil, but it's cleaner to exit rather than letting Emacs continue to do things).

Emacsclient use-case how?

Hi,

I think a very common use case would be to use "emacs -daemon" and "emacsclient" together with this to avoid the startup time of emacs. Could you clarify how to do this? "emacsclient" only offers an eval parameter.

Cheers

Markdown error: Wrong type argument: symbolp, (font-lock-function-name-face)

I have e2ansi working with eg Elisp files, but not Markdown. I get this error:

$ /usr/bin/emacs --batch -l markdown-mode -l solarized-theme -l e2ansi-cat --theme solarized-dark src/seq.el/README.md

Wrong type argument: symbolp, (font-lock-function-name-face)

The same command (without the -l markdown-mode, and passing my init.el instead of the .md file) correctly produces syntax-highlighted Elisp output.

The only place I find font-lock-function-name-face in the e2ansi directory is in file e2ansi-list.el. I can't understand why that would be eval'ed at all.

BTW, in case you're wondering, -l e2ansi-cat works because I have ~/.emacs.d/elpa/e2ansi-xxxxx/bin in my EMACSLOADPATH environment variable. You might want to add something about that to your doco. Or not. It's pretty nerdy :-)

$ emacs --version
GNU Emacs 24.5.1

Not working in emacs 27

Hi:
I just moved to emacs 27 and the e2ansy-cat doesn't work at all. When I try it in the old emacs it works perfectly, but not in the newer (future release) of emacs.

Any suggestion?

Error: "Symbol's value as variable is void: special-mode-map"

Hi

I've successfully been able to use e2ansi with less using a manual pipe but not with the input preprocessor indicated by LESSOPEN. This works:

emacs --batch -l ~/.emacs -l bin/e2ansi-cat foo | less -R

but this

export LESSOPEN="|emacs --batch -l ~/.emacs -l bin/e2ansi-cat %s"
less -R foo

gives the error:

Symbol's value as variable is void: special-mode-map

Any idea what can be happening?

I'm using emacs version 24.5.1, less version 530 and the contents of ~/.emacs is

(add-to-list 'load-path "~/.emacs.d/e2ansi/")
(add-to-list 'load-path "~/.emacs.d/face-explorer/")

Thank you!

Improve the emacs search

Hi:

I have a different emacs path in my system so I need to update e2ansi-cat header everytime I download it:

Could you consider to use:
#!/usr/bin/env emacs

?

Thanks in advance,
Ergus

No output when input is standard input

The e2ansi-cat program seems to produce no useful output when the input data comes from stdin. For instance,

emacs --batch -Q -l ~/.emacs -l bin/e2ansi-cat /etc/passwd

works fine for me, but

cat /etc/passwd |emacs --batch -Q -l ~/.emacs -l bin/e2ansi-cat /dev/stdin

produces no output. In situations where you know the input is stdin, you could save it to a temporary file, but this is problematic for streaming data and such. Is there a way to make it so that it can handle stdin directly?

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.