unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@gmail.com>
To: Roland Winkler <winkler@gnu.org>
Cc: 57712@debbugs.gnu.org, Lars Ingebrigtsen <larsi@gnus.org>
Subject: bug#57712: 29.0.50; bibtex.el: Should `bibtex-parse-entry' handle curly braces inside fields?
Date: Wed, 14 Sep 2022 10:07:13 +0800	[thread overview]
Message-ID: <87zgf2yai6.fsf@localhost> (raw)
In-Reply-To: <874jxbzzk4.fsf@gnu.org>

Roland Winkler <winkler@gnu.org> writes:

>> will return
>>
>> '("Introduction " (mathmode "$3^5$") " to Markȯv Chain " (braces
>> "{MOnte}") "Carlo" (latex "\LaTeX"))
>>
>> that is
>> 1. Escaped symbols are replaced by their unicode
>> 2. Braces are indicated by (braces "string")
>> 3. LaTeX math is indicated by (mathmode "math string")
>> 4. LaTeX commands are indicated by (latex "command")
>> 5. @strings are replaced appropriately
>
> I believe this is much beyond BibTeX mode and yet more beyond
> bibtex-parse-entry.  It is mostly about parsing LaTeX while BibTeX plays
> only a marginal role (adding support for @string's will be cheap once you
> get the rest of this parser working).  Then, you also need to deal with
> the question: what do you want to do with a return value you illustrated
> above?  From what I vaguely understood, your real goal is to convert
> this into something human-readable.

> This is a fairly substantial project.  I am not sure whether it would be
> worth the effort.  And I would not want to bury such a pretty complex
> machinery in a new optional arg of a function that is intended to do
> something very different.

I am looking at this differently. Similar to BibTeX fields, text in the
fields is a subject of a specific format. That format is _not_ exactly
the same with TeX (e.g. see
https://tex.stackexchange.com/questions/26338/how-to-code-%C3%9F-german-sharp-s-in-bibtex)

I expect bibtex.el to handle all the peculiarities of BibTeX format, so
that external packages do not need to perform extra parsing.

If you dislike modifying bibtex-parse-entry, bibtex-parse-field-text
looks like a reasonable place to handle field text parsing.

-- 
Ihor Radchenko,
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-09-14  2:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-10  4:32 bug#57712: 29.0.50; bibtex.el: Should `bibtex-parse-entry' handle curly braces inside fields? Ihor Radchenko
2022-09-10  4:39 ` Lars Ingebrigtsen
2022-09-10 16:07   ` Roland Winkler
2022-09-11  5:11     ` Roland Winkler
2022-09-12  5:20       ` Ihor Radchenko
2022-09-12 13:50         ` Roland Winkler
2022-09-13  2:34           ` Ihor Radchenko
2022-09-13  4:08             ` Roland Winkler
2022-09-14  2:07               ` Ihor Radchenko [this message]
2022-09-14 17:02                 ` Roland Winkler
2022-12-30  6:39                   ` Roland Winkler
2022-09-12  5:06     ` 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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87zgf2yai6.fsf@localhost \
    --to=yantar92@gmail.com \
    --cc=57712@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    --cc=winkler@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 public inbox

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

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).