Feed on
Posts
Comments

it’s been a bit of a hassle getting emacs to read python files in python-mode.  in spite of downloading a python-mode file and putting it in my boot path, emacs still refused to enter python mode.  i kept getting the error message:

file-error “Cannot open load file” “python-mode”

turns out the problem was that i needed to specify emacs’ own load-path, by inserting the following line into my .emacs file:

(add-to-list ‘load-path “/Users/user_name/bin/”)

where  “/Users/user_name/bin/” is the directory i’ve placed my python-mode.el file into.

Stumble it!

if that was helpful ...

check out the other tips and tricks i've compiled on these pages. you might learn something else interesting!

3 Responses to “fixing emacs “cannot open load file” errors”

  1. on 20 Apr 2007 at 6:59 am Isabelle

    Thanks for the tip .. I was using wrong syntax for my path (C:\Users\…)

  2. on 02 Jul 2007 at 1:24 pm Krishnan

    Great! It worked for me for setting up the matlab mode.

  3. on 23 Aug 2007 at 10:09 am Rob Stewart

    Here’s a shell script I use:

    #!/bin/bash

    usage()
    {
    echo >&2 “$0 [-d directory [directory …]] file.el [file.el …]

    where is added to the load-path during compilation.”
    [ $# -eq 0 ] || echo >&2 ”
    $@”
    exit 1
    }

    while [ $# -gt 0 ]; do
    case $1 in
    –help|-h|-’?') usage;;
    -d)
    [ $# -gt 1 ] || usage “Missing directory argument for -d”
    DIRECTORIES=”$DIRECTORIES $2″; shift
    ;;
    *) break;;
    esac
    shift
    done

    for directory in $DIRECTORIES; do
    LOAD_PATH=”$LOAD_PATH –directory=$directory”
    done

    for file in “$@”; do
    cd $(dirname $file)
    emacs -batch -no-init-file $LOAD_PATH -f batch-byte-compile $file
    done

Did I get this wrong? Let me know!

Trackback URI | Comments RSS

More blogs about http://desk.stinkpot.org:8080/tricks.