[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2] org.el: Preserve case for link subgroups from `org-file-a
From: |
Max Nikulin |
Subject: |
Re: [PATCH v2] org.el: Preserve case for link subgroups from `org-file-apps' |
Date: |
Thu, 8 Sep 2022 21:37:49 +0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 |
On 06/09/2022 19:07, Ihor Radchenko wrote:
Max Nikulin writes:
Debugging `org-file-apps' and `org-open-file' regexp subgroups I noticed
an issue: the code distorts case of the link components making them
invalid. The patch to fix the bug is attached, the commit message
contains an example of the problem.
Maybe I break some use case, but I am unaware when namely downcased link
must be used.
I tracked this dlink business down to
75563bf71e6df356a5ae77a93152fcf913378107.
The relevant ML discussion is in
https://orgmode.org/list/4B51D104.9090502@jboecker.de
It is the thread I mentioned in the commit message.
So, it is probably safe to drop it, especially if tests are passing.
There is no tests for `org-open-file'. Checking of file existence,
running an asynchronous process make it harder to create such tests.
;; First, try matching against apps-dlink if we
;; get a match here, store the match data for
;; later.
- (let ((match (assoc-default dlink apps-dlink
- 'string-match)))
+ (let* ((case-fold-search t)
+ (match (assoc-default link apps-dlink
+ 'string-match)))
With this patch, `apps-dlink' name becomes completely confusing.
Is there any way to get rid of it as well? (or maybe rename to something
more reasonable).
Evey attempt to read this function gives a new surprise. I agree that
dlink has no sense any more, see the new patches.
v2-0001-org.el-Pass-link-match-data-to-org-file-apps-func.patch
Description: Text Data
v2-0002-org.el-Preserve-case-for-link-subgroups-from-org-.patch
Description: Text Data
v2-0003-org.el-Avoid-dlink-identifiers-in-org-open-file.patch
Description: Text Data