diff options
| author | Juanma Barranquero | 2003-03-06 13:07:24 +0000 |
|---|---|---|
| committer | Juanma Barranquero | 2003-03-06 13:07:24 +0000 |
| commit | c9029fe54be0f7b0a6ecfee0528b171d7392b5fe (patch) | |
| tree | 87c12a82e820321fe1ad95a08e14787f5811807a /src | |
| parent | e5af3c25c972a28df90fa48aa9a121a8c2cb7e61 (diff) | |
| download | emacs-c9029fe54be0f7b0a6ecfee0528b171d7392b5fe.tar.gz emacs-c9029fe54be0f7b0a6ecfee0528b171d7392b5fe.zip | |
(w32_get_rdb_resource): New function.
(x_get_string_resource): Use it, so resources passed with -xrm supercede the
ones in the registry.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 16 | ||||
| -rw-r--r-- | src/w32reg.c | 32 |
2 files changed, 47 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 5d33debc93d..711f99351ba 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,19 @@ | |||
| 1 | 2003-03-06 Juanma Barranquero <lektu@terra.es> | ||
| 2 | |||
| 3 | * w32term.h (struct w32_display_info): Add xrdb member to support | ||
| 4 | passing resources via -xrm on Windows. | ||
| 5 | |||
| 6 | * w32term.c (w32_make_rdb): New function. | ||
| 7 | (w32_term_init): Use it to initialize xrdb member of w32_display_info | ||
| 8 | struct. Delete leftover code. | ||
| 9 | |||
| 10 | * w32fns.c (Fx_get_resource, x_get_resource_string): Pass xrdb to check | ||
| 11 | for resources passed on the command line. | ||
| 12 | |||
| 13 | * w32reg.c (w32_get_rdb_resource): New function. | ||
| 14 | (x_get_string_resource): Use it, so resources passed with -xrm | ||
| 15 | supercede the ones in the registry. | ||
| 16 | |||
| 1 | 2003-03-04 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | 17 | 2003-03-04 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> |
| 2 | 18 | ||
| 3 | * xterm.c (x_detect_focus_change): Call x_any_window_to_frame | 19 | * xterm.c (x_detect_focus_change): Call x_any_window_to_frame |
diff --git a/src/w32reg.c b/src/w32reg.c index 3a2bd1b68d9..73214d787d5 100644 --- a/src/w32reg.c +++ b/src/w32reg.c | |||
| @@ -30,6 +30,26 @@ Boston, MA 02111-1307, USA. */ | |||
| 30 | 30 | ||
| 31 | #define REG_ROOT "SOFTWARE\\GNU\\Emacs" | 31 | #define REG_ROOT "SOFTWARE\\GNU\\Emacs" |
| 32 | 32 | ||
| 33 | static char * | ||
| 34 | w32_get_rdb_resource (rdb, resource) | ||
| 35 | char *rdb; | ||
| 36 | char *resource; | ||
| 37 | { | ||
| 38 | char *value = rdb; | ||
| 39 | int len = strlen (resource); | ||
| 40 | |||
| 41 | while (*value) | ||
| 42 | { | ||
| 43 | /* Comparison is case-insensitive because registry searches are too. */ | ||
| 44 | if ((strnicmp (value, resource, len) == 0) && (value[len] == ':')) | ||
| 45 | return xstrdup (&value[len + 1]); | ||
| 46 | |||
| 47 | value = strchr (value, '\0') + 1; | ||
| 48 | } | ||
| 49 | |||
| 50 | return NULL; | ||
| 51 | } | ||
| 52 | |||
| 33 | LPBYTE | 53 | LPBYTE |
| 34 | w32_get_string_resource (name, class, dwexptype) | 54 | w32_get_string_resource (name, class, dwexptype) |
| 35 | char *name, *class; | 55 | char *name, *class; |
| @@ -99,8 +119,18 @@ w32_get_string_resource (name, class, dwexptype) | |||
| 99 | 119 | ||
| 100 | char * | 120 | char * |
| 101 | x_get_string_resource (rdb, name, class) | 121 | x_get_string_resource (rdb, name, class) |
| 102 | int rdb; | 122 | char *rdb; |
| 103 | char *name, *class; | 123 | char *name, *class; |
| 104 | { | 124 | { |
| 125 | if (rdb) | ||
| 126 | { | ||
| 127 | char *resource; | ||
| 128 | |||
| 129 | if (resource = w32_get_rdb_resource (rdb, name)) | ||
| 130 | return resource; | ||
| 131 | if (resource = w32_get_rdb_resource (rdb, class)) | ||
| 132 | return resource; | ||
| 133 | } | ||
| 134 | |||
| 105 | return (w32_get_string_resource (name, class, REG_SZ)); | 135 | return (w32_get_string_resource (name, class, REG_SZ)); |
| 106 | } | 136 | } |