zenspider
2021-1-12 22:58:12

@soegaard2 the above looks like flyspell-prog-mode … which only does comments and strings.

I would recommend checking out flycheck over flyspell… it’s a little less clunky and more modular.


soegaard2
2021-1-12 23:01:21

I’ll check it out. I found out that there are both a flyspell-mode and a flyspell-prohibit-mode. However, flyspell-mode knows about latex, and was confused about the contents of my file, which weren’t latex, but some parts looked like it. The hook above makes flyspell-mode check everything.


zenspider
2021-1-12 23:02:34

They’re both kinda hard to debug the config… But flycheck at least gives some help. Poke me and I can dig up some of my config for racket and such.


zenspider
2021-1-12 23:02:39

(On phone)


zenspider
2021-1-12 23:21:35

I’m gonna respond OUTSIDE this thread since it isn’t about flycheck/spell


zenspider
2021-1-12 23:29:25

@soegaard2 apparently for racket-mode, I still use (flyspell-prog-mode) in my hook. Ah! for good reason… after poking around… flycheck is only for doing syntax check / lint type actions and doesn’t (and won’t) do spelling at all. flycheck was amazing for learning haskell quickly via hlint (I wish all languages had a linter that smart). I still use flyspell in a bunch of programming language hooks.


zenspider
2021-1-12 23:46:21

poking around more.. I was crossing wires with flymake, which is a disaster.


zenspider
2021-1-13 00:05:28

Is there a built in version of this? I’ve been poking around and don’t see something that’ll negative index a list/sequence.

(defun nth* (n xs) "Select the Nth item from XS, zero based. Go backwards from the right if N is negative." (if (< n 0) (nth* (1- (abs n)) (reverse xs)) (nth n xs)))


greg
2021-1-13 01:58:56

Not that I’ve seen an exhaustive amount of Emacs Lisp source code, but: I don’t recall negative indexes meaning “from the end” — being a common idiom.


greg
2021-1-13 02:00:27

There’s a whole cluster of (forward-x amt) functions where negative amount means backwards. e.g. (backward-line 1) is actually implemented as (forward-line -1).


greg
2021-1-13 02:00:49

But I haven’t seen much in the way of negative index idioms.


greg
2021-1-13 02:02:44

Oh duh. One obvious counter-example is substring. Signature (substring STRING &optional FROM TO) Documentation Return a new string whose contents are a substring of STRING. The returned string consists of the characters between index FROM (inclusive) and index TO (exclusive) of STRING. FROM and TO are zero-indexed: 0 means the first character of STRING. Negative values are counted from the end of STRING. If TO is nil, the substring runs to the end of STRING.


greg
2021-1-13 02:03:45

Having said that: substring is a function defined in C source code.


zenspider
2021-1-13 04:23:45

Same. I was mostly wondering if I overlooked something. My desire for it mostly comes from ruby array/substring indexing… but it especially makes sense for what I’m working on (display size independent window management).