From: Glenn Morris Date: Mon, 7 Mar 2011 08:56:30 +0000 (-0800) Subject: vc.el fix for bug#6146. X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~653 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7e319d3cc31d6735616e9f68c81042b4920e43e8;p=emacs.git vc.el fix for bug#6146. * lisp/vc/vc.el (vc-next-action): Add missing space to y-or-n-p prompt. Give an explicit error if failed to make writable. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index effb2a3038a..4ff65b16c6d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,6 +1,7 @@ 2011-03-07 Glenn Morris * vc/vc.el (vc-next-action): Add missing space to y-or-n-p prompt. + Give an explicit error if failed to make writable. (Bug#6146) 2011-03-07 Ed Reingold diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 2fb397ed6f8..7f55ffdbdad 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -1117,7 +1117,10 @@ merge in the changes into your working copy." ;; Make the file+buffer read-write. (unless (y-or-n-p (format "%s is edited but read-only; make it writable and continue? " file)) (error "Aborted")) - (set-file-modes file (logior (file-modes file) 128)) + ;; Maybe we somehow lost permissions on the directory. + (condition-case nil + (set-file-modes file (logior (file-modes file) 128)) + (error (error "Unable to make file writable"))) (let ((visited (get-file-buffer file))) (when visited (with-current-buffer visited