From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gautier Ponsinet Newsgroups: gmane.emacs.devel Subject: Bibtex new entry key prompt Date: Fri, 08 Nov 2024 15:17:16 +0200 Message-ID: <87ed3lamqr.fsf@gautierponsinet.xyz> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26414"; mail-complaints-to="usenet@ciao.gmane.io" Cc: winkler@gnu.org To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Nov 08 14:18:29 2024 Return-path: Envelope-to: ged-emacs-devel@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 1t9OsZ-0006hB-U0 for ged-emacs-devel@m.gmane-mx.org; Fri, 08 Nov 2024 14:18:28 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t9Oro-0004z9-ED; Fri, 08 Nov 2024 08:17:36 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t9Ork-0004yM-Uj for emacs-devel@gnu.org; Fri, 08 Nov 2024 08:17:33 -0500 Original-Received: from 3.mo584.mail-out.ovh.net ([46.105.57.129]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t9Ori-0000zi-3m for emacs-devel@gnu.org; Fri, 08 Nov 2024 08:17:32 -0500 Original-Received: from director6.ghost.mail-out.ovh.net (unknown [10.109.176.8]) by mo584.mail-out.ovh.net (Postfix) with ESMTP id 4XlKH31hnkz1TVx for ; Fri, 8 Nov 2024 13:17:19 +0000 (UTC) Original-Received: from ghost-submission-5b5ff79f4f-ns64v (unknown [10.110.164.77]) by director6.ghost.mail-out.ovh.net (Postfix) with ESMTPS id A29151FD59; Fri, 8 Nov 2024 13:17:18 +0000 (UTC) Original-Received: from gautierponsinet.xyz ([37.59.142.104]) by ghost-submission-5b5ff79f4f-ns64v with ESMTPSA id iawkF14PLmfvFQAAbNtMoA (envelope-from ); Fri, 08 Nov 2024 13:17:18 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-104R00503ee8a96-84c8-4d43-b952-81aa25ca2e88, 586E39EBEA3BCA3A2B7BED27489250767F88327B) smtp.auth=gautier@gautierponsinet.xyz X-OVh-ClientIp: 77.49.242.8 X-Ovh-Tracer-Id: 1107604037415397249 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 70 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeefuddrtdeigdegjecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecufghrlhcuvffnffculdejtddmnecujfgurhephffvvefufffkgggtsehmtderredttddtnecuhfhrohhmpefirghuthhivghrucfrohhnshhinhgvthcuoehgrghuthhivghrsehgrghuthhivghrphhonhhsihhnvghtrdighiiiqeenucggtffrrghtthgvrhhnpeejieevheduveduieeguddukeethefgheekleetuddvkeetleetudejvdeutedtfeenucfkphepuddvjedrtddrtddruddpjeejrdegledrvdegvddrkedpfeejrdehledrudegvddruddtgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepghgruhhtihgvrhesghgruhhtihgvrhhpohhnshhinhgvthdrgiihiidpnhgspghrtghpthhtohepuddprhgtphhtthhopegvmhgrtghsqdguvghvvghlsehgnhhurdhorhhgpdfovfetjfhoshhtpehmohehkeegmgdpmhhouggvpehsmhhtphhouhht DKIM-Signature: a=rsa-sha256; bh=q5k11Mv7q9oShC17ukvvQKDr1uOefKKkR3Ye0KaBMLU=; c=relaxed/relaxed; d=gautierponsinet.xyz; h=From; s=ovhmo4576755-selector1; t=1731071839; v=1; b=Fa57uXzNLn1TEvl8ZiyG611Dy4lujLoqfdNEi0UXE4WViGz5aLmtx4OV3MeRKZktqJtfT4nJ xnVUTSMBR2nXmmyVS2tdzM/L0uVObrMKFe7FxwHGS9A5J3p8uhwfKzFjHW+eMDAENBkp7lpccIv LnE4WZ08a08SM8e5vnaPMfD6St/BF1Fwc3mxV8JC4AHSdmTaRDtdng38Jk+E5kRdefrQmBi4wmh CRgBm/AXfSjflIfVG7aUGcT7NjVbmyIcIyqus+vTwoE5XB1yMqUXb/Ze/KRawdnoKAusm82A2ad AaIzXTfGr6QqfEZBRirlAXcmEalClWFkxKlAwGpk4ecuw== Received-SPF: pass client-ip=46.105.57.129; envelope-from=gautier@gautierponsinet.xyz; helo=3.mo584.mail-out.ovh.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:325277 Archived-At: --=-=-= Content-Type: text/plain Hello everyone, (CC: Roland Winkler, current maintainer of bibtex.el) The bibtex major mode to edit and maintain bibtex files has the capability to generate key for new bibtex entry. It is very convenient. However, when inserting a template for a new entry via `bibtex-entry', the function always asks the user for a key. I would like to be able to bypass this prompt since I rely on the autokey system to generate a key after validating the entry via `bibtex-clean-entry'. I have attached a patch to this mail, and I would like your opinion on this. All the best, Gautier. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Add-the-user-option-bibtex-entry-ask-for-key.patch >From d62df5a257c6a9c02936e88ecb5f6fd95613ebe3 Mon Sep 17 00:00:00 2001 From: Gautier Ponsinet Date: Fri, 8 Nov 2024 15:07:15 +0200 Subject: [PATCH] Add the user option bibtex-entry-ask-for-key * lisp/textmodes/bibtex.el (bibtex-entry-ask-for-key): add the user option. (bibtex-entry): Ask the user for a key if the variable bibtex-entry-ask-for-key is non-nil. --- lisp/textmodes/bibtex.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el index cbcea8af012..d26b67dca7b 100644 --- a/lisp/textmodes/bibtex.el +++ b/lisp/textmodes/bibtex.el @@ -1377,6 +1377,11 @@ ;;; Code: :version "28.1" :type 'function) +(defcustom bibtex-entry-ask-for-key nil + "If non-nil, `bibtex-entry' asks for a key." + :group 'bibtex + :type 'boolean) + (defcustom bibtex-entry-offset 0 "Offset for BibTeX entries. Added to the value of all other variables which determine columns." @@ -3852,7 +3857,7 @@ ;;;###autoload (let ((completion-ignore-case t)) (list (completing-read "Entry Type: " bibtex-entry-alist nil t nil 'bibtex-entry-type-history)))) - (let ((key (if bibtex-maintain-sorted-entries + (let ((key (if bibtex-entry-ask-for-key (bibtex-read-key (format "%s key: " entry-type)))) (field-list (bibtex-field-list entry-type))) (unless (bibtex-prepare-new-entry (list key nil entry-type)) -- 2.47.0 --=-=-=--