unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#67930: 29.1; emacs 29.1 follows symlinks when a grep result is selected
@ 2023-12-20 13:54 Jurgen De Backer via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-12-20 18:46 ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Jurgen De Backer via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-12-20 13:54 UTC (permalink / raw)
  To: 67930

[-- Attachment #1: Type: text/plain, Size: 28374 bytes --]


Since emacs 29.1 (possibly already in 28.x), symlinks are resolved
whenever a file is selected in a grep result in the *grep* buffer.
For our project, we preferred the old behaviour to remain in the symlink's
directory.
Also, when symlinks are resolved and a new grep is done, we may end up
grepping in another directory than we started from.

Attached is a patch o revert the behaviour, and to add a custom
variable compilation-follow-symlinks to disable/enable this behaviour.

It may be useful to allow the user to select either behaviour.


In GNU Emacs 29.1 (build 4, x86_64-pc-linux-gnu, GTK+ Version 3.22.30,
 cairo version 1.15.12) of 2023-12-17 built on dhdevd14
Windowing system distributor 'The X.Org Foundation', version 11.0.12004000
System Description: Red Hat Enterprise Linux Server 7.9 (Maipo)

Configured using:
 'configure
 --prefix=/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated
 --exec-prefix=/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/libexec/emacs-29.1
 --mandir=/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/man
 --with-x-toolkit=gtk3 --with-modules --with-xft
 'CFLAGS=-I/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/include
 ' LDFLAGS=-L/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/lib'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GNUTLS GPM GSETTINGS HARFBUZZ JPEG
LIBSELINUX LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG SECCOMP SOUND
SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XINPUT2 XPM GTK3
ZLIB

Important settings:
  value of $EMACSDATA: /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/etc
  value of $EMACSDOC: /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/etc
  value of $EMACSLOADPATH: /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp:/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/site-lisp:/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp
  value of $EMACSPATH: /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/libexec/emacs-29.1/libexec/emacs/29.1/x86_64-pc-linux-gnu:
  value of $LANG: C
  locale-coding-system: nil

Major mode: Lisp Interaction

Minor modes in effect:
  global-display-line-numbers-mode: t
  display-line-numbers-mode: t
  which-function-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-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
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/sh-script hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/progmodes/sh-script
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ob-eshell hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ob-eshell
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ox-texinfo hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ox-texinfo
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ox-publish hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ox-publish
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ox-latex hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ox-latex
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ox-icalendar hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ox-icalendar
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ox-ascii hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ox-ascii
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/org-timer hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/org-timer
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/org-tempo hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/org-tempo
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/org-table hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/org-table
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/org-protocol hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/org-protocol
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/org-plot hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/org-plot
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/org-pcomplete hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/org-pcomplete
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/org-mouse hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/org-mouse
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/org-mobile hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/org-mobile
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/org-macs hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/org-macs
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/org-macro hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/org-macro
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/org-list hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/org-list
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/org-lint hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/org-lint
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/org-keys hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/org-keys
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/org-inlinetask hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/org-inlinetask
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/org-indent hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/org-indent
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/org-habit hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/org-habit
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/org-goto hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/org-goto
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/org-footnote hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/org-footnote
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/org-feed hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/org-feed
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/org-faces hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/org-faces
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/org-entities hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/org-entities
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/org-element hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/org-element
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/org-duration hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/org-duration
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/org-datetree hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/org-datetree
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/org-crypt hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/org-crypt
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/org-compat hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/org-compat
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/org-colview hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/org-colview
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/org-clock hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/org-clock
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/org-capture hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/org-capture
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/org-attach hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/org-attach
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/org-attach-git hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/org-attach-git
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/org-archive hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/org-archive
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/org-agenda hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/org-agenda
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ol hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ol
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ol-w3m hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ol-w3m
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ol-rmail hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ol-rmail
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ol-mhe hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ol-mhe
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ol-eshell hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ol-eshell
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ol-docview hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ol-docview
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ob-tangle hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ob-tangle
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ob-table hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ob-table
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ob-shell hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ob-shell
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ob-screen hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ob-screen
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ob-scheme hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ob-scheme
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ob-python hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ob-python
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ob-processing hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ob-processing
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ob-plantuml hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ob-plantuml
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ob-octave hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ob-octave
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ob-ocaml hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ob-ocaml
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ob-maxima hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ob-maxima
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ob-matlab hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ob-matlab
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ob-makefile hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ob-makefile
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ob-lilypond hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ob-lilypond
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ob-latex hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ob-latex
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ob-haskell hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ob-haskell
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ob-groovy hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ob-groovy
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ob-gnuplot hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ob-gnuplot
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ob-fortran hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ob-fortran
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ob-forth hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ob-forth
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ob-emacs-lisp hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ob-emacs-lisp
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ob-dot hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ob-dot
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ob-ditaa hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ob-ditaa
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ob-comint hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ob-comint
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ob-clojure hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ob-clojure
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ob-calc hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ob-calc
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ob-awk hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ob-awk
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ob-R hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ob-R
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ob-eval hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ob-eval
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ox hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ox
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ox-org hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ox-org
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ox-odt hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ox-odt
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ox-md hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ox-md
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ox-man hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ox-man
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ox-html hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ox-html
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ox-beamer hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ox-beamer
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/org-version hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/org-version
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/org-src hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/org-src
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/org-num hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/org-num
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/org-loaddefs hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/org-loaddefs
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/org-id hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/org-id
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/org hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/org
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/org-ctags hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/org-ctags
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ol-irc hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ol-irc
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ol-info hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ol-info
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ol-gnus hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ol-gnus
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ol-eww hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ol-eww
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ol-bibtex hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ol-bibtex
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ol-bbdb hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ol-bbdb
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ob hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ob
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ob-sqlite hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ob-sqlite
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ob-sql hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ob-sql
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ob-sed hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ob-sed
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ob-sass hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ob-sass
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ob-ruby hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ob-ruby
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ob-ref hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ob-ref
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ob-perl hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ob-perl
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ob-lisp hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ob-lisp
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ob-org hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ob-org
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ob-lua hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ob-lua
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ob-lob hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ob-lob
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ob-js hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ob-js
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ob-java hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ob-java
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ob-exp hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ob-exp
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ob-css hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ob-css
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ob-core hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ob-core
/cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/27.2/site-lisp/org-9.3.1/ob-C hides /cm/ot/TOOL/GNU!28.0.0.44/build_G!30.IP.L7/generated/share/emacs/29.1/lisp/org/ob-C

Features:
(shadow sort mail-extr cl-extra help-mode warnings emacsbug message
yank-media puny rfc822 mml mml-sec epa derived epg rfc6068 epg-config
gnus-util mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util
mail-prsvr mail-utils add-log display-line-numbers gpc dired
dired-loaddefs mule-util etags fileloop generator which-func ido
ada-mode align ada-skel wisi-skel skeleton ada-process
wisi-process-parse ada-indent-user-options ada-imenu imenu ada-core
wisi-prj wisi xref wisi-fringe wisi-parse-common semantic/lex
semantic/fw mode-local uniquify-files project find-file compile
easy-mmode files-x pcase text-property-search
highlight-beyond-fill-column cperl-mode rx facemenu jka-compr which-key
vlf-setup vlf vlf-base vlf-tune org ob ob-tangle ob-ref ob-lob ob-table
ob-exp org-macro org-footnote org-src ob-comint org-pcomplete pcomplete
org-list org-faces org-entities time-date noutline outline icons
org-version ob-emacs-lisp ob-core ob-eval org-table ol org-keys
org-compat advice org-macs org-loaddefs format-spec find-func cal-menu
calendar cal-loaddefs memory-usage ffap thingatpt comint ansi-osc
ansi-color ring finder-inf solarized-theme-autoloads package browse-url
url url-proxy url-privacy url-expand url-methods url-history url-cookie
generate-lisp-file url-domsuf url-util mailcap url-handlers url-parse
auth-source cl-seq eieio eieio-core cl-macs password-cache json subr-x
map byte-opt gv bytecomp byte-compile url-vars cl-loaddefs cl-lib rmc
iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook
vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode lisp-mode prog-mode register
page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame minibuffer nadvice seq simple cl-generic indonesian philippine
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 composite emoji-zwj charscript
charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure
cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp
files window text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget keymap hashtable-print-readable backquote
threads dbusbind inotify dynamic-setting system-font-setting
font-render-setting cairo move-toolbar gtk x-toolkit xinput2 x multi-tty
make-network-process emacs)

Memory information:
((conses 16 164552 9039)
 (symbols 48 17860 0)
 (strings 32 56258 2270)
 (string-bytes 1 1879266)
 (vectors 16 32599)
 (vector-slots 8 625425 79206)
 (floats 8 123 72)
 (intervals 56 320 0)
 (buffers 976 11)
 (heap 1024 29327 1694))
____

This message and any files transmitted with it are legally privileged and intended for the sole use of the individual(s) or entity to whom they are addressed. If you are not the intended recipient, please notify the sender by reply and delete the message and any attachments from your system. Any unauthorised use or disclosure of the content of this message is strictly prohibited and may be unlawful.

Nothing in this e-mail message amounts to a contractual or legal commitment on the part of EUROCONTROL, unless it is confirmed by appropriately signed hard copy.

Any views expressed in this message are those of the sender.

[-- Attachment #2: emacs-29.1.patches.07_follow_symlinks --]
[-- Type: application/octet-stream, Size: 3397 bytes --]

# Since emacs 29.1, when clicking on a file link in the *grep* results buffer,
# symlinks are resolved to the actual filename(s).
# When following symlinks, the behaviour may be unexpected, for example:
#  - A directory contains symlinks to files in various other directories.
#  - You launch a grep which returns some results.
#  - Then you select a file in the *grep* results buffer. (You may e.g. “fix/change” something in this grep hit.)
#    Because symlinks are resolved, the actual file is opened in a buffer
#      and the directory of this file becomes current.
#  - You relaunch the same grep from this buffer just opened.
#  - You are now grepping in another directory than the directory you started from
#      which usually produces different results.
#
# This patch disables the symlink resolution by default and adds a custom variable
# compilation-follow-symlinks to disable/enable this behaviour.

--- lisp/progmodes/compile.el.orig	2023-02-11 12:06:09.000000000 +0000
+++ lisp/progmodes/compile.el	2023-12-19 17:07:23.002617000 +0000
@@ -844,6 +844,13 @@
   :type 'boolean
   :version "28.1")
 
+(defcustom compilation-follow-symlinks nil
+  "if Non-nil, follow symlinks whenever a file is selected or clicked
+in a *compilation* or *grep* buffer. If nil, only expand directories and
+don't follow symlinks."
+  :type 'boolean
+  :version "29.1")
+
 ;;;###autoload
 (defcustom compilation-ask-about-save t
   "Non-nil means \\[compile] asks which buffers to save before compiling.
@@ -3122,8 +3129,9 @@
             fmts formats)
       ;; For each directory, try each format string.
       (while (and fmts (null buffer))
-        (setq name (file-truename
-                    (file-name-concat thisdir (format (car fmts) filename)))
+        (setq name (if compilation-follow-symlinks
+                       (file-truename (file-name-concat thisdir (format (car fmts) filename)))
+                     (expand-file-name (format (car fmts) filename) thisdir))
               buffer (and (file-exists-p name)
                           (find-file-noselect name))
               fmts (cdr fmts)))
@@ -3145,8 +3153,9 @@
         (setq thisdir (car dirs)
               fmts formats)
         (while (and fmts (null buffer))
-          (setq name (file-truename
-                      (file-name-concat thisdir (format (car fmts) filename)))
+          (setq name (if compilation-follow-symlinks
+                         (file-truename (file-name-concat thisdir (format (car fmts) filename)))
+                       (expand-file-name (format (car fmts) filename) thisdir))
                 buffer (and (file-exists-p name)
                             (find-file-noselect name))
                 fmts (cdr fmts)))
@@ -3206,8 +3215,10 @@
               (ding) (sit-for 2))
              ((and (file-directory-p name)
                    (not (file-exists-p
-                         (setq name (file-truename
-                                     (file-name-concat name filename))))))
+                         (setq name (if compilation-follow-symlinks
+                                        (file-truename (file-name-concat name filename))
+                                      (expand-file-name filename name))
+                               ))))
               (message "No `%s' in directory %s" filename origname)
               (ding) (sit-for 2))
              (t

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

* bug#67930: 29.1; emacs 29.1 follows symlinks when a grep result is selected
  2023-12-20 13:54 bug#67930: 29.1; emacs 29.1 follows symlinks when a grep result is selected Jurgen De Backer via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-12-20 18:46 ` Eli Zaretskii
  2023-12-22 16:20   ` DE BACKER Jurgen (EXT) via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2023-12-20 18:46 UTC (permalink / raw)
  To: Jurgen De Backer; +Cc: 67930

> Date: Wed, 20 Dec 2023 13:54:19 +0000
> From:  Jurgen De Backer via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
> Since emacs 29.1 (possibly already in 28.x), symlinks are resolved
> whenever a file is selected in a grep result in the *grep* buffer.
> For our project, we preferred the old behaviour to remain in the symlink's
> directory.
> Also, when symlinks are resolved and a new grep is done, we may end up
> grepping in another directory than we started from.
> 
> Attached is a patch o revert the behaviour, and to add a custom
> variable compilation-follow-symlinks to disable/enable this behaviour.
> 
> It may be useful to allow the user to select either behaviour.

Thanks, but I don't think this is a matter of user preferences.  We
replaced expand-file-name there by file-truename because in some cases
the former doesn't work: it expands to a file that doesn't exist.  See
bug#8035, where such cases are presented.  We cannot ask the user to
set or reset this option each time they need to work with these or
those file names.

So I don't think the fix you propose is the right one.  I think we
need to use expand-file-name where it works, and file-truename where
expand-file-name doesn't work.  Or maybe just try expand-file-name
first, and if that produces a file name that fails file-exists-p, try
file-truename.

Would you like to propose and test a patch along these lines?





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

* bug#67930: 29.1; emacs 29.1 follows symlinks when a grep result is selected
  2023-12-20 18:46 ` Eli Zaretskii
@ 2023-12-22 16:20   ` DE BACKER Jurgen (EXT) via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-12-23 11:10     ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: DE BACKER Jurgen (EXT) via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-12-22 16:20 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 67930@debbugs.gnu.org

[-- Attachment #1: Type: text/plain, Size: 2645 bytes --]

> -----Original Message-----
> From: Eli Zaretskii <eliz@gnu.org>
> Sent: Wednesday, December 20, 2023 7:47 PM
> To: DE BACKER Jurgen (EXT) <jurgen.de-backer.ext@eurocontrol.int>
> Cc: 67930@debbugs.gnu.org
> Subject: Re: bug#67930: 29.1; emacs 29.1 follows symlinks when a grep result
> is selected
>
> > Date: Wed, 20 Dec 2023 13:54:19 +0000
> > From:  Jurgen De Backer via "Bug reports for GNU Emacs,  the Swiss
> > army knife of text editors" <bug-gnu-emacs@gnu.org>
> >
> > Since emacs 29.1 (possibly already in 28.x), symlinks are resolved
> > whenever a file is selected in a grep result in the *grep* buffer.
> > For our project, we preferred the old behaviour to remain in the
> > symlink's directory.
> > Also, when symlinks are resolved and a new grep is done, we may end up
> > grepping in another directory than we started from.
> >
> > Attached is a patch o revert the behaviour, and to add a custom
> > variable compilation-follow-symlinks to disable/enable this behaviour.
> >
> > It may be useful to allow the user to select either behaviour.
>
> Thanks, but I don't think this is a matter of user preferences.  We replaced
> expand-file-name there by file-truename because in some cases the former
> doesn't work: it expands to a file that doesn't exist.  See bug#8035, where
> such cases are presented.  We cannot ask the user to set or reset this option
> each time they need to work with these or those file names.
>
> So I don't think the fix you propose is the right one.  I think we need to use
> expand-file-name where it works, and file-truename where expand-file-
> name doesn't work.  Or maybe just try expand-file-name first, and if that
> produces a file name that fails file-exists-p, try file-truename.
>
> Would you like to propose and test a patch along these lines?

Hi Eli,

Please find attached a patch that does this: first we  try to expand the file name with expand-file-name
and if this fails, retry with file-truename.

____

This message and any files transmitted with it are legally privileged and intended for the sole use of the individual(s) or entity to whom they are addressed. If you are not the intended recipient, please notify the sender by reply and delete the message and any attachments from your system. Any unauthorised use or disclosure of the content of this message is strictly prohibited and may be unlawful.

Nothing in this e-mail message amounts to a contractual or legal commitment on the part of EUROCONTROL, unless it is confirmed by appropriately signed hard copy.

Any views expressed in this message are those of the sender.

[-- Attachment #2: emacs-29.1_expand_file_names.patch --]
[-- Type: application/octet-stream, Size: 3630 bytes --]

# In emacs 29.1, when clicking on a file link in the *grep* results buffer,
# symlinks are resolved to the actual filename(s). In some cases this is not preferable.
#
# This patch -1 will first use the previous behaviour (using expand-file-name) to resolve a (relative) filename
#            -2 if this fails (i.e. the result is not an existing file), we try with the new behaviour 
#                which uses function file-truename.
#
# In emacs 29.1 expand-file-name was replaced by file-truename to solve bug #8035, 
#   because in specific cases expand-file-name returned a wrong/non existing file.
# Unlike expand-file-name, file-truename follows symlinks.

--- lisp/progmodes/compile.el.orig	2023-02-11 12:06:09.000000000 +0000
+++ lisp/progmodes/compile.el	2023-12-21 17:22:34.000688000 +0000
@@ -3108,7 +3108,7 @@
         (spec-dir (if directory
                       (expand-file-name directory)
                     default-directory))
-        buffer thisdir fmts name)
+        buffer thisdir fmts expandedname name)
     (if (and filename
              (file-name-absolute-p filename))
         ;; The file name is absolute.  Use its explicit directory as
@@ -3122,8 +3122,10 @@
             fmts formats)
       ;; For each directory, try each format string.
       (while (and fmts (null buffer))
-        (setq name (file-truename
-                    (file-name-concat thisdir (format (car fmts) filename)))
+        (setq expandedname (expand-file-name (format (car fmts) filename) thisdir)
+              name (if (file-exists-p expandedname) ;; See bug #8035 expand-file-name fails in specific cases
+                       expandedname
+                     (file-truename (file-name-concat thisdir (format (car fmts) filename))))
               buffer (and (file-exists-p name)
                           (find-file-noselect name))
               fmts (cdr fmts)))
@@ -3145,8 +3147,10 @@
         (setq thisdir (car dirs)
               fmts formats)
         (while (and fmts (null buffer))
-          (setq name (file-truename
-                      (file-name-concat thisdir (format (car fmts) filename)))
+          (setq expandedname (expand-file-name (format (car fmts) filename) thisdir)
+                name (if (file-exists-p expandedname)
+                         expandedname
+                       (file-truename (file-name-concat thisdir (format (car fmts) filename))))
                 buffer (and (file-exists-p name)
                             (find-file-noselect name))
                 fmts (cdr fmts)))
@@ -3199,15 +3203,18 @@
                         ;;       (setq name (expand-file-name filename name)))
                         ;;   (file-exists-p name))
                         ))
-                 (origname name))
+                 (origname name) expandedname)
             (cond
              ((not (file-exists-p name))
               (message "Cannot find file `%s'" name)
               (ding) (sit-for 2))
              ((and (file-directory-p name)
                    (not (file-exists-p
-                         (setq name (file-truename
-                                     (file-name-concat name filename))))))
+                         (setq expandedname (expand-file-name filename name)
+                               name (if (file-exists-p expandedname)
+                                        expandedname
+                                      (file-truename (file-name-concat name filename)))
+                               ))))
               (message "No `%s' in directory %s" filename origname)
               (ding) (sit-for 2))
              (t

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

* bug#67930: 29.1; emacs 29.1 follows symlinks when a grep result is selected
  2023-12-22 16:20   ` DE BACKER Jurgen (EXT) via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-12-23 11:10     ` Eli Zaretskii
  2024-01-04 11:10       ` DE BACKER Jurgen (EXT) via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2023-12-23 11:10 UTC (permalink / raw)
  To: DE BACKER Jurgen (EXT); +Cc: 67930

> From: "DE BACKER Jurgen (EXT)" <jurgen.de-backer.ext@eurocontrol.int>
> CC: "67930@debbugs.gnu.org" <67930@debbugs.gnu.org>
> Date: Fri, 22 Dec 2023 16:20:42 +0000
> 
> > From: Eli Zaretskii <eliz@gnu.org>
> > Sent: Wednesday, December 20, 2023 7:47 PM
> > To: DE BACKER Jurgen (EXT) <jurgen.de-backer.ext@eurocontrol.int>
> > Cc: 67930@debbugs.gnu.org
> > Subject: Re: bug#67930: 29.1; emacs 29.1 follows symlinks when a grep result
> > is selected
> >
> > Thanks, but I don't think this is a matter of user preferences.  We replaced
> > expand-file-name there by file-truename because in some cases the former
> > doesn't work: it expands to a file that doesn't exist.  See bug#8035, where
> > such cases are presented.  We cannot ask the user to set or reset this option
> > each time they need to work with these or those file names.
> >
> > So I don't think the fix you propose is the right one.  I think we need to use
> > expand-file-name where it works, and file-truename where expand-file-
> > name doesn't work.  Or maybe just try expand-file-name first, and if that
> > produces a file name that fails file-exists-p, try file-truename.
> >
> > Would you like to propose and test a patch along these lines?
> 
> Hi Eli,
> 
> Please find attached a patch that does this: first we  try to expand the file name with expand-file-name
> and if this fails, retry with file-truename.

Thanks.  I have a couple of minor comments:

> # In emacs 29.1, when clicking on a file link in the *grep* results buffer,
> # symlinks are resolved to the actual filename(s). In some cases this is not preferable.
> #
> # This patch -1 will first use the previous behaviour (using expand-file-name) to resolve a (relative) filename
> #            -2 if this fails (i.e. the result is not an existing file), we try with the new behaviour 
> #                which uses function file-truename.
> #
> # In emacs 29.1 expand-file-name was replaced by file-truename to solve bug #8035, 
> #   because in specific cases expand-file-name returned a wrong/non existing file.
> # Unlike expand-file-name, file-truename follows symlinks.

Could you please reformat this log message using our style?  The
details can be found in the file CONTRIBUTE in the Emacs Git
repository.

> --- lisp/progmodes/compile.el.orig	2023-02-11 12:06:09.000000000 +0000
> +++ lisp/progmodes/compile.el	2023-12-21 17:22:34.000688000 +0000
> @@ -3108,7 +3108,7 @@
>          (spec-dir (if directory
>                        (expand-file-name directory)
>                      default-directory))
> -        buffer thisdir fmts name)
> +        buffer thisdir fmts expandedname name)
>      (if (and filename
>               (file-name-absolute-p filename))
>          ;; The file name is absolute.  Use its explicit directory as
> @@ -3122,8 +3122,10 @@
>              fmts formats)
>        ;; For each directory, try each format string.
>        (while (and fmts (null buffer))
> -        (setq name (file-truename
> -                    (file-name-concat thisdir (format (car fmts) filename)))
> +        (setq expandedname (expand-file-name (format (car fmts) filename) thisdir)
> +              name (if (file-exists-p expandedname) ;; See bug #8035 expand-file-name fails in specific cases
> +                       expandedname
> +                     (file-truename (file-name-concat thisdir (format (car fmts) filename))))
>                buffer (and (file-exists-p name)
>                            (find-file-noselect name))
>                fmts (cdr fmts)))

Your changes repeat the same pattern several times, so I think it
would be better to factor out this code into a separate function, and
then call that function in those places.  Would you like to rewrite
the patch along these lines?

Thanks again for working on this.





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

* bug#67930: 29.1; emacs 29.1 follows symlinks when a grep result is selected
  2023-12-23 11:10     ` Eli Zaretskii
@ 2024-01-04 11:10       ` DE BACKER Jurgen (EXT) via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-01-06 10:35         ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: DE BACKER Jurgen (EXT) via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-01-04 11:10 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 67930@debbugs.gnu.org

[-- Attachment #1: Type: text/plain, Size: 5120 bytes --]

> -----Original Message-----
> From: Eli Zaretskii <eliz@gnu.org>
> Sent: Saturday, December 23, 2023 12:11 PM
> To: DE BACKER Jurgen (EXT) <jurgen.de-backer.ext@eurocontrol.int>
> Cc: 67930@debbugs.gnu.org
> Subject: Re: bug#67930: 29.1; emacs 29.1 follows symlinks when a grep result
> is selected
>
> > From: "DE BACKER Jurgen (EXT)" <jurgen.de-backer.ext@eurocontrol.int>
> > CC: "67930@debbugs.gnu.org" <67930@debbugs.gnu.org>
> > Date: Fri, 22 Dec 2023 16:20:42 +0000
> >
> > > From: Eli Zaretskii <eliz@gnu.org>
> > > Sent: Wednesday, December 20, 2023 7:47 PM
> > > To: DE BACKER Jurgen (EXT) <jurgen.de-backer.ext@eurocontrol.int>
> > > Cc: 67930@debbugs.gnu.org
> > > Subject: Re: bug#67930: 29.1; emacs 29.1 follows symlinks when a
> > > grep result is selected
> > >
> > > Thanks, but I don't think this is a matter of user preferences.  We
> > > replaced expand-file-name there by file-truename because in some
> > > cases the former doesn't work: it expands to a file that doesn't
> > > exist.  See bug#8035, where such cases are presented.  We cannot ask
> > > the user to set or reset this option each time they need to work with
> these or those file names.
> > >
> > > So I don't think the fix you propose is the right one.  I think we
> > > need to use expand-file-name where it works, and file-truename where
> > > expand-file- name doesn't work.  Or maybe just try expand-file-name
> > > first, and if that produces a file name that fails file-exists-p, try file-
> truename.
> > >
> > > Would you like to propose and test a patch along these lines?
> >
> > Hi Eli,
> >
> > Please find attached a patch that does this: first we  try to expand
> > the file name with expand-file-name and if this fails, retry with file-
> truename.
>
> Thanks.  I have a couple of minor comments:
>
> > # In emacs 29.1, when clicking on a file link in the *grep* results
> > buffer, # symlinks are resolved to the actual filename(s). In some cases this
> is not preferable.
> > #
> > # This patch -1 will first use the previous behaviour (using expand-file-
> name) to resolve a (relative) filename
> > #            -2 if this fails (i.e. the result is not an existing file), we try with the
> new behaviour
> > #                which uses function file-truename.
> > #
> > # In emacs 29.1 expand-file-name was replaced by file-truename to solve
> bug #8035,
> > #   because in specific cases expand-file-name returned a wrong/non
> existing file.
> > # Unlike expand-file-name, file-truename follows symlinks.
>
> Could you please reformat this log message using our style?  The details can
> be found in the file CONTRIBUTE in the Emacs Git repository.
>
> > --- lisp/progmodes/compile.el.orig  2023-02-11 12:06:09.000000000 +0000
> > +++ lisp/progmodes/compile.el       2023-12-21 17:22:34.000688000 +0000
> > @@ -3108,7 +3108,7 @@
> >          (spec-dir (if directory
> >                        (expand-file-name directory)
> >                      default-directory))
> > -        buffer thisdir fmts name)
> > +        buffer thisdir fmts expandedname name)
> >      (if (and filename
> >               (file-name-absolute-p filename))
> >          ;; The file name is absolute.  Use its explicit directory as
> > @@ -3122,8 +3122,10 @@
> >              fmts formats)
> >        ;; For each directory, try each format string.
> >        (while (and fmts (null buffer))
> > -        (setq name (file-truename
> > -                    (file-name-concat thisdir (format (car fmts) filename)))
> > +        (setq expandedname (expand-file-name (format (car fmts) filename)
> thisdir)
> > +              name (if (file-exists-p expandedname) ;; See bug #8035 expand-
> file-name fails in specific cases
> > +                       expandedname
> > +                     (file-truename (file-name-concat thisdir (format
> > + (car fmts) filename))))
> >                buffer (and (file-exists-p name)
> >                            (find-file-noselect name))
> >                fmts (cdr fmts)))
>
> Your changes repeat the same pattern several times, so I think it would be
> better to factor out this code into a separate function, and then call that
> function in those places.  Would you like to rewrite the patch along these
> lines?
>
> Thanks again for working on this.

Hi,

Please find attached an updated patch which addresses your remarks.

All the best,
Jurgen
____

This message and any files transmitted with it are legally privileged and intended for the sole use of the individual(s) or entity to whom they are addressed. If you are not the intended recipient, please notify the sender by reply and delete the message and any attachments from your system. Any unauthorised use or disclosure of the content of this message is strictly prohibited and may be unlawful.

Nothing in this e-mail message amounts to a contractual or legal commitment on the part of EUROCONTROL, unless it is confirmed by appropriately signed hard copy.

Any views expressed in this message are those of the sender.

[-- Attachment #2: emacs-29.1_expand_file_names.patch --]
[-- Type: application/octet-stream, Size: 3040 bytes --]

Avoid resolving symlinks when selecting files in the *grep* buffer

When clicking on a file link in the *grep* results buffer, symlinks are
resolved to the actual filename(s).  In some cases this is not preferable.
This patch will first use the previous behavior (using expand-file-name)
to resolve a filename and if this fails (the result is not an existing file),
we try with the new behavior which uses function file-truename.
(In emacs 29.1 expand-file-name was replaced by file-truename to solve bug #8035;
in specific cases expand-file-name returned a wrong/non existing file.
Unlike expand-file-name, file-truename follows symlinks.)
* lisp/progmodes/compile.el: first try expand-file-name and if it fails try file-truename

--- lisp/progmodes/compile.el.orig	2023-02-11 12:06:09.000000000 +0000
+++ lisp/progmodes/compile.el	2023-12-21 17:22:34.000688000 +0000
@@ -3101,7 +3101,16 @@
       (cancel-timer next-error-highlight-timer))
   (remove-hook 'pre-command-hook
 	       #'compilation-goto-locus-delete-o))
-\f
+
+(defun safe-expand-file-name (directory filename)
+  "Expand the specified filename using expand-file-name.  If this fails,
+retry with file-truename (see bug #8035)
+Unlike expand-file-name, file-truename follows symlinks which we try to avoid if possible."
+  (let* ((expandedname (expand-file-name filename directory)))
+    (if (file-exists-p expandedname)
+        expandedname
+      (file-truename (file-name-concat directory filename)))))
+
 (defun compilation-find-file-1 (marker filename directory &optional formats)
   (or formats (setq formats '("%s")))
   (let ((dirs compilation-search-path)
@@ -3122,8 +3131,7 @@
             fmts formats)
       ;; For each directory, try each format string.
       (while (and fmts (null buffer))
-        (setq name (file-truename
-                    (file-name-concat thisdir (format (car fmts) filename)))
+        (setq name (safe-expand-file-name thisdir (format (car fmts) filename))
               buffer (and (file-exists-p name)
                           (find-file-noselect name))
               fmts (cdr fmts)))
@@ -3145,8 +3153,7 @@
         (setq thisdir (car dirs)
               fmts formats)
         (while (and fmts (null buffer))
-          (setq name (file-truename
-                      (file-name-concat thisdir (format (car fmts) filename)))
+          (setq name (safe-expand-file-name thisdir (format (car fmts) filename))
                 buffer (and (file-exists-p name)
                             (find-file-noselect name))
                 fmts (cdr fmts)))
@@ -3206,8 +3213,7 @@
               (ding) (sit-for 2))
              ((and (file-directory-p name)
                    (not (file-exists-p
-                         (setq name (file-truename
-                                     (file-name-concat name filename))))))
+                         (setq name (safe-expand-file-name name filename)))))
               (message "No `%s' in directory %s" filename origname)
               (ding) (sit-for 2))
              (t

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

* bug#67930: 29.1; emacs 29.1 follows symlinks when a grep result is selected
  2024-01-04 11:10       ` DE BACKER Jurgen (EXT) via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-01-06 10:35         ` Eli Zaretskii
  0 siblings, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2024-01-06 10:35 UTC (permalink / raw)
  To: DE BACKER Jurgen (EXT); +Cc: 67930-done

> From: "DE BACKER Jurgen (EXT)" <jurgen.de-backer.ext@eurocontrol.int>
> CC: "67930@debbugs.gnu.org" <67930@debbugs.gnu.org>
> Date: Thu, 4 Jan 2024 11:10:56 +0000
> 
> Please find attached an updated patch which addresses your remarks.

Thanks, installed on the master branch, and closing the bug.





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

end of thread, other threads:[~2024-01-06 10:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-20 13:54 bug#67930: 29.1; emacs 29.1 follows symlinks when a grep result is selected Jurgen De Backer via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-20 18:46 ` Eli Zaretskii
2023-12-22 16:20   ` DE BACKER Jurgen (EXT) via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-23 11:10     ` Eli Zaretskii
2024-01-04 11:10       ` DE BACKER Jurgen (EXT) via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-06 10:35         ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).