Mercurial > emacs
comparison lisp/imenu.el @ 9176:5646f9ac8ec3
(imenu--cleanup): Changed 'mapc' to 'mapcar'.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Thu, 29 Sep 1994 06:32:06 +0000 |
parents | 109166e311ce |
children | a7b70665c937 |
comparison
equal
deleted
inserted
replaced
9175:df2f1773aa06 | 9176:5646f9ac8ec3 |
---|---|
3 ;; Copyright (C) 1994 Free Software Foundation, Inc. | 3 ;; Copyright (C) 1994 Free Software Foundation, Inc. |
4 | 4 |
5 ;; Author: Ake Stenhoff <etxaksf@aom.ericsson.se> | 5 ;; Author: Ake Stenhoff <etxaksf@aom.ericsson.se> |
6 ;; Lars Lindberg <lli@sypro.cap.se> | 6 ;; Lars Lindberg <lli@sypro.cap.se> |
7 ;; Created: 8 Feb 1994 | 7 ;; Created: 8 Feb 1994 |
8 ;; Version: 1.11 | 8 ;; Version: 1.12 |
9 ;; Keywords: tools | 9 ;; Keywords: tools |
10 ;; | 10 ;; |
11 ;; This program is free software; you can redistribute it and/or modify | 11 ;; This program is free software; you can redistribute it and/or modify |
12 ;; it under the terms of the GNU General Public License as published by | 12 ;; it under the terms of the GNU General Public License as published by |
13 ;; the Free Software Foundation; either version 2, or (at your option) | 13 ;; the Free Software Foundation; either version 2, or (at your option) |
40 ;; There are *examples* for index gathering functions for C/C++ and | 40 ;; There are *examples* for index gathering functions for C/C++ and |
41 ;; Lisp/Emacs Lisp but it is easy to customize for other modes. A | 41 ;; Lisp/Emacs Lisp but it is easy to customize for other modes. A |
42 ;; function for jumping to the chosen index position is also | 42 ;; function for jumping to the chosen index position is also |
43 ;; supplied. | 43 ;; supplied. |
44 | 44 |
45 ;;; Change Log: | |
46 ;; v1.11 Jul 26 1994 Ake Stenhoff | |
47 ;; Fixed bugs in 'imenu-add-to-menubar'. | |
48 ;; v1.10 Jul 21 1994 Ake Stenhoff | |
49 ;; Added support for markers. | |
50 ;; Changed the examples to use | |
51 ;; markers. | |
52 ;; Thanks [alon]. | |
53 ;; v1.9 Jun 14 1994 Ake Stenhoff | |
54 ;; Added 'imenu-add-to-menubar'. | |
55 ;; v1.7 Apr 12 1994 Ake Stenhoff | |
56 ;; Changed doc strings refering to symbols. | |
57 ;; Require 'cl' when compiling only. | |
58 ;; Only uses 'cl' macros. | |
59 ;; v1.6 Feb 28 1994 Ake Stenhoff | |
60 ;; Added alist as an optional argument to | |
61 ;; 'imenu-choose-buffer-index'. | |
62 ;; Thanks [dean]. | |
63 ;; v1.5 Feb 25 1994 Ake Stenhoff | |
64 ;; Added code to parse DEFSTRUCT, DEFCLASS, DEFTYPE, | |
65 ;; DEFINE-CONDITION in the lisp example function. | |
66 ;; Thanks [simon]. | |
67 ;; v1.4 Feb 18 1994 Ake Stenhoff | |
68 ;; Added 'imenu-create-submenu-name' for creating a submenu name. | |
69 ;; This is for getting a general look of submenu names. | |
70 ;; Added variable 'imenu-submenu-name-format' used by | |
71 ;; 'imenu-create-submenu-name'. | |
72 ;; v1.3 Feb 17 1994 Lars Lindberg | |
73 ;; Added 'imenu--flatten-index-alist' for flatten nexted index | |
74 ;; alists. | |
75 ;; New examples for lisp mode that utilizes the features better. | |
76 ;; Added the variable 'imenu-space-replacement'. | |
77 ;; The completion-buffer version of the index menu now replaces | |
78 ;; spaces in the index-names to make tokens of them. | |
79 ;; v1.2 Feb 14 1994 Ake Stenhoff & Lars Lindberg | |
80 ;; Now handles nested index lists. | |
81 ;; v1.1 Feb 9 1994 Ake Stenhoff & Lars Lindberg | |
82 ;; Better comments (?). | |
83 ;; v1.0 Feb 8 1994 Ake Stenhoff & Lars Lindberg | |
84 ;; Based on func-menu.el 3.5. | |
85 | |
86 ;;; Thanks goes to | 45 ;;; Thanks goes to |
87 ;; [simon] - Simon Leinen simon@lia.di.epfl.ch | 46 ;; [simon] - Simon Leinen simon@lia.di.epfl.ch |
88 ;; [dean] - Dean Andrews ada@unison.com | 47 ;; [dean] - Dean Andrews ada@unison.com |
89 ;; [alon] - Alon Albert al@mercury.co.il | 48 ;; [alon] - Alon Albert al@mercury.co.il |
49 ;; [greg] - Greg Thompson gregt@porsche.visix.COM | |
90 | 50 |
91 ;;; Code | 51 ;;; Code |
92 (eval-when-compile (require 'cl)) | 52 (eval-when-compile (require 'cl)) |
93 | 53 |
94 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 54 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
303 (defun imenu--cleanup (&optional alist) | 263 (defun imenu--cleanup (&optional alist) |
304 ;; Sets the markers in imenu--index-alist | 264 ;; Sets the markers in imenu--index-alist |
305 ;; point nowhere. | 265 ;; point nowhere. |
306 ;; if alist is provided use that list. | 266 ;; if alist is provided use that list. |
307 (and imenu--index-alist | 267 (and imenu--index-alist |
308 (mapc | 268 (mapcar |
309 (function | 269 (function |
310 (lambda (item) | 270 (lambda (item) |
311 (cond | 271 (cond |
312 ((markerp (cdr item)) | 272 ((markerp (cdr item)) |
313 (set-marker (cdr item) nil)) | 273 (set-marker (cdr item) nil)) |