arnested / drupal-mode

Advanced Emacs minor mode for Drupal development
https://melpa.org/#/drupal-mode
GNU General Public License v3.0
32 stars 14 forks source link

Drupal jargon spell checking #23

Closed arnested closed 11 years ago

arnested commented 11 years ago

Create a dictionary of Drupal specific words and add the follwing to drupal/ispell.el:

(when ispell-really-aspell
  (add-to-list (make-local-variable 'ispell-extra-args)
               '("--extra-dicts" "some_dict_with_drupal_jargon")))

Would enable aspell users to have better spell checking in comments and strings.

arnested commented 11 years ago

Does a Drupal specific dictionary exist somewhere? Because that will probably be the hard part...

arnested commented 11 years ago

Maybe a dictionary could be build based on http://drupal.org/glossary.

arnested commented 11 years ago

I scraped http://drupal.org/glossary manually: https://gist.github.com/4160351.

Convert the wordlist to an aspell dictionary:

aspell --lang en create master drupal.aspell < drupal.wordlist

Dump dictionary in the same folder as drupal/ispell.el and add

(defvar drupal/ispell-aspell-extra-dict (concat (file-name-directory
                                                 (or load-file-name buffer-file-name))
                                                "drupal.aspell"))

to drupal/ispell.el and add the following code snippet to the function drupal/ispell-enable:

  (when ispell-really-aspell
    (add-to-list (make-local-variable 'ispell-extra-args) "--extra-dicts" t)
    (add-to-list (make-local-variable 'ispell-extra-args) drupal/ispell-aspell-extra-dict t))

The code needs some cleaning and we probably don't want to scrape http://drupal.org/glossary manually to keep it up to date.

arnested commented 11 years ago

See my drupal-spell project which integrates nicely with drupal-mode.