From 94912b884586d2b0258a33b793959c13ee34656c Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 17 Feb 2014 10:29:15 -0500 Subject: [PATCH] * lisp/ido.el (ido-file-internal): Remove unused var `d'. Use \` for to match BoS. Fit within 80n columns. --- lisp/ChangeLog | 8 ++++++-- lisp/ido.el | 43 ++++++++++++++++++++++++++----------------- 2 files changed, 32 insertions(+), 19 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7bea4f3727..c6c4264bcb 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2014-02-17 Stefan Monnier + + * ido.el (ido-file-internal): Remove unused var `d'. + Use \` for to match BoS. Fit within 80n columns. + 2014-02-17 Daniel Colascione * net/dbus.el (dbus-call-method): Work around bug#16775 by having @@ -24,8 +29,7 @@ * progmodes/sql.el: Version 3.4 (sql-oracle-options): New default value ("-L"). - (sql-mode-oracle-font-lock-keywords): Added placeholder - highlighting. + (sql-mode-oracle-font-lock-keywords): Add placeholder highlighting. (sql-placeholders-filter): Correct placeholder pattern. (sql-read-table-name): Bug fix. Detect absence of SQLi process. (sql-login-delay): New variable. diff --git a/lisp/ido.el b/lisp/ido.el index 6c12894335..9267274e0d 100644 --- a/lisp/ido.el +++ b/lisp/ido.el @@ -430,10 +430,10 @@ in merged file and directory lists." ;; (with-current-buffer name ;; (derived-mode-p 'c-mode))) ;; -;;(setq ido-ignore-buffers '("^ " ido-ignore-c-mode)) +;;(setq ido-ignore-buffers '("\\` " ido-ignore-c-mode)) ;; Examples for setting the value of ido-ignore-files -;;(setq ido-ignore-files '("^ " "\\.c\\'" "\\.h\\'")) +;;(setq ido-ignore-files '("\\` " "\\.c\\'" "\\.h\\'")) (defcustom ido-default-file-method 'raise-frame "How to visit a new file when using `ido-find-file'. @@ -2356,8 +2356,8 @@ If cursor is not at the end of the user input, move to end of input." (ido-directory-too-big-p ido-current-directory)))) (when (and (eq item 'file) - (or ido-use-url-at-point ido-use-filename-at-point)) - (let (fn d) + (or ido-use-url-at-point ido-use-filename-at-point)) + (let (fn) (require 'ffap) ;; Duplicate code from ffap-guesser as we want different ;; behavior for files and URLs. @@ -2375,17 +2375,19 @@ If cursor is not at the end of the user input, move to end of input." (if (eq ido-use-filename-at-point 'guess) (ffap-guesser) (ffap-string-at-point)))) - (not (string-match "^http:/" fn))) + (not (string-match "\\`http:/" fn))) (let ((absolute-fn (expand-file-name fn))) (cond ((file-directory-p absolute-fn) - (setq ido-current-directory (file-name-as-directory absolute-fn))) + (setq ido-current-directory + (file-name-as-directory absolute-fn))) ((file-directory-p (file-name-directory absolute-fn)) (setq ido-current-directory (file-name-directory absolute-fn)) (setq initial (file-name-nondirectory absolute-fn))))))))) (let (ido-saved-vc-hb - (vc-handled-backends (and (boundp 'vc-handled-backends) vc-handled-backends)) + (vc-handled-backends (and (boundp 'vc-handled-backends) + vc-handled-backends)) (ido-work-directory-index -1) (ido-work-file-index -1) (ido-find-literal nil)) @@ -2393,11 +2395,13 @@ If cursor is not at the end of the user input, move to end of input." (unless filename (setq ido-saved-vc-hb vc-handled-backends) (let ((minibuffer-completing-file-name t)) - (setq filename (ido-read-internal item - (or prompt "Find file: ") - 'ido-file-history - (and (eq method 'alt-file) buffer-file-name) - (confirm-nonexistent-file-or-buffer) initial)))) + (setq filename + (ido-read-internal item + (or prompt "Find file: ") + 'ido-file-history + (and (eq method 'alt-file) buffer-file-name) + (confirm-nonexistent-file-or-buffer) + initial)))) ;; Choose the file name: either the text typed in, or the head ;; of the list of matches @@ -2414,11 +2418,13 @@ If cursor is not at the end of the user input, move to end of input." ((eq ido-exit 'switch-to-buffer) (ido-buffer-internal - (if (memq method '(other-window other-frame)) method ido-default-buffer-method) + (if (memq method '(other-window other-frame)) + method ido-default-buffer-method) nil nil nil ido-text)) ((eq ido-exit 'insert-buffer) - (ido-buffer-internal 'insert 'insert-buffer "Insert buffer: " nil ido-text 'ido-enter-insert-file)) + (ido-buffer-internal 'insert 'insert-buffer "Insert buffer: " + nil ido-text 'ido-enter-insert-file)) ((eq ido-exit 'dired) (funcall (cond ((eq method 'other-window) 'dired-other-window) @@ -2438,7 +2444,8 @@ If cursor is not at the end of the user input, move to end of input." ((memq method '(dired list-directory)) (if (equal filename ".") (setq filename "")) - (let* ((dirname (ido-final-slash (concat ido-current-directory filename) t)) + (let* ((dirname (ido-final-slash + (concat ido-current-directory filename) t)) (file (substring dirname 0 -1))) (cond ((file-directory-p dirname) @@ -2459,7 +2466,8 @@ If cursor is not at the end of the user input, move to end of input." (ido-record-command method dirname) (ido-record-work-directory) (funcall method dirname)) - ((y-or-n-p (format "Directory %s does not exist. Create it? " filename)) + ((y-or-n-p (format "Directory %s does not exist. Create it? " + filename)) (ido-record-command method dirname) (ido-record-work-directory dirname) (make-directory-internal dirname) @@ -2505,7 +2513,8 @@ If cursor is not at the end of the user input, move to end of input." (ido-record-command 'find-file filename) (add-to-history 'file-name-history filename) (ido-record-work-directory) - (ido-visit-buffer (find-file-noselect filename nil ido-find-literal) method)))))) + (ido-visit-buffer (find-file-noselect filename nil ido-find-literal) + method)))))) (defun ido-existing-item-p () ;; Return non-nil if there is a matching item -- 2.20.1