Giter Club home page Giter Club logo

zprint-mode.el's People

Contributors

codeasone avatar pesterhazy 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

Watchers

 avatar  avatar  avatar  avatar

zprint-mode.el's Issues

'utf-8' codec can't decode byte

When trying to run zprint on a clojure file I get the following. It might be work adding the option to specify a local zprint path.

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100   604    0   604    0     0    703      0 --:--:-- --:--:-- --:--:--   702

  0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0
  0 47.0M    0  254k    0     0    99k      0  0:08:04  0:00:02  0:08:02  239k
  6 47.0M    6 3065k    0     0   896k      0  0:00:53  0:00:03  0:00:50 1592k
 18 47.0M   18 8825k    0     0  2007k      0  0:00:23  0:00:04  0:00:19 3043k
 29 47.0M   29 13.7M    0     0  2608k      0  0:00:18  0:00:05  0:00:13 3608k
 40 47.0M   40 19.1M    0     0  3064k      0  0:00:15  0:00:06  0:00:09 3998k
 52 47.0M   52 24.7M    0     0  3430k      0  0:00:14  0:00:07  0:00:07 5192k
 64 47.0M   64 30.5M    0     0  3719k      0  0:00:12  0:00:08  0:00:04 5658k
 77 47.0M   77 36.3M    0     0  3955k      0  0:00:12  0:00:09  0:00:03 5665k
 89 47.0M   89 42.1M    0     0  4153k      0  0:00:11  0:00:10  0:00:01 5820k
100 47.0M  100 47.0M    0     0  4283k      0  0:00:11  0:00:11 --:--:-- 5894k
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/matthys/.pyenv/versions/3.7.1/lib/python3.7/codecs.py", line 322, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe0 in position 25: invalid continuation byte

Add support for --hang option

Hello!

I found this library extremely useful!!! Thanks for writing it.

I was fiddling with adding a defcustom to allow for optionally calling zprint with the --hang option, since I prefer that output. Makes sense to have it be an option only, because it ~doubles the time that zprint takes...

The part I'm not sure about is exaclty how this package calls into the graal version of zprint, or I would do it myself.

Detect project root or configuration files

Hi there, thanks for the project, it is really quick with the native binary.

I am using the autoformatting feature of this mode but I see that sometimes the result does not match what I would get from the command line.

At the command line we force a {search-config? true} option so that zprint goes up the directories tries to find either .zprintrc or .zprint.edn.

Does this mode do the same/should it do that?

PS.: maybe I am missing something and there is another way

after-save-hook?

Any reason for not choosing before-save-hook?

My beautifully reformatted file stays unsaved, because it was changed, until my next save.

Make path to zprint configurable

Hi again, I am skimming the code and wrap-zprint and I have noticed that both the wrapper and the version are hard-coded.

Would you be open to a patch that makes both configurable?

Having the binary called directly is probably a good idea if somebody went a ahead and installed zprint herself.

Thanks!

Path to python problematic on some systems

First, thanks for zprint-mode :)

I had some trouble getting it to work initially -- it looks like there is an expectation of python2 being used. Is that right?

For whatever reasons, the system I'm using treats python as python3. Changing the instance of python in the following bit to python2 seems to work for me:

$(python -c \"import sys,hashlib; m=hashlib.sha256(); f=open(sys.argv[1]) if len(sys.argv)>1 else sys.stdin; m.update(f.read()); print(m.hexdigest())\" \"$our_temp_dir/zprint\")\";

This seems consistent with:

We expect Unix-like software distributions (including systems like macOS and Cygwin) to install the python2 command into the default path whenever a version of the Python 2 interpreter is installed, and the same for python3 and the Python 3 interpreter

via: https://www.python.org/dev/peps/pep-0394/#for-python-runtime-distributors

Do you think changing the code to reference python2 would be reasonable?

Variable width formatting? But how would you decide the correct width?

You probably know that zprint has a :width key in the top level options-map. You can get it to format to any width. Not everyone uses 80 columns as their preferred width. Now if you don't do anything, it should use ~/.zprintrc to initialize itself, and people can put a :width value there, which might be the best thing. Also, if you configure {:cwd-zprintrc? true} in ~/.zprintrc, zprint will also look for a .zprintrc in its current working directory. The theory is that this allows different projects to have different formatting standards. So if you do nothing special, all of that works and is probably pretty reasonable.

On the other hand, you might want to (optionally?) figure out someone's preferred width from a buffer (or something) in emacs and use that? I don't know if that makes sense or not (or would be possible or not on the emacs side). But it seemed worth mentioning it.

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.