emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r118058: * imenu.el (imenu): Re-write for clarity.


From: Leo Liu
Subject: [Emacs-diffs] trunk r118058: * imenu.el (imenu): Re-write for clarity.
Date: Mon, 06 Oct 2014 04:02:10 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 118058
revision-id: address@hidden
parent: address@hidden
committer: Leo Liu <address@hidden>
branch nick: trunk
timestamp: Mon 2014-10-06 11:59:38 +0800
message:
  * imenu.el (imenu): Re-write for clarity.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/imenu.el                  imenu.el-20091113204419-o5vbwnq5f7feedwu-696
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-10-06 02:02:04 +0000
+++ b/lisp/ChangeLog    2014-10-06 03:59:38 +0000
@@ -1,3 +1,7 @@
+2014-10-06  Leo Liu  <address@hidden>
+
+       * imenu.el (imenu): Re-write for clarity.
+
 2014-10-06  Glenn Morris  <address@hidden>
 
        Remove calendar code obsolete since at least version 23.1.

=== modified file 'lisp/imenu.el'
--- a/lisp/imenu.el     2014-10-05 00:58:38 +0000
+++ b/lisp/imenu.el     2014-10-06 03:59:38 +0000
@@ -1034,16 +1034,13 @@
   (if (stringp index-item)
       (setq index-item (assoc index-item (imenu--make-index-alist))))
   (when index-item
-    (push-mark nil t)
-    (let* ((is-special-item (listp (cdr index-item)))
-          (function
-           (if is-special-item
-               (nth 2 index-item) imenu-default-goto-function))
-          (position (if is-special-item
-                        (cadr index-item) (cdr index-item)))
-          (args (if is-special-item (cdr (cddr index-item)))))
-      (apply function (car index-item) position args))
-    (run-hooks 'imenu-after-jump-hook)))
+    (pcase index-item
+      (`(,name ,pos ,fn . ,args)
+       (push-mark nil t)
+       (apply fn name pos args)
+       (run-hooks 'imenu-after-jump-hook))
+      (`(,name . ,pos) (imenu (list name pos imenu-default-goto-function)))
+      (_ (error "Unknown imenu item: %S" index-item)))))
 
 (provide 'imenu)
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]