all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Getting fakemail to work when I steal a lock
@ 2008-12-16 23:01 Tolkin, Steve
  2008-12-18  4:53 ` Kevin Rodgers
  0 siblings, 1 reply; 2+ messages in thread
From: Tolkin, Steve @ 2008-12-16 23:01 UTC (permalink / raw)
  To: help-gnu-emacs, help-emacs-windows, help-rcs

Summary:  Sometimes emacs asks me if I want to steal a lock on a file
controlled by RCS.  When I say yes I want it to run the fakemail
program, instead of starting my real email program (Outlook).  This used
to work in gnu emacs version 21, but does not work in version 22.3.1 on
Windows XP.
 
Details:
I use emacs and RCS on my PC.  For reasons unknown to me (I work at a
large company) sometimes the value of the USERNAME environment variable
starts with a capital letter, e.g. A123, and sometimes it starts with a
lower case letter, e.g., a123.  If I have a lock on a file and the case
is different I get prompted by emacs: "Steal the lock on %s from %s?"
from vc-steal-lock in vc.el in emacs/lisp .
When I say yes I want this to just run the fakemail.exe program.  That
is what happened in emacs version 22.  Now it launches Outlook, which
creates a new email message, and pastes some text into it.  This has the
side effect of removing any text I had copied to the clipboard. And then
I need to cancel that message.

The definition of vc-steal-lock begins: (defun vc-steal-lock (file rev
owner)
but I cannot figure out where the value of owner comes from.
The body of vc-steal-lock contains: (vc-call steal-lock file rev)
But I cannot find where steal-lock is defined.

In vc-rcs.el there is this function: (defun vc-rcs-steal-lock (file
&optional rev)
But I cannot see how this relates to vc-steal-lock -- does it invoke it?
Override it?  Get called by it?

I am not sure that it is the USERNAME variable that RCS (or emacs) uses
to determine whether I am trying to steal the lock. Running strings on
these programs did not get any matches:
strings diff.exe co.exe ci.exe rcsdiff.exe | grep -i user

I tried using setenv inside of emacs to change USERNAME but that caused
a variety of other problems. 

I had a fakemail.exe in my c:\bin which is the first one found in my
PATH.  I made that fakemail.exe a long time ago by copying clear.exe
which was a small program that just returns 0 (I think).

Based on the following code in feedmail.el I added copies of
fakemail.exe to c:\emacs\bin and c:\emacs\etc but it did not help solve
the problem.
(defcustom sendmail-program
  (cond
    ((file-exists-p "/usr/sbin/sendmail") "/usr/sbin/sendmail")
    ((file-exists-p "/usr/lib/sendmail") "/usr/lib/sendmail")
    ((file-exists-p "/usr/ucblib/sendmail") "/usr/ucblib/sendmail")
    (t "fakemail"))			;In ../etc, to interface to
/bin/mail.
  "Program used to send messages."
...

In emacs I asked for the value of the variable sendmail-program by C-h v
and it says:
sendmail-program is a variable defined in `sendmail.el'.
Its value is "fakemail"
 
I do not even know if feedmail.el is used, because it opens Outlook to
send the mail.

I am currently running: "GNU Emacs 22.3.1 (i386-mingw-nt5.1.2600) of
2008-09-06 on SOFT-MJASON" on Windows XP SP3.

P.S.  I would appreciate any suggestions about why USERNAME sometimes
has a different case, and what to do about that, because that is the
"root cause" of the problem.

Thanks in advance,
Steve
-- 
Steven Tolkin    Steve.Tolkin@fmr.com     508-787-9006
Fidelity Investments   400 Puritan Way M3B     Marlborough MA 01752
There is nothing so practical as a good theory.  Comments are by me, 
not Fidelity Investments, its subsidiaries or affiliates.





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

* Re: Getting fakemail to work when I steal a lock
  2008-12-16 23:01 Getting fakemail to work when I steal a lock Tolkin, Steve
