# HG changeset patch # User Kim F. Storm # Date 1163455506 0 # Node ID 5783c1198e3b663e13d802a3535f6bb0e4342d61 # Parent 4ef51aae669d6b48a5cd74e90494fdb2be5bf17e (ido-copy-current-word): C-o copies region if active. diff -r 4ef51aae669d -r 5783c1198e3b lisp/ido.el --- a/lisp/ido.el Mon Nov 13 22:04:56 2006 +0000 +++ b/lisp/ido.el Mon Nov 13 22:05:06 2006 +0000 @@ -2917,18 +2917,21 @@ (let ((word (save-excursion (set-buffer ido-entry-buffer) (let ((p (point)) start-line end-line start-name name) - (beginning-of-line) - (setq start-line (point)) - (end-of-line) - (setq end-line (point)) - (goto-char p) - (if (re-search-backward "[^-_a-zA-Z0-9:./\\~@]" start-line 1) - (forward-char 1)) - (setq start-name (point)) - (re-search-forward "[-_a-zA-Z0-9:./\\~@]*" end-line 1) - (if (= start-name (point)) - nil - (buffer-substring-no-properties start-name (point))))))) + (if (and mark-active (/= p (mark))) + (setq start-name (mark)) + (beginning-of-line) + (setq start-line (point)) + (end-of-line) + (setq end-line (point)) + (goto-char p) + (if (re-search-backward "[^-_a-zA-Z0-9:./\\~@]" start-line 1) + (forward-char 1)) + (setq start-name (point)) + (re-search-forward "[-_a-zA-Z0-9:./\\~@]*" end-line 1) + (if (= start-name (point)) + (setq start-name nil))) + (and start-name + (buffer-substring-no-properties start-name (point))))))) (if (cond ((not word) nil) ((string-match "\\`[~/]" word)