From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.bugs Subject: bug#57712: 29.0.50; bibtex.el: Should `bibtex-parse-entry' handle curly braces inside fields? Date: Mon, 12 Sep 2022 13:20:18 +0800 Message-ID: <87bkrlw4ml.fsf@localhost> References: <87k06b26iu.fsf@localhost> <87r10jrgf4.fsf@gnus.org> <87zgf75i32.fsf@gnu.org> <871qsi5wcf.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22054"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 57712@debbugs.gnu.org, Lars Ingebrigtsen To: Roland Winkler Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Sep 12 07:20:40 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oXbs7-0005YY-IO for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 12 Sep 2022 07:20:39 +0200 Original-Received: from localhost ([::1]:34354 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oXbs5-00033G-OV for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 12 Sep 2022 01:20:37 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60454) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oXbrX-000332-4W for bug-gnu-emacs@gnu.org; Mon, 12 Sep 2022 01:20:07 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55153) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oXbrW-0006Wm-K9 for bug-gnu-emacs@gnu.org; Mon, 12 Sep 2022 01:20:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oXbrW-0003YX-6T for bug-gnu-emacs@gnu.org; Mon, 12 Sep 2022 01:20:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ihor Radchenko Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 12 Sep 2022 05:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57712 X-GNU-PR-Package: emacs Original-Received: via spool by 57712-submit@debbugs.gnu.org id=B57712.166295997913635 (code B ref 57712); Mon, 12 Sep 2022 05:20:02 +0000 Original-Received: (at 57712) by debbugs.gnu.org; 12 Sep 2022 05:19:39 +0000 Original-Received: from localhost ([127.0.0.1]:43852 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXbr5-0003Xm-9w for submit@debbugs.gnu.org; Mon, 12 Sep 2022 01:19:38 -0400 Original-Received: from mail-pl1-f173.google.com ([209.85.214.173]:47052) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXbr0-0003XX-Md for 57712@debbugs.gnu.org; Mon, 12 Sep 2022 01:19:34 -0400 Original-Received: by mail-pl1-f173.google.com with SMTP id jm11so7484869plb.13 for <57712@debbugs.gnu.org>; Sun, 11 Sep 2022 22:19:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date; bh=jxdJHjLvdyFA1VTaDgyWCC6VwD4HH60WGV5ziRqyxXc=; b=o7xqfepoIr3u4EBPMQRlAkvWpfvotKPIy5uws9A1ARdHVO8t/fyetcmc4GhpRwsVxH arWNer/tc6xcTZ07CCo4eTYBO6iuJ6HAUuCA8Nr5cth6ynPqUxGVuypxq9aeEOC10Avh m7aYvLsm8iLJ2/VPvvW8zXQNMqfv2+eVLW+cYmtt6fFlzmJNFYzyMZuILQYSrpu1cbUT DfbamO96k6bmaiWkCrL2jMLlfmypsCn6J50jIWGXBxMPSx3nDAtE7COOWEUeyO61pkNd WlMvpIGEHADtk8rvesn1QP9sj+R/0qcebB2GROpLiudisR0lCtL4NTIFlGzkcQPGXRH8 kyUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date; bh=jxdJHjLvdyFA1VTaDgyWCC6VwD4HH60WGV5ziRqyxXc=; b=dejwClyJ0tV0vhbDluP6MFywaR+BTIDNs7kBuMQPgmmk0tvFthslAh9RsqrfQhjEju kMPHpn6hitJs6VIqe+DfWXwVMSrYhqogyicHaSf1jxkiOrJwHZ10TGQUxAq4dJARVez6 D1JeiQVyqXSY6cjAWW3GT1N4dQ7n4McJ5ElhGAgE/mGR5LQ33zVy+5VfQ5jQrVGSKUPA 7KwmEoluznDsq1uEuqpnvrBH1bzhTn/C1DmutABP9sDU2A/2+6sjCdkhssd17a1jppSB RTcT/C8x1V2KiFBAoEEShRsbxq6kDn+zZElg5FCeVoqyRsp73hQeIktvP9DhMKJ/1eCn FKtg== X-Gm-Message-State: ACgBeo25Nr6A9qtLhe/U+RYsdxN4a9J0L+jAiNyG5FWU1k98Y98yUtP4 JmXcMkcwV8Sm0N7dvXNvZ14= X-Google-Smtp-Source: AA6agR75/LTI1cSAFgGWcUbXc8YUSOK+YPSRMojY0H4O5GHSD5GwhX5PFzTKpoDftrfua8yHNKrnSw== X-Received: by 2002:a17:90b:2743:b0:200:9be5:d492 with SMTP id qi3-20020a17090b274300b002009be5d492mr22046172pjb.237.1662959964742; Sun, 11 Sep 2022 22:19:24 -0700 (PDT) Original-Received: from localhost ([2409:8a70:2bc:c850:8ec6:81ff:fe70:339d]) by smtp.gmail.com with ESMTPSA id c200-20020a621cd1000000b00541469775fesm4008990pfc.138.2022.09.11.22.19.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Sep 2022 22:19:24 -0700 (PDT) In-Reply-To: <871qsi5wcf.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:242207 Archived-At: Roland Winkler writes: > On Sat, Sep 10 2022, Roland Winkler wrote: >> I must be missing something. > > I looked at the original org bug report that triggered the present > report. I guess that now I understand what the OP is concerned about. > I believe that bibtex-parse-entry is not the right place to try to fix > this. The problem is to define what an optional arg CONTENT should do. To clarify, I do not expect bibtex-parse-entry to strip the braces. What I'd like to see is _parsing_ braces (say, as sexp) and other special BibTeX syntax. At least, as long as appropriate option is passed to bibtex-parse-entry. What to do with the braces is another question and has nothing to do with bibtex.el. It is to be decided by Org. > I do not know what the "basic org cite export processor" mentioned by > the OP is doing in detail. But it reminds me of bibtex-summary which is > the default value of bibtex-summary-function. This function generates a > "human-readable" summary of a BibTeX entry. It uses the autokey > machinery of bibtex-mode that was originally developed for generating > keys for new BibTeX entries. But this machinery can easily be "misused" > for things like bibtex-summary. The point is that it offers rather many > options to customize what such a summary should look like. Say, an > entry has 20 authors. Do you want to display three or four authors? Do > you want to just put dots after the third author or "et al."? Should the > author(s) come first or should the title come first? Should the year > appear before or after the title? (Essentially, you can go through all > the questions relevant for BibTeX style files; but the autokey machinery > comes with the power of emacs :-) > > So I suggest that the "basic org cite export processor" could use > something similar to bibtex-summary. But this should just be the > default value of something similar to bibtex-summary-function so that > users can customize this more easily. > > (Letting users define their personal bibtex-summary function is probably > easier than trying to define some user variables that can control this. > There are just too many possibilities how one might want to customize > things. My personal bibtex-summary function does a couple things that > nobody else might like, but they are important for me.) bibtex-summary approach might be an option, although it is clearly an abuse and begs for future bugs. However, there are at least several issues with, say, `bibtex-autokey-get-title': 1. Its docstring does not clarify which variables affect the return value and does not even mention that the actual title contents is transformed in any way. 2. It simply strips the curly braces. `bibtex-autokey-titleword-case-convert' is applied regardless of the braces. -- 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