From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Francesco =?UTF-8?Q?Potort=C3=AC?= Newsgroups: gmane.emacs.bugs Subject: bug#44618: 26.3; bibtex.el ignores file variable bibtex-contline-indentation Date: Fri, 13 Nov 2020 13:45:58 +0100 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22876"; mail-complaints-to="usenet@ciao.gmane.io" To: 44618@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Nov 13 13:47:34 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 1kdYUI-0005qv-Dk for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 13 Nov 2020 13:47:34 +0100 Original-Received: from localhost ([::1]:48904 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kdYUH-0001OP-Eh for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 13 Nov 2020 07:47:33 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42454) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kdYTm-0001NB-II for bug-gnu-emacs@gnu.org; Fri, 13 Nov 2020 07:47:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35697) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kdYTm-00086I-7R for bug-gnu-emacs@gnu.org; Fri, 13 Nov 2020 07:47:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kdYTm-0008J0-6E for bug-gnu-emacs@gnu.org; Fri, 13 Nov 2020 07:47:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Francesco =?UTF-8?Q?Potort=C3=AC?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 13 Nov 2020 12:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 44618 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.160527157231868 (code B ref -1); Fri, 13 Nov 2020 12:47:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 13 Nov 2020 12:46:12 +0000 Original-Received: from localhost ([127.0.0.1]:47243 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kdYSu-0008Hr-1v for submit@debbugs.gnu.org; Fri, 13 Nov 2020 07:46:11 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:34826) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kdYSp-0008Hh-4r for submit@debbugs.gnu.org; Fri, 13 Nov 2020 07:46:07 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42298) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kdYSo-0000CP-Sp for bug-gnu-emacs@gnu.org; Fri, 13 Nov 2020 07:46:02 -0500 Original-Received: from smtp-clients1.isti.cnr.it ([146.48.28.36]:43672) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kdYSn-0007m5-3I for bug-gnu-emacs@gnu.org; Fri, 13 Nov 2020 07:46:02 -0500 Original-Received: from tucano.isti.cnr.it (tucano.isti.cnr.it [146.48.81.102]) (Authenticated sender: pot) by smtp-clients1.isti.cnr.it (Postfix) with ESMTPSA id 990B0AE6E0 for ; Fri, 13 Nov 2020 13:45:58 +0100 (CET) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.102.4 at smtp-out.isti.cnr.it Original-Received: from pot by tucano.isti.cnr.it with local (Exim 4.94) (envelope-from ) id 1kdYSk-00EHxr-5C for bug-gnu-emacs@gnu.org; Fri, 13 Nov 2020 13:45:58 +0100 X-fingerprint: 4B02 6187 5C03 D6B1 2E31 7666 09DF 2DC9 BE21 6115 Received-SPF: softfail client-ip=146.48.28.36; envelope-from=pot@gnu.org; helo=smtp-clients1.isti.cnr.it X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/13 07:03:07 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Spam_score_int: -11 X-Spam_score: -1.2 X-Spam_bar: - X-Spam_report: (-1.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665 autolearn=no 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:193229 Archived-At: In GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, X toolkit, Xaw3d scroll bars) of 2020-05-17, modified by Debian built on x86-csail-01 I set bibtex-contline-indentation as a file variable, yeet it is ignored by bibtex-mode. I am not sure how file variables and minor modes interact, but it looks like when the minor mode is fired, the local variables have not been set yet. Whatever the reason, bibtex-mode sets fill-prefix as a local variable irrespective of the file variable bibtex-contline-indentation. The fix for my case is simple: avoid setting fill-prefix as a local variable in the minor mode, and just set it inside the bibtex-fill-field-bounds function. A patch follows. However, I don't know if this is a hint of some more general problem on how bibtex-mode trets file variables. --- bibtex-2019.el 2020-11-13 11:54:34.000000000 +0100 +++ bibtex.el 2020-11-13 13:34:24.000000000 +0100 @@ -3399,8 +3409,6 @@ (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) - (set (make-local-variable 'fill-prefix) - (make-string (+ bibtex-entry-offset bibtex-contline-indentation) ?\s)) (set (make-local-variable 'font-lock-defaults) '(bibtex-font-lock-keywords nil t ((?$ . "\"") @@ -4830,7 +4838,9 @@ "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." - (let ((end-field (copy-marker (bibtex-end-of-field bounds)))) + (let ((fill-prefix + (make-string (+ bibtex-entry-offset bibtex-contline-indentation) ?\s)) + (end-field (copy-marker (bibtex-end-of-field bounds)))) (if (not justify) (goto-char (bibtex-start-of-text-in-field bounds)) (goto-char (bibtex-start-of-field bounds))