overtone / emacs-live

M-x start-hacking
http://overtone.github.com/emacs-live/
Other
1.52k stars 241 forks source link

Added user-provided welcome messages. #155

Closed cryptorick closed 10 years ago

cryptorick commented 10 years ago

The welcome message is the one-liner affirmation that shows up in the scratch buffer, underneath the "Emacs Live" ASCII logo, when you startup emacs under Emacs Live. Stock Emacs Live comes with a "database" of these one-liners that are chosen randomly at each startup. If you've ever wanted your own message "database" to override the default one, thus giving you your own randomly-chosen snarky welcome message, then this new facility is for you, my friend!

Here's how to activate it. You create a text file called ~/.emacs-live-welcome-messages.txt[1] containing the one-liners, occurring one per line. Then, Emacs Live will randomly choose a line from this file for your welcome message, instead of from the stock messages.

Here are sample contents (lines) from ~/.emacs-live-welcome-messages.txt:

Hello, hope you enjoyed your coffee. Now, get back to work!!! Hello, there may be no end to your good taste; there also may be no beginning. People follow you anywhere, but only out of morbid curiosity.

Easy as that!

This new facility, like the current (old) one, will try to insert your first name in the welcome message, by following this simple rule: if the message starts with the string "Hello, ", then insert the first name after "Hello"; otherwise, insert the first name at the beginning of the message.

So, if the first name is "Sam", this:

Hello, hope you enjoyed your coffee. Now, get back to work!!!

becomes:

Hello Sam, hope you enjoyed your coffee. Now, get back to work!!!

And this:

People follow you anywhere, but only out of morbid curiosity.

becomes:

Sam, people follow you anywhere, but only out of morbid curiosity.

(Note that the initial "P" in "People" is lowercased by the transform.)


[1] You can also change the location (pathname) of your custom welcome message "database" by setting the variable live-welcome-messages-file before Emacs Lives's init.el gets called.

samaaron commented 10 years ago

Thanks so much for putting the effort into this - especially the wonderfully detailed pull request info. However, this isn't something I'm looking to support.

cryptorick commented 10 years ago

Thank you, Sam, for your consideration. Always a pleasure, my friend! Cheers!