emacsdired

Corrupted Dired Output, Disappears After Refresh


My dired output shows some additional information that are cluttering the screen, the first time I visit any directory I get an output like

  drwxr-xr-x 2 user1 user1  4096 Jan  5  2024 dir1
  drwxr-xr-x 3 user1 user1  4096 May 12 15:34 dir2
  ..
//DIRED// 58 59 106 108 155 165 212 219 266 270 317 323 370 395 442 456 503 528 575 597 644 666 713 718 765 768 815 823 870 878 925 928 975 979 1026 1032
//DIRED-OPTIONS// --quoting-style=literal

I was told the DIRED-OPTIONS text comes from the fact that the internal ls that is called by Dired uses the --dired option. But this output should be removed after ls is executed, I guess due to a bug it is not (oddly enough when I refresh the buffer, the additions go away).

I was not able to fix this via config changes, I was thinking I could write an elisp function and run it as dired hook that removes the additions from the dired output. Which hook function do I use for that, are there any templates available? Any pointers would be welcome.

I am using Emacs 29 on Ubuntu 24.


Solution

  • The culprit turned out to be language-environment settings. Under custom-set-variables if

     '(current-language-environment "Turkish")
     '(default-input-method "turkish-postfix")
    

    is set, the dired output becomes corrupted. If however I set the language env through a function, dired has no problems, eg

    (defun turkish-env ()
      (interactive)
      (set-language-environment "turkish")
      (set-input-method "turkish-postfix"))
    

    This is a workaround but it works. I could delete the question but will leave it here so people can find it via search.