all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* vc-checkin (RCS) always. Problem with vc-checkin
@ 2015-09-06 19:04 Uwe Brauer
  2015-09-07  3:49 ` Pierre Lorenzon
  0 siblings, 1 reply; 7+ messages in thread
From: Uwe Brauer @ 2015-09-06 19:04 UTC (permalink / raw)
  To: help-gnu-emacs

Hello

The following code can be found in

http://www.emacswiki.org/emacs/VersionControlAlways

(defun ensure-in-vc-or-check-in ()
  "Automatically checkin file ,v can be in the same directory or in the
subdirectory RCS. The idea is  to call that function only for files
not for buffers. See the function ensure-in-vc-or-check-in-modes  
which could be use in an apropriate HOOK."
  (interactive)
  (when (buffer-file-name)   
	(if (or (and (file-exists-p (format "%s,v" (buffer-file-name))))
			(and (file-exists-p (format "RCS/%s,v" (file-name-nondirectory buffer-file-name)))))
  (let ((p (point)))
		(progn
			(vc-checkin (buffer-file-name) nil "")
			(vc-toggle-read-only) 
			(message "Checked in"))
		    (goto-char p))
	  (progn
		  (message "You need to check this in! ")))))

I modified the original code
by adding (format "RCS/%s,v" (file-name-nondirectory buffer-file-name)



The point is the code works for a old version of VC, however for GNU
emacs 25
(vc-checkin (buffer-file-name) nil "")

does not work any more.

The docstring for the old function said:
(vc-checkin FILE &optional REV COMMENT INITIAL-CONTENTS)
file for the new function:
(vc-checkin FILES BACKEND &optional COMMENT INITIAL-CONTENTS)
so I thought

(vc-checkin (buffer-file-name) 'RCS nil "")
or
(vc-checkin (buffer-file-name) 'RCS  "")

Should work, it does not. The following error is given
 vc-delistify seems the culprit, but I am stack.


Thanks

Uwe Brauer


--8<---------------cut here---------------start------------->8---

Debugger entered--Lisp error: (wrong-type-argument sequencep 47)
  mapconcat(identity
  "/home/oub/emacs/site-lisp/versch/vc-ensure-checkin.el" " ")
  vc-delistify("/home/oub/emacs/site-lisp/versch/vc-ensure-checkin.el")
  #[514
  "\303\304\305!\"\210\211\203




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: vc-checkin (RCS) always. Problem with vc-checkin
  2015-09-06 19:04 Uwe Brauer
@ 2015-09-07  3:49 ` Pierre Lorenzon
  2015-09-07 20:44   ` Uwe Brauer
  0 siblings, 1 reply; 7+ messages in thread
From: Pierre Lorenzon @ 2015-09-07  3:49 UTC (permalink / raw)
  To: oub; +Cc: help-gnu-emacs


Hi



From: Uwe Brauer <oub@mat.ucm.es>
Subject: vc-checkin (RCS) always. Problem with vc-checkin 
Date: Sun, 06 Sep 2015 21:04:29 +0200

> Hello
> 
> The following code can be found in
> 
> http://www.emacswiki.org/emacs/VersionControlAlways
> 
> (defun ensure-in-vc-or-check-in ()
>   "Automatically checkin file ,v can be in the same directory or in the
> subdirectory RCS. The idea is  to call that function only for files
> not for buffers. See the function ensure-in-vc-or-check-in-modes  
> which could be use in an apropriate HOOK."
>   (interactive)
>   (when (buffer-file-name)   
> 	(if (or (and (file-exists-p (format "%s,v" (buffer-file-name))))
> 			(and (file-exists-p (format "RCS/%s,v" (file-name-nondirectory buffer-file-name)))))
>   (let ((p (point)))
> 		(progn
> 			(vc-checkin (buffer-file-name) nil "")
> 			(vc-toggle-read-only) 
> 			(message "Checked in"))
> 		    (goto-char p))
> 	  (progn
> 		  (message "You need to check this in! ")))))
> 
> I modified the original code
> by adding (format "RCS/%s,v" (file-name-nondirectory buffer-file-name)
> 
> 
> 
> The point is the code works for a old version of VC, however for GNU
> emacs 25
> (vc-checkin (buffer-file-name) nil "")
> 
> does not work any more.
> 
> The docstring for the old function said:
> (vc-checkin FILE &optional REV COMMENT INITIAL-CONTENTS)
> file for the new function:
> (vc-checkin FILES BACKEND &optional COMMENT INITIAL-CONTENTS)


  Ok that the form I know. backend is required. 



> so I thought
> 
> (vc-checkin (buffer-file-name) 'RCS nil "")
> or
> (vc-checkin (buffer-file-name) 'RCS  "")
> 
> Should work, it does not. The following error is given



  In fact it does not work. vc-checkin launches a very
  complicated process of interaction opening the log buffer to
  setup the check in message. In fact if you do not want this
  process to run interactively vc-checkin is maybe not the
  right method. You might replace your code by :

  (vc-call-backend 'RCS 'checkin (list (buffer-file-name)) "")

  Sure it won't accomplish certain tasks around check in
  performed by vc-checkin but if yuou only want to check in
  ....


  Regards

  Pierre

>  vc-delistify seems the culprit, but I am stack.
> 
> 
> Thanks
> 
> Uwe Brauer
> 
> 
> --8<---------------cut here---------------start------------->8---
> 
> Debugger entered--Lisp error: (wrong-type-argument sequencep 47)
>   mapconcat(identity
>   "/home/oub/emacs/site-lisp/versch/vc-ensure-checkin.el" " ")
>   vc-delistify("/home/oub/emacs/site-lisp/versch/vc-ensure-checkin.el")
>   #[514
>   "\303\304\305!\"\210\211\203
> 
> 



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: vc-checkin (RCS) always. Problem with vc-checkin
  2015-09-07  3:49 ` Pierre Lorenzon
