Re: FVWM: fvwm 2.0.45 ready (long)

From: Douglas K. Rand <rand_at_aero.und.edu>
Date: 29 Jan 1997 08:13:49 -0600

Here is a small patch to libs/wild.c to allow nots (!) with wild
cards. I use it to have Next/Prior to skip the Fvwm* windows when
moving focus around. Here is a small excerpt from my .fvwmrc:

Key Prior A M Next [!Iconic CurrentDesk CurrentScreen !Fvwm*] FocusAndWarpToWindow
Key Next A M Prev [!Iconic CurrentDesk CurrentScreen !Fvwm*] FocusAndWarpToWindow
Key Prior A MC Next [!Iconic CurrentDesk !Fvwm*] FocusAndWarpToWindow
Key Next A MC Prev [!Iconic CurrentDesk !Fvwm*] FocusAndWarpToWindow

The patch is pretty simple. The only difficulity I have with it is the
redefinition of the NoClass and NoResource variables.


*** wild.c-orig Wed Jan 29 08:02:39 1997
--- wild.c Wed Jan 29 08:06:28 1997
***************
*** 5,10 ****
--- 5,13 ----
  #define FALSE 0
  #endif
  
+ char NoClass[] = "NoClass";
+ char NoResource[] = "NoResource";
+
  /*****************************************************************************
   * Does `string' match `pattern'? '*' in pattern matches any sub-string
   * (including the null string) '?' matches any single char. For use
***************
*** 12,25 ****
   *
   * This code donated by Paul Hudson <paulh_at_harlequin.co.uk>
   * It is public domain, no strings attached. No guarantees either.
   *
   *****************************************************************************/
  int matchWildcards(char *pattern, char *string)
  {
! if(string == NULL)
      {
! if(pattern == NULL)
! return TRUE;
        else if(strcmp(pattern,"*")==0)
        return TRUE;
        else
--- 15,39 ----
   *
   * This code donated by Paul Hudson <paulh_at_harlequin.co.uk>
   * It is public domain, no strings attached. No guarantees either.
+ *
+ * Simple code to understand patterns that begin with '!' to reverse
+ * the bias of the search. I use it with commands like
+ * Next [!Iconic CurrentDesk CurrentScreen !Fvwm*] Focus
+ * Mods by Douglas Rand <rand_at_aero.und.edu>
   *
   *****************************************************************************/
  int matchWildcards(char *pattern, char *string)
  {
! if (pattern == NULL)
! return TRUE;
! else if (*pattern == '!')
      {
! if(strcmp(string, NoClass) == 0 || strcmp(string, NoResource) == 0)
! return FALSE;
! else return !matchWildcards(pattern + 1, string);
! }
! else if (string == NULL)
! {
        if(strcmp(pattern,"*")==0)
        return TRUE;
        else
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to majordomo_at_hpc.uh.edu.
To report problems, send mail to fvwm-owner_at_hpc.uh.edu.
Received on Wed Jan 29 1997 - 08:14:09 GMT

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:38:00 BST