Subject: bug#29423: 27.0.50; ls-lisp does not handle -F switch properly

From: Michael Albinus <[email-masked]>
Date: Fri, 24 Nov 2017 13:45:45 +0100

Goto the *scratch* buffer, and perform

M-: (ls-lisp-insert-directory "/tmp/" '(?F) nil nil nil)

Move the cursor into the string /tmp/, and perform

M-x describe-char

There is no text property 'dired-filename, as it should.

The following patch seems to cure the problem. Run the same test, you
will see the text property 'dired-filename.

diff --git a/lisp/ls-lisp.el b/lisp/ls-lisp.el
index caddc7f760..6765cc8dc9 100644
--- a/lisp/ls-lisp.el
+++ b/lisp/ls-lisp.el
@@ -841,9 +841,7 @@ ls-lisp-format
 	    " "
 	    (ls-lisp-format-time file-attr time-index)
 	    " "
-	    (if (not (memq ?F switches)) ; ls-lisp-classify already did that
-		(propertize file-name 'dired-filename t)
-	      file-name)
+	    (propertize file-name 'dired-filename t)
 	    (if (stringp file-type)	; is a symbolic link
 		(concat " -> " file-type))
 	    "\n"

This is a minor problem only. But I've stumbled over it, working on new
Tramp tests. Any objection to install the patch?

In GNU Emacs 27.0.50 (build 14, x86_64-pc-linux-gnu, GTK+ Version 3.22.24)
 of 2017-11-23 built on detlef
Repository revision: 0092a856ff3900c3771408893fb7fd8d731de568
Windowing system distributor 'The X.Org Foundation', version 11.0.11905000
System Description:	Ubuntu 17.10

Recent messages:
Buffer B: Processing difference region 0 of 2
Processing difference regions ... done
Refining difference region 1 ...
Saving file /usr/local/src/emacs/lisp/ls-lisp.el...
Wrote /usr/local/src/emacs/lisp/ls-lisp.el
ls-lisp-format
Continue...
nil
Type C-x 1 to delete the help window, C-M-v to scroll help.
Mark set

Configured using:
 'configure --with-file-notification=inotify'

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 LCMS2

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

Major mode: Lisp Interaction

Minor modes in effect:
  diff-auto-refine-mode: t
  erc-notify-mode: t
  erc-notifications-mode: t
  erc-list-mode: t
  erc-menu-mode: t
  erc-autojoin-mode: t
  erc-ring-mode: t
  erc-networks-mode: t
  erc-pcomplete-mode: t
  erc-track-mode: t
  erc-match-mode: t
  erc-button-mode: t
  erc-fill-mode: t
  erc-stamp-mode: t
  erc-netsplit-mode: t
  erc-irccontrols-mode: t
  erc-noncommands-mode: t
  erc-move-to-prompt-mode: t
  erc-readonly-mode: t
  url-handler-mode: t
  display-time-mode: t
  shell-dirtrack-mode: t
  icomplete-mode: t
  show-paren-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-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
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
/home/albinus/src/elpa/packages/debbugs/debbugs-org hides /home/albinus/.emacs.d/elpa/debbugs-0.14/debbugs-org
/home/albinus/src/elpa/packages/debbugs/debbugs-gnu hides /home/albinus/.emacs.d/elpa/debbugs-0.14/debbugs-gnu
/home/albinus/src/elpa/packages/debbugs/debbugs hides /home/albinus/.emacs.d/elpa/debbugs-0.14/debbugs
/home/albinus/src/elpa/packages/debbugs/debbugs-autoloads hides /home/albinus/.emacs.d/elpa/debbugs-0.14/debbugs-autoloads
/home/albinus/src/elpa/packages/debbugs/debbugs-pkg hides /home/albinus/.emacs.d/elpa/debbugs-0.14/debbugs-pkg
/home/albinus/src/elpa/packages/debbugs/debbugs-browse hides /home/albinus/.emacs.d/elpa/debbugs-0.14/debbugs-browse
/home/albinus/.emacs.d/elpa/counsel-20171101.1121/counsel hides /home/albinus/.emacs.d/elpa/ivy-0.9.1/counsel
/home/albinus/.emacs.d/elpa/swiper-20171105.42/swiper hides /home/albinus/.emacs.d/elpa/ivy-0.9.1/swiper
/home/albinus/src/elpa/packages/tramp-theme/tramp-theme hides /home/albinus/.emacs.d/elpa/tramp-theme-0.2/tramp-theme
/home/albinus/src/elpa/packages/tramp-theme/tramp-theme-autoloads hides /home/albinus/.emacs.d/elpa/tramp-theme-0.2/tramp-theme-autoloads
/home/albinus/src/elpa/packages/tramp-theme/tramp-theme-pkg hides /home/albinus/.emacs.d/elpa/tramp-theme-0.2/tramp-theme-pkg
/home/albinus/.emacs.d/elpa/telepathy-20131209.458/telepathy hides ~/lisp/telepathy
~/src/tramp/lisp/tramp-smb hides /usr/local/src/emacs/lisp/net/tramp-smb
~/src/tramp/lisp/tramp-uu hides /usr/local/src/emacs/lisp/net/tramp-uu
~/src/tramp/lisp/tramp-adb hides /usr/local/src/emacs/lisp/net/tramp-adb
~/src/tramp/lisp/tramp-cmds hides /usr/local/src/emacs/lisp/net/tramp-cmds
~/src/tramp/lisp/tramp-cache hides /usr/local/src/emacs/lisp/net/tramp-cache
~/src/tramp/lisp/trampver hides /usr/local/src/emacs/lisp/net/trampver
~/src/tramp/lisp/tramp-ftp hides /usr/local/src/emacs/lisp/net/tramp-ftp
~/src/tramp/lisp/tramp-sh hides /usr/local/src/emacs/lisp/net/tramp-sh
~/src/tramp/lisp/tramp hides /usr/local/src/emacs/lisp/net/tramp
~/src/tramp/lisp/tramp-loaddefs hides /usr/local/src/emacs/lisp/net/tramp-loaddefs
~/lisp/dbus hides /usr/local/src/emacs/lisp/net/dbus
~/src/tramp/lisp/tramp-gvfs hides /usr/local/src/emacs/lisp/net/tramp-gvfs
~/src/tramp/lisp/tramp-compat hides /usr/local/src/emacs/lisp/net/tramp-compat

Features:
(shadow sort mail-extr warnings emacsbug message rmc puny rfc822 mml
mml-sec epa derived epg gnus-util rmail rmail-loaddefs 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 log-view pcvs-util ediff-vers ediff-merg ediff-wind ediff-diff
ediff-mult ediff-help ediff-init ediff-util ediff erc-replace
magit-utils crm cus-edit descr-text time-stamp misearch multi-isearch
tramp-adb tramp-cmds tramp-ftp cl-print edebug eieio-opt speedbar
sb-image ezimage dframe help-fns radix-tree ls-lisp files-x cl-extra
help-mode tramp-archive-tests tramp-archive tramp-gvfs zeroconf url-util
ert find-func ewoc debug vc-hg vc-git diff-mode easy-mmode bug-reference
map cus-start cus-load elec-pair erc-notify erc-desktop-notifications
notifications dbus xml erc-list erc-menu erc-join erc-ring erc-networks
erc-pcomplete erc-track erc-match erc-button wid-edit erc-fill erc-stamp
erc-netsplit erc-goodies erc erc-backend erc-compat thingatpt pp
cperl-mode tramp-theme em-dirs esh-var esh-io esh-cmd esh-opt esh-ext
esh-proc esh-arg esh-groups eshell esh-module esh-mode esh-util
finder-inf rx docker-tramp tramp-cache slime-autoloads vagrant-tramp
dash term disp-table ehelp info package easymenu epg-config url-handlers
url-parse url-vars time tramp-sh tramp tramp-compat tramp-loaddefs
trampver ucs-normalize shell pcomplete comint ansi-color ring parse-time
format-spec advice auth-source cl-seq eieio eieio-core cl-macs
eieio-loaddefs password-cache ido seq byte-opt gv bytecomp byte-compile
cconv jka-compr icomplete paren vc cl-loaddefs cl-lib vc-dispatcher
dired dired-loaddefs time-date mule-util tooltip eldoc electric uniquify
ediff-hook vc-hooks lisp-float-type 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 elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow isearch timer select
scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors 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 composite charscript charprop case-table epa-hook jka-cmpr-hook
help simple abbrev obarray 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 lcms2 dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty
make-network-process emacs)

Memory information:
((conses 16 591729 78592)
 (symbols 48 51583 5)
 (miscs 40 1187 1629)
 (strings 32 163059 9766)
 (string-bytes 1 4144809)
 (vectors 16 66157)
 (vector-slots 8 2194248 184812)
 (floats 8 143 706)
 (intervals 56 12315 1573)
 (buffers 992 44))