diff options
| author | Feng Li | 2013-01-10 10:36:01 -0500 |
|---|---|---|
| committer | Stefan Monnier | 2013-01-10 10:36:01 -0500 |
| commit | e6ed8f08460d9bc9af7109c5a8619b3d1d407bdf (patch) | |
| tree | b8e62bdf81bae00b909761fd5fa778951ef5710b | |
| parent | 327a6ccaa01cdcd220e74df4f71acf0ad7e92f5f (diff) | |
| download | emacs-e6ed8f08460d9bc9af7109c5a8619b3d1d407bdf.tar.gz emacs-e6ed8f08460d9bc9af7109c5a8619b3d1d407bdf.zip | |
* lisp/progmodes/which-func.el (which-function): Understand Semantic's use
of overlays in imenu--index-alist.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/imenu.el | 2 | ||||
| -rw-r--r-- | lisp/progmodes/which-func.el | 4 |
3 files changed, 10 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f26c009bf2b..f74abc427af 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2013-01-10 Feng Li <fengli@gmail.com> (tiny change) | ||
| 2 | |||
| 3 | * progmodes/which-func.el (which-function): Understand Semantic's use | ||
| 4 | of overlays in imenu--index-alist. | ||
| 5 | |||
| 1 | 2013-01-10 Wolfgang Jenkner <wjenkner@inode.at> | 6 | 2013-01-10 Wolfgang Jenkner <wjenkner@inode.at> |
| 2 | 7 | ||
| 3 | * man.el: Handle different "man -k" behaviors (bug#13160). Use utf-8. | 8 | * man.el: Handle different "man -k" behaviors (bug#13160). Use utf-8. |
diff --git a/lisp/imenu.el b/lisp/imenu.el index 0bfee770094..f64d1afe951 100644 --- a/lisp/imenu.el +++ b/lisp/imenu.el | |||
| @@ -447,6 +447,8 @@ Don't move point." | |||
| 447 | Simple elements in the alist look like (INDEX-NAME . POSITION). | 447 | Simple elements in the alist look like (INDEX-NAME . POSITION). |
| 448 | POSITION is the buffer position of the item; to go to the item | 448 | POSITION is the buffer position of the item; to go to the item |
| 449 | is simply to move point to that position. | 449 | is simply to move point to that position. |
| 450 | POSITION is passed to `imenu-default-goto-function', so it can be a non-number | ||
| 451 | if that variable has been changed (e.g. Semantic uses overlays for POSITIONs). | ||
| 450 | 452 | ||
| 451 | Special elements look like (INDEX-NAME POSITION FUNCTION ARGUMENTS...). | 453 | Special elements look like (INDEX-NAME POSITION FUNCTION ARGUMENTS...). |
| 452 | To \"go to\" a special element means applying FUNCTION | 454 | To \"go to\" a special element means applying FUNCTION |
diff --git a/lisp/progmodes/which-func.el b/lisp/progmodes/which-func.el index 0279319cc89..adf378f6bc7 100644 --- a/lisp/progmodes/which-func.el +++ b/lisp/progmodes/which-func.el | |||
| @@ -319,7 +319,9 @@ If no function name is found, return nil." | |||
| 319 | namestack (cons (car pair) namestack) | 319 | namestack (cons (car pair) namestack) |
| 320 | alist (cdr pair))) | 320 | alist (cdr pair))) |
| 321 | 321 | ||
| 322 | ((number-or-marker-p (setq mark (cdr pair))) | 322 | ((or (number-or-marker-p (setq mark (cdr pair))) |
| 323 | (and (overlayp mark) | ||
| 324 | (setq mark (overlay-start mark)))) | ||
| 323 | (when (and (>= (setq offset (- (point) mark)) 0) | 325 | (when (and (>= (setq offset (- (point) mark)) 0) |
| 324 | (< offset minoffset)) ; Find the closest item. | 326 | (< offset minoffset)) ; Find the closest item. |
| 325 | (setq minoffset offset | 327 | (setq minoffset offset |