On 22/06/2025 01:45, Charles Choi wrote:
On Jun 21, 2025, at 6:27 AM, Max Nikulin wrote:

To my taste first "custom" may be omitted to avoid repetition.

Done.

Thanks for this and others updates.

I have noticed that some lines added by your patch have trailing white space characters. "git show" (or "git diff") in console highlights them.

Some sections have multiple blank lines at the end.

#+begin_src elisp :lexical no
(add-hook 'org-mode-hook
(lambda ()
   (add-to-list 'org-capture-templates
                '("capture"
                  "Capture (Org Protocol)"
                  entry
                  (file "notes.org")
                  (function (lambda ()
                              (string-join
                               '("* %:description"
                                 ":PROPERTIES:"
                                 ":CREATED: %U"
                                 ":END:"
                                 "%:annotation"
                                 "%i"
                                 ""
                                 "%?")
                               "\n")))
                  :prepend t
                  :empty-lines 1))))
#+end_src
[...]
My usage of `string-join’ is to facilitate readability and
maintainability. I have found that using a string literal with multiple
lines to have poor readability when editing in Elisp mode, particularly
if `org-capture-template’ has many templates. Furthermore, I find using
a string literal with embedded “\n” difficult to debug.

I like "<<-EOF" shell feature for here-docs that allows to keep text block indented, but I do not consider zero indent in elisp strings as a really annoying issue. It is unclear to me what are complications with debugging. Do you mean that `string-join' allows to comment out specific lines by prepending them with ";"?

#+begin_src elisp :lexical no
(add-hook 'org-mode-hook
 (lambda ()
   (add-to-list 'org-capture-templates
                '("capture"
                  "Capture (Org Protocol)"
                  entry
                  (file "notes.org")
                  "* %:description
:PROPERTIES:
:CREATED: %U
:END:
%:annotation
%i

%?"
                  :prepend t
                  :empty-lines 1))))
#+end_src

 #+HTML_HEAD_EXTRA:   </script>
+# #+HTML_HEAD: <link rel="stylesheet" href="../style/worg.css">
 #+HTML_LINK_UP:    index.html

The added line is commented out.

-  - =org-protocol-store-link= ::
[...]
+- ~store-link~ :: Store a link, push URL to kill-ring.

You changed verbatim markup to code. Strictly speaking, "store-link" is not code, so =store-link= should be a bit better.

*** macOS
[...]
***** Setup the Org protocol scheme handler
[...]
#+begin_warningbox

If you are using an old version of macOS (nee Mac OS X) older than

"nee"?

Ventura, this guidance may still be valid. If you are using macOS
Ventura or newer, *none* of this guidance is valid.

Warning here is a bit long here to my taste, have you considered "blindtext" instead? An alternative may be a brief warning like "The following text in this section applies to macOS versions prior to Ventura" and normal text below.

- url :: a URL (typically of a web page)
- title ::  the title of the web page
- selected text ::  selected text (body) within the web page

I am confused by "selected text" here. On the other hand all fields including body are described in the table a bit below.

*** Deprecated Protocols

"Deprecated URL style" may be more precise here

| ~store-link~  |                                                      |
|-------------+------------------------------------------------------|
| Old Style   | ~org-protocol:/store-link:/URL/TITLE~                  |
| New Style   | ~org-protocol://store-link?url=URL&title=TITLE~        |

\\

| ~capture~     |                                                      |
|-------------+------------------------------------------------------|
| Old Style   | ~org-protocol:/capture:/URL/TITLE~                   |
| New Style   | ~org-protocol://capture?url=URL&title=TITLE&body=BODY~ |

I had in mind

| Protocol | Old style | New style |
|--------------+---------------------------------------+--------------------------------------------------------|
| =store-link= | =org-protocol:/store-link:/URL/TITLE= | =org-protocol://store-link?url=URL&title=TITLE= | | =capture= | =org-protocol:/capture:/URL/TITLE= | =org-protocol://capture?url=URL&title=TITLE&body=BODY= |

Do you expect issues with too wide table on narrow smartphone screens?

Apply the following replacement rules from old style to new style URLs:
- =org-protocol:/store-link:/URL/TITLE= to =org-protocol://store-link?url=URL&title=TITLE=
...

may be more flexible.

*** Obsolete Protocols

The ~remember~ protocol is /obsolete/. Users should migrate any configuration 
relying on it to the ~capture~ protocol.

From my point of view *obsolete* should be still available while "remember" has been completely *removed*.

I find the following fragments at the end of sections for specific OSes almost identical

*** GNU/Linux, BSD, and Unix variants
[...]
***** Test your Org protocol setup

To test that Org protocol is setup and running, click on the JavaScript link
below to store an Org link to this page.

#+begin_export html
     <ul>
      <li><a href="javascript:storeLink();">Test Org protocol 
store-link</a></li>
     </ul>
#+end_export

In an Org buffer, use the binding ~C-c M-l~
(~org-insert-last-stored-link~) to paste the recently stored Org link.

***** Setup Org protocol capture
See [[#capture][Setup Org protocol capture]] in the common section.

***** Construct Org protocol URL Request

Numerous approaches can be used to [[#construct-url-request][construct an Org 
protocol request]]:

- As a [[#web-browser-bookmark][web browser bookmark]] that can invoke 
JavaScript
- Via program/script generation (Bash, Python, Java, Go, Rust, C, etc.)

Once the URL request has been constructed, it can be sent to Emacs via
the scheme handler which will invoke *emacsclient*.

-----

*** macOS
[...]
***** Test your Org protocol setup

To test that Org protocol is setup and running, click on the JavaScript link
below to store an Org link to this page.

#+begin_export html
     <ul>
      <li><a href="javascript:storeLink();">Test Org protocol 
store-link</a></li>
     </ul>
#+end_export

In an Org buffer, use the binding ~C-c M-l~
(~org-insert-last-stored-link~) to paste the recently stored Org link.


***** Setup Org protocol capture

See [[#capture][Setup Org protocol capture]] in the common section.

***** Setup Org protocol URL request

Numerous approaches can be used to [[#construct-url-request][construct an Org 
protocol request]]:

- As a [[#web-browser-bookmark][web browser bookmark]] that can invoke 
JavaScript
- Via program/script generation (Bash, Python, Java, Go, Rust, C, etc.)
- [[http://yummymelon.com/captee][Captee]] is a commerical app that can 
construct an Org protocol URL
  request from the native macOS Share
  Menu [fn:scrim-captee-disclaimer].

Once the URL request has been constructed, it can be sent to Emacs via the 
scheme handler.

-----

*** Windows
[...]
***** Test your Org protocol setup

To test that Org protocol is setup and running, click on the JavaScript link
below to store an Org link to this page.

#+begin_export html
     <ul>
      <li><a href="javascript:storeLink();">Test Org protocol 
store-link</a></li>
     </ul>
#+end_export

In an Org buffer, use the binding ~C-c M-l~
(~org-insert-last-stored-link~) to paste the recently stored Org link.


***** Setup Org protocol capture

See [[#capture][Setup Org protocol capture]] in the common section.

***** Setup Org protocol URL request

Numerous approaches can be used to [[#construct-url-request][construct an Org 
protocol request]]:

- As a [[#web-browser-bookmark][web browser bookmark]] that can invoke 
JavaScript
- Via program/script generation (Bash, Python, Java, Go, Rust, C#, etc.)

Once the URL request has been constructed, it can be sent to Emacs via
the scheme handler which will invoke *emacsclient*.

-----
*** Common

I would consider moving a single instance to the common part. A remark on macOS should not be annoying or distracting for Linux and Windows users.

Reply via email to