Subject: bug#46122: 25.2; changes to .dir-locals.el are not picked up when .dir-locals.el is a symlink

From: Dan Connolly <[email-masked]>
Date: Tue, 26 Jan 2021 15:47:21 -0600

1. Create ~/projects/m/.dir-locals.el file to set tab-width to 4.
2. Visit ~/projects/m/xyz.c and verify that tabs use 4 spaces
3. mv ~/projects/m/.dir-locals.el to ~/.emacs.d/m-locals.el
4. ln -s ~/.emacs.d/m-locals.el ~/projects/m/.dir-locals.el
5. Change 4 6 in ~/.emacs.d/m-locals.el
6. in the xyz.c buffer, M-x revert-buffer

expected result:
7. tabs use 6 spaces

actual result:
7. no change; tabs still use 4 spaces

work-around:
(setq dir-locals-directory-cache nil) before step 6.

In GNU Emacs 25.2.2 (x86_64-pc-linux-gnu, GTK+ Version 3.22.21)
 of 2017-09-22, modified by Debian built on lgw01-amd64-050
Windowing system distributor 'The X.Org Foundation', version 11.0.11906000
System Description: Ubuntu 18.04.5 LTS

Configured using:
 'configure --build x86_64-linux-gnu --prefix=/usr
 --sharedstatedir=/var/lib --libexecdir=/usr/lib
 --localstatedir=/var/lib --infodir=/usr/share/info
 --mandir=/usr/share/man --with-pop=yes
 --enable-locallisppath=/etc/emacs25:/etc/emacs:/usr/local/share/emacs/25.2/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/25.2/site-lisp:/usr/share/emacs/site-lisp
 --with-sound=alsa --without-gconf --build x86_64-linux-gnu
 --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib
 --localstatedir=/var/lib --infodir=/usr/share/info
 --mandir=/usr/share/man --with-pop=yes
 --enable-locallisppath=/etc/emacs25:/etc/emacs:/usr/local/share/emacs/25.2/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/25.2/site-lisp:/usr/share/emacs/site-lisp
 --with-sound=alsa --without-gconf --with-x=yes --with-x-toolkit=gtk3
 --with-toolkit-scroll-bars 'CFLAGS=-g -O2
 -fdebug-prefix-map=/build/emacs25-jYekUr/emacs25-25.2+1=.
-fstack-protector-strong
 -Wformat -Werror=format-security -Wall' 'CPPFLAGS=-Wdate-time
 -D_FORTIFY_SOURCE=2' 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro''

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS NOTIFY
ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11

Important settings:
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Magit

Minor modes in effect:
  diff-auto-refine-mode: t
  magit-auto-revert-mode: t
  global-git-commit-mode: t
  async-bytecomp-package-mode: t
  shell-dirtrack-mode: t
  direnv-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
Mark set
Press C-c C-c when you are done editing.
Enter a change comment.  Type C-c C-c when done
Checking in /home/connolly/projects/emacs-dotfiles/moddable-c-style/.dir-locals.el...done
[C-t] show common commands, [?] describe events, [C-h i] show manual [2 times]
Running git push -v dckc master:refs/heads/master
Git finished
mwheel-scroll: Beginning of buffer
mwheel-scroll: End of buffer
mwheel-scroll: Beginning of buffer

