--- minibuf.el.~1~ 2006-06-28 17:00:03.000000000 -0700 +++ minibuf.el 2006-06-28 17:01:05.000000000 -0700 @@ -1863,6 +1863,8 @@ (defun read-file-name-internal (string dir action) + (let ((completion-ignore-case + (memq system-type '(ms-dos windows-nt darwin)))) (read-file-name-internal-1 string dir action #'(lambda (action orig string specdir dir name) @@ -1903,6 +1905,7 @@ ;; substitute-in-file-name did something tem val))))))))) + ) (defun read-directory-name-internal (string dir action) (read-file-name-internal-1 --- comint.el.~1~ 2006-06-28 16:59:13.000000000 -0700 +++ comint.el 2006-06-28 16:59:25.000000000 -0700 @@ -2248,7 +2248,9 @@ (defun comint-dynamic-complete-as-filename () "Dynamically complete at point as a filename. See `comint-dynamic-complete-filename'. Returns t if successful." - (let* ((completion-ignore-case (memq system-type '(ms-dos windows-nt))) + (let* ((completion-ignore-case (memq system-type '(ms-dos windows-nt + darwin ; #### jwz + ))) (completion-ignored-extensions comint-completion-fignore) ;; If we bind this, it breaks remote directory tracking in rlogin.el. ;; I think it was originally bound to solve file completion problems, @@ -2283,9 +2285,18 @@ (comint-dynamic-list-filename-completions)) (t ; Completion string returned. (let ((file (concat (file-name-as-directory directory) completion))) - (insert (comint-quote-filename - (substring (directory-file-name completion) - (length pathnondir)))) + + ;; jwz: when completing "mus" to "Music", instead of just + ;; inserting "ic", delete "mus" and insert "Music" to get + ;; the case right when using a case-insensitive file system. + ;; + ;; (insert (comint-quote-filename + ;; (substring (directory-file-name completion) + ;; (length pathnondir)))) + + (delete-char (- (length (comint-quote-filename pathnondir)))) + (insert (comint-quote-filename (directory-file-name completion))) + (cond ((symbolp (file-name-completion completion directory)) ;; We inserted a unique completion. (insert (if (file-directory-p file) dirsuffix filesuffix))