不知道什么原因,dired现在不能进sudo模式了,例如:/sudo::/etc/

如果人为打开 tramp.el.gz, 全选然后执行一遍就好了。错误附后,

  1. 请问这可能的原因是沈什么
  2. 这个错误里有个符号 “#f(compiled-function ” ,我怎么知道这个compiled-function是哪一个呢?
Debugger entered--Lisp error: (file-missing "Setting current directory" "?????????" "/sudo::/etc/")
call-process("ls" nil nil nil "--dired")
dired-insert-directory("/sudo::/etc/" "-alh --group-directories-first" nil nil t)
dired-readin-insert()
dired-readin()
dired-internal-noselect("/sudo::/etc/" nil)
dired-noselect("/sudo::/etc/" nil)
#f(compiled-function (dirname &optional switches) "\"Edit\" directory DIRNAME--delete, rename, print, etc. some files in it.\nOptional second argument SWITCHES specifies the `ls' options used.\n(Interactively, use a prefix argument to be able to specify SWITCHES.)\n\nIf DIRNAME is a string, Dired displays a list of files in DIRNAME (which\nmay also have shell wildcards appended to select certain files).\n\nIf DIRNAME is a cons, its first element is taken as the directory name\nand the rest as an explicit list of files to make directory entries for.\nIn this case, SWITCHES are applied to each of the files separately, and\ntherefore switches that control the order of the files in the produced\nlisting have no effect.\n\n\\<dired-mode-map>You can flag files for deletion with \\[dired-flag-file-deletion] and then\ndelete them by typing \\[dired-do-flagged-delete].\nType \\[describe-mode] after entering Dired for more info.\n\nIf DIRNAME is already in a Dired buffer, that buffer is used without refresh." (interactive (dired-read-dir-and-switches "")) #<bytecode 0xf38c11>)("/sudo::/etc/" nil)
ad-Advice-dired(#f(compiled-function (dirname &optional switches) "\"Edit\" directory DIRNAME--delete, rename, print, etc. some files in it.\nOptional second argument SWITCHES specifies the `ls' options used.\n(Interactively, use a prefix argument to be able to specify SWITCHES.)\n\nIf DIRNAME is a string, Dired displays a list of files in DIRNAME (which\nmay also have shell wildcards appended to select certain files).\n\nIf DIRNAME is a cons, its first element is taken as the directory name\nand the rest as an explicit list of files to make directory entries for.\nIn this case, SWITCHES are applied to each of the files separately, and\ntherefore switches that control the order of the files in the produced\nlisting have no effect.\n\n\\<dired-mode-map>You can flag files for deletion with \\[dired-flag-file-deletion] and then\ndelete them by typing \\[dired-do-flagged-delete].\nType \\[describe-mode] after entering Dired for more info.\n\nIf DIRNAME is already in a Dired buffer, that buffer is used without refresh." (interactive (dired-read-dir-and-switches "")) #<bytecode 0xf38c11>) "/sudo::/etc/" nil)
apply(ad-Advice-dired #f(compiled-function (dirname &optional switches) "\"Edit\" directory DIRNAME--delete, rename, print, etc. some files in it.\nOptional second argument SWITCHES specifies the `ls' options used.\n(Interactively, use a prefix argument to be able to specify SWITCHES.)\n\nIf DIRNAME is a string, Dired displays a list of files in DIRNAME (which\nmay also have shell wildcards appended to select certain files).\n\nIf DIRNAME is a cons, its first element is taken as the directory name\nand the rest as an explicit list of files to make directory entries for.\nIn this case, SWITCHES are applied to each of the files separately, and\ntherefore switches that control the order of the files in the produced\nlisting have no effect.\n\n\\<dired-mode-map>You can flag files for deletion with \\[dired-flag-file-deletion] and then\ndelete them by typing \\[dired-do-flagged-delete].\nType \\[describe-mode] after entering Dired for more info.\n\nIf DIRNAME is already in a Dired buffer, that buffer is used without refresh." (interactive (dired-read-dir-and-switches "")) #<bytecode 0xf38c11>) ("/sudo::/etc/" nil))
dired("/sudo::/etc/" nil)
funcall-interactively(dired "/sudo::/etc/" nil)
call-interactively(dired nil nil)
command-execute(dired)

哪个 ad-Advice-dired 有些可疑,显然你用 Advice 了 dired,且用的是老式的 Advice 系统,不是 nadvice。

找到了,原来我把file-name-handler-alist设成nil没改回来,感谢指点!