lisp-format icon indicating copy to clipboard operation
lisp-format copied to clipboard

Fails to read from stdin

Open tjtrabue opened this issue 4 years ago • 1 comments

Hello everyone,

Thank you so much for this awesome tool! I really enjoy it, and it sure seems to work for files on disk. However, when I try to get lisp-format to read from stdin, it neither reads my input nor writes any output, to stdout or elsewhere. I'm using the latest version of lisp-format from master.

Here's how I'm using lisp-format:

cat my-lisp-file.el | lisp-format

However, I've also tried:

cat my-lisp-file | lisp-format </dev/stdin

Am I not using it correctly? I've also tried adding -verbose to increase the level of output, but that did nothing.

Thank you in advance!

EDIT

Emacs version: 29

I just tried running make in this repo's root directory, and I get failing tests for add-tabs-default:

Debugger entered--Lisp error: (file-missing "Cannot open load file" "No such file or directory" "paredit")
  require(paredit)
  load-with-code-conversion("/home/shinepo/workspace/lisp-format/test/fix-trail..." "/home/shinepo/workspace/lisp-format/test/fix-trail..." nil t)
  load("/home/shinepo/workspace/lisp-format/test/fix-trail..." nil t t)
  (let ((inhibit-message (if verbose nil t))) (load lisp-format-file nil t t))
  (if lisp-format-file (let ((inhibit-message (if verbose nil t))) (load lisp-format-file nil t t)) (error "No '.lisp-format' file found in '%s' or parent dir..." (file-name-directory (expand-file-name file))))
  (let ((lisp-format-file (find-file-recursively ".lisp-format" (file-name-directory (expand-file-name file))))) (if lisp-format-file (let ((inhibit-message (if verbose nil t))) (load lisp-format-file nil t t)) (error "No '.lisp-format' file found in '%s' or parent dir..." (file-name-directory (expand-file-name file)))))
  (progn (let ((lisp-format-file (find-file-recursively ".lisp-format" (file-name-directory (expand-file-name file))))) (if lisp-format-file (let ((inhibit-message (if verbose nil t))) (load lisp-format-file nil t t)) (error "No '.lisp-format' file found in '%s' or parent dir..." (file-name-directory (expand-file-name file))))))
  (if (eql style :file) (progn (let ((lisp-format-file (find-file-recursively ".lisp-format" (file-name-directory (expand-file-name file))))) (if lisp-format-file (let ((inhibit-message (if verbose nil t))) (load lisp-format-file nil t t)) (error "No '.lisp-format' file found in '%s' or parent dir..." (file-name-directory (expand-file-name file)))))))
  lisp-format-process-file("example.lisp")
  (while (not (null file)) (lisp-format-process-file file) (setq file (car-safe (prog1 argv (setq argv (cdr argv))))))
  (let ((file (car-safe (prog1 argv (setq argv (cdr argv)))))) (while (not (null file)) (lisp-format-process-file file) (setq file (car-safe (prog1 argv (setq argv (cdr argv)))))) nil)
  load-with-code-conversion("/home/shinepo/workspace/lisp-format/lisp-format" "/home/shinepo/workspace/lisp-format/lisp-format" nil t)
  command-line-1(("-scriptload" "../../lisp-format" "--" "-style=file" "example.lisp"))
  command-line()
  normal-top-level()

tjtrabue avatar Dec 23 '21 15:12 tjtrabue

I don't think we ever anticipated that lisp-format would read from stdout. Instead can you just pass your file name to lisp-format as an argument so e.g. cat my-lisp-file.el | lisp-format becomes lisp-format my-lisp-file.el?

eschulte avatar Jan 10 '22 19:01 eschulte