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


From: Stefan Monnier
Subject: [Emacs-diffs] Changes to emacs/lisp/imenu.el
Date: Wed, 14 Aug 2002 20:11:15 -0400

Index: emacs/lisp/imenu.el
diff -c emacs/lisp/imenu.el:1.89 emacs/lisp/imenu.el:1.90
*** emacs/lisp/imenu.el:1.89    Sun Mar 17 23:27:30 2002
--- emacs/lisp/imenu.el Wed Aug 14 20:11:15 2002
***************
*** 104,120 ****
    :type 'integer
    :group 'imenu)
  
! (defcustom imenu-always-use-completion-buffer-p nil
!   "*Set this to non-nil for displaying the index in a completion buffer.
! 
! `never' means never automatically display a listing of any kind.
! A value of nil (the default) means display the index as a mouse menu
! if the mouse was used to invoke `imenu'.
! Another non-nil value means always display the index in a completion buffer."
!   :type '(choice (const :tag "On Mouse" nil)
!                (const :tag "Never" never)
!                (other :tag "Always" t))
!   :group 'imenu)
  
  (defcustom imenu-after-jump-hook nil
    "*Hooks called after jumping to a place in the buffer.
--- 104,129 ----
    :type 'integer
    :group 'imenu)
  
! (defvar imenu-always-use-completion-buffer-p nil)
! (make-obsolete-variable 'imenu-always-use-completion-buffer-p
!                       'imenu-use-popup-menu "21.4")
! 
! (defcustom imenu-use-popup-menu
!   (if imenu-always-use-completion-buffer-p
!       (not (eq imenu-always-use-completion-buffer-p 'never))
!     'on-mouse)
!   "Use a popup menu rather than a minibuffer prompt.
! If nil, always use a minibuffer prompt.
! If t, always use a popup menu,
! If `on-mouse' use a popup menu when `imenu' was invoked with the mouse."
!   :type '(choice (const :tag "On Mouse" on-mouse)
!                (const :tag "Never" nil)
!                (other :tag "Always" t)))
! 
! (defcustom imenu-eager-completion-buffer
!   (not (eq imenu-always-use-completion-buffer-p 'never))
!   "If non-nil, eagerly popup the completion buffer."
!   :type 'boolean)
  
  (defcustom imenu-after-jump-hook nil
    "*Hooks called after jumping to a place in the buffer.
***************
*** 164,170 ****
    "*The replacement string for spaces in index names.
  Used when presenting the index in a completion buffer to make the
  names work as tokens."
!   :type 'string
    :group 'imenu)
  
  (defcustom imenu-level-separator ":"
--- 173,179 ----
    "*The replacement string for spaces in index names.
  Used when presenting the index in a completion buffer to make the
  names work as tokens."
!   :type '(choice string (const nil))
    :group 'imenu)
  
  (defcustom imenu-level-separator ":"
***************
*** 857,893 ****
    (let ((name (thing-at-point 'symbol))
        choice
        (prepared-index-alist
!        (mapcar
!         (lambda (item)
!           (cons (subst-char-in-string ?\ (aref imenu-space-replacement 0)
!                                       (car item))
!                 (cdr item)))
!         index-alist)))
      (when (stringp name)
        (setq name (or (imenu-find-default name prepared-index-alist) name)))
      (cond (prompt)
          ((and name (imenu--in-alist name prepared-index-alist))
           (setq prompt (format "Index item (default %s): " name)))
          (t (setq prompt "Index item: ")))
!     (if (eq imenu-always-use-completion-buffer-p 'never)
!       (setq name (completing-read prompt
!                                   prepared-index-alist
!                                   nil t nil 'imenu--history-list name))
!       (save-window-excursion
!       ;; Display the completion buffer
!       (with-output-to-temp-buffer "*Completions*"
!         (display-completion-list
!          (all-completions "" prepared-index-alist )))
!       (let ((minibuffer-setup-hook
!              (function
!               (lambda ()
!                 (let ((buffer (current-buffer)))
!                   (with-current-buffer "*Completions*"
!                     (setq completion-reference-buffer buffer)))))))
!         ;; Make a completion question
!         (setq name (completing-read prompt
!                                     prepared-index-alist
!                                     nil t nil 'imenu--history-list name)))))
      (cond ((not (stringp name)) nil)
          ((string= name (car imenu--rescan-item)) t)
          (t
--- 866,891 ----
    (let ((name (thing-at-point 'symbol))
        choice
        (prepared-index-alist
!        (if (not imenu-space-replacement) index-alist
!          (mapcar
!           (lambda (item)
!             (cons (subst-char-in-string ?\ (aref imenu-space-replacement 0)
!                                         (car item))
!                   (cdr item)))
!           index-alist))))
      (when (stringp name)
        (setq name (or (imenu-find-default name prepared-index-alist) name)))
      (cond (prompt)
          ((and name (imenu--in-alist name prepared-index-alist))
           (setq prompt (format "Index item (default %s): " name)))
          (t (setq prompt "Index item: ")))
!     (let ((minibuffer-setup-hook minibuffer-setup-hook))
!       ;; Display the completion buffer.
!       (if (not imenu-eager-completion-buffer)
!         (add-hook 'minibuffer-setup-hook 'minibuffer-completion-help))
!       (setq name (completing-read prompt
!                                 prepared-index-alist
!                                 nil t nil 'imenu--history-list name)))
      (cond ((not (stringp name)) nil)
          ((string= name (car imenu--rescan-item)) t)
          (t
***************
*** 923,929 ****
  With no index alist ALIST, it calls `imenu--make-index-alist' to
  create the index alist.
  
! If `imenu-always-use-completion-buffer-p' is non-nil, then the
  completion buffer is always used, no matter if the mouse was used or
  not.
  
--- 921,927 ----
  With no index alist ALIST, it calls `imenu--make-index-alist' to
  create the index alist.
  
! If `imenu-use-popup-menu' is non-nil, then the
  completion buffer is always used, no matter if the mouse was used or
  not.
  
***************
*** 941,948 ****
      (while (eq result t)
        (setq index-alist (if alist alist (imenu--make-index-alist)))
        (setq result
!           (if (and mouse-triggered
!                    (not imenu-always-use-completion-buffer-p))
                (imenu--mouse-menu index-alist last-nonmenu-event)
              (imenu--completion-buffer index-alist prompt)))
        (and (eq result t)
--- 939,946 ----
      (while (eq result t)
        (setq index-alist (if alist alist (imenu--make-index-alist)))
        (setq result
!           (if (and imenu-use-popup-menu
!                    (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)




reply via email to

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