[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to do a massive unfill paragraph operation over several hundred
From: |
Van L |
Subject: |
Re: How to do a massive unfill paragraph operation over several hundred files? |
Date: |
Sun, 30 Sep 2018 15:10:17 +1000 |
>> It's been decades since I messed with it, but
>> as I vaguely recall there's a batch mode for
>> emacs. Basically, you call emacs from the
>> command line with the "--batch" and other
>> options ("--script [file_containing_elisp]").
>
> See? I was right even decades ago!
>
> :)
You had this formulation:
┌────
│ 1 #! /bin/zsh
│ 2
│ 3 # Script to insert a string into files
│ 4 # 1, 2, and 3:
│ 5
│ 6 local script=do-this.el
│ 7
│ 8 emacs -Q --batch --script $script 1 2 3
└────
┌────
│ 1 ;; do-this.el
│ 2
│ 3 ;; Elisp to do it:
│ 4
│ 5 (dolist (f argv)
│ 6 (find-file f)
│ 7 (insert "Sail away, sail away, sail away…") ; do your thing here
│ 8 (save-buffer) )
└────