[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: (Feature Request) have org-edit-special work inside non-environment
From: |
TEC |
Subject: |
Re: (Feature Request) have org-edit-special work inside non-environment LaTeX blocks, i.e. \( \) and \[ \] |
Date: |
Tue, 26 May 2020 17:23:21 +0800 |
User-agent: |
mu4e 1.4.6; emacs 26.3 |
Nicolas Goaziou <address@hidden> writes:
Without hesitation, the first form is nicer. The second one is
just abusing let-binding. I die a little just by looking at it.
I'll make an attempt to avoid killing you then :P
See `rx' macro. S-exp regexps are usually easier to read (after
an initial struggle), and less likely to introduce subtle bugs.
For long regexps, this is important. For this one, either way is
fine.
I'll just remove the -p and be done with it then.
Well. Ideally, let-binding should enclose the minimum part of
the code that needs the binding. Sometimes, an exception is
tolerated, because the code would contain too many nested
let-forms. But, conversely, you shouldn't stuff every local
variable at the beginning of the function and be done with it.
In this particular case, there's no reason to stuff the `length'
call at the top of the function when you need it later on, on a
well-defined S-exp. IOW, it is more idiomatic to just add a
let-binding around the appropriate (add-text-properties ...).
Somehow it feels like overkill to have
(let (contents-length (length contents))
...)
when it's only used twice :P
But it should be ", so remove newlines."
Gah!
I recall being asked to list modified/added functions, what
else do I need?
Nothing else.
Should be good then, as far as I can tell.
Bonus points if you can add some tests in
"testing/lisp/test-org-src.el".
I'll have a look at that, but I'm not quite sure what to do.
You could look at `test-org-src/footnote-references' for
inspiration. However, I assume tests will be less complicated
for LaTeX fragments.
I'll have a look.
We're almost there, then.
Nice! :) I'll try to send through the next iteration soon.
- Re: (Feature Request) have org-edit-special work inside non-environment LaTeX blocks, i.e. \( \) and \[ \], (continued)
- Re: (Feature Request) have org-edit-special work inside non-environment LaTeX blocks, i.e. \( \) and \[ \], TEC, 2020/05/25
- Re: (Feature Request) have org-edit-special work inside non-environment LaTeX blocks, i.e. \( \) and \[ \], TEC, 2020/05/25
- Re: (Feature Request) have org-edit-special work inside non-environment LaTeX blocks, i.e. \( \) and \[ \], Nicolas Goaziou, 2020/05/25
- Re: (Feature Request) have org-edit-special work inside non-environment LaTeX blocks, i.e. \( \) and \[ \], TEC, 2020/05/25
- Re: (Feature Request) have org-edit-special work inside non-environment LaTeX blocks, i.e. \( \) and \[ \], Nicolas Goaziou, 2020/05/25
- Re: (Feature Request) have org-edit-special work inside non-environment LaTeX blocks, i.e. \( \) and \[ \], Timothy, 2020/05/25
- Re: (Feature Request) have org-edit-special work inside non-environment LaTeX blocks, i.e. \( \) and \[ \], TEC, 2020/05/25
- Re: (Feature Request) have org-edit-special work inside non-environment LaTeX blocks, i.e. \( \) and \[ \], Nicolas Goaziou, 2020/05/26
- Re: (Feature Request) have org-edit-special work inside non-environment LaTeX blocks, i.e. \( \) and \[ \], Timothy, 2020/05/26
- Re: (Feature Request) have org-edit-special work inside non-environment LaTeX blocks, i.e. \( \) and \[ \], Nicolas Goaziou, 2020/05/26
- Re: (Feature Request) have org-edit-special work inside non-environment LaTeX blocks, i.e. \( \) and \[ \],
TEC <=
- Re: (Feature Request) have org-edit-special work inside non-environment LaTeX blocks, i.e. \( \) and \[ \], TEC, 2020/05/26
- Re: (Feature Request) have org-edit-special work inside non-environment LaTeX blocks, i.e. \( \) and \[ \], Nicolas Goaziou, 2020/05/26
- Re: (Feature Request) have org-edit-special work inside non-environment LaTeX blocks, i.e. \( \) and \[ \], John Kitchin, 2020/05/26
- Re: (Feature Request) have org-edit-special work inside non-environment LaTeX blocks, i.e. \( \) and \[ \], Nicolas Goaziou, 2020/05/25
- Re: (Feature Request) have org-edit-special work inside non-environment LaTeX blocks, i.e. \( \) and \[ \], TEC, 2020/05/26
- Re: (Feature Request) have org-edit-special work inside non-environment LaTeX blocks, i.e. \( \) and \[ \], Nicolas Goaziou, 2020/05/25
- Re: (Feature Request) have org-edit-special work inside non-environment LaTeX blocks, i.e. \( \) and \[ \], TEC, 2020/05/25
(Feature Request) have org-edit-special work inside non-environment LaTeX blocks, i.e. \( \) and \[ \], Timothy, 2020/05/19