diff options
| author | Gerd Moellmann | 2000-03-01 10:27:54 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-03-01 10:27:54 +0000 |
| commit | 6b62286235528eac4fc7ffe9eb7478c1cce24ddc (patch) | |
| tree | da02c2b2354aaeeb15d305a18c107891deb7e07d | |
| parent | 0a86e779336666b69a827056274737962bd45cbd (diff) | |
| download | emacs-6b62286235528eac4fc7ffe9eb7478c1cce24ddc.tar.gz emacs-6b62286235528eac4fc7ffe9eb7478c1cce24ddc.zip | |
(dired-filename-at-point): Add `@' to valid
file name characters.
(dired-filename-at-point): Handle ange-ftp file names.
| -rw-r--r-- | lisp/dired-x.el | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lisp/dired-x.el b/lisp/dired-x.el index 50cdb493dc1..63d51c7716f 100644 --- a/lisp/dired-x.el +++ b/lisp/dired-x.el | |||
| @@ -1611,10 +1611,10 @@ to test if that file exists. Use minibuffer after snatching filename." | |||
| 1611 | ;; preference for looking backward when not directly on a symbol. Not | 1611 | ;; preference for looking backward when not directly on a symbol. Not |
| 1612 | ;; perfect - point must be in middle of or end of filename. | 1612 | ;; perfect - point must be in middle of or end of filename. |
| 1613 | 1613 | ||
| 1614 | (let ((filename-chars ".a-zA-Z0-9---_/:$+") | 1614 | (let ((filename-chars ".a-zA-Z0-9---_/:$+@") |
| 1615 | (bol (save-excursion (beginning-of-line) (point))) | 1615 | (bol (save-excursion (beginning-of-line) (point))) |
| 1616 | (eol (save-excursion (end-of-line) (point))) | 1616 | (eol (save-excursion (end-of-line) (point))) |
| 1617 | start end filename) | 1617 | start end filename prefix) |
| 1618 | 1618 | ||
| 1619 | (save-excursion | 1619 | (save-excursion |
| 1620 | ;; First see if just past a filename. | 1620 | ;; First see if just past a filename. |
| @@ -1630,6 +1630,11 @@ to test if that file exists. Use minibuffer after snatching filename." | |||
| 1630 | (progn | 1630 | (progn |
| 1631 | (skip-chars-backward filename-chars) | 1631 | (skip-chars-backward filename-chars) |
| 1632 | (setq start (point)) | 1632 | (setq start (point)) |
| 1633 | (setq prefix | ||
| 1634 | (and (string-match "^\\w+@" | ||
| 1635 | (buffer-substring start eol)) | ||
| 1636 | "/")) | ||
| 1637 | (goto-char start) | ||
| 1633 | (if (string-match "[/~]" (char-to-string (preceding-char))) | 1638 | (if (string-match "[/~]" (char-to-string (preceding-char))) |
| 1634 | (setq start (1- start))) | 1639 | (setq start (1- start))) |
| 1635 | (skip-chars-forward filename-chars)) | 1640 | (skip-chars-forward filename-chars)) |
| @@ -1637,7 +1642,7 @@ to test if that file exists. Use minibuffer after snatching filename." | |||
| 1637 | (error "No file found around point!")) | 1642 | (error "No file found around point!")) |
| 1638 | 1643 | ||
| 1639 | ;; Return string. | 1644 | ;; Return string. |
| 1640 | (expand-file-name (buffer-substring start (point)))))) | 1645 | (expand-file-name (concat prefix (buffer-substring start (point))))))) |
| 1641 | 1646 | ||
| 1642 | (defun read-filename-at-point (prompt) | 1647 | (defun read-filename-at-point (prompt) |
| 1643 | ;;; Returns filename prompting with PROMPT with completion. If | 1648 | ;;; Returns filename prompting with PROMPT with completion. If |