diff options
| author | Richard M. Stallman | 1997-01-21 00:40:19 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-01-21 00:40:19 +0000 |
| commit | d1e49742c50297a3c0b73f0ea8ed09378545daa1 (patch) | |
| tree | f515d8f81981d33b9c75ef1c37e1360986b90bc1 | |
| parent | f7bbab75eab793b5c2f56ffa71619bd34468d956 (diff) | |
| download | emacs-d1e49742c50297a3c0b73f0ea8ed09378545daa1.tar.gz emacs-d1e49742c50297a3c0b73f0ea8ed09378545daa1.zip | |
Merge in octave.el; don't require octave.el.
Don't require octave-inf.el.
(octave-mode): Delete the startup message.
(octave-maintainer-address): Add bug-gnu-emacs.
(octave-version): Variable deleted.
(octave-submit-bug-report): Use emacs-version.
| -rw-r--r-- | lisp/progmodes/octave-mod.el | 192 |
1 files changed, 186 insertions, 6 deletions
diff --git a/lisp/progmodes/octave-mod.el b/lisp/progmodes/octave-mod.el index 4c87ec2b0f7..ab08b0e4718 100644 --- a/lisp/progmodes/octave-mod.el +++ b/lisp/progmodes/octave-mod.el | |||
| @@ -26,12 +26,20 @@ | |||
| 26 | 26 | ||
| 27 | ;;; Commentary: | 27 | ;;; Commentary: |
| 28 | 28 | ||
| 29 | ;;; Code: | 29 | ;; This package provides Emacs support for Octave. |
| 30 | ;; It defines Octave mode, a major mode for editing | ||
| 31 | ;; Octave code. | ||
| 32 | |||
| 33 | ;; The file octave-hlp.el provides `octave-help', a facility for looking up | ||
| 34 | ;; documentation on a symbol in the Octave info files. | ||
| 35 | |||
| 36 | ;; The file octave-inf.el contains code for interacting with an inferior | ||
| 37 | ;; Octave process using comint. | ||
| 30 | 38 | ||
| 31 | (require 'octave) | 39 | ;; See the documentation of `octave-mode', `octave-help' and |
| 40 | ;; `run-octave' for further information on usage and customization. | ||
| 32 | 41 | ||
| 33 | ;; Keep the debugger quiet | 42 | ;;; Code: |
| 34 | (eval-when-compile (load "octave-inf")) | ||
| 35 | 43 | ||
| 36 | (defvar octave-mode-map nil | 44 | (defvar octave-mode-map nil |
| 37 | "Keymap used in Octave mode.") | 45 | "Keymap used in Octave mode.") |
| @@ -1219,5 +1227,177 @@ code line." | |||
| 1219 | "\n"))) | 1227 | "\n"))) |
| 1220 | (mapconcat 'identity inferior-octave-output-list "\n"))) | 1228 | (mapconcat 'identity inferior-octave-output-list "\n"))) |
| 1221 | (terpri))) | 1229 | (terpri))) |
| 1222 | 1230 | ||
| 1223 | ;;; octave-mod.el ends here \ No newline at end of file | 1231 | (defconst octave-maintainer-address |
| 1232 | "Kurt Hornik <Kurt.Hornik@ci.tuwien.ac.at>, bug-gnu-emacs@prep.ai.mit.edu" | ||
| 1233 | "Current maintainer of the Emacs Octave package.") | ||
| 1234 | |||
| 1235 | (defvar octave-abbrev-table nil | ||
| 1236 | "Abbrev table for Octave's reserved words. | ||
| 1237 | Used in octave-mode and inferior-octave-mode buffers. | ||
| 1238 | All Octave abbrevs start with a grave accent (`).") | ||
| 1239 | (if octave-abbrev-table | ||
| 1240 | () | ||
| 1241 | (let ((ac abbrevs-changed)) | ||
| 1242 | (define-abbrev-table 'octave-abbrev-table ()) | ||
| 1243 | (define-abbrev octave-abbrev-table "`a" "all_va_args" nil) | ||
| 1244 | (define-abbrev octave-abbrev-table "`b" "break" nil) | ||
| 1245 | (define-abbrev octave-abbrev-table "`ca" "catch" nil) | ||
| 1246 | (define-abbrev octave-abbrev-table "`c" "continue" nil) | ||
| 1247 | (define-abbrev octave-abbrev-table "`el" "else" nil) | ||
| 1248 | (define-abbrev octave-abbrev-table "`eli" "elseif" nil) | ||
| 1249 | (define-abbrev octave-abbrev-table "`et" "end_try_catch" nil) | ||
| 1250 | (define-abbrev octave-abbrev-table "`eu" "end_unwind_protect" nil) | ||
| 1251 | (define-abbrev octave-abbrev-table "`ef" "endfor" nil) | ||
| 1252 | (define-abbrev octave-abbrev-table "`efu" "endfunction" nil) | ||
| 1253 | (define-abbrev octave-abbrev-table "`ei" "endif" nil) | ||
| 1254 | (define-abbrev octave-abbrev-table "`ew" "endwhile" nil) | ||
| 1255 | (define-abbrev octave-abbrev-table "`f" "for" nil) | ||
| 1256 | (define-abbrev octave-abbrev-table "`fu" "function" nil) | ||
| 1257 | (define-abbrev octave-abbrev-table "`gl" "global" nil) | ||
| 1258 | (define-abbrev octave-abbrev-table "`gp" "gplot" nil) | ||
| 1259 | (define-abbrev octave-abbrev-table "`gs" "gsplot" nil) | ||
| 1260 | (define-abbrev octave-abbrev-table "`if" "if ()" nil) | ||
| 1261 | (define-abbrev octave-abbrev-table "`rp" "replot" nil) | ||
| 1262 | (define-abbrev octave-abbrev-table "`r" "return" nil) | ||
| 1263 | (define-abbrev octave-abbrev-table "`t" "try" nil) | ||
| 1264 | (define-abbrev octave-abbrev-table "`up" "unwind_protect" nil) | ||
| 1265 | (define-abbrev octave-abbrev-table "`upc" "unwind_protect_cleanup" nil) | ||
| 1266 | (define-abbrev octave-abbrev-table "`w" "while ()" nil) | ||
| 1267 | (setq abbrevs-changed ac))) | ||
| 1268 | |||
| 1269 | (defvar octave-comment-char ?# | ||
| 1270 | "Character to start an Octave comment.") | ||
| 1271 | (defvar octave-comment-start | ||
| 1272 | (concat (make-string 1 octave-comment-char) " ") | ||
| 1273 | "String to insert to start a new Octave in-line comment.") | ||
| 1274 | (defvar octave-comment-start-skip "\\s<+\\s-*" | ||
| 1275 | "Regexp to match the start of an Octave comment up to its body.") | ||
| 1276 | |||
| 1277 | (defvar octave-begin-keywords | ||
| 1278 | '("for" "function" "if" "try" "unwind_protect" "while")) | ||
| 1279 | (defvar octave-else-keywords | ||
| 1280 | '("catch" "else" "elseif" "unwind_protect_cleanup")) | ||
| 1281 | (defvar octave-end-keywords | ||
| 1282 | '("end" "endfor" "endfunction" "endif" "end_try_catch" | ||
| 1283 | "end_unwind_protect" "endwhile")) | ||
| 1284 | |||
| 1285 | (defvar octave-reserved-words | ||
| 1286 | (append octave-begin-keywords octave-else-keywords octave-end-keywords | ||
| 1287 | '("all_va_args" "break" "continue" "global" "gplot" "gsplot" | ||
| 1288 | "replot" "return")) | ||
| 1289 | "Reserved words in Octave.") | ||
| 1290 | |||
| 1291 | (defvar octave-text-functions | ||
| 1292 | '("casesen" "cd" "chdir" "clear" "diary" "dir" "document" "echo" | ||
| 1293 | "edit_history" "format" "gset" "gshow" "help" "history" "hold" | ||
| 1294 | "load" "ls" "more" "run_history" "save" "set" "show" "type" | ||
| 1295 | "which" "who" "whos") | ||
| 1296 | "Text functions in Octave (these names are also reserved).") | ||
| 1297 | |||
| 1298 | (defvar octave-variables | ||
| 1299 | '("EDITOR" "EXEC_PATH" "F_DUPFD" "F_GETFD" "F_GETFL" "F_SETFD" | ||
| 1300 | "F_SETFL" "I" "IMAGEPATH" "INFO_FILE" "INFO_PROGRAM" "Inf" "J" | ||
| 1301 | "LOADPATH" "NaN" "OCTAVE_VERSION" "O_APPEND" "O_CREAT" "O_EXCL" | ||
| 1302 | "O_NONBLOCK" "O_RDONLY" "O_RDWR" "O_TRUNC" "O_WRONLY" "PAGER" "PS1" | ||
| 1303 | "PS2" "PS4" "PWD" "SEEK_CUR" "SEEK_END" "SEEK_SET" "__F_DUPFD__" | ||
| 1304 | "__F_GETFD__" "__F_GETFL__" "__F_SETFD__" "__F_SETFL__" "__I__" | ||
| 1305 | "__Inf__" "__J__" "__NaN__" "__OCTAVE_VERSION__" "__O_APPEND__" | ||
| 1306 | "__O_CREAT__" "__O_EXCL__" "__O_NONBLOCK__" "__O_RDONLY__" | ||
| 1307 | "__O_RDWR__" "__O_TRUNC__" "__O_WRONLY__" "__PWD__" "__SEEK_CUR__" | ||
| 1308 | "__SEEK_END__" "__SEEK_SET__" "__argv__" "__e__" "__eps__" | ||
| 1309 | "__error_text__" "__i__" "__inf__" "__j__" "__nan__" "__pi__" | ||
| 1310 | "__program_invocation_name__" "__program_name__" "__realmax__" | ||
| 1311 | "__realmin__" "__stderr__" "__stdin__" "__stdout__" "ans" "argv" | ||
| 1312 | "automatic_replot" "beep_on_error" "completion_append_char" | ||
| 1313 | "default_return_value" "default_save_format" | ||
| 1314 | "define_all_return_values" "do_fortran_indexing" "e" | ||
| 1315 | "echo_executing_commands" "empty_list_elements_ok" "eps" | ||
| 1316 | "error_text" "gnuplot_binary" "gnuplot_has_multiplot" "history_file" | ||
| 1317 | "history_size" "ignore_function_time_stamp" "implicit_str_to_num_ok" | ||
| 1318 | "inf" "nan" "nargin" "ok_to_lose_imaginary_part" | ||
| 1319 | "output_max_field_width" "output_precision" | ||
| 1320 | "page_output_immediately" "page_screen_output" "pi" | ||
| 1321 | "prefer_column_vectors" "prefer_zero_one_indexing" | ||
| 1322 | "print_answer_id_name" "print_empty_dimensions" | ||
| 1323 | "program_invocation_name" "program_name" "propagate_empty_matrices" | ||
| 1324 | "realmax" "realmin" "resize_on_range_error" | ||
| 1325 | "return_last_computed_value" "save_precision" "saving_history" | ||
| 1326 | "silent_functions" "split_long_rows" "stderr" "stdin" "stdout" | ||
| 1327 | "string_fill_char" "struct_levels_to_print" | ||
| 1328 | "suppress_verbose_help_message" "treat_neg_dim_as_zero" | ||
| 1329 | "warn_assign_as_truth_value" "warn_comma_in_global_decl" | ||
| 1330 | "warn_divide_by_zero" "warn_function_name_clash" | ||
| 1331 | "warn_missing_semicolon" "whitespace_in_literal_matrix") | ||
| 1332 | "Builtin variables in Octave.") | ||
| 1333 | |||
| 1334 | (defvar octave-function-header-regexp | ||
| 1335 | (concat "^\\s-*\\<\\(function\\)\\>" | ||
| 1336 | "\\([^=;\n]*=[ \t]*\\|[ \t]*\\)\\(\\w+\\)\\>") | ||
| 1337 | "Regexp to match an Octave function header. | ||
| 1338 | The string `function' and its name are given by the first and third | ||
| 1339 | parenthetical grouping.") | ||
| 1340 | |||
| 1341 | (defvar octave-font-lock-keywords | ||
| 1342 | (list | ||
| 1343 | ;; Fontify all builtin keywords. | ||
| 1344 | (cons (concat "\\<\\(" | ||
| 1345 | (mapconcat 'identity octave-reserved-words "\\|") | ||
| 1346 | (mapconcat 'identity octave-text-functions "\\|") | ||
| 1347 | "\\)\\>") | ||
| 1348 | 'font-lock-keyword-face) | ||
| 1349 | ;; Fontify all builtin operators. | ||
| 1350 | (cons "\\(&\\||\\|<=\\|>=\\|==\\|<\\|>\\|!=\\|!\\)" | ||
| 1351 | 'font-lock-reference-face) | ||
| 1352 | ;; Fontify all builtin variables. | ||
| 1353 | (cons (concat "\\<\\(" | ||
| 1354 | (mapconcat 'identity octave-variables "\\|") | ||
| 1355 | "\\)\\>") | ||
| 1356 | 'font-lock-variable-name-face) | ||
| 1357 | ;; Fontify all function declarations. | ||
| 1358 | (list octave-function-header-regexp | ||
| 1359 | '(1 font-lock-keyword-face) | ||
| 1360 | '(3 font-lock-function-name-face nil t))) | ||
| 1361 | "Additional Octave expressions to highlight.") | ||
| 1362 | |||
| 1363 | (defvar inferior-octave-buffer "*Inferior Octave*" | ||
| 1364 | "*Name of buffer for running an inferior Octave process.") | ||
| 1365 | |||
| 1366 | (defvar inferior-octave-process nil) | ||
| 1367 | |||
| 1368 | |||
| 1369 | ;;; Autoloads | ||
| 1370 | (autoload 'octave-mode "octave-mod" nil t) | ||
| 1371 | (autoload 'octave-help "octave-hlp" nil t) | ||
| 1372 | (autoload 'inferior-octave "octave-inf" nil t) | ||
| 1373 | (autoload 'run-octave "octave-inf" nil t) | ||
| 1374 | |||
| 1375 | |||
| 1376 | ;;; Bug reporting | ||
| 1377 | (defun octave-submit-bug-report () | ||
| 1378 | "Submit a bug report on the Emacs Octave package via mail." | ||
| 1379 | (interactive) | ||
| 1380 | (require 'reporter) | ||
| 1381 | (and | ||
| 1382 | (y-or-n-p "Do you want to submit a bug report? ") | ||
| 1383 | (reporter-submit-bug-report | ||
| 1384 | octave-maintainer-address | ||
| 1385 | (concat "Emacs version " emacs-version) | ||
| 1386 | (list | ||
| 1387 | 'octave-auto-newline | ||
| 1388 | 'octave-blink-matching-block | ||
| 1389 | 'octave-block-offset | ||
| 1390 | 'octave-comment-char | ||
| 1391 | 'octave-continuation-offset | ||
| 1392 | 'octave-continuation-string | ||
| 1393 | 'octave-help-files | ||
| 1394 | 'octave-mode-startup-message | ||
| 1395 | 'octave-send-echo-input | ||
| 1396 | 'octave-send-line-auto-forward | ||
| 1397 | 'octave-send-show-buffer)))) | ||
| 1398 | |||
| 1399 | ;;; provide ourself | ||
| 1400 | |||
| 1401 | (provide 'octave) | ||
| 1402 | |||
| 1403 | ;;; octave-mod.el ends here | ||