vc-ignore fixes.
authorXue Fuqiao <xfq.free@gmail.com>
Tue, 30 Jul 2013 03:46:06 +0000 (11:46 +0800)
committerXue Fuqiao <xfq.free@gmail.com>
Tue, 30 Jul 2013 03:46:06 +0000 (11:46 +0800)
* 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.

lisp/ChangeLog
lisp/vc/vc-bzr.el
lisp/vc/vc-cvs.el
lisp/vc/vc-git.el
lisp/vc/vc-hg.el
lisp/vc/vc-svn.el

index f27a6fa..082dd75 100644 (file)
@@ -1,3 +1,19 @@
+2013-07-30  Xue Fuqiao  <xfq.free@gmail.com>
+
+       * 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  <eliz@gnu.org>
 
        * frame.el (frame-notice-user-settings): Avoid inflooping when the
index 5f026a2..9d2adde 100644 (file)
@@ -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")
index 3472673..48d83d4 100644 (file)
@@ -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)
index 2183fef..4716d13 100644 (file)
@@ -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")))
index dd9ff00..bc125e2 100644 (file)
@@ -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)
index 7851aac..743a4d5 100644 (file)
@@ -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)