Mercurial > emacs
comparison lisp/comint.el @ 53272:bb2708b976f1
(comint-quote-filename): Correctly handle backslash
in comint-file-name-quote-list.
author | Andreas Schwab <schwab@suse.de> |
---|---|
date | Wed, 24 Dec 2003 10:05:31 +0000 |
parents | 695cf19ef79e |
children | ab9195f48a6f |
comparison
equal
deleted
inserted
replaced
53271:00ac28166865 | 53272:bb2708b976f1 |
---|---|
2623 "Return FILENAME with magic characters quoted. | 2623 "Return FILENAME with magic characters quoted. |
2624 Magic characters are those in `comint-file-name-quote-list'." | 2624 Magic characters are those in `comint-file-name-quote-list'." |
2625 (if (null comint-file-name-quote-list) | 2625 (if (null comint-file-name-quote-list) |
2626 filename | 2626 filename |
2627 (let ((regexp | 2627 (let ((regexp |
2628 (format "\\(^\\|[^\\]\\)\\([%s]\\)" | 2628 (format "[%s]" |
2629 (mapconcat 'char-to-string comint-file-name-quote-list "")))) | 2629 (mapconcat 'char-to-string comint-file-name-quote-list "")))) |
2630 (save-match-data | 2630 (save-match-data |
2631 (while (string-match regexp filename) | 2631 (let ((i 0)) |
2632 (setq filename (replace-match "\\1\\\\\\2" nil nil filename))) | 2632 (while (string-match regexp filename i) |
2633 (setq filename (replace-match "\\\\\\&" nil nil filename)) | |
2634 (setq i (1+ (match-end 0))))) | |
2633 filename)))) | 2635 filename)))) |
2634 | 2636 |
2635 (defun comint-unquote-filename (filename) | 2637 (defun comint-unquote-filename (filename) |
2636 "Return FILENAME with quoted characters unquoted." | 2638 "Return FILENAME with quoted characters unquoted." |
2637 (if (null comint-file-name-quote-list) | 2639 (if (null comint-file-name-quote-list) |