all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#44618: 26.3; bibtex.el ignores file variable bibtex-contline-indentation
@ 2020-11-13 12:45 Francesco Potortì
  2020-11-14 16:20 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 6+ messages in thread
From: Francesco Potortì @ 2020-11-13 12:45 UTC (permalink / raw)
  To: 44618

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))





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-12-03 19:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-13 12:45 bug#44618: 26.3; bibtex.el ignores file variable bibtex-contline-indentation Francesco Potortì
2020-11-14 16:20 ` Lars Ingebrigtsen
2020-11-16 23:31   ` Roland Winkler
2020-11-16 23:36     ` Lars Ingebrigtsen
2020-12-02 18:38       ` Roland Winkler
2020-12-03 19:39     ` Francesco Potortì

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.