1
votes

In emacs I always have the need to run a command to validate the file.

I want to run a shell command against the file I am editing in the buffer how should I do that ?

the shell command ( I wrote using python ) only accept file names as argument. so probably two solutions:

  1. how do I pass the file-name in the mini-buffer to the command ?
  2. how do I change the script so that it can accept the buffer region as input?
1
If you are validating a file you may wish to look into flymake - it does what you describe. It periodically and automatically runs a shell command against the content of the buffer being edited.Cheeso

1 Answers

1
votes
  1. Is an exact duplicate. See link above.

  2. You can use M-| to pass the region as input to any shell script. Assuming your script can read from stdin, that should resolve that option. (And if it can't, fixing that would certainly warrant a separate question.)