------------------------------------------------------------ revno: 361 committer: Stefan Monnier <monn...@iro.umontreal.ca> branch nick: elpa timestamp: Sun 2013-03-03 20:22:01 -0500 message: * packages/sml-mode/sml-mode.el (sml-imenu-regexp): Make it a const. (sml-imenu-create-index): Don't assume we'll find an = after structure. modified: packages/sml-mode/sml-mode.el
=== modified file 'packages/sml-mode/sml-mode.el' --- a/packages/sml-mode/sml-mode.el 2013-01-24 23:37:44 +0000 +++ b/packages/sml-mode/sml-mode.el 2013-03-04 01:22:01 +0000 @@ -3,7 +3,7 @@ ;; Copyright (C) 1989,1999,2000,2004,2007,2010-2013 Free Software Foundation, Inc. ;; Maintainer: (Stefan Monnier) <monn...@iro.umontreal.ca> -;; Version: 6.3 +;; Version: 6.4 ;; Keywords: SML ;; Author: Lars Bo Nielsen ;; Olin Shivers @@ -656,7 +656,7 @@ ;;;; Imenu support ;;;; -(defvar sml-imenu-regexp +(defconst sml-imenu-regexp (concat "^[ \t]*\\(let[ \t]+\\)?" (regexp-opt (append sml-module-head-syms '("and" "fun" "datatype" "abstype" "type")) t) @@ -678,9 +678,9 @@ (name (sml-smie-forward-token))) ;; Eliminate trivial renamings. (when (or (not (member kind '("structure" "signature"))) - (progn (search-forward "=") - (forward-comment (point-max)) - (looking-at "sig\\|struct"))) + (when (search-forward "=" nil t) + (forward-comment (point-max)) + (looking-at "sig\\|struct"))) (push (cons (concat (make-string (/ column 2) ?\ ) name) location) alist))))) alist))