1

While the documentation states that archive mode supports rar files, I seem to have no luck with it. Trying to view/open a rar file in dired, lead to this message:

File mode specification error: (file-error Searching for program No such file or directory lsar)

My emacs version is 25.2.1. I suspect the source of the error is here, in using unar instead of unrar:

(defun archive-rar-extract (archive name)
  ;; unrar-free seems to have no way to extract to stdout or even to a file.
  (if (file-name-absolute-p name)
      ;; The code below assumes the name is relative and may do undesirable
      ;; things otherwise.
      (error "Can't extract files with non-relative names")
    (archive-extract-by-file archive name `("unar" "-no-directory" "-o") "Successfully extracted")))

I don't have experience modifying compiled emacs lisp libraries. Would love to know what is causing this error.

  • 1
    Yep, that looks like a bug to me. I would report it to the Emacs team, and try fixing it yourself in the meantime. You can require the library (require 'arc-mode) and then use the same function name and everything, while just changing the program name. In my own setup, I actually substituted it with an absolute path to a registered version of unrar which required modifying some of the regexp functions since the output was slightly different. My recollection is that arc-mode was based on the assumption everyone would be using an unrar free version, which was not available to me. – lawlist Sep 10 '17 at 5:30
2

On Arch Linux, installing unarchiver from the AUR solved the problem. The programs unar and lsar are provided by the said package from the AUR.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.