@ 2015-09-07 20:44   ` Uwe Brauer
  2015-10-18 22:03     ` Thien-Thi Nguyen
  0 siblings, 1 reply; 7+ messages in thread
From: Uwe Brauer @ 2015-09-07 20:44 UTC (permalink / raw)
  To: help-gnu-emacs

Not sure whether my message went through. I don't see it that is why I
resend it.



Hello

Thanks for your answer

[+]
>   Ok that the form I know. backend is required. 

>   In fact it does not work. vc-checkin launches a very
>   complicated process of interaction opening the log buffer to
>   setup the check in message. In fact if you do not want this
>   process to run interactively vc-checkin is maybe not the
>   right method. You might replace your code by :

>   (vc-call-backend 'RCS 'checkin (list (buffer-file-name)) "")


Hm it does not work work me.
In a file which is under version control I
used eval-last-sexp for
(vc-call-backend 'RCS 'checkin (list (buffer-file-name)) "")

and I obtained: the following error message

ci: missing message for -m option


Did you try this command out?


Regards

Uwe 




^ permalink raw reply	[flat|nested] 7+ messages in thread

* vc-checkin (RCS) always. Problem with vc-checkin
@ 2015-09-12  8:17 Uwe Brauer
  2015-09-12  9:33 ` Andreas Schwab
  0 siblings, 1 reply; 7+ messages in thread
From: Uwe Brauer @ 2015-09-12  8:17 UTC (permalink / raw)
  To: emacs-devel



Hello


I asked this some days ago in Emacs.help. However the answer given did
not work of me, so I hope somebody in this list might now the answer.



http://www.emacswiki.org/emacs/VersionControlAlways

(defun ensure-in-vc-or-check-in ()
  "Automatically checkin file ,v can be in the same directory or in the
subdirectory RCS. The idea is  to call that function only for files
not for buffers. See the function ensure-in-vc-or-check-in-modes  
which could be use in an apropriate HOOK."
  (interactive)
  (when (buffer-file-name)   
	(if (or (and (file-exists-p (format "%s,v" (buffer-file-name))))
(and (file-exists-p (format "RCS/%s,v" (file-name-nondirectory buffer-file-name)))))
  (let ((p (point)))
		(progn
			(vc-checkin (buffer-file-name) nil "")
			(vc-toggle-read-only) 
			(message "Checked in"))
		    (goto-char p))
	  (progn
		  (message "You need to check this in! ")))))


The point is the code works for a old version of VC, however for GNU
emacs 25
(vc-checkin (buffer-file-name) nil "")

does not work any more.

The docstring for the old function said:
(vc-checkin FILE &optional REV COMMENT INITIAL-CONTENTS)
file for the new function:
(vc-checkin FILES BACKEND &optional COMMENT INITIAL-CONTENTS)
so I thought

(vc-checkin (buffer-file-name) 'RCS nil "")
or
(vc-checkin (buffer-file-name) 'RCS  "")

Should work, however it does not. The following error is given
 vc-delistify seems the culprit, but I am stack.


Thanks

Uwe Brauer


--8<---------------cut here---------------start------------->8---

Debugger entered--Lisp error: (wrong-type-argument sequencep 47)
  mapconcat(identity
  "/home/oub/emacs/site-lisp/versch/vc-ensure-checkin.el" " ")
  vc-delistify("/home/oub/emacs/site-lisp/versch/vc-ensure-checkin.el")
  #[514
  "\303\304\305!\"\210\211\203







^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: vc-checkin (RCS) always. Problem with vc-checkin
  2015-09-12  8:17 vc-checkin (RCS) always. Problem with vc-checkin Uwe Brauer
@ 2015-09-12  9:33 ` Andreas Schwab
  2015-09-12 13:04   ` Uwe Brauer
  0 siblings, 1 reply; 7+ messages in thread
From: Andreas Schwab @ 2015-09-12  9:33 UTC (permalink / raw)
  To: emacs-devel

Uwe Brauer <oub@mat.ucm.es> writes:

> (vc-checkin (buffer-file-name) nil "")

vc-checkin expects a list as the first argument.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: vc-checkin (RCS) always. Problem with vc-checkin
  2015-09-12  9:33 ` Andreas Schwab
