<commit_before>if is_mac?

  ENV["EMACS_D"] = File.expand_path("~/.emacs.d")

  def emacs_reqs
    [ "emacs --with-gnutls --cocoa",
      "ispell",
      "cask",
      "markdown" ]
  end

  def node_reqs
    %w{jshint jsonlint js-beautify git://github.com/ramitos/jsctags.git}
  end

  def setup
    echo "Installing emacs dependencies"
    emacs_reqs.each { |pkg| Package.install pkg }
  end

  def setup_node
    echo "Installing node dependencies"
    sh_safe "/usr/local/bin/npm install -g #{node_reqs.join(' ')}"
  end

  def setup_emacs_d
    echo "Setting up emacs.d & updating cask"
    github 'hlissner/emacs.d', '~/.emacs.d'
    sh_safe "cd '#{ENV["EMACS_D"]}' && cask install"
  end

  def emacs_installed?
    Dir.exists?(ENV["EMACS_D"])
  end

  #
  desc "Ensure emacs 24.4 is installed & up to date"
  task :emacs => "emacs:update"

  namespace :emacs do
    desc "Install emacs completely"
    task :install => ["pkg:nodejs:install", :setup, :setup_node, :setup_emacs_d]

    desc "Setup required homebrew packages"
    task :setup do
      setup if !emacs_installed? || ENV["FORCE"]
    end

    desc "Setup required node & node plugins"
    task :setup_node do
      setup_node if !emacs_installed? || ENV["FORCE"]
    end

    desc "Setup emacs.d folder, plugins and cask"
    task :setup_emacs_d do
      setup_emacs_d if !emacs_installed? || ENV["FORCE"]
    end

    task :update => "emacs:install" do
      if emacs_installed? && Dir.exists?("#{ENV['EMACS_D']}/.git")
        echo "Updating emacs.d & packages"
        sh_safe "cd '#{ENV["EMACS_D"]}' && git pull && cask update"

        # Update node
        sh "/usr/local/bin/npm update -g #{node_reqs.join(' ')}"
      end
    end

    task :remove do
      echo "Uninstalling emacs"
      Package.remove "emacs"
      Package.remove "homebrew/dupes/tidy"
      emacs_reqs.each { |pkg| Package.remove pkg.split.first }<commit_msg>Update emacs rakefile<commit_after>if is_mac?

  ENV["EMACS_D"] = File.expand_path("~/.emacs.d")

  def emacs_reqs
    [ "emacs-mac --with-gnutls --with-imagemagick --with-modern-icon --HEAD",
      "ispell",
      "cask",
      "markdown" ]
  end

  def node_reqs
    %w{jshint jsonlint js-beautify git://github.com/ramitos/jsctags.git}
  end

  def setup
    echo "Installing emacs dependencies"
    emacs_reqs.each { |pkg| Package.install pkg }
  end

  def setup_node
    echo "Installing node dependencies"
    sh_safe "/usr/local/bin/npm install -g #{node_reqs.join(' ')}"
  end

  def setup_emacs_d
    echo "Setting up emacs.d & updating cask"
    github 'hlissner/emacs.d', '~/.emacs.d'
    sh_safe "cd '#{ENV["EMACS_D"]}' && cask install"
  end

  def emacs_installed?
    Dir.exists?(ENV["EMACS_D"])
  end

  #
  desc "Ensure emacs 24.4 is installed & up to date"
  task :emacs => "emacs:update"

  namespace :emacs do
    desc "Install emacs completely"
    task :install => ["pkg:nodejs:install", :setup, :setup_node, :setup_emacs_d]

    desc "Setup required homebrew packages"
    task :setup do
      if !emacs_installed? || ENV["FORCE"]
        Package.tap "railwaycat/emacsmacport"
        setup
      end
    end

    desc "Setup required node & node plugins"
    task :setup_node do
      setup_node if !emacs_installed? || ENV["FORCE"]
    end

    desc "Setup emacs.d folder, plugins and cask"
    task :setup_emacs_d do
      setup_emacs_d if !emacs_installed? || ENV["FORCE"]
    end

    task :update => "emacs:install" do
      if emacs_installed? && Dir.exists?("#{ENV['EMACS_D']}/.git")
        echo "Updating emacs.d & packages"
        sh_safe "cd '#{ENV["EMACS_D"]}' && git pull && cask update"

        # Update node
        sh "/usr/local/bin/npm update -g #{node_reqs.join(' ')}"
      end
    end

    task :remove do
      echo "Uninstalling emacs"
      Package.remove "emacs"
      Package.remove "homebrew/dupes/tidy"
      Package.untap "railwaycat/emacsmacport"
      emacs_reqs.each { |pkg| Package.remove pkg.split.first }
{'fraction_non_alphanumeric': 0.13094938302694537, 'fraction_numerical': 0.0015109544195416771, 'mean_word_length': 2.8119001919385798, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6158354', 'n_tokens_mistral': 1489, 'n_tokens_neox': 1419, 'n_words': 353}