1. 3

    Thank you! But also

    (setq backup-by-copying t)
    (setq sentence-end-double-space nil)
    (global-set-key [(control h)] 'delete-backward-char)
    (keyboard-translate ?\C-h ?\C-?)
    
    1. 2

      I feel like I’m the only person who has sentence-end-double-space set to t — I like it because it allows me to easily navigate sentences, and it doesn’t matter because when I export the document to another format the spaces get properly minimized.

      1. 7

        Hi acdw!♥

        I felt like setting it to nil (which I didn’t realize until after a few years) unlocked super powers of Emacs I had only dreamt of before, M-a, M-k, transposing sentences etc, even in text I didn’t originally author, and it does a really good job.

        Also, with this set to nil, it works with one or two spaces; with it set to t it can’t find sentence boundaries if there’s only one space. I can’t believe that’s the default.

        1. 2

          Hi there :) Nice to see you on lobsters!

          Oh my god, you’ve actually convinced me to turn sentence-end-double-space to nil … I honestly did not realize that it’s telling Emacs to recognize single-spaced sentences, which honestly makes so much sense.

          I think the only place I want to set it is when filling paragraphs, so it fills the “proper” (to my eyes anyway) two-spaced sentences, which of course I can just add some advice to to fix. Thanks for the mind-changer, snan!

          1. 1

            PS. I’ve made a small dumb package to correctly fill even with sentence-end-double-space set to nil:

            https://github.com/duckwork/fill-sentences-correctly.el

            I hope it’s okay I quoted you.

            1. 2

              🧕 I wouldn’t exactly call it “correctly” since I favor the single spaced style. I don’t mind the quotes ofc.

              1. 1

                hahahahah I’ll make sure to mention you’re not in favor :P

              2. 2

                So if you can make it clear that I’m not an advocate for double-spacing, that’d be great ♥

            2. 4

              Can not sentences be recognized without double space? If some text starts with a capital letter and ends with punctuation followed by a space or the end of the line, then that should do the job, right?

              1. 8

                Dr. Spock might want to have a word with you. Mr. Smith might also chime in.

                1. 1

                  In all seriousness, I’ve never heard about them. Is this something local to the US?

                  1. 2

                    I was giving an example of a sentence that would be mis-parsed by assuming all sentances end with a period followed by a single space.

                    As for the names, Dr. Spock was a rather famous medical doctor in the U.S. and wrote a popular book about having babies (I think in the 60s?). There was also a character on a science fiction TV show (Star Trek) where there was a character named “Spock.” As for Mr. Smith, the last name “Smith” is one of the most popular (if not the most popular) last name in the English speaking world.

                    1. 2

                      Yes, it’s an US thing. They even use period as a decimal marker (!).

                      1. 1

                        That’s crazy talk right there!

                  2. 4

                    Yeah. Setting it to nil, it can recognize sentences either way. Leaving it in t means it only recognizes double spaces.

                  3. 2

                    I’d be a lot more likely to enable this if everyone else had it enabled, but when I’m working on documentation it’s more important for my style to match the project itself than for me to have it work the way I like personally.

                    1. 1

                      I think I was able to get away with it because I generally only write for myself, but you’re right that most people are single-spacers. grumble :P

                    2. 2

                      You’re not. Even vi does it. ;)

                    3. 2

                      Disabling the help shortcuts seems like a real bad idea to me?

                      1. 1

                        F1 ftw!

                        Having a homerow key combo that’s delete-backwards-char in almost any other app split the window and pop up help stuff is pretty cumbersome. I do F1 m, F1 k, F1 f all the time. Pretty great.

                        1. 2

                          Hm; I guess if I didn’t have a keyboard that put backspace on the thumbs that’d be more appealing. I use C-M-h a lot more than backspace in Emacs tho.

                          1. 3

                            You made my keyboard ♥

                            But

                            1. I hate using my thumbs (other than space) so I didn’t put any important keys there.
                            2. It’s also not just about adding access to backspace but about decreasing the “minefield factor” of having a help popup.
                            3. On the Atreus specifically, I have a layer switcher in the outer lower corners, which + h sends literal backspace so I don’t need change in my .emacs anymore. + works in other apps too.
                            1. 1

                              I have a layer switcher in the outer lower corners, which + h sends literal backspace so I don’t need change in my .emacs anymore. + works in other apps too.

                              I have a similar thing but in my WM instead; if I press C-i or C-m it will send a tab or enter character in any program, even outside Emacs. Indispensible!

                              1. 1

                                I have i, m, h, j, f, n, p, b, v etc but because it’s on a layer switch I can send actual C-i when I need to (for example invert selection in some drawing apps). ♥

                    1. 31

                      Python is as messy, if not messier, than Node

                      I’d say Node is, like, not messy at all. Due to Node being younger, its ecosystem developed and matured in an age where per-project isolated local dependencies were becoming the norm.

                      Python is arguably uniquely messy due to the invention of virtualenv. I’m not aware of any other language community where the default way to make isolated projects for ages was a thing that made a whole local prefix with symlinks to the interpreter and whatnot and a script you’d have to run to bring it into $PATH. Python’s closest cousin (in terms of 2000s web dev evolution anyway), Ruby, did it all correctly relatively early on — the Bundler experience is just like npm/cargo/stack/etc.

                      But forget virtualenv, the real messiness of Python packaging is the freaking layering. Distutils, setuptools, pip, virtualenv (or the new project-based managers) — it’s all there and which part is handled by which layer gets confusing quickly.

                      1. 10

                        The thing that worries me is that I don’t think the core Python devs get it: the packaging situation is so bad that it very well may kill the language. It should be all hands on deck, this is the most important thing for us to fix. But I don’t see that happening at all, and instead there’s fiddling with esoterica like walrus and match…

                        1. 13

                          So one interesting twist here is that many core devs work for big companies that use their own build and deployment systems for Python. (e.g. I worked with probably a dozen core Python devs at Google many years ago.) So they may not feel the issue on a daily basis. I certainly feel it more now that I do more open source, although I was aware of it back then whenever I had to install NumPy, etc.

                          From what I hear Jane St. is in a similar situation with OCaml and OPAM. They sponsor the open source package manager, but they don’t actually use it themselves! Because they use a monorepo like Google. monorepo means “no version constraint solving”, which simplifies the problem drastically (it’s an NP complete problem).


                          I also think the problem is more complicated than “core devs don’t get it”. It’s more like the solutions being very constrained by what happened in the past. For a long time the import system / algorithm itself was a very big wart and there was a huge effort to clean it up.

                          I will say that I think most of these problems were known before Python 3, and I wish there was a hard break then, but that was already 12-15 years ago at this point. And then people would have probably liked the 2->3 transition even less, etc.

                          1. 5

                            So one interesting twist here is that many core devs work for big companies that use their own build and deployment systems for Python. (e.g. I worked with probably a dozen core Python devs at Google many years ago.) So they may not feel the issue on a daily basis. I certainly feel it more now that I do more open source, although I was aware of it back then whenever I had to install NumPy, etc.

                            This is definitely the case with my cloudy overlords, although I will say that this may be changing. I think some people are recognizing that there is wisdom in not rolling their own and allowing devs to leverage familiar interfaces for packaging.

                          2. 4

                            For what it’s worth, this is the #1 reason I keep not trying Python. It’s just a huge headache and I can’t care enough about it.

                            1. 6

                              I’ve been using Python professionally since 2010, I used to absolutely love it, and I’ve finally just reached the point where I no longer consider it an acceptable choice for a greenfield project of any scale, no exceptions. Someone will always come around to suggest that it’s open source, and you should fix what you don’t like, but it’s been my experience that the community culture has settled into a state that no project or ecosystem ever recovers from, which is when issues start being responded to with justifications along the lines of “this can’t change because of fundamental technical deficiency X, which because of its magnitude we’ve decided to stop treating as a technical deficiency in favor of treating it as a fundamental invariant of the universe, in spite of ample evidence that there are better ways to do it.” Either that technical deficiency is truly unsurmountable, in which case the tool is de jure broken and I have no good reason to use it, or that technical deficiency is surmountable but there will never be any will to fix it, in which case the tool is de facto broken and I have no good reason to use it. I feel deep sadness about this, but at this point there is too little that is exceptional about Python to justify putting effort into fixing what’s broken. No tool lasts forever, maybe we should just accept that it’s time to sunset this one.

                              1. 1

                                Thats a great point, and a good answer to “Why don’t you just fix it yourself” that is thrown anytime you complain about any open source project, especially established ones like Python.

                                Python especially has this cultish mentality “All if perfect how dare you suggest otherwise”

                            2. 3

                              The thing that worries me is that I don’t think the core Python devs get it: the packaging situation is so bad that it very well may kill the language. It should be all hands on deck, this is the most important thing for us to fix. But I don’t see that happening at all, and instead there’s fiddling with esoterica like walrus and match…

                              Python’s governance is pretty transparent. Do you have concrete suggestions for improvement? If you do, consider coming up with even a proof of concept implementation and creating a PEP.

                              Be the change you want to see in the world :)

                            3. 8

                              the real messiness of Python packaging is the freaking layering. Distutils, setuptools, pip, virtualenv (or the new project-based managers) — it’s all there

                              Yup +100 to this … This is why I sometimes download tarballs with shell scripts and use “python setup.py build” instead. That’s only one layer :)

                              That approach doesn’t work all the time, e.g. if you have a big NumPy stack, or a big web framework with transitive dependencies.

                              On the other hand, if it works, then you know exactly what your dependencies are, and you can archive the tarballs somewhere for reproducible builds, etc.

                              1. 3

                                the Bundler experience is just like npm/cargo/stack/etc

                                Thatk’s mostly splitting hairs, but for me there’s a big difference with cargo when it comes to experience: cargo run / cargo build just work, while bundle exec, npm run require running install command manually.

                                1. 1

                                  There’s a lot that node gets right simply by virtue of being a younger language and community than Python or Ruby by a long shot, so it could benefit from observing the effect of critical decisions over time.

                                  Unfortunately that lack of maturity can express itself in various ways, some merely cosmetic, some less so.

                                  Overall even as someone like myself who doesn’t love the language, having now learned it I can appreciate that there’s a lot of interesting work going into that community that bears watching and learning from, whatever your first choice in programming languages may be.

                                1. 1

                                  Can someone who has migrated from vim to nvim recommend a guide for doing so, or if it’s really just as simple as changing to init.vim? I’m also wondering if folks keep compatibility layers in dotfiles repos, or anything like that.

                                  1. 5

                                    We added a skeleton init.vim so you can just use your normal vimrc when we started using nvim: https://github.com/braintreeps/vim_dotfiles/blob/416912bb64a034241a40906693c0298dc5d8ea49/config/nvim/init.vim

                                    Then you can just start vim or nvim depending on if you want to shave yaks or to be classically productive.

                                    1. 2

                                      If I recall correctly (I used nvim a while ago, I think the latest was 0.2), you can start by just changing your .vimrc to init.vim, and then go from there.

                                    1. 4

                                      Isn’t there an Emacs clutch somewhere too? Honestly that makes more sense to me, given the RSI complaints.

                                      1. 3

                                        Using pedals for Emacs is not really that uncommon, e.g..

                                        1. 2

                                          That’s what I thought! I thought I’d read or heard somehting before about an emacs pedal.

                                          (BTW, if you tried to add a link, it didn’t come thru for me)

                                      1. 5

                                        I’m going to work on my blog, I think – I’m redesigning it right now!

                                        I also might make some bread

                                        1. 1

                                          Neither https://acdw.net/ nor https://www.acdw.net/ seem to resolve for me, have you taken your blog down while you redesign it? I got the link off your lobste.rs profile

                                          1. 1

                                            Should be up now, sorry!

                                        1. 19

                                          [the man directory] contains the generated man pages. Because it’s adjacent to bin (which is on my path) the man program automatically finds the man pages as expected.

                                          Whoa! I just tried this: my $PATH contains ~/dotfiles/bin, so I creating a simple text file ~/dotfiles/man/man1/mytest.1, and typed man mytest, and it worked! Finally I can easily create & install man pages, rather than implementing a response to a -h/--help flag.

                                          1. 1

                                            I just discovered this poking around in the manual page for manpath, or whatever the man config file is. It’s pretty neat! You can also set MANPATH.

                                            1. 1

                                              So, I actually also tried, yesterday, to find the docs for the ‘$PATH -> man path’ auto-mapping in the manpage; but unlike you, I couldn’t find it. If you have an occasion, could you perhaps post the man page / excerpt you found, so I can know what I overlooked? No need to reply if you don’t have an occasion.

                                              I ran man 1 man 1 manpath 5 manpath and read through those manpages; and I read through the comments in /etc/manpath.config; but the closest I could find was set of directives like MANPATH_MAP /bin /usr/share/man, which only map specifies specific man dirs to specific PATH dirs. I couldn’t find anything documenting the rewriting rule ‘for any directory in $PATH, look in a sibling directory called man.’ Pointers welcome!

                                              1. 3

                                                Linux man pages do not describe this, but freebsd manpages do.

                                                1. 2

                                                  On Linux, old man (1.6g) documents this as well, only modern man-db does not.

                                                2. 1

                                                  I have no idea what I was thinking about with the PATH -> MANPATH conversion, lol

                                                  However, I do know that you can set $MANPATH with a leading : to have it append directories to the auto-generated MANPATH, or with a trailing : to have it prepend them. So that’s what I do.

                                            1. 3

                                              Oh neat! See also, gemini://flounder.online, though this is a little different from a first look.

                                              1. 2

                                                Thanks!

                                              1. 13

                                                I think it would be very funny if a language used yeet instead of throw.

                                                1. 9

                                                  I’ve got git aliases set up for yeet == push and yoink == pull for this precise reason :)

                                                  1. 8

                                                    Nice!

                                                    I have discovered that you can do const c╯°□°ↄ╯ = throw in Julia, which is pretty fun :)

                                                  2. 3

                                                    Perl has a Carp module that clucks and croaks.

                                                    1. 1

                                                      Lolcode https://github.com/justinmeza/lolcode-spec/blob/master/v1.2/lolcode-spec-v1.2.md has not defined exceptions yet and it’s been written up before yeet was a meme, so there’s a chance for an update. If you ever wanted to YEET a BUKKIT OF YARN, now’s your chance.

                                                    1. 4

                                                      I’m working on my personal website, and possibly applying for a job.

                                                      1. 2

                                                        This is a great idea, and maybe someday I’ll implement it with bash completion and stuff. … maybe

                                                        1. 2

                                                          Well there you have it, the precise accuracy that’s “good enough for government work!”

                                                          1. 1

                                                            Well there you have it, the precise accuracy that’s “good enough for government work!”

                                                            1. 3

                                                              I think this is a dupe

                                                              1. 8

                                                                Well there you have it, the precise accuracy that’s “good enough for government work!”

                                                            1. 11

                                                              There is also this less specialized tool:

                                                              column --table /etc/fstab
                                                              
                                                              1. 5

                                                                But that also spreads the fields in the comments out, right?

                                                                1. 3

                                                                  Ah, good point!

                                                                  Maybe worth mentioning. I was kind of wondering what I was forgetting. I think I removed the comments I had because of this.

                                                                  Congratulations with a new tool!

                                                                  1. 2
                                                                     gawk '/^#/ { print $0 } !/^#/ { print $0 | "column --table" }' < /etc/fstab
                                                                    

                                                                    This will still group your comments up above your fstab entries, so I think this specific tool (or really any real programming language) will be required to do something like this as you’d need to track where lines started and update the table width.

                                                                    1. 3

                                                                      This picked my curiosity, could it be solved using tools installed by default on my system?

                                                                      I managed to get this, but probably a shorter solution without perl is possible, if one is willing to write some loops in bash:

                                                                      $ perl -wnle 'BEGIN{open($fmt, "<&", 5) or die("cannot");}; print, next if /^#/; next if /^\s*$/; $l=<$fmt>; chomp $l; print $l;' fstab 5< <(grep -v '^#' fstab|column -t)
                                                                      # Static information about the filesystems.
                                                                      # See fstab(5) for details.
                                                                      #
                                                                      # <file system> <dir> <type> <options> <dump> <pass>
                                                                      # /dev/nvme0n1p2 LABEL=root
                                                                      UUID=2bb3c21b-dc8f-401e-991b-66afd7301cb7  /      xfs   rw,relatime,inode64,logbufs=8,logbsize=32k,noquota                                                         0  1
                                                                      # /dev/nvme0n1p1 LABEL=boot
                                                                      UUID=1815-DD5D                             /boot  vfat  rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro  0  2
                                                                      
                                                                      1. 7

                                                                        picked my curiosity

                                                                        FYI, it’s piqued – the more you know!

                                                                  2. 1

                                                                    Shouldn’t it? I think it makes more sense for the field headers to be spread out too, indicating their associated columns directly. That’s how I format my fstab when I do it manually.

                                                                    1. 2

                                                                      That could actually be nice, but surely you don’t wish to spread out the rest of the comments?

                                                                1. 1

                                                                  I’m so disappointed this isn’t like Facebook’s pokes … the only good thing about that platform!

                                                                  1. 2

                                                                    I’m working tomorrow, so I’ll dick around online for a bit then, probably. Saturdays tend to be pretty dead.

                                                                    I /should/ finish my website redesign, so I’ll work on that! Yeah!!

                                                                    1. 7

                                                                      Setting up Fastmail. I was browsing Youtube today while logged into my account I’ve been using for 8 years, and out of nowhere it asked me to “verify my age” so I could watch an age-restricted video by inputting my credit card info (which it already has since I’ve been paying membership to a few channels for the last year or so, but apparently my credit card’s not good for this particular check) or sending my ID (which I am not doing), and this was the last straw.

                                                                      Other bullshit Google tried to pull on my accounts in the past includes locking up my oldest account for daring to use IMAP to access gmail on a wifi network I hadn’t previously approved, and then unblocking it as soon as I tried logging in from a new phone, probably because it was a Pixel that had just come out.

                                                                      I have four gmail accounts which I’m increasingly afraid of losing and they’re the only google service I depend on, so I’m gonna move all the important accounts off of it and forward the rest of the emails to Fastmail.

                                                                      1. 4

                                                                        I have only good things to say about Fastmail. I’ve considered moving to a cheaper option but I would never ever go back to Google. And honestly, the cheaper options are only thoughts b/c I’m cheap.

                                                                        1. 2

                                                                          I have been very very very happy with Fastmail. I use it for several domains, including one I share with the family. The downtimes have been measured in the order of hours, total over the last few years. It doesn’t do anything fancy, but it provides me reliable mail and calendaring that I pay for and that’s just so great.

                                                                          1. 1

                                                                            Good for you. I’ve been on Fastmail for a couple of years and very happy with it.

                                                                          1. 4

                                                                            generally good things. I’m opposed to set -e-ish advice just because I think the behavior it adds is unusual and not universal and bash provides the appropriate tools to check for errors in pipes as well: $PIPESTATUS.

                                                                            Overall for the first problem, I’d probably just set REPLY to some value and return with an error code instead of using stdout/err as any means of “returning” values, but that’s just me. REPLY is used in things like read -r so it doesn’t seem that monstrous to assume its safe for clobbering.

                                                                            so instead of

                                                                              local -r config=$(get_config_path)
                                                                            

                                                                            I’d probably do

                                                                              if get_config_path; then
                                                                                local -r config="$REPLY"
                                                                              else
                                                                                : do something like fail since author is using set -euo pipefail
                                                                              fi
                                                                            

                                                                            EDIT:

                                                                            for the usage case, I’d probably wrap all of the invocations in braces so they can be redirected to stderr, which seems to be the norm for –help related output.

                                                                            {
                                                                              echo "usage: blah"
                                                                              echo ""
                                                                              echo "more"
                                                                            } >&2
                                                                            
                                                                            1. 1

                                                                              Initially I was skeptical about this (REPLY based) approach, but the more I consider it, the more I like it.

                                                                              1. 1

                                                                                That setting REPLY thought, that’s a great idea! I think I will definitely incorporate that a bit in my scripts.

                                                                                1. 1

                                                                                  for the usage case, I’d probably wrap all of the invocations in braces so they can be redirected to stderr, which seems to be the norm for –help related output.

                                                                                  I think the print_usage function is actually better as in the post (un-redirected) – that way it’s up to the caller to decide, and you can just do print_usage >&2 as needed. Further, call me pedantic, but I’d argue that in the case of --help, the usage message going to stderr is inappropriate – it’s not an error message, it’s the output that was requested, so just send it to stdout. For reporting syntax errors or whatever, sure, stderr is the right place, but --help isn’t an error (assuming you recognize it as a flag). Leaving the usage-printing function un-redirected makes it easy to handle both cases appropriately.

                                                                                  1. 1

                                                                                    set -e indeed has many pitfalls. As far as I know, Oil fixes every single one:

                                                                                    http://www.oilshell.org/blog/2020/10/osh-features.html#reliable-error-handling

                                                                                    If anyone knows any counterexamples, let me know. There should be no reason not to use it (if you’re using Oil – if you have to run under 2 shells, that’s a different story)

                                                                                    I had planned to write up a longer doc / manual about this, but haven’t gotten around to it yet.

                                                                                  1. 2

                                                                                    The local and readonly are great advice; I should start using them more often in my (bash) scripts. I also struggle with figuring out a good log function; maybe something simpler like this is a good idea!

                                                                                    I also use a heredoc with the usage() function, but other than that, I think this is pretty good advice!!

                                                                                    1. 2

                                                                                      $work: writing up an interview i had with a local entrepreneur. $home: working on my website and trying to get it/gemini/gopher? all together

                                                                                      1. 3

                                                                                        I’ve been rewriting my static site generator in Posix shell and AWK. I don’t plan on getting hired for either of those skills anytime soon XD