something weird is going on in my 'emacs-IDE'. I am editing some javascript files in a django project using spacemacs. Some tools I use are treemacs and lsp-mode.

In order to test my code I call up a shell using spacemacs/default-pop-shell and start the django server from there python manage.py runserver.

Now here comes the catch: when I edit some javascript code, e.g. uncomment a console.log() statement, the old code gets loaded even when I kill the server and restart it (which should not be required anyways). Is there some bug that makes emacs somehow cache and load the 'old' files? Seems like a stupid question, but I cannot think of another explanation why my edits do not get applied immediately.

document.addEventListener('DOMContentLoaded', function() {

    // Use buttons to toggle between views
    document.querySelector('#inbox').addEventListener('click', () => load_mailbox('inbox'));
    document.querySelector('#sent').addEventListener('click', () => load_mailbox('sent'));
    document.querySelector('#archived').addEventListener('click', () => load_mailbox('archive'));
    document.querySelector('#compose').addEventListener('click', compose_email);

    // Disable submit button unless recipients field and subject has some content
    document.onkeyup = () => {
        const recipientsValue = document.querySelector('#compose-recipients').value;
        const subjectValue = document.querySelector('#compose-subject').value;
        // console.log('Recipients:', recipientsValue);
        if (recipientsValue.length > 0 && subjectValue.length >0) {
            document.querySelector('#compose-submit').disabled = false;
            // console.log('enabled');
        } else {
            document.querySelector('#compose-submit').disabled = true;
            // console.log('disabled');
    // By default, load the inbox

function compose_email() {

    // Show compose view and hide other views
    document.querySelector('#emails-view').style.display = 'none';
    document.querySelector('#compose-view').style.display = 'block';

    // Clear out composition fields
    document.querySelector('#compose-recipients').value = '';
    document.querySelector('#compose-subject').value = '';
    document.querySelector('#compose-body').value = '';

function load_mailbox(mailbox) {
    // Show the mailbox and hide other views
    document.querySelector('#emails-view').style.display = 'block';
    document.querySelector('#compose-view').style.display = 'none';

    // Show the mailbox name
    document.querySelector('#emails-view').innerHTML = `<h3>${mailbox.charAt(0).toUpperCase() + mailbox.slice(1)}</h3>`;

Above is the existing code in my /static/mail folder.

However, the line I last commented out is line 15: // console.log('Recipients" ...)

In the Inspector/Debugger in the browser the line shows as uncommented. I have since then reloaded the emacs instance. Same result...

Am I missing something here?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.