Load-path shadows:
/usr/share/emacs/25.2/site-lisp/debian-startup hides
/usr/share/emacs/site-lisp/debian-startup
/usr/share/emacs25/site-lisp/cmake-data/cmake-mode hides
/usr/share/emacs/site-lisp/cmake-mode
/home/connolly/.emacs.d/elpa/org-9.4.4/org-datetree hides
/usr/share/emacs/25.2/lisp/org/org-datetree
/home/connolly/.emacs.d/elpa/org-9.4.4/ob-fortran hides
/usr/share/emacs/25.2/lisp/org/ob-fortran
/home/connolly/.emacs.d/elpa/org-9.4.4/ob-C hides
/usr/share/emacs/25.2/lisp/org/ob-C
/home/connolly/.emacs.d/elpa/org-9.4.4/org-capture hides
/usr/share/emacs/25.2/lisp/org/org-capture
/home/connolly/.emacs.d/elpa/org-9.4.4/ob-css hides
/usr/share/emacs/25.2/lisp/org/ob-css
/home/connolly/.emacs.d/elpa/org-9.4.4/ob-ruby hides
/usr/share/emacs/25.2/lisp/org/ob-ruby
/home/connolly/.emacs.d/elpa/org-9.4.4/ob-gnuplot hides
/usr/share/emacs/25.2/lisp/org/ob-gnuplot
/home/connolly/.emacs.d/elpa/org-9.4.4/org-inlinetask hides
/usr/share/emacs/25.2/lisp/org/org-inlinetask
/home/connolly/.emacs.d/elpa/org-9.4.4/org-clock hides
/usr/share/emacs/25.2/lisp/org/org-clock
/home/connolly/.emacs.d/elpa/org-9.4.4/ox-md hides
/usr/share/emacs/25.2/lisp/org/ox-md
/home/connolly/.emacs.d/elpa/org-9.4.4/org-table hides
/usr/share/emacs/25.2/lisp/org/org-table
/home/connolly/.emacs.d/elpa/org-9.4.4/org-loaddefs hides
/usr/share/emacs/25.2/lisp/org/org-loaddefs
/home/connolly/.emacs.d/elpa/org-9.4.4/org-mobile hides
/usr/share/emacs/25.2/lisp/org/org-mobile
/home/connolly/.emacs.d/elpa/org-9.4.4/org-crypt hides
/usr/share/emacs/25.2/lisp/org/org-crypt
/home/connolly/.emacs.d/elpa/org-9.4.4/org-element hides
/usr/share/emacs/25.2/lisp/org/org-element
/home/connolly/.emacs.d/elpa/org-9.4.4/ob-ref hides
/usr/share/emacs/25.2/lisp/org/ob-ref
/home/connolly/.emacs.d/elpa/org-9.4.4/org-list hides
/usr/share/emacs/25.2/lisp/org/org-list
/home/connolly/.emacs.d/elpa/org-9.4.4/ob-latex hides
/usr/share/emacs/25.2/lisp/org/ob-latex
/home/connolly/.emacs.d/elpa/org-9.4.4/ox-ascii hides
/usr/share/emacs/25.2/lisp/org/ox-ascii
/home/connolly/.emacs.d/elpa/org-9.4.4/org-faces hides
/usr/share/emacs/25.2/lisp/org/org-faces
/home/connolly/.emacs.d/elpa/org-9.4.4/ob-table hides
/usr/share/emacs/25.2/lisp/org/ob-table
/home/connolly/.emacs.d/elpa/org-9.4.4/org-macs hides
/usr/share/emacs/25.2/lisp/org/org-macs
/home/connolly/.emacs.d/elpa/org-9.4.4/org-feed hides
/usr/share/emacs/25.2/lisp/org/org-feed
/home/connolly/.emacs.d/elpa/org-9.4.4/ob-org hides
/usr/share/emacs/25.2/lisp/org/ob-org
/home/connolly/.emacs.d/elpa/org-9.4.4/ob-octave hides
/usr/share/emacs/25.2/lisp/org/ob-octave
/home/connolly/.emacs.d/elpa/org-9.4.4/ob-eval hides
/usr/share/emacs/25.2/lisp/org/ob-eval
/home/connolly/.emacs.d/elpa/org-9.4.4/ob-maxima hides
/usr/share/emacs/25.2/lisp/org/ob-maxima
/home/connolly/.emacs.d/elpa/org-9.4.4/ob-python hides
/usr/share/emacs/25.2/lisp/org/ob-python
/home/connolly/.emacs.d/elpa/org-9.4.4/ob-mscgen hides
/usr/share/emacs/25.2/lisp/org/ob-mscgen
/home/connolly/.emacs.d/elpa/org-9.4.4/org-habit hides
/usr/share/emacs/25.2/lisp/org/org-habit
/home/connolly/.emacs.d/elpa/org-9.4.4/org-protocol hides
/usr/share/emacs/25.2/lisp/org/org-protocol
/home/connolly/.emacs.d/elpa/org-9.4.4/ob-asymptote hides
/usr/share/emacs/25.2/lisp/org/ob-asymptote
/home/connolly/.emacs.d/elpa/org-9.4.4/ob-js hides
/usr/share/emacs/25.2/lisp/org/ob-js
/home/connolly/.emacs.d/elpa/org-9.4.4/ob-comint hides
/usr/share/emacs/25.2/lisp/org/ob-comint
/home/connolly/.emacs.d/elpa/org-9.4.4/ob-ledger hides
/usr/share/emacs/25.2/lisp/org/ob-ledger
/home/connolly/.emacs.d/elpa/org-9.4.4/ob-matlab hides
/usr/share/emacs/25.2/lisp/org/ob-matlab
/home/connolly/.emacs.d/elpa/org-9.4.4/org-agenda hides
/usr/share/emacs/25.2/lisp/org/org-agenda
/home/connolly/.emacs.d/elpa/org-9.4.4/org-attach hides
/usr/share/emacs/25.2/lisp/org/org-attach
/home/connolly/.emacs.d/elpa/org-9.4.4/ob-shen hides
/usr/share/emacs/25.2/lisp/org/ob-shen
/home/connolly/.emacs.d/elpa/org-9.4.4/ob-makefile hides
/usr/share/emacs/25.2/lisp/org/ob-makefile
/home/connolly/.emacs.d/elpa/org-9.4.4/ox hides
/usr/share/emacs/25.2/lisp/org/ox
/home/connolly/.emacs.d/elpa/org-9.4.4/ob-plantuml hides
/usr/share/emacs/25.2/lisp/org/ob-plantuml
/home/connolly/.emacs.d/elpa/org-9.4.4/ox-beamer hides
/usr/share/emacs/25.2/lisp/org/ox-beamer
/home/connolly/.emacs.d/elpa/org-9.4.4/ob-calc hides
/usr/share/emacs/25.2/lisp/org/ob-calc
/home/connolly/.emacs.d/elpa/org-9.4.4/ob-sql hides
/usr/share/emacs/25.2/lisp/org/ob-sql
/home/connolly/.emacs.d/elpa/org-9.4.4/ob-dot hides
/usr/share/emacs/25.2/lisp/org/ob-dot
/home/connolly/.emacs.d/elpa/org-9.4.4/org-colview hides
/usr/share/emacs/25.2/lisp/org/org-colview
/home/connolly/.emacs.d/elpa/org-9.4.4/org-plot hides
/usr/share/emacs/25.2/lisp/org/org-plot
/home/connolly/.emacs.d/elpa/org-9.4.4/ob-tangle hides
/usr/share/emacs/25.2/lisp/org/ob-tangle
/home/connolly/.emacs.d/elpa/org-9.4.4/ob-ocaml hides
/usr/share/emacs/25.2/lisp/org/ob-ocaml
/home/connolly/.emacs.d/elpa/org-9.4.4/ox-odt hides
/usr/share/emacs/25.2/lisp/org/ox-odt
/home/connolly/.emacs.d/elpa/org-9.4.4/ob-R hides
/usr/share/emacs/25.2/lisp/org/ob-R
/home/connolly/.emacs.d/elpa/org-9.4.4/ob-screen hides
/usr/share/emacs/25.2/lisp/org/ob-screen
/home/connolly/.emacs.d/elpa/org-9.4.4/ob-clojure hides
/usr/share/emacs/25.2/lisp/org/ob-clojure
/home/connolly/.emacs.d/elpa/org-9.4.4/ob-exp hides
/usr/share/emacs/25.2/lisp/org/ob-exp
/home/connolly/.emacs.d/elpa/org-9.4.4/ob-lisp hides
/usr/share/emacs/25.2/lisp/org/ob-lisp
/home/connolly/.emacs.d/elpa/org-9.4.4/ob-scheme hides
/usr/share/emacs/25.2/lisp/org/ob-scheme
/home/connolly/.emacs.d/elpa/org-9.4.4/ob-picolisp hides
/usr/share/emacs/25.2/lisp/org/ob-picolisp
/home/connolly/.emacs.d/elpa/org-9.4.4/org-ctags hides
/usr/share/emacs/25.2/lisp/org/org-ctags
/home/connolly/.emacs.d/elpa/org-9.4.4/org-timer hides
/usr/share/emacs/25.2/lisp/org/org-timer
/home/connolly/.emacs.d/elpa/org-9.4.4/org-macro hides
/usr/share/emacs/25.2/lisp/org/org-macro
/home/connolly/.emacs.d/elpa/org-9.4.4/ob-ditaa hides
/usr/share/emacs/25.2/lisp/org/ob-ditaa
/home/connolly/.emacs.d/elpa/org-9.4.4/ob-awk hides
/usr/share/emacs/25.2/lisp/org/ob-awk
/home/connolly/.emacs.d/elpa/org-9.4.4/ob-lilypond hides
/usr/share/emacs/25.2/lisp/org/ob-lilypond
/home/connolly/.emacs.d/elpa/org-9.4.4/org-entities hides
/usr/share/emacs/25.2/lisp/org/org-entities
/home/connolly/.emacs.d/elpa/org-9.4.4/ob-sass hides
/usr/share/emacs/25.2/lisp/org/ob-sass
/home/connolly/.emacs.d/elpa/org-9.4.4/ob-emacs-lisp hides
/usr/share/emacs/25.2/lisp/org/ob-emacs-lisp
/home/connolly/.emacs.d/elpa/org-9.4.4/org-archive hides
/usr/share/emacs/25.2/lisp/org/org-archive
/home/connolly/.emacs.d/elpa/org-9.4.4/ob-perl hides
/usr/share/emacs/25.2/lisp/org/ob-perl
/home/connolly/.emacs.d/elpa/org-9.4.4/org-src hides
/usr/share/emacs/25.2/lisp/org/org-src
/home/connolly/.emacs.d/elpa/org-9.4.4/ox-org hides
/usr/share/emacs/25.2/lisp/org/ox-org
/home/connolly/.emacs.d/elpa/org-9.4.4/ox-man hides
/usr/share/emacs/25.2/lisp/org/ox-man
/home/connolly/.emacs.d/elpa/org-9.4.4/ox-latex hides
/usr/share/emacs/25.2/lisp/org/ox-latex
/home/connolly/.emacs.d/elpa/org-9.4.4/ob-io hides
/usr/share/emacs/25.2/lisp/org/ob-io
/home/connolly/.emacs.d/elpa/org-9.4.4/ob-java hides
/usr/share/emacs/25.2/lisp/org/ob-java
/home/connolly/.emacs.d/elpa/org-9.4.4/ox-icalendar hides
/usr/share/emacs/25.2/lisp/org/ox-icalendar
/home/connolly/.emacs.d/elpa/org-9.4.4/ox-texinfo hides
/usr/share/emacs/25.2/lisp/org/ox-texinfo
/home/connolly/.emacs.d/elpa/org-9.4.4/org-indent hides
/usr/share/emacs/25.2/lisp/org/org-indent
/home/connolly/.emacs.d/elpa/org-9.4.4/org-compat hides
/usr/share/emacs/25.2/lisp/org/org-compat
/home/connolly/.emacs.d/elpa/org-9.4.4/org-id hides
/usr/share/emacs/25.2/lisp/org/org-id
/home/connolly/.emacs.d/elpa/org-9.4.4/org-pcomplete hides
/usr/share/emacs/25.2/lisp/org/org-pcomplete
/home/connolly/.emacs.d/elpa/org-9.4.4/org-mouse hides
/usr/share/emacs/25.2/lisp/org/org-mouse
/home/connolly/.emacs.d/elpa/org-9.4.4/ob-lob hides
/usr/share/emacs/25.2/lisp/org/ob-lob
/home/connolly/.emacs.d/elpa/org-9.4.4/ob hides
/usr/share/emacs/25.2/lisp/org/ob
/home/connolly/.emacs.d/elpa/org-9.4.4/ob-core hides
/usr/share/emacs/25.2/lisp/org/ob-core
/home/connolly/.emacs.d/elpa/org-9.4.4/ob-haskell hides
/usr/share/emacs/25.2/lisp/org/ob-haskell
/home/connolly/.emacs.d/elpa/org-9.4.4/ob-sqlite hides
/usr/share/emacs/25.2/lisp/org/ob-sqlite
/home/connolly/.emacs.d/elpa/org-9.4.4/ox-publish hides
/usr/share/emacs/25.2/lisp/org/ox-publish
/home/connolly/.emacs.d/elpa/org-9.4.4/org-footnote hides
/usr/share/emacs/25.2/lisp/org/org-footnote
/home/connolly/.emacs.d/elpa/org-9.4.4/org-version hides
/usr/share/emacs/25.2/lisp/org/org-version
/home/connolly/.emacs.d/elpa/org-9.4.4/org hides
/usr/share/emacs/25.2/lisp/org/org
/home/connolly/.emacs.d/elpa/org-9.4.4/ox-html hides
/usr/share/emacs/25.2/lisp/org/ox-html
/home/connolly/.emacs.d/elpa/seq-2.20/seq hides
/usr/share/emacs/25.2/lisp/emacs-lisp/seq
/home/connolly/.emacs.d/elpa/let-alist-1.0.5/let-alist hides
/usr/share/emacs/25.2/lisp/emacs-lisp/let-alist

