Age | Commit message (Collapse) | Author |
|
When a point is on a blank space beyond the link but before the next
element, org-element-context considers point to be a part of the link.
This leads to incorrect behavior (shown in the added tests) when
either barfing backward or forward. Avoid these issues by moving
point to the beginning of the link before deleting the old link and
inserting a new one. As a bonus, this makes some of the later
goto-char calculations unnecessary.
|
|
Most of the tests fail when running them with 8.2 checked out from the
Org repo. So far, it hasn't been too much extra work supporting
8.2.10 [*], but I'd rather not deal with the headache of trying to
support anything older.
[*] This is the version that shipped with Emacs 25.1. The current Org
version is 9.0.5.
|
|
Before Org 8.3 (specifically before aea374680), org-link-unescape
called string-match, which changes the match data and interferes with
extracting the description. (I noticed this because the slurp/barf
round-trip test failed with Org 8.2.10, but not on newer versions.)
Save the match data before calling org-link-unescape.
|
|
|
|
|
|
|
|
org-make-link-string will escape the link again when it's reinserted.
|
|
|
|
|
|
... instead of replacing each new line with a space.
|
|
Using words as the unit for slurping can give confusing results. For
example, slurping forward with
The [http://orgmode.org] Org-mode site
results in
The [[http://orgmode.org][Org]]-mode site
This is somewhat inconvenient because the intended slurp here is most
likely 'Org-mode'. However, given that the command clearly says that
it works at the level of words, this shouldn't be too surprising.
The problem is that, unless the user is displaying the full link
(e.g., using org-toggle-link-display), the entire text 'Org-mode' is
highlighted as though it's part of the link. If the user then tried
to slurp again to get 'site', '-mode' would actually be slurped, and
it would appear like nothing happened.
Instead of words, make blocks of non-whitespace characters, referred
to as blobs, the unit for slurping and barfing. When slurping
forward, don't consider trailing punctuation as part of a blob.
|
|
Fix the test that should have caught this.
|
|
|
|
Don't fail when there is no description and the slurped word isn't
separated by a non-word character.
|
|
|
|
|
|
|
|
|
|
|