unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* vc uses 1 set of switches for all back ends
@ 2005-01-30 21:51 Syd Bauman
  0 siblings, 0 replies; 3+ messages in thread
From: Syd Bauman @ 2005-01-30 21:51 UTC (permalink / raw)


This bug report will be sent to the Free Software Foundation,
not to your local site managers!
Please write in English, because the Emacs maintainers do not have
translators to read other languages for them.

Your bug report will be posted to the bug-gnu-emacs@gnu.org mailing list,
and to the gnu.emacs.bug news group.

In GNU Emacs 21.3.1 (powerpc-unknown-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2004-10-16 on voltaire, modified by Debian
configured using `configure '--build=powerpc-linux' '--host=powerpc-linux' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--with-x=yes' '--with-x-toolkit=athena' 'CFLAGS=-DDEBIAN -g -O2' 'build_alias=powerpc-linux' 'host_alias=powerpc-linux''
Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: nil
  locale-coding-system: nil
  default-enable-multibyte-characters: t

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

Executive Summary
--------- -------
vc uses the same checkin switches for both RCS and CVS, but the two
commands take very different command-line switches.

Actions/Symptoms
----------------
I use GNU Emacs 21.3.1 on a Debian "sarge" GNU/Linux system. I have
been using RCS via 'vc.el' for years. In my .emacs the variable
`vc-checkin-switches' is set (to "-zLT", because I can't stand having
almost, but not quite, ISO-format dates, if you're interested). A
project I work on recently moved to Sourceforge, so I've started to
use CVS for those files in addition to RCS for my local projects.

When I try to check a file in (aka commit) to cvs using C-x v v with a
modified file under CVS control as the front active buffer, I get an
error message that "-z" is not a valid switch:

| ci: invalid option -- z
| Usage: cvs commit [-Rlf] [-m msg | -F logfile] [-r rev] files...
|     -R          Process directories recursively.
|     -l          Local directory only (not recursive).
|     -f          Force the file to be committed; disables recursion.
|     -F logfile  Read the log message from file.
|     -m msg      Log message.
|     -r rev      Commit to this branch or trunk revision.
| (Specify the --help global option for a list of other help options)

I have had some other problems using CVS from within Emacs, but the
inability to commit a file was a showstopper, so I investigated this
one. It turns out that vc.el defines one variable, vc-checkin-
switches, for use with all back ends, but does not provide a mechanism
for giving it a different value with each back end (at least, not one I
found :-).

Hack-around
-----------
This may not be the right way to do this, but it does seem to work.

(defun syd-set-vc-checkin-switches ()
  (if (equal (vc-backend file) 'RCS)
      (setq vc-checkin-switches "-zLT")
    (setq vc-checkin-switches nil))
  )
(custom-set-variables
  ;; custom-set-variables was added by Custom -- don't edit or cut/paste it!
  ;; Your init file should contain only one such instance.
 '(vc-before-checkin-hook (quote (syd-set-vc-checkin-switches)))


Recent input:
C-x C-q C-x b <return> C-u C-x C-b C-x t i <return> 
M-x C-g C-h f v c - <tab> <backspace> <tab> <tab> <return> 
- b a k <backspace> c k <tab> <return> C-x o <tab> 
<return> M-< C-x 1 C-x t o <return> C-x C-f v c . <tab> 
<return> C-s b u g C-s C-v C-s C-s C-s C-s M-x b u 
g <tab> M-x C-g C-h a b u g <return> C-x 0 M-x M-p 
<return> M-x C-g C-h a [ ^ e ] b u g <return> M-x r 
e p o <tab> r <tab> <return>

Recent messages:
Note: file is write protected
Mark saved where search started [2 times]
call-interactively: Quit [2 times]
Loading apropos...done
Type C-x 1 to remove help window.  C-M-v to scroll the help.
next-history-element: Beginning of history; no preceding item
call-interactively: No command name given
call-interactively: Quit
Making completion list...
Loading emacsbug...done

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

* Re: vc uses 1 set of switches for all back ends
       [not found] <mailman.47.1107122874.2841.bug-gnu-emacs@gnu.org>
@ 2005-02-05  8:10 ` Jari Aalto
       [not found] ` <mailman.883.1107591964.2841.bug-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 3+ messages in thread
From: Jari Aalto @ 2005-02-05  8:10 UTC (permalink / raw)


* Sun 2005-01-30 Syd Bauman <Syd_Bauman AT Brown.edu> gnu.emacs.bug
| I use GNU Emacs 21.3.1 on a Debian "sarge" GNU/Linux system. I have
| been using RCS via 'vc.el' for years. In my .emacs the variable
| `vc-checkin-switches' is set (to "-zLT", because I can't stand having
| almost, but not quite, ISO-format dates, if you're interested). A
| project I work on recently moved to Sourceforge, so I've started to
| use CVS for those files in addition to RCS for my local projects.
| 
| When I try to check a file in (aka commit) to cvs using C-x v v with a
| modified file under CVS control as the front active buffer, I get an
| error message that "-z" is not a valid switch:

The vc-checkin-switches is global. What you need is "local" switch for
RCS, which you define in your environment. For bash:

   export RCSINIT='-x,v -zLT'

or in ~/.emacs:

   (setenv "RCSINIT" "-x,v -zLT")

Jari

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

* Re: vc uses 1 set of switches for all back ends
       [not found] ` <mailman.883.1107591964.2841.bug-gnu-emacs@gnu.org>
@ 2005-02-07 20:33   ` Kevin Rodgers
  0 siblings, 0 replies; 3+ messages in thread
From: Kevin Rodgers @ 2005-02-07 20:33 UTC (permalink / raw)


Jari Aalto wrote:
 > The vc-checkin-switches is global. What you need is "local" switch for
 > RCS, which you define in your environment. For bash:
 >
 >    export RCSINIT='-x,v -zLT'
 >
 > or in ~/.emacs:
 >
 >    (setenv "RCSINIT" "-x,v -zLT")

I think the point is that vc-rcs.el defines vc-rcs-checkin-switches (and
-checkout-) but doesn't reference them.  So the obvious fix is to
replace references to vc-checkin-switches with vc-rcs-checkin-switches
(and -checkout-), in vc-rcs.el.

I don't know how a backend-independent switch could be useful anyway,
but if it is, they could both be used:

   (let ((switches (append (if (stringp vc-checkin-switches)
                               (list vc-checkin-switches)
                             vc-checkin-switches)
                           (if (stringp vc-rcs-checkin-switches)
                               (list vc-rcs-checkin-switches)
                             vc-rcs-checkin-switches)))

-- 
Kevin Rodgers

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

end of thread, other threads:[~2005-02-07 20:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.47.1107122874.2841.bug-gnu-emacs@gnu.org>
2005-02-05  8:10 ` vc uses 1 set of switches for all back ends Jari Aalto
     [not found] ` <mailman.883.1107591964.2841.bug-gnu-emacs@gnu.org>
2005-02-07 20:33   ` Kevin Rodgers
2005-01-30 21:51 Syd Bauman

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).