4 ms·
OK. Here's a usecase where I found emacs to be wonderful. I had to email the grades, together with totals, and class averages to many students in a class. I t
by sn41 4y ago
OK. Here's a usecase where I found emacs to be wonderful.
I had to email the grades, together with totals, and class averages to many students in a class.
I tried fiddling with Excel and Google spreadsheets and scripted mail merges. Then I realized I could do it emacs.
Export the gradesheet into csv, and convert to an org table.
Carefully record a macro where you copy paste the name of the student the mark columns into a mail window (I used gnus), copy paste them into a calc window, do the calculation, copy the result onto the mail, and email the student. Go to the org buffer, and go to the next line. This took about 12 minutes to get right.
Keep pressing f4. Sending individual mails to 125 students took <5 minutes.
Maybe this is overkill, and I am sure excel wizards can do it in a few minutes. Nevertheless, I was surprised - if you spend time carefully recording the macro, the Emacs ecosystem (org+gnus+keyboard macros) is insanely powerful.
- kreetx 4y agoIt's overkill if you ever only needed to do it once, but should the situation come up again the investment in time and effort will likely pay off.
- miroljub 4y agoIt's not an overkill. He spent 12 minutes developing the solution and then 5 more minutes for actual sending of 125 emails. That's 17 minutes in total. I assume doing the same task manually would take him at least a day or two, with the possibility of making numerous mistakes by doing it.
- tmtvl 4y agoYou can do C-u 125 C-x e (or C-1 C-2 C-5 F4) to repeat a macro 125 times.
- axytol 4y agoOr if you're confident enough in your macro definition you can do C-u 0 C-x e to repeat until it reaches the end of the buffer.
- Kwpolska 4y agoThe "Excel wizard" (not really) solution is to use Mail Merge in Word: https://support.microsoft.com/en-us/office/use-mail-merge-to-send-bulk-email-messages-0f123521-20ce-4aa8-8b62-ac211dedefa4 https://support.microsoft.com/en-us/office/use-mail-merge-to...
- wrycoder 4y agoI would think that a Python code using the csv and email modules would be as fast or faster, and be more robust against typos.
- BeetleB 4y ago> Export the gradesheet into csv, and convert to an org table. Your mistake was not using org first ;-) I learned org mode while a grad TA, and one of the first times I used org tables was to keep track of student scores.
- olivertaylor 4y agoYou can also do this with the system's built-in mail program. I set this up for doing bulk emails a while ago and it has proved very useful and versatile. (defun compose-mail-macos (&optional to subject body) "Compose a message using macOS's default mail program." (interactive) (start-process "Open Mail Message" nil "open" (concat "mailto:" (when to to) "?" (when subject (concat "&subject=" (url-hexify-string subject))) (when body (concat "&body=" (url-hexify-string body)))))) (defun compose-mail-macos-multiple (list subject body) "ADDRESSES should be a list of email addresses in the form of: (setq mail-list '(\"Mail 1 <mail1@example.com>\" \"Mail 2 <mail2@example.com>\" \"Mail 3 <mail3@example.com>\"))" (while list (let ((to (car list))) (compose-mail-macos to subject body) (setq list (cdr list)))))