Mercurial > emacs
changeset 73985:5783c1198e3b
(ido-copy-current-word): C-o copies region if active.
author | Kim F. Storm <storm@cua.dk> |
---|---|
date | Mon, 13 Nov 2006 22:05:06 +0000 |
parents | 4ef51aae669d |
children | 2443b8a6f498 |
files | lisp/ido.el |
diffstat | 1 files changed, 15 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- 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)