I'm looking for a package that converts

United States to us Netherlands to nl

Where does one go to find Elisp packages?

For Ruby there's rubygems.org, for example.

  • 1
    You seem to systematically apply tag elisp, and you seem to always apply it incorrectly. Tag elisp is not about how to do things in Elisp or how to find Elisp code. Tag elisp is about Elisp as a Lisp dialect - its particularities wrt other Lisps, etc. Please make a real effort to apply tags that are relevant to your questions. That will help everyone, including you, by helping people who are interested in your question to find it, including by searching tags. – Drew Jul 5 '18 at 5:15
  • If you're not sure what tags are available, click Tags at the top center of your browser. – Drew Jul 5 '18 at 5:29
  • 1
    Clicking the two tags I replaced your elisp tag with will already get you started on an answer. That will show you questions about Emacs-Lisp package repositories and questions about Emacs Wiki. – Drew Jul 5 '18 at 5:32
  • I have my doubts such a package exists. Yes, one can use Emacs Lisp as a general purpose programming language, but it's going to be tough because most of the code out there for it is to enhance your editing experience. – wasamasa Jul 5 '18 at 5:56

Where does one go to find Elisp packages? You can look at Melpa and search there. Otherwise just Github or Reddit.

Now, what you are trying to do is so specific that I don't think anyone would care to write a whole package just for this sole purpose. You can download a canonical country csv from anywhere in the Internets (example here) and write a quick script to do the substitution.

In python, for example, something like the following would read a file and save another one with words changed (untested, but should work up to minor bug fixes):

with open('countries.csv', 'r') as mapping:
    countries = {}
    for row in mapping:
        k, v = row
        countries[k] = v

with open (file, 'r') as f:
     content = f.readlines()

for index, line in enumerate(content):
    while any(country in line for country in countries.keys()):
        content[index].replace(country, countries[country])

with open(outfile, 'w') as out:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.