diff options
| author | Leo Liu | 2014-10-06 11:59:38 +0800 |
|---|---|---|
| committer | Leo Liu | 2014-10-06 11:59:38 +0800 |
| commit | 195c5c4c925cfced8d720659dc638b434282f29b (patch) | |
| tree | 7224345fcfbaf5c7a057ebeef9a02988bc332570 | |
| parent | 3f65970414538063e38ada2a47cb4ef4f35b630e (diff) | |
| download | emacs-195c5c4c925cfced8d720659dc638b434282f29b.tar.gz emacs-195c5c4c925cfced8d720659dc638b434282f29b.zip | |
* imenu.el (imenu): Re-write for clarity.
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/imenu.el | 17 |
2 files changed, 11 insertions, 10 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a04e6d2b91d..c118209933d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2014-10-06 Leo Liu <sdl.web@gmail.com> | ||
| 2 | |||
| 3 | * imenu.el (imenu): Re-write for clarity. | ||
| 4 | |||
| 1 | 2014-10-06 Glenn Morris <rgm@gnu.org> | 5 | 2014-10-06 Glenn Morris <rgm@gnu.org> |
| 2 | 6 | ||
| 3 | Remove calendar code obsolete since at least version 23.1. | 7 | Remove calendar code obsolete since at least version 23.1. |
diff --git a/lisp/imenu.el b/lisp/imenu.el index 3159b6cc563..5bad4c09c44 100644 --- a/lisp/imenu.el +++ b/lisp/imenu.el | |||
| @@ -1034,16 +1034,13 @@ for more information." | |||
| 1034 | (if (stringp index-item) | 1034 | (if (stringp index-item) |
| 1035 | (setq index-item (assoc index-item (imenu--make-index-alist)))) | 1035 | (setq index-item (assoc index-item (imenu--make-index-alist)))) |
| 1036 | (when index-item | 1036 | (when index-item |
| 1037 | (push-mark nil t) | 1037 | (pcase index-item |
| 1038 | (let* ((is-special-item (listp (cdr index-item))) | 1038 | (`(,name ,pos ,fn . ,args) |
| 1039 | (function | 1039 | (push-mark nil t) |
| 1040 | (if is-special-item | 1040 | (apply fn name pos args) |
| 1041 | (nth 2 index-item) imenu-default-goto-function)) | 1041 | (run-hooks 'imenu-after-jump-hook)) |
| 1042 | (position (if is-special-item | 1042 | (`(,name . ,pos) (imenu (list name pos imenu-default-goto-function))) |
| 1043 | (cadr index-item) (cdr index-item))) | 1043 | (_ (error "Unknown imenu item: %S" index-item))))) |
| 1044 | (args (if is-special-item (cdr (cddr index-item))))) | ||
| 1045 | (apply function (car index-item) position args)) | ||
| 1046 | (run-hooks 'imenu-after-jump-hook))) | ||
| 1047 | 1044 | ||
| 1048 | (provide 'imenu) | 1045 | (provide 'imenu) |
| 1049 | 1046 | ||