A continuación se muestra la versión modificada org-make-link-regexp
que permitirá un nivel de anidamiento de corchetes dentro de la descripción:
(defun org-make-link-regexps ()
"Update the link regular expressions.
This should be called after the variable `org-link-types' has changed."
(setq org-link-types-re
(concat
"\\`\\(" (mapconcat 'regexp-quote org-link-types "\\|") "\\):")
org-link-re-with-space
(concat
"<?\\(" (mapconcat 'regexp-quote org-link-types "\\|") "\\):"
"\\([^" org-non-link-chars " ]"
"[^" org-non-link-chars "]*"
"[^" org-non-link-chars " ]\\)>?")
org-link-re-with-space2
(concat
"<?\\(" (mapconcat 'regexp-quote org-link-types "\\|") "\\):"
"\\([^" org-non-link-chars " ]"
"[^\t\n\r]*"
"[^" org-non-link-chars " ]\\)>?")
org-link-re-with-space3
(concat
"<?\\(" (mapconcat 'regexp-quote org-link-types "\\|") "\\):"
"\\([^" org-non-link-chars " ]"
"[^\t\n\r]*\\)")
org-angle-link-re
(concat
"<\\(" (mapconcat 'regexp-quote org-link-types "\\|") "\\):"
"\\([^" org-non-link-chars " ]"
"[^" org-non-link-chars "]*"
"\\)>")
org-plain-link-re
(concat
"\\<\\(" (mapconcat 'regexp-quote org-link-types "\\|") "\\):"
(org-re "\\([^ \t\n()<>]+\\(?:([[:word:]0-9_]+)\\|\\([^[:punct:] \t\n]\\|/\\)\\)\\)"))
;; "\\([^]\t\n\r<>() ]+[^]\t\n\r<>,.;() ]\\)")
org-bracket-link-regexp
;; "\\[\\[\\([^][]+\\)\\]\\(\\[\\([^][]+\\)\\]\\)?\\]"
"\\[\\[\\([^][]+\\)\\]\\(\\[\\([^[]*?\\[[^]]*?\\][^]]*?\\|[^][]+\\)\\]\\)?\\]"
org-bracket-link-analytic-regexp
(concat
"\\[\\["
"\\(\\(" (mapconcat 'regexp-quote org-link-types "\\|") "\\):\\)?"
"\\([^]]+\\)"
"\\]"
"\\(\\[" "\\([^[]*?\\[[^]]*?\\][^]]*?\\|[^]]+\\)" "\\]\\)?"
;; "\\(\\[" "\\([^]]+\\)" "\\]\\)?"
"\\]")
org-bracket-link-analytic-regexp++
(concat
"\\[\\["
"\\(\\(" (mapconcat 'regexp-quote (cons "coderef" org-link-types) "\\|") "\\):\\)?"
"\\([^]]+\\)"
"\\]"
"\\(\\[" "\\([^]]+\\)" "\\]\\)?"
"\\]")
org-any-link-re
(concat "\\(" org-bracket-link-regexp "\\)\\|\\("
org-angle-link-re "\\)\\|\\("
org-plain-link-re "\\)")))
Pero como se señaló anteriormente, esto no resuelve el problema de editar enlaces (Org aún querrá reemplazar los corchetes con llaves). Esto también solo puede manejar un nivel de anidamiento de un grupo entre corchetes.
org-make-link-regexps
, pero en general eso no se puede hacer con la configuración actual.