diff options
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/imenu.el | 23 |
2 files changed, 16 insertions, 11 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5713734fd80..a8d66839d12 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2013-02-28 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * imenu.el: Comment nitpicks. | ||
| 4 | |||
| 1 | 2013-02-28 Sam Steingold <sds@gnu.org> | 5 | 2013-02-28 Sam Steingold <sds@gnu.org> |
| 2 | 6 | ||
| 3 | * vc/diff-mode.el (diff-hunk-file-names): Handle filenames with spaces. | 7 | * vc/diff-mode.el (diff-hunk-file-names): Handle filenames with spaces. |
diff --git a/lisp/imenu.el b/lisp/imenu.el index c1077a49d1a..d79b0abeebc 100644 --- a/lisp/imenu.el +++ b/lisp/imenu.el | |||
| @@ -405,11 +405,11 @@ Don't move point." | |||
| 405 | ;; Regular expression to find C functions | 405 | ;; Regular expression to find C functions |
| 406 | (defvar imenu-example--function-name-regexp-c | 406 | (defvar imenu-example--function-name-regexp-c |
| 407 | (concat | 407 | (concat |
| 408 | "^[a-zA-Z0-9]+[ \t]?" ; type specs; there can be no | 408 | "^[a-zA-Z0-9]+[ \t]?" ; Type specs; there can be no |
| 409 | "\\([a-zA-Z0-9_*]+[ \t]+\\)?" ; more than 3 tokens, right? | 409 | "\\([a-zA-Z0-9_*]+[ \t]+\\)?" ; more than 3 tokens, right? |
| 410 | "\\([a-zA-Z0-9_*]+[ \t]+\\)?" | 410 | "\\([a-zA-Z0-9_*]+[ \t]+\\)?" |
| 411 | "\\([*&]+[ \t]*\\)?" ; pointer | 411 | "\\([*&]+[ \t]*\\)?" ; Pointer. |
| 412 | "\\([a-zA-Z0-9_*]+\\)[ \t]*(" ; name | 412 | "\\([a-zA-Z0-9_*]+\\)[ \t]*(" ; Name. |
| 413 | )) | 413 | )) |
| 414 | 414 | ||
| 415 | (defun imenu-example--create-c-index (&optional regexp) | 415 | (defun imenu-example--create-c-index (&optional regexp) |
| @@ -556,7 +556,7 @@ NOT share structure with ALIST." | |||
| 556 | (defun imenu--truncate-items (menulist) | 556 | (defun imenu--truncate-items (menulist) |
| 557 | "Truncate all strings in MENULIST to `imenu-max-item-length'." | 557 | "Truncate all strings in MENULIST to `imenu-max-item-length'." |
| 558 | (mapc (lambda (item) | 558 | (mapc (lambda (item) |
| 559 | ;; truncate if necessary | 559 | ;; Truncate if necessary. |
| 560 | (when (and (numberp imenu-max-item-length) | 560 | (when (and (numberp imenu-max-item-length) |
| 561 | (> (length (car item)) imenu-max-item-length)) | 561 | (> (length (car item)) imenu-max-item-length)) |
| 562 | (setcar item (substring (car item) 0 imenu-max-item-length))) | 562 | (setcar item (substring (car item) 0 imenu-max-item-length))) |
| @@ -575,7 +575,7 @@ See `imenu--index-alist' for the format of the index alist." | |||
| 575 | (or (not imenu-auto-rescan) | 575 | (or (not imenu-auto-rescan) |
| 576 | (and imenu-auto-rescan | 576 | (and imenu-auto-rescan |
| 577 | (> (buffer-size) imenu-auto-rescan-maxout)))) | 577 | (> (buffer-size) imenu-auto-rescan-maxout)))) |
| 578 | ;; Get the index; truncate if necessary | 578 | ;; Get the index; truncate if necessary. |
| 579 | (progn | 579 | (progn |
| 580 | (setq imenu--index-alist | 580 | (setq imenu--index-alist |
| 581 | (save-excursion | 581 | (save-excursion |
| @@ -687,8 +687,9 @@ The alternate method, which is the one most often used, is to call | |||
| 687 | (save-excursion | 687 | (save-excursion |
| 688 | (setq name (funcall imenu-extract-index-name-function))) | 688 | (setq name (funcall imenu-extract-index-name-function))) |
| 689 | (and (stringp name) | 689 | (and (stringp name) |
| 690 | ;; [ydi] updated for imenu-use-markers | 690 | ;; [ydi] Updated for imenu-use-markers. |
| 691 | (push (cons name (if imenu-use-markers (point-marker) (point))) | 691 | (push (cons name |
| 692 | (if imenu-use-markers (point-marker) (point))) | ||
| 692 | index-alist))) | 693 | index-alist))) |
| 693 | index-alist)) | 694 | index-alist)) |
| 694 | ;; Use generic expression if possible. | 695 | ;; Use generic expression if possible. |
| @@ -741,12 +742,12 @@ depending on PATTERNS." | |||
| 741 | (modify-syntax-entry c (cdr syn) table)) | 742 | (modify-syntax-entry c (cdr syn) table)) |
| 742 | (car syn)))) | 743 | (car syn)))) |
| 743 | (goto-char (point-max)) | 744 | (goto-char (point-max)) |
| 744 | (unwind-protect ; for syntax table | 745 | (unwind-protect ; For syntax table. |
| 745 | (save-match-data | 746 | (save-match-data |
| 746 | (set-syntax-table table) | 747 | (set-syntax-table table) |
| 747 | 748 | ||
| 748 | ;; map over the elements of imenu-generic-expression | 749 | ;; Map over the elements of imenu-generic-expression |
| 749 | ;; (typically functions, variables ...) | 750 | ;; (typically functions, variables ...). |
| 750 | (dolist (pat patterns) | 751 | (dolist (pat patterns) |
| 751 | (let ((menu-title (car pat)) | 752 | (let ((menu-title (car pat)) |
| 752 | (regexp (nth 1 pat)) | 753 | (regexp (nth 1 pat)) |
| @@ -1002,7 +1003,7 @@ The ignored args just make this function have the same interface as a | |||
| 1002 | function placed in a special index-item." | 1003 | function placed in a special index-item." |
| 1003 | (if (or (< position (point-min)) | 1004 | (if (or (< position (point-min)) |
| 1004 | (> position (point-max))) | 1005 | (> position (point-max))) |
| 1005 | ;; widen if outside narrowing | 1006 | ;; Widen if outside narrowing. |
| 1006 | (widen)) | 1007 | (widen)) |
| 1007 | (goto-char position)) | 1008 | (goto-char position)) |
| 1008 | 1009 | ||