From f236dd8432cad5f39088e4b99a44478e21930e4d Mon Sep 17 00:00:00 2001 From: Leo Liu Date: Wed, 29 May 2013 14:50:48 +0800 Subject: [PATCH] * 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. --- lisp/ChangeLog | 8 ++++++++ lisp/emacs-lisp/smie.el | 15 ++++++--------- lisp/progmodes/octave.el | 7 +++---- test/ChangeLog | 4 ++++ test/indent/octave.m | 2 +- 5 files changed, 22 insertions(+), 14 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c3c2cc829cb..219e3d902ea 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2013-05-29 Leo Liu + + * progmodes/octave.el (octave-indent-comment): Tweak regexps. + (octave-help): Small simplification. + + * emacs-lisp/smie.el (smie-highlight-matching-block): Always turn + off the highlight first. + 2013-05-29 Glenn Morris * progmodes/idlwave.el (idlwave-scan-user-lib-files) diff --git a/lisp/emacs-lisp/smie.el b/lisp/emacs-lisp/smie.el index 9e338a0f4be..a88b9d70930 100644 --- a/lisp/emacs-lisp/smie.el +++ b/lisp/emacs-lisp/smie.el @@ -1060,10 +1060,10 @@ This uses SMIE's tables and is expected to be placed on `post-self-insert-hook'. beg end (current-buffer)) (overlay-put smie--highlight-matching-block-overlay 'face 'smie-matching-block-highlight)))) - (save-excursion - (condition-case nil - (if (nth 8 (syntax-ppss)) - (overlay-put smie--highlight-matching-block-overlay 'face nil) + (overlay-put smie--highlight-matching-block-overlay 'face nil) + (unless (nth 8 (syntax-ppss)) + (save-excursion + (condition-case nil (let ((token (or (funcall beg-of-tok) (funcall beg-of-tok @@ -1082,11 +1082,8 @@ This uses SMIE's tables and is expected to be placed on `post-self-insert-hook'. (let ((beg (point)) (opener (funcall smie-forward-token-function))) (when (assoc opener smie-closer-alist) - (funcall highlight beg (point))))) - (t (overlay-put smie--highlight-matching-block-overlay - 'face nil))))) - (scan-error - (overlay-put smie--highlight-matching-block-overlay 'face nil))))))) + (funcall highlight beg (point))))))) + (scan-error))))))) (defvar smie--highlight-matching-block-timer nil) diff --git a/lisp/progmodes/octave.el b/lisp/progmodes/octave.el index 4985f5fb38e..bacd37b3d3c 100644 --- a/lisp/progmodes/octave.el +++ b/lisp/progmodes/octave.el @@ -446,11 +446,11 @@ Non-nil means always go to the next Octave code line after sending." (back-to-indentation) (cond ((octave-in-string-or-comment-p) nil) - ((looking-at-p "\\s<\\{3,\\}") + ((looking-at-p "\\(\\s<\\)\\1\\{2,\\}") 0) ;; Exclude %{, %} and %!. ((and (looking-at-p "\\s<\\(?:[^{}!]\\|$\\)") - (not (looking-at-p "\\s<\\s<"))) + (not (looking-at-p "\\(\\s<\\)\\1"))) (comment-choose-indent))))) @@ -1637,8 +1637,7 @@ if ismember(exist(\"%s\"), [2 3 5 103]) print_usage(\"%s\") endif\n" ;; Make 'See also' clickable (with-syntax-table octave-mode-syntax-table (when (re-search-forward "^\\s-*See also:" nil t) - (let ((end (or (save-excursion (re-search-forward "^\\s-*$" nil t)) - (point-max)))) + (let ((end (save-excursion (re-search-forward "^\\s-*$" nil t)))) (while (re-search-forward "\\_<\\(?:\\sw\\|\\s_\\)+\\_>" end t) (make-text-button (match-beginning 0) ;; If the match ends with . exclude it. diff --git a/test/ChangeLog b/test/ChangeLog index 8ab70c98c82..56e019ec4af 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,7 @@ +2013-05-29 Leo Liu + + * indent/octave.m: Tweak. + 2013-05-26 Aidan Gauland * tests/eshell.el: Rewrite tests using ERT. diff --git a/test/indent/octave.m b/test/indent/octave.m index 55f8cc045f4..e5bae850589 100644 --- a/test/indent/octave.m +++ b/test/indent/octave.m @@ -2311,7 +2311,7 @@ function dep = is_architecture_dependent (nm) ext(end) = []; else isglob = false; # I am a test - # me too + #%% me too ### I shall align to column 0 endif pos = findstr (nm, ext); -- 2.39.2