emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Make broken link markers customizable


From: Ihor Radchenko
Subject: Re: [PATCH] Make broken link markers customizable
Date: Mon, 12 Dec 2022 12:52:56 +0000

Rudolf Adamkovič <salutis@me.com> writes:

> Org provides no good way to ignore broken links when exporting subtrees
> with lots of links.  With `org-export-with-broken-links' set to `nil',
> the exporter aborts.  When set to `t', the exporter removes the linked
> words altogether, breaking the sentences.  Lastly, when set to `mark',
> the sentences become unreadable due to the million [BROKEN LINK: ...]
> fragments everywhere.
>
> What do you folks think about the WIP patch below?  It allows the user
> to customize the broken link marker the Org exporter will use.  A user
> like me, one who works in a large Org file and often exports only its
> parts, can use a more gentle marker or even no marker at all.

In general, sounds like a reasonable addition.
Though it should be accompanied by a NEWS entry.

>  When this variable is non-nil, broken links are ignored, without
>  stopping the export process.  If it is set to `mark', broken
> -links are marked as such in the output, with a string like
> +links are marked with `org-export-broken-link-marker'.
>  
> -  [BROKEN LINK: path]
> -
> -where PATH is the un-resolvable reference.
> -
> -This option can also be set with the OPTIONS keyword, e.g.,
> +This variable can also be set with the OPTIONS keyword, e.g.,
>  \"broken-links:mark\"."

This is wrong.
broken-links:mark is an option defined in `org-export-options-alist'.

You may instead add a sentence that the string may be customized via the
new variable.

> +(defcustom org-export-broken-link-marker "[BROKEN LINK: %s]"
> +  "The string used to mark broken links.
> +
> +This variable applies only when `org-export-with-broken-links' is
> +set to `mark'.  If the value contains the %-sequence `%s', the
> +exporter will replace it with the broken reference which it
> +cannot resolve."
> +  :group 'org-export-general
> +  :package-version '(Org . "9.7")
> +  :type 'string
> +  :safe #'stringp)

What will happen if multiple %s are inside the string?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
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>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]