Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
b54f978b
Commit
b54f978b
authored
May 03, 2013
by
Leo Liu
Browse files
* progmodes/octave.el (octave-font-lock-keywords): Do not
dehighlight 'end' in comments or strings.
parent
27135018
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
17 deletions
+26
-17
lisp/ChangeLog
lisp/ChangeLog
+5
-0
lisp/progmodes/octave.el
lisp/progmodes/octave.el
+21
-17
No files found.
lisp/ChangeLog
View file @
b54f978b
2013-05-03 Leo Liu <sdl.web@gmail.com>
* progmodes/octave.el (octave-font-lock-keywords): Do not
dehighlight 'end' in comments or strings.
2013-05-02 Leo Liu <sdl.web@gmail.com>
* progmodes/octave.el (octave-mode-syntax-table): Correct syntax
...
...
lisp/progmodes/octave.el
View file @
b54f978b
...
...
@@ -100,30 +100,34 @@ parenthetical grouping.")
(
list
;; Fontify all builtin keywords.
(
cons
(
concat
"\\_<\\("
(
regexp-opt
(
append
octave-reserved-words
(
regexp-opt
(
append
octave-reserved-words
octave-text-functions
))
"\\)\\_>"
)
'font-lock-keyword-face
)
"\\)\\_>"
)
'font-lock-keyword-face
)
;; Note: 'end' also serves as the last index in an indexing expression.
;; Ref: http://www.mathworks.com/help/matlab/ref/end.html
'
(
"\\_<end\\_>"
(
0
(
save-excursion
(
condition-case
nil
(
progn
(
goto-char
(
match-beginning
0
))
(
backward-up-list
)
(
unless
(
memq
(
char-after
)
'
(
?\(
?\[
?\{
))
font-lock-keyword-face
))
(
error
font-lock-keyword-face
)))
t
))
'
((
lambda
(
limit
)
(
while
(
re-search-forward
"\\_<end\\_>"
limit
'move
)
(
let
((
beg
(
match-beginning
0
))
(
end
(
match-end
0
)))
(
unless
(
octave-in-string-or-comment-p
)
(
unwind-protect
(
progn
(
goto-char
beg
)
(
backward-up-list
)
(
when
(
memq
(
char-after
)
'
(
?\(
?\[
?\{
))
(
put-text-property
beg
end
'face
nil
)))
(
goto-char
end
)))))
nil
))
;; Fontify all builtin operators.
(
cons
"\\(&\\||\\|<=\\|>=\\|==\\|<\\|>\\|!=\\|!\\)"
(
if
(
boundp
'font-lock-builtin-face
)
'font-lock-builtin-face
'font-lock-preprocessor-face
))
(
if
(
boundp
'font-lock-builtin-face
)
'font-lock-builtin-face
'font-lock-preprocessor-face
))
;; Fontify all function declarations.
(
list
octave-function-header-regexp
'
(
1
font-lock-keyword-face
)
'
(
3
font-lock-function-name-face
nil
t
)))
'
(
1
font-lock-keyword-face
)
'
(
3
font-lock-function-name-face
nil
t
)))
"Additional Octave expressions to highlight."
)
(
defun
octave-syntax-propertize-function
(
start
end
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment