emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@posteo.net>
To: "Rudolf Adamkovič" <salutis@me.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [PATCH] Make broken link markers customizable
Date: Mon, 12 Dec 2022 12:52:56 +0000	[thread overview]
Message-ID: <877cywhjh3.fsf@localhost> (raw)
In-Reply-To: <m2wn7cou6t.fsf@me.com>

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	other threads:[~2022-12-12 12:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-01  0:15 [PATCH] Make broken link markers customizable Rudolf Adamkovič
2022-12-12 12:52 ` Ihor Radchenko [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877cywhjh3.fsf@localhost \
    --to=yantar92@posteo.net \
    --cc=emacs-orgmode@gnu.org \
    --cc=salutis@me.com \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).