From: Xue Fuqiao Date: Tue, 30 Jul 2013 03:46:06 +0000 (+0800) Subject: vc-ignore fixes. X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~1697 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5c09de04ca053874f37281e22ea5556590875be2;p=emacs.git vc-ignore fixes. * vc/vc-svn.el (vc-svn-ignore): Remove `interactive'. Use `*vc*' buffer for output. * vc/vc-hg.el (vc-hg-ignore): Remove `interactive'; do not assume point-min==1; fix search string; fix parentheses missing. * vc/vc-git.el (vc-git-ignore): Remove `interactive'; do not assume point-min==1; fix search string; fix parentheses missing. * vc/vc-cvs.el (vc-cvs-ignore): Remove `interactive'. * vc/vc-bzr.el (vc-bzr-ignore): Remove `interactive'. Use `*vc*' buffer for output. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f27a6fa1945..082dd75439e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,19 @@ +2013-07-30 Xue Fuqiao + + * vc/vc-svn.el (vc-svn-ignore): Remove `interactive'. Use `*vc*' + buffer for output. + + * vc/vc-hg.el (vc-hg-ignore): Remove `interactive'; do not assume + point-min==1; fix search string; fix parentheses missing. + + * vc/vc-git.el (vc-git-ignore): Remove `interactive'; do not + assume point-min==1; fix search string; fix parentheses missing. + + * vc/vc-cvs.el (vc-cvs-ignore): Remove `interactive'. + + * vc/vc-bzr.el (vc-bzr-ignore): Remove `interactive'. Use `*vc*' + buffer for output. + 2013-07-29 Eli Zaretskii * frame.el (frame-notice-user-settings): Avoid inflooping when the diff --git a/lisp/vc/vc-bzr.el b/lisp/vc/vc-bzr.el index 5f026a2ecd9..9d2adde8554 100644 --- a/lisp/vc/vc-bzr.el +++ b/lisp/vc/vc-bzr.el @@ -653,9 +653,7 @@ REV non-nil gets an error." (defun vc-bzr-ignore (file) "Ignore FILE under Bazaar." - (interactive) - (vc-bzr-command "ignore" (get-buffer-create "*vc-ignore*") 0 - file)) + (vc-bzr-command "ignore" t 0 file)) (defun vc-bzr-checkout (_file &optional _editable rev) (if rev (error "Operation not supported") diff --git a/lisp/vc/vc-cvs.el b/lisp/vc/vc-cvs.el index 3472673f46d..48d83d4f408 100644 --- a/lisp/vc/vc-cvs.el +++ b/lisp/vc/vc-cvs.el @@ -1228,7 +1228,6 @@ is non-nil." (defun vc-cvs-ignore (file) "Ignore FILE under CVS." - (interactive) (cvs-append-to-ignore (file-name-directory file) file)) (defun cvs-append-to-ignore (dir str &optional old-dir) diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 2183fef4e7d..4716d13da13 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -682,15 +682,14 @@ It is based on `log-edit-mode', and has Git-specific extensions.") (defun vc-git-ignore (file) "Ignore FILE under Git." - (interactive) (with-temp-buffer (insert-file-contents - (let (gitignore (concat (file-name-as-directory (vc-git-root - default-directory)) ".gitignore")) - (unless (search-forward file nil t) + (let ((gitignore (concat (file-name-as-directory (vc-git-root + default-directory)) ".gitignore"))) + (unless (search-forward (concat "\n" file "\n") nil t) (goto-char (point-max)) (insert (concat "\n" file "\n")) - (write-region 1 (point-max) gitignore)))))) + (write-region (point-min) (point-max) gitignore)))))) (defun vc-git-checkout (file &optional _editable rev) (vc-git-command nil 0 file "checkout" (or rev "HEAD"))) diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index dd9ff003493..bc125e2cfa6 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el @@ -461,15 +461,14 @@ REV is ignored." (defun vc-hg-ignore (file) "Ignore FILE under Mercurial." - (interactive) (with-temp-buffer (insert-file-contents - (let (hgignore (concat (file-name-as-directory (vc-hg-root - default-directory)) ".hgignore")) - (unless (search-forward file nil t) + (let ((hgignore (concat (file-name-as-directory (vc-hg-root + default-directory)) ".hgignore"))) + (unless (search-forward (concat "\n" file "\n") nil t) (goto-char (point-max)) (insert (concat "\n" file "\n")) - (write-region 1 (point-max) hgignore)))))) + (write-region (point-min) (point-max) hgignore)))))) ;; Modeled after the similar function in vc-bzr.el (defun vc-hg-checkout (file &optional _editable rev) diff --git a/lisp/vc/vc-svn.el b/lisp/vc/vc-svn.el index 7851aac435e..743a4d5cb67 100644 --- a/lisp/vc/vc-svn.el +++ b/lisp/vc/vc-svn.el @@ -354,9 +354,7 @@ This is only possible if SVN is responsible for FILE's directory.") (defun vc-svn-ignore (file) "Ignore FILE under Subversion." - (interactive) - (vc-svn-command (get-buffer-create "*vc-ignore*") 0 - file "propedit" "svn:ignore")) + (vc-svn-command t 0 file "propedit" "svn:ignore")) (defun vc-svn-checkout (file &optional editable rev) (message "Checking out %s..." file)