Commit graph

155 commits

Author SHA1 Message Date
Leo Liu
976cb06628 Re-implement smie matching block highlight using show-paren-data-function.
* emacs-lisp/smie.el (smie-matching-block-highlight)
(smie--highlight-matching-block-overlay)
(smie--highlight-matching-block-lastpos)
(smie-highlight-matching-block)
(smie-highlight-matching-block-mode): Remove.
(smie--matching-block-data-cache): New variable.
(smie--matching-block-data): New function.
(smie-setup): Use smie--matching-block-data for
show-paren-data-function.

* progmodes/octave.el (octave-mode-menu): Fix.
(octave-find-definition): Skip garbage lines.

Fixes: debbugs:14395
2013-06-05 15:40:02 +08:00
Leo Liu
c75c93c7ed * progmodes/octave.el (octave-mode-syntax-table): Give `.'
punctuation syntax.
(inferior-octave-minimal-columns)
(inferior-octave-last-column-width): New variables.
(inferior-octave-track-window-width-change): New function.
(inferior-octave-mode): Adjust column width so that Octave output,
for example from 'ls', can fit into the window nicely.
2013-06-01 11:38:36 +08:00
Leo Liu
f236dd8432 * lisp/emacs-lisp/smie.el (smie-highlight-matching-block): Always turn
off the highlight first.

* lisp/progmodes/octave.el (octave-indent-comment): Tweak regexps.
(octave-help): Small simplification.

* test/indent/octave.m: Tweak.
2013-05-29 14:50:48 +08:00
Leo Liu
837fd9af07 * progmodes/octave.el (inferior-octave-directory-tracker-resync):
New variable.
(inferior-octave-directory-tracker): Automatically re-sync
default-directory.
(octave-help): Improve handling of 'See also'.
2013-05-27 13:08:04 +08:00
Stefan Monnier
650cff3d87 * lisp/emacs-lisp/smie.el (smie-auto-fill): Rework to be more robust.
(smie-setup): Use add-function to set it.

* lisp/progmodes/octave.el (octave-smie-rules): Return nil rather than
0 after a semi-colon; it works better for smie-auto-fill.
(octave--indent-new-comment-line): New function.
(octave-indent-new-comment-line): Use it (indirectly).
(octave-mode): Don't disable smie-auto-fill.  Use add-function to
modify comment-line-break-function.
2013-05-24 15:37:55 -04:00
Leo Liu
85d090a95c * progmodes/octave.el (inferior-octave-startup): Fix bug#14433. 2013-05-22 23:28:42 +08:00
Leo Liu
3ac7cff4f4 Minor fix to last change 2013-05-22 07:19:03 +08:00
Leo Liu
ee44b62a9c * progmodes/octave.el (octave-mode-menu): Update and re-organize
menu items.
(octave-mode): Tweak fill-nobreak-predicate.
(inferior-octave-startup): Check process to avoid infinite loop.
(inferior-octave): Pop to buffer first to show abornmal process
exit information.
2013-05-22 07:05:16 +08:00
Leo Liu
9cc3e83f9d Simplify auto fill in Octave mode and some small improvements 2013-05-21 17:43:14 +08:00
Leo Liu
b4da2cbb0d Use octave-help-mode for the Octave Help buffer 2013-05-21 06:52:40 +08:00
Leo Liu
f6f87d33da Teach inferior-octave-startup to handle Octave > 3.7 2013-05-18 11:17:35 +08:00
Leo Liu
5e80b74f7a * progmodes/octave.el (inferior-octave-startup): Use OCTAVE_SRCDIR
instead.
(octave-source-directories): Don't check process.
(octave-source-directories, octave-find-definition): Doc fix.
2013-05-18 09:17:50 +08:00
Leo Liu
42caeb895d * newcomment.el (comment-search-backward): Stricter in finding
comment start. 

* progmodes/octave.el (octave-comment-start): Remove the SPC char.
(octave-comment-start-skip): Properly anchored.

Fixes: debbugs:14303
2013-05-18 06:46:10 +08:00
Leo Liu
c7a8fcacf9 * subr.el (delete-consecutive-dups): New function.
* ido.el (ido-set-matches-1): Use it.
* progmodes/octave.el (inferior-octave-completion-table): Use it.
* ido.el (ido-remove-consecutive-dups): Remove.
2013-05-17 10:43:41 +08:00
Leo Liu
2d4bf34b5b * progmodes/octave.el (octave-indent-defun): Mark obsolete.
(octave-mode-menu, octave-mode-map): Remove its uses.
2013-05-16 16:52:02 +08:00
Leo Liu
e3772e9833 * progmodes/octave.el (octave-goto-function-definition): Improve
and fix callers.
2013-05-15 16:17:22 +08:00
Leo Liu
6073d8f44a * progmodes/octave.el (octave-font-lock-texinfo-comment):
Fix invalid search bound error: wrong side of point.
2013-05-14 18:11:56 +08:00
Leo Liu
4d25fd7e52 * progmodes/octave.el (octave-font-lock-keywords): Fix error
during redisplay.
(octave-goto-function-definition, octave-find-definition): Minor tweaks.
2013-05-14 13:19:29 +08:00
Leo Liu
b0e069c2ac * progmodes/octave.el (octave-indent-comment): Fix indentation for %!.
(octave-comment-start-skip): Include %!.
(octave-mode): Set comment-start-skip to octave-comment-start-skip.
2013-05-13 15:24:22 +08:00
Leo Liu
f5a9432fa6 * progmodes/octave.el (octave-mode-map): Bind octave-indent-defun to
C-c C-q instead of C-M-q.
2013-05-13 09:36:42 +08:00
Leo Liu
2aeb3a1dba * progmodes/octave.el (octave-indent-comment): Fix the indentation
of ### or %%%.
2013-05-13 08:07:18 +08:00
Leo Liu
30ea8374a7 * progmodes/octave.el (inferior-octave-startup): Store the value
of __octave_srcdir__ for octave-source-directories.
(inferior-octave-check-process): New function refactored out of
inferior-octave-send-list-and-digest.
(octave-source-directories)
(octave-find-definition-filename-function): New variables.
(octave-source-directories)
(octave-find-definition-default-filename): New functions.
(octave-find-definition): Improve to find functions implemented in C++.
2013-05-12 12:10:40 +08:00
Leo Liu
c8730c3abe * progmodes/octave.el (octave-indent-comment): Improve.
(octave-eldoc-message-style, octave-eldoc-cache): New variables.
(octave-eldoc-function-signatures, octave-eldoc-function): New
functions.
(octave-mode, inferior-octave-mode): Add eldoc support.
2013-05-11 21:22:06 +08:00
Leo Liu
6980b0cabf * progmodes/octave.el (octave-begin-keywords, octave-end-keywords)
(octave-reserved-words, octave-smie-bnf-table)
(octave-smie-rules): Add new keywords from Octave 3.6.4.
2013-05-11 15:39:59 +08:00
Leo Liu
9dbdb67ed9 * progmodes/octave.el (octave-indent-comment): New function.
(octave-mode): Use it in smie-indent-functions.

Fixes: debbugs:14350
2013-05-11 14:20:10 +08:00
Leo Liu
083fe0d743 * progmodes/octave.el (octave-beginning-of-line)
(octave-end-of-line): Check before using up-list because it jumps
out of more syntactic contructs since moving to smie.
2013-05-11 11:50:34 +08:00
Leo Liu
f71c50d026 * progmodes/octave.el (inferior-octave-completion-table): No
longer a function and all uses changed.  Use cache to speed up
completion due to bug#11906.
(octave-beginning-of-defun): Re-write to be more general.
2013-05-10 14:26:42 +08:00
Leo Liu
455851dd0c * progmodes/octave.el (inferior-octave-completion-at-point):
Restore the broken file completion. 
(inferior-octave-startup): Fix incorrect highlighting for the
first prompt.

Fixes: debbugs:14300
2013-05-09 08:52:49 +08:00
Leo Liu
150194c32f * progmodes/octave.el (octave-smie-forward-token): Fix typo. 2013-05-07 12:53:31 +08:00
Stefan Monnier
ceb57e5997 * lisp/progmodes/octave.el (octave-smie-forward-token): Be more careful
about implicit semi-colons.

Fixes: debbugs:14218
2013-05-07 00:05:43 -04:00
Leo Liu
203a557223 * progmodes/octave.el (octave-syntax-propertize-function): Change
\'s syntax to escape when inside double-quoted strings. 
(octave-font-lock-keywords): Use octave-operator-regexp.
(octave-completion-at-point): Renamed from
octave-completion-at-point-function.
(inferior-octave-directory-tracker): Robustify.
(octave-text-functions): Remove and fix its uses.  No such things
any more.

Fixes: debbugs:14332
2013-05-07 07:46:07 +08:00
Stefan Monnier
1e2c18dfbd * lisp/progmodes/octave.el (octave-texinfo-font-lock-keywords): Remove.
(octave-font-lock-texinfo-comment): Use texinfo-font-lock-keywords with
some tweaks, instead.
2013-05-05 22:29:42 -04:00
Leo Liu
02502a5fd2 * progmodes/octave.el (octave-font-lock-keywords)
(octave-font-lock-texinfo-comment): Adjust for the byte-compiler.
(inferior-octave-send-list-and-digest): Improve error message.
(octave-mode, inferior-octave-mode): Use setq-local.
(octave-help): Set info-lookup-mode.
2013-05-05 23:29:51 +08:00
Leo Liu
c129b51f4b * progmodes/octave.el (inferior-octave-strip-ctrl-g)
(inferior-octave-output-filter): Remove.
(octave-send-region, inferior-octave-startup): Fix callers.
(inferior-octave-mode-map): Don't use comint-dynamic-complete.
(octave-binary-file-extensions): New user variable.
(octave-find-definition): Confirm if opening binary files.
(octave-help-file): Use octave-find-definition to get the binary
confirmation.
(octave-help): Adjust for octave-help-file change.
2013-05-05 12:49:27 +08:00
Leo Liu
d74a158186 * progmodes/octave.el (user-error): Alias to error if not defined. 2013-05-03 15:52:17 +08:00
Leo Liu
d4d0f9b31a * progmodes/octave.el (octave-completing-read)
(octave-goto-function-definition): New helpers.
(octave-help-buffer): New user variable.
(octave-help-file, octave-help-function): New button types.
(octave-help): New command and bind it to C-h ;.
(octave-find-definition): New command and bind it to M-.
2013-05-03 15:22:26 +08:00
Leo Liu
b54f978b83 * progmodes/octave.el (octave-font-lock-keywords): Do not
dehighlight 'end' in comments or strings.
2013-05-03 12:47:08 +08:00
Leo Liu
271350180c * progmodes/octave.el (octave-mode-syntax-table): Correct syntax
for \. 
(octave-font-lock-keywords): Include [ and {.

Fixes: debbugs:14332
2013-05-03 07:03:00 +08:00
Leo Liu
0d634d3a3c * progmodes/octave.el (inferior-octave-startup-file): Change default.
(inferior-octave): Remove calling comint-mode and return the buffer.
(inferior-octave-startup): Cosmetic changes.
2013-05-03 05:34:53 +08:00
Leo Liu
b4c8295e81 * progmodes/octave.el (octave-syntax-propertize-function): Include
the case when ' is at line beginning.

Fixes: debbugs:14336
2013-05-03 05:27:16 +08:00
Leo Liu
2640d52e4e * progmodes/octave.el: Compatible with older emacs-24 releases. 2013-05-02 01:25:03 +08:00
Leo Liu
d8ef28b19d * progmodes/octave.el (inferior-octave-has-built-in-variables):
Remove.  Buil-in variables were removed from Octave in 2007.
(inferior-octave-startup): Fix uses.
(comint-line-beginning-position): Remove compatibility code for
emacs 21.
2013-05-02 00:42:18 +08:00
Leo Liu
9b92c13baa * progmodes/octave.el (octave-abbrev-table): Remove abbrev
definitions.  Use completion-at-point to insert keywords.
(octave-abbrev-start): Remove.
(inferior-octave-mode, octave-mode): Use :abbrev-table instead.
2013-05-01 14:13:20 +08:00
Leo Liu
b12d33d7e4 * progmodes/octave.el (inferior-octave-prompt-read-only): Fix last
change.
2013-05-01 00:27:36 +08:00
Rüdiger Sonderfeld
5147fc1773 * progmodes/octave.el (inferior-octave-prompt-read-only): New user
variable.
2013-04-30 23:20:46 +08:00
Leo Liu
5b78d7fcc7 * progmodes/octave.el (octave-variables): Remove. No builtin
variables any more.  All converted to functions.
(octave-font-lock-keywords, octave-completion-at-point-function):
Fix uses.
(octave-font-lock-texinfo-comment): New user variable.
(octave-texinfo-font-lock-keywords): New variable for texinfo
comment block.
(octave-function-comment-block): New face.
(octave-font-lock-texinfo-comment): New function.
(octave-mode): Font lock texinfo comment block.
2013-04-30 22:23:03 +08:00
Leo Liu
38d8527bab * progmodes/octave.el (octave-font-lock-keywords): Handle 'end' in
indexing expression.
(octave-continuation-string): Do not use \.
(inferior-octave-complete-impossible): Remove.
(inferior-octave-completion-table)
(inferior-octave-completion-at-point): Remove its uses.
(inferior-octave-startup): completion_matches was introduced to
Octave in 1996 so safe to assume it.
(octave-function-file-comment): Improve to follow how Octave does it.
(octave-update-function-file-comment): Tweak.
2013-04-30 04:09:18 +08:00
Leo Liu
2ec12cb0f0 * progmodes/octave.el (inferior-octave-startup-hook): Obsolete.
(inferior-octave-startup): Remove inferior-octave-startup-hook.
(octave-function-file-comment): Fix typo.
(octave-sync-function-file-names): Use read-char-choice.
2013-04-29 12:37:36 +08:00
Leo Liu
b7260dd49c * files.el (basic-save-buffer): Don't let errors in
before-save-hook prevent saving buffer.

* progmodes/octave.el (octave-function-file-p)
(octave-skip-comment-forward, octave-function-file-comment)
(octave-update-function-file-comment): New functions.
(octave-mode-map): Bind C-c ; to
octave-update-function-file-comment.
(octave-mode-menu): Add octave-update-function-file-comment.
(octave-mode, inferior-octave-mode): Fix doc-string.
(octave-insert-defun): Conform to Octave's coding convention.

Fixes: debbugs:14285
2013-04-28 01:07:01 +08:00
Leo Liu
ff7210d55b * progmodes/octave.el (octave-sync-function-file-names): Fix last
change.
2013-04-27 01:11:04 +08:00