Rens Oliemans <[email protected]> writes: >> Rather than having a special code for each link type, you may instead >> consider altering the link object itself, followed by >> org-element-interpret-data. > > Hmm, I took a slightly different approach: get the information from properties > instead of regex; build strings with format rather than with > org-element-interpret-data. See the attached patch, what do you think?
LGTM. I tried to use the new code, and noticed that stackoverflow links are still left intact. Also, looks like gothub instances are not up-to-date. Reported https://codeberg.org/LibRedirect/instances/issues/40, but we may need some way to check that things are working, so that we have heads up and report to libredirect as needed. Maybe some additional check that an URL is live at the time is publishing. > Also, for each iteration I find myself squashing new changes onto the relevant > commits; creating patches using magit; and attaching them. Two questions about > this: 1) is this a/the recommended approach? This is a fine approach. Another way is sending patch + a diff. Or just a diff followed by full patch after discussion finishes. Or creating a branch on public repo or in worg itself and working from there. > ... 2) how do you review this? Do you > apply the three commits onto master and review them as a whole? Or do you look > at the difference between this patch and the previous iteration (and if so, > how)? I use piem to automatically apply patches from emails on a new branch. Old branches from previous iterations are still there, so I can easily see a diff. Or review in full, depending on how I want to do it. > My mental model is still in the pull request style, which (also?) has some > troubles with iterated changes - the GitHub UI makes it uncomfortable for the > reviewer if the commits keep amending - and I wonder how you review with this > approach. I look at the diffs from magit or directly from email reply. Most commonly, from email - when I do Reply, the diff is left in the quote block, which I go through and add comment as needed. Or just copy-paste from diff like > - (original (buffer-substring begin end)) > - ;; the URL might be in [[https://...]] > - ;; format or "just" in https://... format. > - (url (if (string-match (rx string-start > - "[[" > - (group (seq "https://" (* > anything))) > - "]]" > - string-end) > - original) > - (match-string 1 original) > - original)) > - (replacement (format "[[%s]] [[%s][(original URL)]]" > new-url url))) > + (replacement (format "[[%s]] [[%s][(original > URL)]]%s" > + new-url > + (concat (org-element-property > :type link) > + ":" > + (org-element-property > :path link)) > + (make-string > (org-element-property :post-blank link) ? )))) -- Ihor Radchenko // yantar92, Org mode maintainer, Learn more about Org mode at <https://orgmode.org/>. Support Org development at <https://liberapay.com/org-mode>, or support my work at <https://liberapay.com/yantar92>
