(setq d-java-online nil)

(save-excursion
  (if (not (get-buffer "*scratch*"))
      (generate-new-buffer "*scratch*"))

  (progn
    (set-buffer "*scratch*")
    (setq default-directory "~/")
    (emacs-lisp-mode)
    (erase-buffer)

    ;;
    ;; NOTE: the following code is for dabbrev functionality
    ;;

    (when (and (boundp 'prefs-scrprefs-scratch-java-online-p) prefs-scratch-java-online-p)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; SIMBAD STUFF ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

      (insert ";; simbad-clean copy gui tar \n")

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; SJS STUFF ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

      (insert ";; begin end beginMain endMain for do while if else then \n")

      (insert ";; property method variable classVariable function \n")
      (insert ";; SYSTEM_OUT_PRINT SYSTEM_OUT_PRINTLN \n")
      (insert ";; BEGINMAIN ENDMAIN VARIABLE m6_answer PRIVATE \n")
      (insert ";; m4_begin_indent m4_end_indent m4_include(readonly.m4) m4_ignore \n")

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; JAVA STUFF ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

      ;; NOTE: Core Java words
      (insert ";; class extends implements instanceof interface enum equals length size \n")
      (insert ";; package private protected public synchronized void int char long boolean String toString \n")
      (insert ";; if else for while do try catch switch break default \n")
      (insert ";; Exception Throwable RuntimeException NullPointerException \n")
      (insert ";; printStackTrace elementAt setElementAt \n")
      (insert ";; String toString startsWith endsWith indexOf StringBuffer append \n")
      (insert ";; System.out.println System.out.print Object \n")

      ;; NOTE: Java core API:
      (insert ";; Math random round floor \n")
      (insert ";; StringBuilder StringBuffer charAt endsWith indexOf startsWith substring toUpperCase toLowerCase \n")
      (insert ";; trim valueOf \n")
      (insert ";; Thread sleep InterruptedException \n")
      (insert ";; Integer Calendar GregorianCalendar YEAR MONTH DAY_OF_MONTH HOUR_OF_DAY MINUTE SECOND \n")
      (insert ";; Runtime exec Process waitFor getErrorStream getInputStream getOutputStream \n")
      (insert ";; Character Integer Double \n")

      ;; NOTE: Gui Stuff java.awt.* or javax.swing.*
      (insert ";; Color BLACK BLUE CYAN DARK_GRAY GRAY GREEN LIGHT_GRAY MAGENTA ORANGE PINK RED WHITE YELLOW \n")
      (insert ";; Rectangle width height union intersection difference Point \n")
      (insert ";; ActionListener addActionListener actionPerformed ActionEvent \n")
      (insert ";; JFrame jFrame getContentPane setPreferredSize Dimension JButton jButton \n")
      (insert ";; JLabel jLabel setText getText JEditorPane jEditorPane JTextPane setEditable \n")
      (insert ";; setCaretPosition File File.separator File.separatorChar \n")
      (insert "public void actionPerformed(ActionEvent e) \n")

      (insert ";; pack setVisible \n")
      (insert ";; JPanel jPanel paintComponent Component Graphics \n")
      (insert ";; JMenuBar jMenuBar JMenu jMenu JMenuItem jMenuItem setJMenuBar \n")
      (insert ";; JFileChooser jFileChooser showOpenDialog APPROVE_OPTION CANCEL_OPTION \n")
      (insert ";; setFileFilter FileFilter File FilenameFilter \n")
      (insert ";; setFileSelectionMode FILES_ONLY DIRECTORIES_ONLY FILES_AND_DIRECTORIES \n")
      (insert ";; setMultiSelectionEnabled getSelectedFile \n")
      (insert ";; returnVal \n")

      (insert ";; JComboBox jComboBox JScrollPane \n")
      (insert ";; JList jList getSelectedIndex JScrollBar jScrollBar \n")

      ;; NOTE: IO stuff
      (insert ";; IOException InputStream FileInputStream OutputStream FileOutputStream \n")
      (insert ";; File getAbsolutePath listFiles debugInfo \n")

      ;; NOTE: Layout managers
      (insert ";; setLayout GridLayout GridBagLayout FlowLayout \n")
      (insert ";; add BorderLayout CENTER EAST LINE_END LINE_START NORTH PAGE_END PAGE_START SOUTH WEST \n")

      ;; NOTE: Joption pane stuff
      (insert ";; showConfirmDialog showInputDialog showMessageDialog showOptionDialog \n")
      (insert ";; CANCEL_OPTION CLOSED_OPTION DEFAULT_OPTION ERROR_MESSAGE ICON_PROPERTY INFORMATION_MESSAGE \n")
      (insert ";; INITIAL_SELECTION_VALUE_PROPERTY INITIAL_VALUE_PROPERTY INPUT_VALUE_PROPERTY MESSAGE_PROPERTY \n")
      (insert ";; MESSAGE_TYPE_PROPERTY NO_OPTION OK_CANCEL_OPTION OK_OPTION OPTION_TYPE_PROPERTY OPTIONS_PROPERTY \n")
      (insert ";; PLAIN_MESSAGE QUESTION_MESSAGE SELECTION_VALUES_PROPERTY UNINITIALIZED_VALUE VALUE_PROPERTY \n")
      (insert ";; WANTS_INPUT_PROPERTY WARNING_MESSAGE YES_NO_CANCEL_OPTION YES_NO_OPTION YES_OPTION \n")

      ;; NOTE: Collections
      (insert ";; Collections.unmodifiableSet Set HashSet SortedSet Comparable compareTo TreeSet List ArrayList Vector \n")
      (insert ";; hashCode size elementAt addElement \n")

      ;; NOTE: Nine patterns
      (insert ";; Iterator Singleton Factory Method Abstract Factory")
      (insert " Observer Template Method Composite Strategy \n")

      ;; NOTE: singleton
      (insert ";; getInstance() \n")

      ;; NOTE: iterator
      (insert ";; iterator hasNext next \n")

      ;; NOTE: Observer stuff
      (insert ";; addObserver notifyObservers Observer Observable setChanged \n")

      ;; NOTE: tags
      (insert ";; @author Davin Pearson \n")

      ;; NOTE: Desmoj packages
      (insert ";; desmoj dist statistic \n")

      ;; NOTE: Desmoj res stuff
      (insert ";; Res provide takeBack \n")

      ;; NOTE: Desmoj bin stuff
      (insert ";; Bin store deliver \n")

      ;; NOTE: Desmoj model stuff
      (insert ";; Model doInitialSchedules init description connectToExperiment setShowProgressBar \n")

      ;; NOTE: Desmoj simprocess stuff
      (insert ";; SimProcess lifeCycle getModel \n")

      ;; NOTE: Desmoj experiment stuff
      (insert ";; Experiment experiment tracePeriod debugPeriod start stop report finish \n")

      ;; NOTE: Desmoj time stuff
      (insert ";; SimTime SimClock activate passivate currentTime \n")

      ;; NOTE: Desmoj dist stuff
      (insert ";; BoolDistBernoulli BoolDistConstant DefaultRandomGenerator Distribution DistributionManager \n")
      (insert ";; IntDist IntDistConstant IntDistEmpirical IntDistPoisson IntDistUniform RealDist RealDistConstant \n")
      (insert ";; RealDistEmpirical RealDistErlang RealDistExponential RealDistNormal RealDistUniform \n")

      ;; NOTE: Simbad stuff
      (insert ";; SuperWiki getRepositoryPath \n")

      ;; NOTE: Reader.java stuff

      (insert ";; currentlyIdentifier() currentlyInt() currentToken() getChar() getBool() getIdentifier() \n")
      (insert ";; getIdentifier() Worker.stringsEqual() nextToken() debugInfo() \n")
      (insert ";; Reader returnValue Worker.stringQuoted \n")
      (insert ";; instanceof /* do nothing */ \n")

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; END OF JAVA ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

      ;; NOTE: Xpath stuff
      (insert ";; ancestor:: ancestor-or-self:: attribute:: child:: descendant:: descendant-or-self:: \n")
      (insert ";; following:: following-sibling:: namespace:: parent:: preceding:: preceding-sibling:: self:: \n")

      )

    (when (and (boundp 'prefs-scratch-libd-online-p) prefs-scratch-libd-online-p)

      ;; NOTE: drive-f word
      (insert " drive-f \n")

      ;; NOTE: C++ words
      (insert ";; ASSERT ASSERT_INFO assert \n")
      (insert ";; bool break const_cast cout cerr cin default #define double #endif \n")
      (insert ";; ORDER IMPORTANT HERE: EXIT_SUCCESS EXIT_FAILURE \n")
      (insert ";; false fclose fopen friend #ifdef #ifndef #include \n")
      (insert ";; int iostream namespace operator ostream printf reinterpret_cast return sprintf \n")
      (insert ";; static std stdlib.h struct true using virtual void \n")
      (insert ";; ALLEGRO_ONLINE DAVINS_IO_ONLINE DMM_ONLINE \n")
      (insert ";; BEGIN_FUNCTION END_FUNCTION \n")

      ;; NOTE: Allegro words
      (insert ";; allegro_error allegro_message \n")
      (insert ";; BITMAP blit circle circlefill clear_bitmap \n")
      (insert ";; clear_to_color COLORCONV_TOTAL create_bitmap create_bitmap_ex destroy_bitmap \n")
      (insert ";; END_OF_MAIN() exists file_exists getpixel GFX_AUTODETECT GFX_AUTODETECT_WINDOWED \n")
      (insert ";; install_keyboard install_mouse install_sound install_timer \n")
      (insert ";; KEY_ESC KEY_SPACE line load_bitmap makecol PAL_SIZE PALETTE \n")
      (insert ";; putpixel RGB rect rectfill rest RLE_SPRITE SAMPLE save_bitmap \n")
      (insert ";; set_color_conversion set_color_depth \n")
      (insert ";; screen SCREEN_H SCREEN_W set_gfx_mode stretch_blit \n")
      (insert ";; textout textout_multiline textout_centre vsync \n")
      (insert ";; ALLEGRO_INFINITE_LOOP \n")
      (insert ";; yield_timeslice retrace_count \n")
      (insert ";; mouse_sprite mouse_x mouse_x_focus mouse_y mouse_y_focus \n")
      (insert ";; KEY_UP KEY_DOWN KEY_LEFT KEY_RIGHT \n")
      (insert ";; keypressed readkey \n")

      ;; NOTE: Allegro colours
      (insert ";; allegro_col_black allegro_col_grey_light allegro_col_grey allegro_col_grey_dark allegro_col_white \n")
      (insert ";; allegro_col_red allegro_col_red_light allegro_col_red_dark allegro_col_orange allegro_col_yellow \n")
      (insert ";; allegro_col_green allegro_col_green_dark allegro_col_cyan allegro_col_purple allegro_col_blue \n")
      (insert ";; allegro_col_sand allegro_col_water allegro_col_tree_leaves allegro_col_tree_bark allegro_col_ice \n")
      (insert ";; allegro_col_grass allegro_col_trans")

      ;; NOTE: Myallegro words
      (insert ";; allegro_begin_windowed allegro_begin_fullscreen \n")
      (insert ";; allegro_quit allegro_quit_on_quit \n")
      (insert ";; allegro_draw_cross_hairs allegro_clone_bitmap \n")
      (insert ";; install_colours install_better_mouse_crosshairs install_better_mouse_white \n")
      (insert ";; allegro_blit_whole_bitmap allegro_blit_whole_bitmap_different \n")

      ;; NOTE: Mylib words
      (insert ";; ALREADY_INCLUDED better-mouse \n")
      (insert ";; BREAKPOINT char_star CHECKPOINT const_char_star \n")
      (insert ";; CONTRACT_1 CONTRACT_2 CONTRACT_3 \n")
      (insert ";; DEBUG_EXIT draw_circles draw_points draw_lines draw_progress_bar \n")
      (insert ";; EXIT_ON_CLOSE_WINDOW EXIT_ON_ESC \n")
      (insert ";; FILENAME File_Reader File_Writer \n")
      (insert ";; Floor gulp_quoted_string looking_at next_token \n")
      (insert ";; power_of_2 \n")
      (insert ";; press_esc_to_quit press_key_to_continue press_key_to_continue_no_message \n")
      (insert ";; PRINT PRINTF_AND_EXIT \n")
      (insert ";; quoted Reader Round string string_buffer strings_equal TELL Temp_Blit \n")
      (insert ";; safe_load_bitmap \n")
      (insert ";; SHOULD_NEVER_HAPPEN should_never_happen \n")
      (insert ";; Writer \n")
      (insert ";; dmm_debug_print dmm_decode \n")
      (insert ";; allegro_init_first_fullscreen allegro_init_first_windowed \n")
      (insert ";; allegro_init_windowed allegro_init_fullscreen allegro_get_is_windowed \n")
      (insert ";; allegro_get_bitmap allegro_blit_bitmap draw_on_me \n")

      ;; NOTE: c2java words
      (insert ";; c2java STUMP= Qointer Pointer \n")

      ;; NOTE: r4 words
      (insert ";; Ship_A Draw_Ship_A Null_Ship_A Human_Ship_A Computer_Ship_A Predictor_Ship_A \n")

      ;; NOTE: Dcode words
      (insert ";; DCODE_GENERIC DCODE_BOOL DCODE_INT \n")
      (insert ";; DCODE_XYI DCODE_XYD DCODE_V3I DCODE_V3D \n")
      (insert ";; DCODE_LIST DCODE_NODE \n")
      (insert ";; DCODE_ITERATOR \n")
      (insert ";; DCODERRAY DCODE_FOO \n")
      (insert ";; Root Auto Manual Super \n")
      (insert ";; Int Bool Array List Node Iterator \n")

      ;; NOTE: List-node template class words
      (insert ";; add_after_current add_before_current add_element delete_current \n")
      (insert ";; for_list for_list_backwards \n")
      (insert ";; get_data get_data_const get_dirty get_element_at get_first \n")
      (insert ";; get_last get_length get_owner \n")
      (insert ";; get_owner_const get_previous \n")

      ;; NOTE: Lisp words
      (insert ";; d-beeps beginning-of-line case-fold-search default-directory \n")
      (insert ";; defun directory-files-deep \n")
      (insert ";; emacs-dialect--xemacs-p os-type--mswindows-p emacs-dialect--gnuemacs-p \n")
      (insert ";; end-of-line \n")
      (insert ";; file-exists-p file-truename forward-char getenv global-set-key \n")
      (insert ";; interactive insert list-faces-display looking-at make-face message \n")
      (insert ";; d-foo d-is-good-buffer \n")
      (insert ";; point-max point-min prin1-to-string progn provide \n")
      (insert ";; re-search-backward re-search-forward require safe-find-file \n")
      (insert ";; safe-load-file safe-require save-excursion save-window-excursion \n")
      (insert ";; set-buffer set-face-background set-face-foreground \n")
      (insert ";; setq setq-default \n")
      (insert ";; shell-command \n")

      ;; NOTE: Makefile words
      (insert ";; r4-tags depend tags-online basic-test-suite test-suite publish build-tritus build-c4 \n")
      (insert ";; NDEBUG=yes \n")

      ;; NOTE: Davin words
      (insert ";; Davin Pearson farticus foomatic smegs smegulate the smegulators dregulator doggerel \n")

      ;; NOTE: HTML words
      (insert ";; apple banana carrot doughnut egg fish grape \n")

      ;; NOTE: Months
      (insert ";; January February March April May June July August September October November December \n")

      ;; NOTE: Website
      (insert "www.davinpearson.com align=justify \n")
      (insert "http://www.davinpearson.com\n")
      (insert "http://h1.ripway.com/davin/games/R4.html \n")
      (insert "http://h1.ripway.com/davin/research/2006/mopa2e.html \n")
      (insert "http://h1.ripway.com/davin/r4-version-0.2.zip  \n")
      (insert "http://davin.50webs.com davin.50webs.com \n")

      ;; NOTE: m4 stuff
      (insert "m4_under_construction \n")

      ;; NOTE: Arithmetickles words
      (insert "Arithmetickles arithmetickles-build")

      ;; NOTE: libd words
      (insert ";; ADDED! CHANGED! Array List Int ptr c-constructor-method c-destructor-method \n")
      (insert ";; cmethod cproperty c-static-method c-static-property \n")
      (insert "\n")

      ;; NOTE: java words
      (insert ";; ShouldNeverHappenException STUMP=A0\n")
      (insert "clean expr/CodeTest.run default ADDED! MOVED! REMOVED! SWAPPED! SWITCHED! \n")
      (insert "STUMP=A1 STUMP=A2 STUMP=A3 STUMP=A4 STUMP=A5 STUMP=A6 STUMP=A7 STUMP=A8 STUMP=A9 STUMP=A10 \n");
      (insert "STUMP=A11 STUMP=A12 STUMP=A13 STUMP=A14 STUMP=A15 STUMP=A16 STUMP=A17 STUMP=A18 STUMP=A19 STUMP=A20 \n");
      (insert "STUMP=A21 STUMP=A22 STUMP=A23 STUMP=A24 STUMP=A25 STUMP=A26 STUMP=A27 STUMP=A28 STUMP=A29 STUMP=A30 \n");
      (insert " davin.pearson@gmail.com \n")
      (insert "abcdefghijklmnopqrstuvwxyz \n")

      (insert "clean build-package \n")

      ;;(goto-char (point-max))

      )
    (insert "(setq list (thing-at-point 'word))")
    )
  ;;(d-f4)
  )

(add-hook 'after-init-hook 'd-after-init-hook)
(defun d-after-init-hook ()
  (save-window-excursion
    ;;(d-foo)
    (set-buffer "*scratch*")
    (goto-char (point-max))
    (if (fboundp 'd-movement--pad-buffer)
        (d-movement--pad-buffer))
      ))

(provide 'd-scratch)
;;; d-scratch.el ends here
