emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/imenu.el [lexbind]


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/lisp/imenu.el [lexbind]
Date: Mon, 25 Oct 2004 00:43:00 -0400

Index: emacs/lisp/imenu.el
diff -c emacs/lisp/imenu.el:1.89.2.5 emacs/lisp/imenu.el:1.89.2.6
*** emacs/lisp/imenu.el:1.89.2.5        Sat Sep  4 09:24:35 2004
--- emacs/lisp/imenu.el Mon Oct 25 04:19:40 2004
***************
*** 317,325 ****
  ;;;;
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  
! ;; Return the current/previous sexp and the location of the sexp (its
! ;; beginning) without moving the point.
  (defun imenu-example--name-and-position ()
    (save-excursion
      (forward-sexp -1)
      ;; [ydi] modified for imenu-use-markers
--- 317,328 ----
  ;;;;
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  
! ;; FIXME: This is the only imenu-example-* definition that's actually used,
! ;; and it seems to only be used by cperl-mode.el.  We should just move it to
! ;; cperl-mode.el and remove the rest.
  (defun imenu-example--name-and-position ()
+   "Return the current/previous sexp and its (beginning) location.
+ Don't move point."
    (save-excursion
      (forward-sexp -1)
      ;; [ydi] modified for imenu-use-markers
***************
*** 549,560 ****
             (cond
              ((consp (cdr item))
               (imenu--truncate-items (cdr item)))
!             (t
!              ;; truncate if necessary
!              (if (and (numberp imenu-max-item-length)
!                       (> (length (car item)) imenu-max-item-length))
!                  (setcar item (substring (car item) 0
!                                          imenu-max-item-length)))))))
          menulist))
  
  
--- 552,561 ----
             (cond
              ((consp (cdr item))
               (imenu--truncate-items (cdr item)))
!             ;; truncate if necessary
!             ((and (numberp imenu-max-item-length)
!                   (> (length (car item)) imenu-max-item-length))
!              (setcar item (substring (car item) 0 imenu-max-item-length))))))
          menulist))
  
  
***************
*** 854,860 ****
  (defun imenu--completion-buffer (index-alist &optional prompt)
    "Let the user select from INDEX-ALIST in a completion buffer with PROMPT.
  
! Returns t for rescan and otherwise a position number."
    ;; Create a list for this buffer only when needed.
    (let ((name (thing-at-point 'symbol))
        choice
--- 855,861 ----
  (defun imenu--completion-buffer (index-alist &optional prompt)
    "Let the user select from INDEX-ALIST in a completion buffer with PROMPT.
  
! Return one of the entries in index-alist or nil."
    ;; Create a list for this buffer only when needed.
    (let ((name (thing-at-point 'symbol))
        choice
***************
*** 880,892 ****
                                  prepared-index-alist
                                  nil t nil 'imenu--history-list name)))
  
!     (cond ((not (stringp name)) nil)
!         ((string= name (car imenu--rescan-item)) t)
!         (t
!          (setq choice (assoc name prepared-index-alist))
!          (if (imenu--subalist-p choice)
!              (imenu--completion-buffer (cdr choice) prompt)
!            choice)))))
  
  (defun imenu--mouse-menu (index-alist event &optional title)
    "Let the user select from a buffer index from a mouse menu.
--- 881,891 ----
                                  prepared-index-alist
                                  nil t nil 'imenu--history-list name)))
  
!     (when (stringp name)
!       (setq choice (assoc name prepared-index-alist))
!       (if (imenu--subalist-p choice)
!         (imenu--completion-buffer (cdr choice) prompt)
!       choice))))
  
  (defun imenu--mouse-menu (index-alist event &optional title)
    "Let the user select from a buffer index from a mouse menu.
***************
*** 937,945 ****
                     (or (eq imenu-use-popup-menu t) mouse-triggered))
                (imenu--mouse-menu index-alist last-nonmenu-event)
              (imenu--completion-buffer index-alist prompt)))
!       (and (eq result t)
           (imenu--cleanup)
!          (setq imenu--index-alist nil)))
      result))
  
  ;;;###autoload
--- 936,944 ----
                     (or (eq imenu-use-popup-menu t) mouse-triggered))
                (imenu--mouse-menu index-alist last-nonmenu-event)
              (imenu--completion-buffer index-alist prompt)))
!       (and (equal result imenu--rescan-item)
           (imenu--cleanup)
!          (setq result t imenu--index-alist nil)))
      result))
  
  ;;;###autoload
***************
*** 1014,1020 ****
      nil))
  
  (defun imenu-default-goto-function (name position &optional rest)
!   "Move the point to the given position.
  
  NAME is ignored.  POSITION is where to move.  REST is also ignored.
  The ignored args just make this function have the same interface as a
--- 1013,1019 ----
      nil))
  
  (defun imenu-default-goto-function (name position &optional rest)
!   "Move to the given position.
  
  NAME is ignored.  POSITION is where to move.  REST is also ignored.
  The ignored args just make this function have the same interface as a
***************
*** 1054,1058 ****
  
  (provide 'imenu)
  
! ;;; arch-tag: 98a2f5f5-4b91-4704-b18c-3aacf77d77a7
  ;;; imenu.el ends here
--- 1053,1057 ----
  
  (provide 'imenu)
  
! ;; arch-tag: 98a2f5f5-4b91-4704-b18c-3aacf77d77a7
  ;;; imenu.el ends here




reply via email to

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