GNU bug report logs - #44618
26.3; bibtex.el ignores file variable bibtex-contline-indentation

Previous Next

Package: emacs;

Reported by: Francesco Potortì <pot <at> gnu.org>

Date: Fri, 13 Nov 2020 12:47:01 UTC

Severity: minor

Merged with 44647

Found in versions 26.3, 27.1.50

Done: "Roland Winkler" <winkler <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: "Roland Winkler" <winkler <at> gnu.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#44618: closed (26.3; bibtex.el ignores file variable
 bibtex-contline-indentation)
Date: Wed, 02 Dec 2020 18:39:01 +0000
[Message part 1 (text/plain, inline)]
Your message dated Wed, 2 Dec 2020 12:38:19 -0600
with message-id <57115.88742.877010.24519 <at> gargle.gargle.HOWL>
and subject line Re: bug#44618: 26.3; bibtex.el ignores file variable bibtex-contline-indentation
has caused the debbugs.gnu.org bug report #44618,
regarding 26.3; bibtex.el ignores file variable bibtex-contline-indentation
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
44618: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=44618
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Francesco Potortì <pot <at> gnu.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.3; bibtex.el ignores file variable bibtex-contline-indentation
Date: Fri, 13 Nov 2020 13:45:58 +0100
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))


[Message part 3 (message/rfc822, inline)]
From: "Roland Winkler" <winkler <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: pot <at> gnu.org, Teemu Likonen <tlikonen <at> iki.fi>, 44647-done <at> debbugs.gnu.org,
 44618-done <at> debbugs.gnu.org
Subject: Re: bug#44618: 26.3; bibtex.el ignores file variable
 bibtex-contline-indentation
Date: Wed, 2 Dec 2020 12:38:19 -0600
On Tue Nov 17 2020 Lars Ingebrigtsen wrote:
> If I'm reading the patch correctly, it looks good to me -- it'll still
> allow people to set fill-prefix from bibtex-mode-hook, and it fixes the
> reported problem in these two bug reports.  (I haven't tested the patch,
> though, just read it.)

Installed as patch d9167d940ac9d0504cc38a044c7cba897c103eaf.
I am closing both bug#44618 and bug#44647.


This bug report was last modified 4 years and 174 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.