Fork me on GitHub
#emacs
<
2018-02-07
>
qqq17:02:23

(defun len-no-prop (s)
                       (length (substring-no-properties s)))

qqq17:02:31

this almost works, except not on empty strings

qqq17:02:49

what is the idikomatic way to get the no-properties length of a strting?

gonewest81818:02:52

If the string is taken from a buffer I think you can get it without properties.

gonewest81818:02:03

buffer-substring-no-properties

gonewest81818:02:54

Are you trying to determine screen position based on string length? There might be more direct ways to do that too.

qqq18:02:13

I'm doing some hacky outline/indentation, where the indentation level is dependent on the # of whitespaces before the first non-whitespace character

qqq18:02:38

lol, maybe I should just count number of ' ' instead 🙂

gonewest81818:02:56

Maybe origami or one of the other folding modes has code you can draw from?

gonewest81818:02:46

I know they didn’t do exactly what you wanted but there could be utility libraries in there.

qqq18:02:31

actually, the bug was elsewhere and I blamed it on string-no-properties

qqq18:02:46

the problem is: when I use string-match, I have to pass the underlying string to match-strinkg NUM

qqq18:02:01

otherwise, it gets weird results (which are they passed to substring-no-properties)

qqq18:02:08

the real bug was the incorrect way I was callikng match-string

gonewest81818:02:17

I just found

(how-many REGEXP &optional RSTART REND INTERACTIVE)

Print and return number of matches for REGEXP following point.

qqq18:02:52

found bug, resolved it!

qqq19:02:15

I feel like 95% of my elisp time is spent debugging, and 95% of my debugging time is spent staring at the wrong line number

qqq19:02:40

so if I could just stare at the right line, i'd 10x my elisp productivity

Andrew19:02:35

as the russian proverb says, "why bomb always drops at epicenter"

dpsutton21:02:09

does this look obviously wrong to anyone? having issues getting some ignored files for greping

((nil .  ((cider-lein-global-options . "with-profile dev")
          (grep-find-ignored-directories . ("SCCS" "RCS" "CVS" "MCVS" ".src" ".svn" ".git"
                                            ".hg" ".bzr" "_MTN" "_darcs" "{arch}" "jib/target"
                                            "jib/dev-resources" "jib/resources" "jib-gae"
                                            "labcorp-client" "mdtoolbox-client" "cordova" "cutter")))))
in my dir-locals.el

richiardiandrea22:02:14

Uhm, It looks ok

dpsutton22:02:47

i know. it's bizarre that i can't affect the ignore file list of the ag searcher

richiardiandrea22:02:24

Do you use projectile?

richiardiandrea22:02:14

I also would check using ielm that var value for your buffer