Subject: Viewport position in functions

From: Will French <[email-masked]>
Date: Fri, 5 Mar 1999 09:59:38 -0500 (EST)

Hi.  This patch allows functions and scripts to gain full knowledge of
where the user is working at the time they are called. I've been using it
patch for two days with no trouble.  The FAQ isn't clear on which Changelog
I should edit; it says how to have Emacs find out automatically, but I
don't use Emacs.  It also refers me to a "Q16" which isn't there.

1999-03-05  Will French <[email-masked]>

  Added special variables $x and $y for complex functions.  These expand
to the x and y coordinates of the viewport.

diff -ur /home/will/fvst/fvwm-2.2/fvwm/complex.c fvwm/fvwm/complex.c
--- /home/will/fvst/fvwm-2.2/fvwm/complex.c     Tue Jan 12 16:07:42 1999
+++ fvwm/fvwm/complex.c Wed Mar  3 08:02:12 1999
@@ -229,7 +229,8 @@
              l2 += strlen(arguments[n])-2;
              i++;
            }
-         else if(input[i+1]=='w' || input[i+1] == 'd')
+         else if(input[i+1] == 'd' || input[i+1] == 'w'
+              || input[i+1] == 'x' || input[i+1] == 'y')
            {
              l2 += 16;
              i++;
@@ -264,6 +265,18 @@
          else if(input[i+1] == 'd')
            {
              sprintf(&out[j], "%d", Scr.CurrentDesk);
+             j += strlen(&out[j]);
+             i++;
+           }
+         else if(input[i+1] == 'x')
+           {
+             sprintf(&out[j], "%d", Scr.Vx);
+             j += strlen(&out[j]);
+             i++;
+           }
+         else if(input[i+1] == 'y')
+           {
+             sprintf(&out[j], "%d", Scr.Vy);
              j += strlen(&out[j]);
              i++;
            }
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: [email-masked] (Paul D. Smith)
Date: 05 Mar 1999 10:49:23 -0500

%% Will French <[email-masked]> writes:

  wf> The FAQ isn't clear on which Changelog I should edit; it says how
  wf> to have Emacs find out automatically, but I don't use Emacs.

The algorithm Emacs uses is to start with the current directory, then go
back up to each parent directory.  The first ChangeLog found is the one
used.  (If none is found, one is created in the current directory.)

  wf> It also refers me to a "Q16" which isn't there.

Oops :-/.

Anyway, what you've done here is fine:

  wf> 1999-03-05  Will French <[email-masked]>

  wf>   Added special variables $x and $y for complex functions.  These expand
  wf> to the x and y coordinates of the viewport.

Preferred, actually: submitting the changelog entry as part of the diff
is problematical because it almost _never_ applies: the changelog file
changes too often.

The "best" way to submit a patch is as you've done it: provide the patch
and provide a vanilla text changelog entry before it, that can be cut
and pasted into the ChangeLog by the person applying the patch.

One nit: the format isn't quite correct.  It should have the filename
and function name you changed.  See the current changelog entries.
S'thing like:

        * fvwm/complex.c (expand): Added special variables $x and $y for
        complex functions.  These expand to the x and y coordinates of
        the viewport.

I'll take a whack at the FAQ entry for this, thanks.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <[email-masked]>         Network Management Development
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist
-------------------------------------------------------------------------------
   These are my opinions---Nortel Networks takes no responsibility for them.
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Dominik Vogt <[email-masked]>
Date: Sat, 6 Mar 1999 14:27:53 +0100

>   wf> It also refers me to a "Q16" which isn't there.

Should be Q5.1 now.

> and pasted into the ChangeLog by the person applying the patch.

I disagree. Removing the conflict markers from the ChangeLog is no
work at all. If I had to cut-and-paste the text into the ChangeLog
it will be considerably more work.

A patch for the manpage would be nice too.

Bye

Dominik

--
Dominik Vogt, [email-masked]
Reply-To: [email-masked]

---

From: [email-masked] (Paul D. Smith)
Date: 06 Mar 1999 22:54:36 -0500

%% Dominik Vogt <[email-masked]> writes:

  >> The "best" way to submit a patch is as you've done it: provide the
  >> patch and provide a vanilla text changelog entry before it, that
  >> can be cut and pasted into the ChangeLog by the person applying the
  >> patch.

  dv> I disagree. Removing the conflict markers from the ChangeLog is no
  dv> work at all. If I had to cut-and-paste the text into the ChangeLog
  dv> it will be considerably more work.

??? I think you're confusing patches with CVS merges.  Certainly CVS
merges, which provide the conflict markers, aren't too much trouble--and
if you forget it someone can go back and fix it up.

But if a patch can't be applied you don't get conflict markers, you get
a foo.rej file and you have to hand-apply the patch, removing the patch
tokens, etc.  This is a pain in the rear.

A simple swipe with mouse-1, then a single click with mouse-2 in the
ChangeLog is all that's necessary to cut-and-paste; I'm not sure how
that could be considerably more work than anything, much less merging
.rej files :)--I've very often accidentally put them in the wrong place,
or left in some of the "+" or "-" tokens, or even forgotten to merge
some rejected parts.

  dv> A patch for the manpage would be nice too.

Definitely, for any change that requires user documentation.

---

From: Dominik Vogt <[email-masked]>
Date: Sun, 7 Mar 1999 15:24:46 +0100

> if you forget it someone can go back and fix it up.

You're right, of course.

> tokens, etc.  This is a pain in the rear.

I still find it easier if I have it in the proper format already. Saves
me the effort of reformatting everything.

> or left in some of the "+" or "-" tokens, or even forgotten to merge

You assume that I use the mouse to do my work :) As a master of zsh
programming I do the most complex tasks with shell commands.

Bye

Dominik

---

From: [email-masked] (Paul D. Smith)
Date: 08 Mar 1999 01:22:26 -0500

>> tokens, etc.  This is a pain in the rear.

  dv> I still find it easier if I have it in the proper format already. Saves
  dv> me the effort of reformatting everything.

Right--that's what I'm saying.  The ChangeLog will never apply cleanly
and always results in a .rej file in diff format--which isn't the proper
format.  That's why it's usual to provide the ChangeLog in "cleartext"
rather than as part of the diff--then it's in the proper format and
ready for inserting directly into the ChangeLog.

Whatever.

  >> ChangeLog is all that's necessary to cut-and-paste

  dv> You assume that I use the mouse to do my work :) As a master of zsh
  dv> programming I do the most complex tasks with shell commands.

Hm.  Well, I personally am all for the right tool for the job--and
regardless of the power and flexibility of your shell, there are some
things that can be done more easily in other ways :).

---

From: Dominik Vogt <[email-masked]>
Date: Mon, 8 Mar 1999 10:50:51 +0100

> things that can be done more easily in other ways :).

Well, that would be correct if my wrist wouldn't hurt whenever I touch
the mouse (or trackball in this case). :(

Bye

Dominik

-- 
Dominik Vogt, Hewlett-Packard GmbH, Dept. BVS
Herrenberger Str.130, 71034 Boeblingen, Germany
phone: 07031/14-4596, fax: 07031/14-3883, [email-masked]
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]