# File raggle, line 4859
    def Engine::load_config
      # expand the default config hash
      Engine::expand_config

      # parse command-line options
      opts = Raggle::CLI::parse_cli_options ARGV
      
      # if $HOME/.raggle doesn't exist, then create it
      Dir::mkdir $config['config_dir'] unless test ?d , $config['config_dir']
      
      # save default config
      default_config = $config

      # load user config ($HOME/.raggle/config.rb)
      puts $config['msg_load_config'] if opts['mode'] == 'view'
      load $config['config_path'], false if test ?e, $config['config_path']

      # save user config, switch to default config, and update from
      # user config
      user_config = $config
      $config = default_config
      $config.update user_config
      
      # expand config again (to handle macros in user config)
      Engine::expand_config
      
      # load feed list
      puts $config['msg_load_list'] if opts['mode'] == 'view'
      if $config['load_feed_list'] && test(?e, $config['feed_list_path'])
        # load feed list
        feeds_str = File.read($config['feed_list_path'])

        # check if feed list is empty
        if feeds_str.size > 0
          # if it's a pre-0.4.0 feed list, then strip out the ruby/object
          # nonsense and shift all lines over
          if feeds_str =~ /^--- !ruby\/object:/
            feeds_str = feeds_str.select { |line| 
              line !~ /^(feeds:|--- !ruby\/object:)/ 
            }.map { |line| line.gsub(/^  /, '') }.join
          end

          # make sure the feed list exists, deserialize our feed list
          $config['feeds'] ||= Raggle::Feed::List.new
          $config['feeds'].feeds = YAML::load(feeds_str)
        end
      end

      # if there is no feed list, then load the default one
      if $config['feeds'] && $config['feeds'].size == 0
        $config['default_feeds'].each do |feed|
          $config['feeds'].add(feed['title'], feed['url'], feed['refresh'],
                               feed['lock_title?'], feed['save_items?'],
                               feed['site'], feed['desc'], feed['items'],
                               feed['image'], feed['category'], false,
                               feed['priority'])
        end
      end

      opts
    end