From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Teemu Likonen Newsgroups: gmane.emacs.bugs Subject: bug#44647: 27.1.50; `bibtex-contline-indentation' doesn't work as file local variable Date: Sat, 14 Nov 2020 23:18:16 +0200 Message-ID: <87d00fmycn.fsf@iki.fi> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2975"; mail-complaints-to="usenet@ciao.gmane.io" To: 44647@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 14 22:19:35 2020 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 1ke2xK-0000ef-H0 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 14 Nov 2020 22:19:35 +0100 Original-Received: from localhost ([::1]:41128 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ke2xJ-0003GD-CW for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 14 Nov 2020 16:19:33 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42378) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ke2wp-0003G5-4X for bug-gnu-emacs@gnu.org; Sat, 14 Nov 2020 16:19:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40630) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ke2wo-0005s6-RA for bug-gnu-emacs@gnu.org; Sat, 14 Nov 2020 16:19:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ke2wo-0006CK-Ml for bug-gnu-emacs@gnu.org; Sat, 14 Nov 2020 16:19:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Teemu Likonen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 14 Nov 2020 21:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 44647 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.160538872223791 (code B ref -1); Sat, 14 Nov 2020 21:19:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 14 Nov 2020 21:18:42 +0000 Original-Received: from localhost ([127.0.0.1]:52176 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ke2wT-0006Bf-QP for submit@debbugs.gnu.org; Sat, 14 Nov 2020 16:18:42 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:58126) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ke2wS-0006BY-O5 for submit@debbugs.gnu.org; Sat, 14 Nov 2020 16:18:41 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42332) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ke2wS-0003EW-II for bug-gnu-emacs@gnu.org; Sat, 14 Nov 2020 16:18:40 -0500 Original-Received: from lahtoruutu.iki.fi ([185.185.170.37]:33062) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ke2wQ-0005qQ-0y for bug-gnu-emacs@gnu.org; Sat, 14 Nov 2020 16:18:39 -0500 Original-Received: from mithlond (mobile-access-bcee73-255.dhcp.inet.fi [188.238.115.255]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: tlikonen) by lahtoruutu.iki.fi (Postfix) with ESMTPSA id 2BA861B00193 for ; Sat, 14 Nov 2020 23:18:25 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1605388705; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=zg8XnSC4v+TW8IV/h2rBzf3+WN0zDkz6p/3sb/B4thA=; b=YKGnLjaPcnCMt3sybF/CkiLolwkXbo6iHElMogujkeDrl+RLbabDjWpiD1It/JCC9dnSCB Hr0FPzV6cjJgP6C83EZrpZo1w/QUplbhToOpSxyKlHWW1mc6CT0B7sHdA/txWx0HFSf0l+ nRNy8ehIkGWSayaVyFXBU2JomMExbJ7FVQvIYBPrQbbn0cAXGPmNLvrYSqBrJADq79wgwj zmbYl0Ni6vrIXeObrwO6YmSkooMJs/CW1FSpZX+dlMbq8FSiRwhnUhR6LikJQR0W7qXtbP tmYo39N9ZBt7j1CsR3TiMtJS6G4u0eISb942CPizEXmKT/FUHFo+M4lWROAzVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1605388705; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=zg8XnSC4v+TW8IV/h2rBzf3+WN0zDkz6p/3sb/B4thA=; b=Uz8ptzttLX2nSzgRtvJkkLZZzn5E0ERwOwpVfAZ3SVp09WxU85HmTtLdEiZLqFFYJZV4aA oChWjQn9+aqn8vjazP43ZBC7QvqixqUuUkAXfkKJKhxTke4Pd67/hdzbEQSEyRpuuJFSUC 9uT+W4EFXtS18ChxjBMgd1fbJyeo3fpXNTx9HBdOng3Oftd/32/lwbY8mMHyv1/sHEwqZL XxiotinqY19YgzxCpeUDa4n1IPkCvuTI5HQ28yoqvV923dZCX0AXZHouPh3SloCyX4Brax c6ZrcU6Lm1gWQJSuV4ldVYfQBnW1RXyR6ee0zpuHj4G3gobYTqZW5EchkhjJvw== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=tlikonen smtp.mailfrom=tlikonen@iki.fi ARC-Seal: i=1; s=lahtoruutu; d=iki.fi; t=1605388705; a=rsa-sha256; cv=none; b=p+T/hvUnx0GyKZu0lF2tqnuVOrqMLjtPdntFnsBOZuG5VUI7BtmKw8g6oJz6AFayVQbihU /VYgeES9rbwMpypCWZa00m0LO6wOpoprzEOqNScLb/Wi44a9MExyPgYbfSLac0GixRjLp5 Tx6NRDRShfBOu94G4Goj11RfJyjbyvPPJqZ9P74KnhxUOhPV0fqYslaba56GKgVC0bwxaE ATgLto4rq+kA6j2N9oYqiIB/IObat+KIcyQt+zlhrBg0XqgAlXnodwm9a/JNc1iWaprwcZ iwwlKqMfCvhkqcI9H2mV3oNBahiXTjt39JUtR9Jfg8wwqwrgxsfHE8XbpABwyQ== Received-SPF: pass client-ip=185.185.170.37; envelope-from=tlikonen@iki.fi; helo=lahtoruutu.iki.fi X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/14 16:18:26 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:193335 Archived-At: --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Variable bibtex-contline-indentation does not work as file local variable. The reason is that bibtex-mode command initializes variable fill-prefix before the possible file local variable is available. It gets always the global value of bibtex-contline-indentation. This can be fixed by locally let-binding fill-prefix every time in the relevant filling function. Patch for that is attached. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Make-bibtex-contline-indentation-work-as-file-local-.patch Content-Transfer-Encoding: quoted-printable From=20a776cae4fcd34987e30b6eab3df45bd2ae66fbd9 Mon Sep 17 00:00:00 2001 From: Teemu Likonen Date: Sat, 14 Nov 2020 22:53:18 +0200 Subject: [PATCH] Make `bibtex-contline-indentation' work as file local variable * lisp/textmodes/bibtex.el (bibtex-mode): Don't make fill-prefix a buffer local variable. It would use the global value, not possible file local variable. * lisp/textmodes/bibtex.el (bibtex-fill-field-bounds): Let-bind fill-prefix variable locally (and dynamically) for use with filling bibtex fields. The variable is initialized every time by using the current value of bibtex-contline-indentation variable. =2D-- lisp/textmodes/bibtex.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el index fcf63ed5ec..151dca6fab 100644 =2D-- a/lisp/textmodes/bibtex.el +++ b/lisp/textmodes/bibtex.el @@ -3442,8 +3442,6 @@ bibtex-mode (set (make-local-variable 'defun-prompt-regexp) "^[ \t]*@[[:alnum:]]+[ \= t]*") (set (make-local-variable 'outline-regexp) "[ \t]*@") (set (make-local-variable 'fill-paragraph-function) #'bibtex-fill-field) =2D (set (make-local-variable 'fill-prefix) =2D (make-string (+ bibtex-entry-offset bibtex-contline-indentation) = ?\s)) (set (make-local-variable 'font-lock-defaults) '(bibtex-font-lock-keywords nil t ((?$ . "\"") @@ -4902,7 +4900,10 @@ bibtex-fill-field-bounds "Fill BibTeX field delimited by BOUNDS. If JUSTIFY is non-nil justify as well. If optional arg MOVE is non-nil move point to end of field." =2D (let ((end-field (copy-marker (bibtex-end-of-field bounds)))) + (let ((end-field (copy-marker (bibtex-end-of-field bounds))) + (fill-prefix (make-string (+ bibtex-entry-offset + bibtex-contline-indentation) + ?\s))) (if (not justify) (goto-char (bibtex-start-of-text-in-field bounds)) (goto-char (bibtex-start-of-field bounds)) =2D-=20 2.20.1 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iIYEARYIAC4WIQTJW2wqtelxC1gHdbitnXWr7pTCcwUCX7BJmBAcdGxpa29uZW5A aWtpLmZpAAoJEK2ddavulMJzpVgA/2m6V1SD9O3DNz0/AKmAFADPZYnDZ2hVyC8O QK3QnIegAP9g/GMOdiT/Z9ZT2vGG7PSPvXrTHBknBnA/nHBbUfUWAQ== =ocoi -----END PGP SIGNATURE----- --==-=-=--