Features:
(shadow sort mail-extr emacsbug sendmail vc-bzr vc-src vc-sccs vc-svn
vc-cvs vc-rcs vc vc-dispatcher pp files-x pcmpl-unix jka-compr pulse
misearch multi-isearch vc-git magit-obsolete magit-blame magit-stash
magit-bisect magit-remote magit-commit magit-sequence magit-notes
magit-worktree magit-tag magit-merge magit-branch magit-reset
magit-collab ghub url-auth url url-proxy url-privacy url-expand
url-methods url-history url-cookie url-domsuf url-util url-parse
url-vars mailcap let-alist auth-source magit-files magit-refs
magit-status magit magit-repos magit-apply magit-wip magit-log
magit-diff smerge-mode diff-mode magit-core magit-autorevert autorevert
filenotify magit-process magit-margin magit-mode git-commit magit-git
magit-section eieio-compat magit-utils crm magit-popup log-edit
easy-mmode message format-spec rfc822 mml mml-sec password-cache epg
gnus-util mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047
rfc2045 ietf-drums mm-util help-fns mail-prsvr mailabbrev mail-utils
gmm-utils mailheader pcvs-util add-log with-editor async-bytecomp async
server shell pcomplete comint ansi-color dired js-dev-flow
add-node-modules-path flycheck-flow cus-edit cus-start cus-load wid-edit
flycheck find-func js2-mode etags xref project eieio eieio-core ring js
advice sgml-mode thingatpt cc-mode cc-fonts cc-guess cc-menus cc-cmds
cc-styles cc-align cc-engine cc-vars cc-defs imenu direnv subr-x json
map dash cl-macs cl-seq use-package-core tabs-are-evil finder-inf rx
info melpa-init package epg-config seq byte-opt gv bytecomp byte-compile
cl-extra help-mode easymenu cconv cl-loaddefs pcase cl-lib time-date
mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel x-win term/common-win x-dnd tool-bar dnd fontset
image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow timer select scroll-bar
mouse jit-lock font-lock syntax facemenu font-core frame cl-generic cham
georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese charscript case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice
loaddefs button faces cus-face macroexp files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote dbusbind inotify dynamic-setting
system-font-setting font-render-setting move-toolbar gtk x-toolkit x
multi-tty make-network-process emacs)

Memory information:
((conses 16 361838 43948)
 (symbols 48 39612 1)
 (miscs 40 1701 1142)
 (strings 32 103022 8981)
 (string-bytes 1 3057294)
 (vectors 16 40480)
 (vector-slots 8 748989 24461)
 (floats 8 399 617)
 (intervals 56 2319 424)
 (buffers 976 39))