Giter Club home page Giter Club logo

Comments (17)

kaushalmodi avatar kaushalmodi commented on June 19, 2024

Also, I usually download Emacs from here. In this case there is no binary called emacs. It's called Emacs.

That's a bit odd, but in any case, I have opened #22. Should be easy to implement.

from eless.

kaushalmodi avatar kaushalmodi commented on June 19, 2024

I think eval-after-load and string-match would suffice.

You are correct. I have made that change. Please try the latest master.

from eless.

sshaw avatar sshaw commented on June 19, 2024

Currently I get an Invalid regex: "Invalid regular expression" error. But, this is with system emacs 22 (OS X 10.9.5). Not clear what the source is.

I have a more recent version of OS X (well, "macOS") that I will try with later today.

from eless.

kaushalmodi avatar kaushalmodi commented on June 19, 2024

Currently I get an Invalid regex: "Invalid regular expression" error.

Let's continue the discussion for this here: #25.

Once just running eless (not building [Requirements]) works on emacs 23 for you, we can close this issue.

from eless.

kaushalmodi avatar kaushalmodi commented on June 19, 2024

@sshaw I'll close this issue (or even you can) once you confirm that eless runs fine on emacs 22.1.

from eless.

sshaw avatar sshaw commented on June 19, 2024

Working here too. Very nice. 🎉

One thing I did notice (unrelated) are broken pipe errors from this, which is always ran.

from eless.

kaushalmodi avatar kaushalmodi commented on June 19, 2024

One thing I did notice (unrelated) are broken pipe errors from this, which is always ran.

I didn't follow. What do they looks like? How to reproduce?

from eless.

sshaw avatar sshaw commented on June 19, 2024

From the eless repo run:

git --no-pager log |  ./eless

Then quit and you'll see:

./eless: line 232: echo: write error: Broken pipe

This is because $(echo "${piped_data}" | head -n 10) will run. Since head is closing the pipe after 10 lines echo complains.

Fix is easy:

$(echo "${piped_data}" 2>/dev/null | head -n 10)

But instead of loading a possibly very big string into a variable when piped (and defeating some of the purpose of a pipe), why not just cat to file immediately? There's no need to do it via echo later .

Then you can just say $(head -n $tempfile)

from eless.

kaushalmodi avatar kaushalmodi commented on June 19, 2024

Then quit and you'll see:

I did as you suggested, hit q, but I don't see any error.

no-broken-pipe

from eless.

kaushalmodi avatar kaushalmodi commented on June 19, 2024

.. no error on both bash and tcsh.

from eless.

kaushalmodi avatar kaushalmodi commented on June 19, 2024

This is because $(echo "${piped_data}" | head -n 10) will run. Since head is closing the pipe after 10 lines echo complains.

That shouldn't get executed under normal conditions.. gets executed only if -D switch is used.

So I tried using the -D switch, but even then.. no error.

from eless.

sshaw avatar sshaw commented on June 19, 2024

It does get executed. The string is interpolated which runs the subshell. This is then passed to debug which only chooses to print if -D was given.

GNU/Linux has different versions of head and Bash so this can be why you're not seeing the error.

from eless.

kaushalmodi avatar kaushalmodi commented on June 19, 2024

It does get executed. The string is interpolated which runs the subshell. This is then passed to debug which only chooses to print if -D was given.

Ah, ok. Also the GNU/BSD issue is still not gone :P

Your suggestion makes a lot of sense.. will work on fixing this. Thanks!

from eless.

kaushalmodi avatar kaushalmodi commented on June 19, 2024

why not just cat to file immediately

I have never used cat to assign to file. What's the syntax? SO doesn't help.

$(cat) > "${piped_data_file}" doesn't work.


UPDATE

It's the first time I am using the below syntax and it works!

cat > "${piped_data_file}"

from eless.

kaushalmodi avatar kaushalmodi commented on June 19, 2024

I have this fix on https://github.com/kaushalmodi/eless/tree/direct-cat-to-tempfile branch.. but make test freezes locally for me with that commit, though your git log example works.

Update: Fixed it locally. Update coming soon.

from eless.

kaushalmodi avatar kaushalmodi commented on June 19, 2024

Test the master now.

from eless.

sshaw avatar sshaw commented on June 19, 2024

👍

from eless.

Related Issues (20)

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.