all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Max Nikulin <manikulin@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: [RFC][PATCH] Allow to export to ascii custom link types as notes
Date: Tue, 24 Oct 2023 15:11:07 +0700	[thread overview]
Message-ID: <uh7u6u$met$1@ciao.gmane.io> (raw)
In-Reply-To: <87lebt8rrm.fsf@localhost>

On 23/10/2023 19:09, Ihor Radchenko wrote:
> Max Nikulin writes:
> 
> Then, `org-ascii-make-link-with-note' may as well receive and modify
> INFO plist. This way, ((org-export-custom-protocol-maybe link desc 'ascii info))
> cond form will work without changes as `org-ascii-make-link-with-note`
> will do all the necessary processing.

Adding INFO argument is a bit more burden for users, but, I think, it is 
acceptable.

However "cond form will work without changes" is not clear for me. 
`org-export-custom-protocol-maybe' is called twice and depending on 
context the result should be either "[description]" inline or 
"[description] path" for note, so the code around 
`org-export-custom-protocol-maybe' has to be changed.

>> angle and square brackets inconsistency
>>
>> --- 8< ---
>> # (require 'ol-man)
>> # (setq org-ascii-links-to-notes nil)
>>
>> - web :: [[http://orgmode.org][Org mode]]
>> - man :: [[man:man][man]]
>> - internal :: [[Heading][heading]]
>>
>> * Heading
>> --- >8 ---
>> --- 8< ---
>> web
>>         [Org mode] (<http://orgmode.org>)
>> man
>>         man (http://man.he.net/?topic=man&section=all)
> 
> This is probably a bug in ol-man.

Which one? Absence of square brackets? Absence of angle brackets? Both?

>> internal
>>         heading (See section 1)
> 
> I see no problem here - internal links are special, and it makes sense to
> drop angle brackets, unlike external web links that are often marked
> with angle brackets in the wild.

Due to absence of square brackets around "heading" it should be treated 
differently from e.g. http links. It is the reason why I added a regexp 
to detect if a caller added square brackets:

>>>>>> +           (if (string-match-p "\\`\u200b*\\[.*\\]\u200b*\\'" anchor)
>>>>>> +               anchor
>>>>>> +	     (format "[%s]" anchor))

I do not like repetitions in the current code.



  reply	other threads:[~2023-10-24  8:12 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-20 17:21 [RFC][PATCH] Allow to export to ascii custom link types as notes Max Nikulin
2023-10-22  9:13 ` Ihor Radchenko
2023-10-22 17:05   ` Max Nikulin
2023-10-23  9:17     ` Ihor Radchenko
2023-10-23 11:00       ` Max Nikulin
2023-10-23 12:09         ` Ihor Radchenko
2023-10-24  8:11           ` Max Nikulin [this message]
2023-10-24 10:40             ` Ihor Radchenko
2023-10-24 15:06               ` [PATCH] ox-ascii.el: Consistently add brackets around links (was: Re: [RFC][PATCH] Allow to export to ascii custom link types as notes) Max Nikulin
2023-10-25 10:34                 ` Ihor Radchenko
2023-10-26 16:46                   ` man pages references (Re: [PATCH] ox-ascii.el: Consistently add brackets around links) Max Nikulin
2023-11-05 12:08                     ` Ihor Radchenko
2023-10-27 14:36               ` [RFC][PATCH] Allow to export to ascii custom link types as notes Max Nikulin
2023-10-25 15:16           ` [RFC][PATCH v2] " Max Nikulin
2023-11-07  9:30             ` Ihor Radchenko
2023-11-07 11:48               ` Max Nikulin
2023-11-07 11:58                 ` Ihor Radchenko
2023-11-08 10:23                   ` Max Nikulin
2023-11-08 10:45                     ` Ihor Radchenko
2023-11-08 10:57                       ` Max Nikulin
2023-11-08 11:16                         ` Ihor Radchenko
2023-11-09 11:12                           ` Max Nikulin
2023-11-11 11:17                             ` Ihor Radchenko

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to='uh7u6u$met$1@ciao.gmane.io' \
    --to=manikulin@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.