342
342
(if (fboundp 'defface)
344
344
(defmacro defface (var values doc &rest args)
346
(defvar (, var) (quote (, var)))
347
;; To make colors for your faces you need to set your .Xdefaults
348
;; or set them up ahead of time in your .emacs file.
346
(defvar ,var (quote ,var))
347
;; To make colors for your faces you need to set your .Xdefaults
348
;; or set them up ahead of time in your .emacs file.
351
351
(if (fboundp 'defcustom)
353
353
(defmacro defcustom (var value doc &rest args)
354
(` (defvar (, var) (, value) (, doc)))))))
354
`(defvar ,var ,value ,doc)))))
356
356
;; (eval-and-compile
357
357
;; (condition-case ()
1837
1837
;;(if (not (fboundp 'hilit-set-mode-patterns))
1838
1838
(if (featurep 'font-lock)
1840
(make-variable-buffer-local 'font-lock-defaults)
1841
1840
(setq font-lock-defaults '(gnuplot-font-lock-keywords t t))
1842
1841
(if gnuplot-xemacs-p (turn-on-font-lock))))
1843
1842
;;(if (featurep 'kw-compl)
1863
1862
(process-kill-without-query gnuplot-process nil)
1864
1863
(save-excursion
1865
1864
(set-buffer gnuplot-buffer)
1866
(make-local-hook 'kill-buffer-hook)
1867
(add-hook 'kill-buffer-hook 'gnuplot-close-down nil t)
1865
;; 'local does not automatically make hook buffer-local in XEmacs.
1866
(if (featurep 'xemacs)
1867
(make-local-hook 'kill-buffer-hook))
1868
(add-hook 'kill-buffer-hook 'gnuplot-close-down nil 'local)
1868
1869
(gnuplot-comint-start-function)
1869
1870
(make-local-variable 'comint-output-filter-functions)
1870
1871
(setq comint-output-filter-functions
2052
2053
(save-excursion
2053
2054
(save-excursion
2054
2055
(end-of-line 0)
2056
(re-search-backward "^[ \t]*." (point-min) "to_limit")
2057
(back-to-indentation)
2058
(setq indent (current-column))
2059
(if (looking-at "s?pl\\(o?\\|\\(ot\\)?\\)[ \t]+.?")
2060
(let ((plus (1- (length (match-string 0)))))
2063
(if (looking-at (regexp-quote "\\"))
2064
(setq indent (+ plus indent)))))))
2059
(if (looking-at "\\([^ \t\n]*[ \t]+\\).*\\\\$")
2060
(setq indent (length (match-string 1)))
2065
2065
(if (= (current-indentation) indent)
2068
2067
(delete-horizontal-space)
2069
(insert (make-string indent ? ))))
2070
(if (looking-at "[ \t]+$")
2068
(insert (make-string indent ? )))
2073
2072
;; FWIW, here are all the options which can be negated:
2074
2073
;; (insert (format "%s"
2173
2172
'((gnuplot-mode
2174
2173
"[a-zA-Z][_a-zA-Z0-9]*" nil
2175
2174
(("(gnuplot)Top" nil "[_a-zA-Z0-9]+")
2176
("(gnuplot)Commands" nil "[_a-zA-Z0-9]+")
2177
("(gnuplot)Functions" nil "[_a-zA-Z0-9]+")
2175
("(gnuplot)Command_Index" nil "[_a-zA-Z0-9]+")
2176
("(gnuplot)Function_Index" nil "[_a-zA-Z0-9]+")
2177
("(gnuplot)Options_Index" nil "[_a-zA-Z0-9]+")
2178
2178
("(gnuplot)plot" nil "[_a-zA-Z0-9]+")
2179
2179
("(gnuplot)set-show" nil "[_a-zA-Z0-9]+")
2180
2180
("(gnuplot)data-file" nil "[_a-zA-Z0-9]+")
2181
2181
("(gnuplot)smooth" nil "[_a-zA-Z0-9]+")
2182
2182
("(gnuplot)style" nil "[_a-zA-Z0-9]+")
2183
("(gnuplot)terminal" nil "[_a-zA-Z0-9]+")
2183
("(gnuplot)Terminal_Index" nil "[_a-zA-Z0-9]+")
2184
2184
;;("(gnuplot)General Index" nil "[_a-zA-Z0-9]+")
2185
2185
) "[_a-zA-Z0-9]+" ))) ))
2187
(info-lookup-maybe-add-help
2188
:mode 'gnuplot-mode :topic 'symbol
2189
:regexp "[a-zA-Z][_a-zA-Z0-9]*"
2190
:doc-spec '(("(gnuplot)Top" nil "[_a-zA-Z0-9]+")
2191
("(gnuplot)Commands" nil "[_a-zA-Z0-9]+")
2192
("(gnuplot)Functions" nil "[_a-zA-Z0-9]+")
2193
("(gnuplot)plot" nil "[_a-zA-Z0-9]+")
2194
("(gnuplot)set-show" nil "[_a-zA-Z0-9]+")
2195
("(gnuplot)data-file" nil "[_a-zA-Z0-9]+")
2196
("(gnuplot)smooth" nil "[_a-zA-Z0-9]+")
2197
("(gnuplot)style" nil "[_a-zA-Z0-9]+")
2198
("(gnuplot)terminal" nil "[_a-zA-Z0-9]+")
2200
2188
;; this hook is my best way of working with info-look and
2201
2189
;; allowing multiple versions of the gnuplot-info file.
2202
2190
;; yes, this is a hassle.
2489
2477
(use-local-map gnuplot-mode-map)
2490
2478
(setq major-mode 'gnuplot-mode
2491
2479
mode-name "Gnuplot")
2480
(eval-after-load "info-look"
2481
'(info-lookup-maybe-add-help
2482
:mode 'gnuplot-mode :topic 'symbol
2483
:regexp "[a-zA-Z][_a-zA-Z0-9]*"
2484
:doc-spec '(("(gnuplot)Top" nil "[_a-zA-Z0-9]+")
2485
("(gnuplot)Command_Index" nil "[_a-zA-Z0-9]+")
2486
("(gnuplot)Function_Index" nil "[_a-zA-Z0-9]+")
2487
("(gnuplot)Options_Index" nil "[_a-zA-Z0-9]+")
2488
("(gnuplot)plot" nil "[_a-zA-Z0-9]+")
2489
("(gnuplot)set-show" nil "[_a-zA-Z0-9]+")
2490
("(gnuplot)data-file" nil "[_a-zA-Z0-9]+")
2491
("(gnuplot)smooth" nil "[_a-zA-Z0-9]+")
2492
("(gnuplot)style" nil "[_a-zA-Z0-9]+")
2493
("(gnuplot)Terminal_Index" nil "[_a-zA-Z0-9]+")
2492
2495
(set (make-local-variable 'comment-start) "# ")
2493
2496
(set (make-local-variable 'comment-end) "")
2494
2497
(set (make-local-variable 'comment-column) 32)
2515
2518
(if gnuplot-xemacs-p ; deal with font-lock
2516
2519
(if (fboundp 'turn-on-font-lock) (turn-on-font-lock))
2518
(make-variable-buffer-local 'font-lock-defaults)
2519
2521
(setq font-lock-defaults '(gnuplot-font-lock-keywords t t))))
2520
2522
;; (if (and gnuplot-xemacs-p gnuplot-toolbar-display-flag)
2521
2523
;; (condition-case () ; deal with the toolbar