@ 2008-12-18  4:53 ` Kevin Rodgers
  0 siblings, 0 replies; 2+ messages in thread
From: Kevin Rodgers @ 2008-12-18  4:53 UTC (permalink / raw)
  To: help-gnu-emacs; +Cc: help-emacs-windows, help-rcs

Tolkin, Steve wrote:
> Summary:  Sometimes emacs asks me if I want to steal a lock on a file
> controlled by RCS.  When I say yes I want it to run the fakemail
> program, instead of starting my real email program (Outlook).  This used
> to work in gnu emacs version 21, but does not work in version 22.3.1 on
> Windows XP.
>  
> Details:
> I use emacs and RCS on my PC.  For reasons unknown to me (I work at a
> large company) sometimes the value of the USERNAME environment variable
> starts with a capital letter, e.g. A123, and sometimes it starts with a
> lower case letter, e.g., a123.  If I have a lock on a file and the case
> is different I get prompted by emacs: "Steal the lock on %s from %s?"
> from vc-steal-lock in vc.el in emacs/lisp .
> When I say yes I want this to just run the fakemail.exe program.  That
> is what happened in emacs version 22.  Now it launches Outlook, which
> creates a new email message, and pastes some text into it.  This has the
> side effect of removing any text I had copied to the clipboard. And then
> I need to cancel that message.

What does `C-h v mail-user-agent' show?

> The definition of vc-steal-lock begins: (defun vc-steal-lock (file rev
> owner)
> but I cannot figure out where the value of owner comes from.
> The body of vc-steal-lock contains: (vc-call steal-lock file rev)
> But I cannot find where steal-lock is defined.
> 
> In vc-rcs.el there is this function: (defun vc-rcs-steal-lock (file
> &optional rev)
> But I cannot see how this relates to vc-steal-lock -- does it invoke it?
> Override it?  Get called by it?

vc-steal-lock -> vc-call -> vc-call-backend -> vc-rcs-steal-lock

> I am not sure that it is the USERNAME variable that RCS (or emacs) uses
> to determine whether I am trying to steal the lock. Running strings on
> these programs did not get any matches:
> strings diff.exe co.exe ci.exe rcsdiff.exe | grep -i user

I'd keep investigating the Emacs interface (VC) before digging into RCS
itself.  The relevant function is vc-rcs-state-heuristic, which is
pretty complicated.

Could your problem be something as simple as case-fold-search being set
to nil, either globally, in the source file buffer, or in some VC buffer?

> I tried using setenv inside of emacs to change USERNAME but that caused
> a variety of other problems. 
> 
> I had a fakemail.exe in my c:\bin which is the first one found in my
> PATH.  I made that fakemail.exe a long time ago by copying clear.exe
> which was a small program that just returns 0 (I think).
> 
> Based on the following code in feedmail.el I added copies of
> fakemail.exe to c:\emacs\bin and c:\emacs\etc but it did not help solve
> the problem.
> (defcustom sendmail-program
>   (cond
>     ((file-exists-p "/usr/sbin/sendmail") "/usr/sbin/sendmail")
>     ((file-exists-p "/usr/lib/sendmail") "/usr/lib/sendmail")
>     ((file-exists-p "/usr/ucblib/sendmail") "/usr/ucblib/sendmail")
>     (t "fakemail"))			;In ../etc, to interface to
> /bin/mail.
>   "Program used to send messages."
> ...
> 
> In emacs I asked for the value of the variable sendmail-program by C-h v
> and it says:
> sendmail-program is a variable defined in `sendmail.el'.
> Its value is "fakemail"
>  
> I do not even know if feedmail.el is used, because it opens Outlook to
> send the mail.

compose-mail ->  (get mail-user-agent 'composefunc)

> I am currently running: "GNU Emacs 22.3.1 (i386-mingw-nt5.1.2600) of
> 2008-09-06 on SOFT-MJASON" on Windows XP SP3.
> 
> P.S.  I would appreciate any suggestions about why USERNAME sometimes
> has a different case, and what to do about that, because that is the
> "root cause" of the problem.
> 
> Thanks in advance,
> Steve


-- 
Kevin Rodgers
Denver, Colorado, USA





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

end of thread, other threads:[~2008-12-18  4:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-16 23:01 Getting fakemail to work when I steal a lock Tolkin, Steve
2008-12-18  4:53 ` Kevin Rodgers

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.