# HG changeset patch # User Stefan Monnier # Date 1255532016 0 # Node ID 88a9e2cad33eb4eb88af27c673d0a332f41db604 # Parent aa17a8adf478bd47fcfae65377ef79a392025ea7 (ido-everywhere): Use define-minor-mode. diff -r aa17a8adf478 -r 88a9e2cad33e lisp/ChangeLog --- a/lisp/ChangeLog Wed Oct 14 14:49:13 2009 +0000 +++ b/lisp/ChangeLog Wed Oct 14 14:53:36 2009 +0000 @@ -1,3 +1,11 @@ +2009-10-14 Stefan Monnier + + * ido.el (ido-everywhere): Use define-minor-mode. + + * buff-menu.el (list-buffers, ctl-x-map): + Mark the entry points with ;;;###autoload cookies. + + 2009-10-14 Dan Nicolaescu * vc-git.el (vc-git-dir-extra-headers): Set the branch name @@ -172,14 +180,13 @@ 2009-10-08 Michael Albinus * net/tramp.el (tramp-file-name-real-user, tramp-file-name-domain) - (tramp-file-name-real-host, tramp-file-name-port): Apply - `save-match-data. + (tramp-file-name-real-host, tramp-file-name-port): + Apply `save-match-data. * net/tramp-smb.el (tramp-smb-handle-copy-directory): Handle the case both directories are remote. (tramp-smb-handle-expand-file-name): Implement "~" expansion. - (tramp-smb-maybe-open-connection): Flush the cache only if - necessary. + (tramp-smb-maybe-open-connection): Flush the cache only if necessary. 2009-10-08 Chong Yidong @@ -187,8 +194,8 @@ (ede-proj-target-makefile-objectcode): Use it. * cedet/ede/source.el (ede-want-any-source-files-p) - (ede-want-any-auxiliary-files-p, ede-want-any-files-p): Return - search result. This error was introduced while merging. + (ede-want-any-auxiliary-files-p, ede-want-any-files-p): + Return search result. This error was introduced while merging. 2009-10-07 Juanma Barranquero @@ -196,8 +203,8 @@ 2009-10-07 Glenn Morris - * emacs-lisp/autoload.el (batch-update-autoloads): Remove useless use of - concat. + * emacs-lisp/autoload.el (batch-update-autoloads): Remove useless use + of concat. 2009-10-07 Stefan Monnier diff -r aa17a8adf478 -r 88a9e2cad33e lisp/ido.el --- a/lisp/ido.el Wed Oct 14 14:49:13 2009 +0000 +++ b/lisp/ido.el Wed Oct 14 14:53:36 2009 +0000 @@ -366,16 +366,6 @@ (const :tag "Switch off all" nil)) :group 'ido) -(defcustom ido-everywhere nil - "Use ido everywhere for reading file names and directories. -Setting this variable directly does not work. Use `customize' or -call the function `ido-everywhere'." - :set #'(lambda (symbol value) - (ido-everywhere (if value 1 -1))) - :initialize 'custom-initialize-default - :type 'boolean - :group 'ido) - (defcustom ido-case-fold case-fold-search "Non-nil if searching of buffer and file names should ignore case." :type 'boolean @@ -1449,6 +1439,25 @@ ;; ido kill emacs hook (ido-save-history)) +(define-minor-mode ido-everywhere + "Toggle using ido speed-ups everywhere file and directory names are read. +With ARG, turn ido speed-up on if arg is positive, off otherwise." + :global t + :group 'ido + (when (get 'ido-everywhere 'file) + (setq read-file-name-function (car (get 'ido-everywhere 'file))) + (put 'ido-everywhere 'file nil)) + (when (get 'ido-everywhere 'buffer) + (setq read-buffer-function (car (get 'ido-everywhere 'buffer))) + (put 'ido-everywhere 'buffer nil)) + (when ido-everywhere + (when (memq ido-mode '(both file)) + (put 'ido-everywhere 'file (cons read-file-name-function nil)) + (setq read-file-name-function 'ido-read-file-name)) + (when (memq ido-mode '(both buffer)) + (put 'ido-everywhere 'buffer (cons read-buffer-function nil)) + (setq read-buffer-function 'ido-read-buffer)))) + (defvar ido-minor-mode-map-entry nil) ;;;###autoload @@ -1492,15 +1501,21 @@ (define-key map [remap insert-file] 'ido-insert-file) (define-key map [remap list-directory] 'ido-list-directory) (define-key map [remap dired] 'ido-dired) - (define-key map [remap find-file-other-window] 'ido-find-file-other-window) - (define-key map [remap find-file-read-only-other-window] 'ido-find-file-read-only-other-window) - (define-key map [remap find-file-other-frame] 'ido-find-file-other-frame) - (define-key map [remap find-file-read-only-other-frame] 'ido-find-file-read-only-other-frame)) + (define-key map [remap find-file-other-window] + 'ido-find-file-other-window) + (define-key map [remap find-file-read-only-other-window] + 'ido-find-file-read-only-other-window) + (define-key map [remap find-file-other-frame] + 'ido-find-file-other-frame) + (define-key map [remap find-file-read-only-other-frame] + 'ido-find-file-read-only-other-frame)) (when (memq ido-mode '(buffer both)) (define-key map [remap switch-to-buffer] 'ido-switch-buffer) - (define-key map [remap switch-to-buffer-other-window] 'ido-switch-buffer-other-window) - (define-key map [remap switch-to-buffer-other-frame] 'ido-switch-buffer-other-frame) + (define-key map [remap switch-to-buffer-other-window] + 'ido-switch-buffer-other-window) + (define-key map [remap switch-to-buffer-other-frame] + 'ido-switch-buffer-other-frame) (define-key map [remap insert-buffer] 'ido-insert-buffer) (define-key map [remap kill-buffer] 'ido-kill-buffer) (define-key map [remap display-buffer] 'ido-display-buffer)) @@ -1513,28 +1528,6 @@ (message "Ido mode %s" (if ido-mode "enabled" "disabled"))) -(defun ido-everywhere (arg) - "Toggle using ido speed-ups everywhere file and directory names are read. -With ARG, turn ido speed-up on if arg is positive, off otherwise." - (interactive "P") - (setq ido-everywhere (if arg - (> (prefix-numeric-value arg) 0) - (not ido-everywhere))) - (when (get 'ido-everywhere 'file) - (setq read-file-name-function (car (get 'ido-everywhere 'file))) - (put 'ido-everywhere 'file nil)) - (when (get 'ido-everywhere 'buffer) - (setq read-buffer-function (car (get 'ido-everywhere 'buffer))) - (put 'ido-everywhere 'buffer nil)) - (when ido-everywhere - (when (memq ido-mode '(both file)) - (put 'ido-everywhere 'file (cons read-file-name-function nil)) - (setq read-file-name-function 'ido-read-file-name)) - (when (memq ido-mode '(both buffer)) - (put 'ido-everywhere 'buffer (cons read-buffer-function nil)) - (setq read-buffer-function 'ido-read-buffer)))) - - ;;; IDO KEYMAP (defun ido-init-completion-maps () "Set up the completion keymaps used by `ido'."