home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / windows / x / motif / 5751 < prev    next >
Encoding:
Text File  |  1992-08-21  |  2.5 KB  |  88 lines

  1. Path: sparky!uunet!mcsun!uknet!edcastle!dcs.ed.ac.uk!gdmr
  2. From: gdmr@dcs.ed.ac.uk (George Ross)
  3. Newsgroups: comp.windows.x.motif
  4. Subject: Re: .mwmrc thru cpp?
  5. Message-ID: <42025@skye.dcs.ed.ac.uk>
  6. Date: 21 Aug 92 16:00:41 GMT
  7. References: <1992Aug21.120834.1745@sniap.mchp.sni.de>
  8. Sender: nnews@dcs.ed.ac.uk
  9. Organization: Department of Computer Science, Edinburgh University
  10. Lines: 76
  11.  
  12. In article <1992Aug21.120834.1745@sniap.mchp.sni.de>, Mathias.Koerber@sniap.mchp.sni.de (Mathias Koerber) writes:
  13. > Is there a way to let mwm run the user's .mwmrc-file tru the
  14. > C-Preprocessor first? We have quite a lot of commands
  15. > set up accessible via key-bindings as well as via menu-entries.
  16.  
  17. We've not tried doing anything to mwm, but here's our patch for twm.  You
  18. could maybe adapt it.
  19.  
  20. *** parse.c.dist    Thu Nov 29 13:25:55 1990
  21. --- parse.c    Mon Dec  3 15:23:19 1990
  22. ***************
  23. *** 52,60 ****
  24.   #include "parse.h"
  25.   #include <X11/Xatom.h> 
  26.   
  27. ! #ifndef SYSTEM_INIT_FILE
  28. ! #define SYSTEM_INIT_FILE "/usr/lib/X11/twm/system.twmrc"
  29. ! #endif
  30.   #define BUF_LEN 300
  31.   
  32.   static FILE *twmrc;
  33. --- 52,60 ----
  34.   #include "parse.h"
  35.   #include <X11/Xatom.h> 
  36.   
  37. ! #undef SYSTEM_INIT_FILE
  38. ! #define SYSTEM_INIT_FILE "/usr/local/share/X11R5/twmrc.default"
  39. ! #define SYSTEM_FILTER "/usr/local/share/X11R5/twmfilter.default"
  40.   #define BUF_LEN 300
  41.   
  42.   static FILE *twmrc;
  43. ***************
  44. *** 122,127 ****
  45. --- 122,128 ----
  46.       int homelen = 0;
  47.       char *cp = NULL;
  48.       char tmpfilename[257];
  49. +     char tmpfilter[257];
  50.   
  51.       /*
  52.        * If filename given, try it, else try ~/.twmrc.# then ~/.twmrc.  Then
  53. ***************
  54. *** 157,163 ****
  55.           break;
  56.       }
  57.   
  58. !     if (cp) twmrc = fopen (cp, "r");
  59.       }
  60.   
  61.       if (twmrc) {
  62. --- 158,177 ----
  63.           break;
  64.       }
  65.   
  66. !        if (cp && (access(cp,R_OK) != -1)) { 
  67. !           if (home) {
  68. !             (void) sprintf( tmpfilter, "%s/.twmfilter", home );
  69. !             if (access(tmpfilter,X_OK) == -1) strcpy(tmpfilter,SYSTEM_FILTER);
  70. !           } else strcpy(tmpfilter,SYSTEM_FILTER);
  71. !           if (access(tmpfilter,X_OK) == -1) {
  72. !             twmrc = fopen (cp, "r");
  73. !           } else {
  74. !             strcat(tmpfilter, " ");
  75. !             strcat(tmpfilter, cp);
  76. !             twmrc = popen(tmpfilter,"r");
  77. !           }
  78. !         }
  79.       }
  80.   
  81.       if (twmrc) {
  82.  
  83. -- 
  84. George D M Ross, Department of Computer Science, University of Edinburgh
  85.      Kings Buildings, Mayfield Road, Edinburgh, Scotland, EH9 3JZ
  86. Tel: 031-650 5147   Internet: gdmr@dcs.ed.ac.uk   JANET: gdmr@uk.ac.ed.dcs
  87.