@ 2015-09-12 13:04   ` Uwe Brauer
  0 siblings, 0 replies; 7+ messages in thread
From: Uwe Brauer @ 2015-09-12 13:04 UTC (permalink / raw)
  To: emacs-devel

>>>>> "Andreas" == Andreas Schwab <schwab@linux-m68k.org> writes:

   > Uwe Brauer <oub@mat.ucm.es> writes:
   >> (vc-checkin (buffer-file-name) nil "")

   > vc-checkin expects a list as the first argument.
This was suggested to me
	    (vc-call-backend  'RCS  'checkin (list (buffer-file-name)) "") 
and did not work,

While 
	    (vc-checkin (list (buffer-file-name)) 'RCS " ")

works now, I swear it did not last week with GNU Emacs 24, now I am
using the actual git version

Thanks

Uwe Brauer 




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: vc-checkin (RCS) always. Problem with vc-checkin
  2015-09-07 20:44   ` Uwe Brauer
@ 2015-10-18 22:03     ` Thien-Thi Nguyen
  0 siblings, 0 replies; 7+ messages in thread
From: Thien-Thi Nguyen @ 2015-10-18 22:03 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 1616 bytes --]

() Uwe Brauer <oub@mat.ucm.es>
() Mon, 07 Sep 2015 20:44:12 +0000

   > (vc-call-backend 'RCS 'checkin (list (buffer-file-name)) "")

   Hm it does not work work me.
   In a file which is under version control I
   used eval-last-sexp for
   (vc-call-backend 'RCS 'checkin (list (buffer-file-name)) "")

   and I obtained: the following error message

   ci: missing message for -m option

In lisp/vc/vc.el, the generic ‘checkin’ signature is documented
as (reproduced here):

 checkin (files rev comment)

 Commit changes in FILES to this backend.  REV is a historical artifact
 and should be ignored.  COMMENT is used as a check-in comment.
 The implementation should pass the value of vc-checkin-switches to
 the backend command.

(If you don't have Emacs Lisp installed as part of the Emacs
installation, stop reading, obtain that, then return here.)
Thus, the above invocation receives the parms:

 FILES -- (list (buffer-file-name))
 REV   -- ""

and COMMENT is unspecified.  Another approach, a bit higher in
abstraction, would be to use ‘vc-rcs-checkin’ directly.  Its
docstring in my old (2014-01-01) copy is not so useful, but the
*Help* buffer produced by ‘C-h f vc-rcs-checkin RET’ shows the
same signature described above; you can probably figure it out.

-- 
Thien-Thi Nguyen -----------------------------------------------
  (if you're human and you know it) read my lisp:
    (defun responsep (type via)
      (case type
        (technical (eq 'mailing-list via))
        ...))
---------------------------------------------- GPG key: 4C807502

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-10-18 22:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-12  8:17 vc-checkin (RCS) always. Problem with vc-checkin Uwe Brauer
2015-09-12  9:33 ` Andreas Schwab
2015-09-12 13:04   ` Uwe Brauer
  -- strict thread matches above, loose matches on Subject: below --
2015-09-06 19:04 Uwe Brauer
2015-09-07  3:49 ` Pierre Lorenzon
2015-09-07 20:44   ` Uwe Brauer
2015-10-18 22:03     ` Thien-Thi Nguyen

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.