diff options
| author | Jim Blandy | 1992-08-19 03:54:46 +0000 |
|---|---|---|
| committer | Jim Blandy | 1992-08-19 03:54:46 +0000 |
| commit | fbfed6f05fdf5bf363ca5691aefde4d573ce8203 (patch) | |
| tree | 726c22e6a55cb3e760a25f6aa60580d76c8de253 | |
| parent | 4d4c4e027fe376759227a6fb6b31a88be6e36347 (diff) | |
| download | emacs-fbfed6f05fdf5bf363ca5691aefde4d573ce8203.tar.gz emacs-fbfed6f05fdf5bf363ca5691aefde4d573ce8203.zip | |
entered into RCS
| -rw-r--r-- | lib-src/b2m.c | 7 | ||||
| -rw-r--r-- | lib-src/timer.c | 334 | ||||
| -rw-r--r-- | lisp/calendar/solar.el | 46 | ||||
| -rw-r--r-- | lisp/info.el | 2 | ||||
| -rw-r--r-- | lisp/progmodes/hideif.el | 4 | ||||
| -rw-r--r-- | lisp/sort.el | 33 | ||||
| -rw-r--r-- | lisp/timer.el | 6 | ||||
| -rw-r--r-- | src/buffer.h | 13 | ||||
| -rw-r--r-- | src/frame.h | 12 | ||||
| -rw-r--r-- | src/window.h | 16 |
10 files changed, 276 insertions, 197 deletions
diff --git a/lib-src/b2m.c b/lib-src/b2m.c index 2aa79b8edc0..5ae81949aed 100644 --- a/lib-src/b2m.c +++ b/lib-src/b2m.c | |||
| @@ -17,7 +17,14 @@ | |||
| 17 | 17 | ||
| 18 | #include <stdio.h> | 18 | #include <stdio.h> |
| 19 | #include <time.h> | 19 | #include <time.h> |
| 20 | |||
| 21 | #include "../src/config.h" | ||
| 22 | |||
| 23 | #ifdef USG | ||
| 24 | #include <string.h> | ||
| 25 | #else | ||
| 20 | #include <strings.h> | 26 | #include <strings.h> |
| 27 | #endif | ||
| 21 | 28 | ||
| 22 | /* BSD's strings.h does not declare the type of strtok. */ | 29 | /* BSD's strings.h does not declare the type of strtok. */ |
| 23 | extern char *strtok (); | 30 | extern char *strtok (); |
diff --git a/lib-src/timer.c b/lib-src/timer.c index 2c1b9a729f6..a12295db014 100644 --- a/lib-src/timer.c +++ b/lib-src/timer.c | |||
| @@ -1,17 +1,17 @@ | |||
| 1 | /* | 1 | /* timer.c --- daemon to provide a tagged interval timer service |
| 2 | * timer.c --- daemon to provide a tagged interval timer service | 2 | |
| 3 | * | 3 | This little daemon runs forever waiting for signals. SIGIO (or |
| 4 | * This little daemon runs forever waiting for signals. SIGIO (or SIGUSR1) | 4 | SIGUSR1) causes it to read an event spec from stdin; that is, a |
| 5 | * causes it to read an event spec from stdin; that is, a date followed by | 5 | date followed by colon followed by an event label. SIGALRM causes |
| 6 | * colon followed by an event label. SIGALRM causes it to check its queue | 6 | it to check its queue for events attached to the current second; if |
| 7 | * for events attached to the current second; if one is found, its label | 7 | one is found, its label is written to stdout. SIGTERM causes it to |
| 8 | * is written to stdout. SIGTERM causes it to terminate, printing a list | 8 | terminate, printing a list of pending events. |
| 9 | * of pending events. | 9 | |
| 10 | * | 10 | This program is intended to be used with the lisp package called |
| 11 | * This program is intended to be used with the lisp package called timer.el. | 11 | timer.el. It was written anonymously in 1990. This version was |
| 12 | * It was written anonymously in 1990. This version was documented and | 12 | documented and rewritten for portability by esr@snark,thyrsus.com, |
| 13 | * rewritten for portability by esr@snark,thyrsus.com, Aug 7 1992. | 13 | Aug 7 1992. */ |
| 14 | */ | 14 | |
| 15 | #include <stdio.h> | 15 | #include <stdio.h> |
| 16 | #include <signal.h> | 16 | #include <signal.h> |
| 17 | #include <fcntl.h> /* FASYNC */ | 17 | #include <fcntl.h> /* FASYNC */ |
| @@ -24,10 +24,8 @@ | |||
| 24 | #endif | 24 | #endif |
| 25 | 25 | ||
| 26 | extern int errno; | 26 | extern int errno; |
| 27 | extern char *sys_errlist[], *malloc(); | 27 | extern char *sys_errlist[], *malloc (); |
| 28 | extern time_t time(); | 28 | extern time_t time (); |
| 29 | |||
| 30 | #define MAXEVENTS 256 | ||
| 31 | 29 | ||
| 32 | /* | 30 | /* |
| 33 | * The field separator for input. This character shouldn't be legal in a date, | 31 | * The field separator for input. This character shouldn't be legal in a date, |
| @@ -37,185 +35,235 @@ extern time_t time(); | |||
| 37 | #define FS '@' | 35 | #define FS '@' |
| 38 | 36 | ||
| 39 | struct event | 37 | struct event |
| 40 | { | 38 | { |
| 41 | char *token; | 39 | char *token; |
| 42 | time_t reply_at; | 40 | time_t reply_at; |
| 43 | } | 41 | }; |
| 44 | events[MAXEVENTS]; | 42 | int events_size; /* How many slots have we allocated? */ |
| 43 | int num_events; /* How many are actually scheduled? */ | ||
| 44 | struct event *events; /* events[0 .. num_events-1] are the | ||
| 45 | valid events. */ | ||
| 45 | 46 | ||
| 46 | char *pname; /* programme name for error messages */ | 47 | char *pname; /* programme name for error messages */ |
| 47 | 48 | ||
| 48 | /* Accepts a string of two fields seperated by FS. | 49 | /* Accepts a string of two fields seperated by FS. |
| 49 | * First field is string for getdate, saying when to wake-up. | 50 | First field is string for getdate, saying when to wake-up. |
| 50 | * Second field is a token to identify the request. | 51 | Second field is a token to identify the request. */ |
| 51 | */ | 52 | void |
| 52 | void schedule(str) | 53 | schedule (str) |
| 53 | char *str; | 54 | char *str; |
| 54 | { | 55 | { |
| 55 | extern time_t getdate(); | 56 | extern time_t getdate (); |
| 56 | extern char *strcpy(); | 57 | extern char *strcpy (); |
| 57 | time_t now; | 58 | time_t now; |
| 58 | register char *p; | 59 | register char *p; |
| 59 | static struct event *ep; | 60 | static struct event *ep; |
| 60 | 61 | ||
| 61 | #ifdef DEBUG | 62 | /* check entry format */ |
| 62 | (void) fprintf(stderr, "Timer sees: %s", str); | 63 | for (p = str; *p && *p != FS; p++) |
| 63 | #endif /* DEBUG */ | 64 | continue; |
| 64 | 65 | if (!*p) | |
| 65 | /* check entry format */ | ||
| 66 | for(p = str; *p && *p != FS; p++) | ||
| 67 | continue; | ||
| 68 | if (!*p) | ||
| 69 | { | 66 | { |
| 70 | (void)fprintf(stderr, "%s: bad input format: %s", pname, str); | 67 | fprintf (stderr, "%s: bad input format: %s", pname, str); |
| 71 | return; | 68 | return; |
| 72 | } | 69 | } |
| 73 | *p++ = 0; | 70 | *p++ = 0; |
| 74 | 71 | ||
| 75 | /* allocate an event slot */ | 72 | /* allocate an event slot */ |
| 76 | for(ep = events; ep < events + MAXEVENTS; ep++) | 73 | ep = events + num_events; |
| 77 | if (ep->token == (char *)NULL) | 74 | |
| 78 | break; | 75 | /* If the event array is full, stretch it. After stretching, we know |
| 79 | if (ep == events + MAXEVENTS) | 76 | that ep will be pointing to an available event spot. */ |
| 80 | (void) fprintf(stderr, "%s: too many events: %s", pname, str); | 77 | if (ep == events + events_size) |
| 81 | |||
| 82 | /* don't allow users to schedule events in past time */ | ||
| 83 | else if ((ep->reply_at = get_date(str, NULL)) - time(&now) < 0) | ||
| 84 | (void)fprintf(stderr, "%s: bad time spec: %s%c%s", pname, str, FS, p); | ||
| 85 | |||
| 86 | /* save the event description */ | ||
| 87 | else if ((ep->token = malloc((unsigned)strlen(p) + 1)) == NULL) | ||
| 88 | (void)fprintf(stderr, "%s: malloc %s: %s%c%s", | ||
| 89 | pname, sys_errlist[errno], str, FS, p); | ||
| 90 | else | ||
| 91 | { | 78 | { |
| 92 | (void)strcpy(ep->token, p); | 79 | int old_size = events_size; |
| 93 | 80 | ||
| 94 | #ifdef DEBUG | 81 | events_size *= 2; |
| 95 | (void) fprintf(stderr, | 82 | events = ((struct event *) |
| 96 | "New event: %ld: %s", ep->reply_at, ep->token); | 83 | realloc (events, events_size * sizeof (struct event))); |
| 97 | #endif /* DEBUG */ | 84 | if (! events) |
| 85 | { | ||
| 86 | fprintf (stderr, "%s: virtual memory exhausted.\n", pname); | ||
| 87 | |||
| 88 | /* Should timer exit now? Well, we've still got other | ||
| 89 | events in the queue, and more memory might become | ||
| 90 | available in the future, so we'll just toss this event. | ||
| 91 | This will screw up whoever scheduled the event, but | ||
| 92 | maybe someone else will survive. */ | ||
| 93 | return; | ||
| 94 | } | ||
| 95 | |||
| 96 | while (old_size < events_size) | ||
| 97 | events[old_size++].token = NULL; | ||
| 98 | } | ||
| 99 | |||
| 100 | /* Don't allow users to schedule events in past time. */ | ||
| 101 | ep->reply_at = get_date (str, NULL); | ||
| 102 | if (ep->reply_at - time (&now) < 0) | ||
| 103 | { | ||
| 104 | fprintf (stderr, "%s: bad time spec: %s%c%s", pname, str, FS, p); | ||
| 105 | return; | ||
| 106 | } | ||
| 107 | |||
| 108 | /* save the event description */ | ||
| 109 | ep->token = (char *) malloc ((unsigned) strlen (p) + 1); | ||
| 110 | if (! ep->token) | ||
| 111 | { | ||
| 112 | fprintf (stderr, "%s: malloc %s: %s%c%s", | ||
| 113 | pname, sys_errlist[errno], str, FS, p); | ||
| 114 | return; | ||
| 98 | } | 115 | } |
| 116 | |||
| 117 | strcpy (ep->token, p); | ||
| 118 | num_events++; | ||
| 99 | } | 119 | } |
| 100 | 120 | ||
| 101 | void | 121 | void |
| 102 | notify() | 122 | notify () |
| 103 | { | 123 | { |
| 104 | time_t now, tdiff, waitfor = -1; | 124 | time_t now, tdiff, waitfor; |
| 105 | register struct event *ep; | 125 | register struct event *ep; |
| 126 | |||
| 127 | now = time ((time_t *) NULL); | ||
| 106 | 128 | ||
| 107 | now = time((time_t *)NULL); | 129 | for (ep = events; ep < events + num_events; ep++) |
| 130 | /* Are any events ready to fire? */ | ||
| 131 | if (ep->reply_at <= now) | ||
| 132 | { | ||
| 133 | fputs (ep->token, stdout); | ||
| 134 | free (ep->token); | ||
| 108 | 135 | ||
| 109 | for(ep = events; ep < events + MAXEVENTS; ep++) | 136 | /* We now have a hole in the event array; fill it with the last |
| 110 | if (ep->token) | 137 | event. */ |
| 138 | ep->token = events[num_events].token; | ||
| 139 | ep->reply_at = events[num_events].reply_at; | ||
| 140 | num_events--; | ||
| 141 | |||
| 142 | /* We ought to scan this event again. */ | ||
| 143 | ep--; | ||
| 144 | } | ||
| 145 | else | ||
| 146 | { | ||
| 147 | /* next timeout should be the soonest of any remaining */ | ||
| 148 | if ((tdiff = ep->reply_at - now) < waitfor || waitfor < 0) | ||
| 149 | waitfor = (long)tdiff; | ||
| 150 | } | ||
| 151 | |||
| 152 | /* If there are no more events, we needn't bother setting an alarm. */ | ||
| 153 | if (num_events > 0) | ||
| 154 | alarm (waitfor); | ||
| 155 | } | ||
| 156 | |||
| 157 | void | ||
| 158 | getevent () | ||
| 159 | { | ||
| 160 | int i; | ||
| 161 | char *buf; | ||
| 162 | int buf_size; | ||
| 163 | |||
| 164 | /* In principle the itimer should be disabled on entry to this | ||
| 165 | function, but it really doesn't make any important difference | ||
| 166 | if it isn't. */ | ||
| 167 | |||
| 168 | buf_size = 80; | ||
| 169 | buf = (char *) malloc (buf_size); | ||
| 170 | |||
| 171 | /* Read a line from standard input, expanding buf if it is too short | ||
| 172 | to hold the line. */ | ||
| 173 | for (i = 0; ; i++) | ||
| 174 | { | ||
| 175 | int c; | ||
| 176 | |||
| 177 | if (i >= buf_size) | ||
| 111 | { | 178 | { |
| 112 | /* any events ready to fire? */ | 179 | buf_size *= 2; |
| 113 | if (ep->reply_at <= now) | 180 | buf = (char *) realloc (buf, buf_size); |
| 114 | { | 181 | |
| 115 | #ifdef DEBUG | 182 | /* If we're out of memory, toss this event. */ |
| 116 | (void) fprintf(stderr, | 183 | do |
| 117 | "Event %d firing: %ld @ %s", | ||
| 118 | (ep - events), ep->reply_at, ep->token); | ||
| 119 | #endif /* DEBUG */ | ||
| 120 | (void)fputs(ep->token, stdout); | ||
| 121 | free(ep->token); | ||
| 122 | ep->token = (char *)NULL; | ||
| 123 | } | ||
| 124 | else | ||
| 125 | { | 184 | { |
| 126 | #ifdef DEBUG | 185 | c = getchar (); |
| 127 | (void) fprintf(stderr, | ||
| 128 | "Event %d still waiting: %ld @ %s", | ||
| 129 | (ep - events), ep->reply_at, ep->token); | ||
| 130 | #endif /* DEBUG */ | ||
| 131 | |||
| 132 | /* next timeout should be the soonest of any remaining */ | ||
| 133 | if ((tdiff = ep->reply_at - now) < waitfor || waitfor < 0) | ||
| 134 | waitfor = (long)tdiff; | ||
| 135 | } | 186 | } |
| 187 | while (c != '\n' && c != EOF); | ||
| 188 | |||
| 189 | return; | ||
| 136 | } | 190 | } |
| 137 | 191 | ||
| 138 | /* If there's no more events, SIGIO should be next wake-up */ | 192 | c = getchar (); |
| 139 | if (waitfor != -1) | ||
| 140 | { | ||
| 141 | #ifdef DEBUG | ||
| 142 | (void) fprintf(stderr, | ||
| 143 | "Setting %d-second alarm\n", waitfor); | ||
| 144 | #endif /* DEBUG */ | ||
| 145 | (void)alarm(waitfor); | ||
| 146 | } | ||
| 147 | } | ||
| 148 | 193 | ||
| 149 | void | 194 | if (c == EOF) |
| 150 | getevent() | 195 | exit (0); |
| 151 | { | ||
| 152 | extern char *fgets(); | ||
| 153 | struct event *ep; | ||
| 154 | char buf[BUFSIZ]; | ||
| 155 | 196 | ||
| 156 | /* in principle the itimer should be disabled on entry to this function, | 197 | if (c == '\n') |
| 157 | but it really doesn't make any important difference if it isn't */ | 198 | { |
| 199 | buf[i] = '\0'; | ||
| 200 | break; | ||
| 201 | } | ||
| 158 | 202 | ||
| 159 | if (fgets(buf, sizeof(buf), stdin) == NULL) | 203 | buf[i] = c; |
| 160 | exit(0); | 204 | } |
| 161 | 205 | ||
| 162 | /* register the event */ | 206 | /* Register the event. */ |
| 163 | schedule(buf); | 207 | schedule (buf); |
| 208 | free (buf); | ||
| 164 | 209 | ||
| 165 | /* Who knows what this interrupted, or if it said "now"? */ | 210 | /* Who knows what this interrupted, or if it said "now"? */ |
| 166 | notify(); | 211 | notify (); |
| 167 | } | 212 | } |
| 168 | 213 | ||
| 169 | void | 214 | void |
| 170 | sigcatch(sig) | 215 | sigcatch (sig) |
| 216 | int sig; | ||
| 171 | /* dispatch on incoming signal, then restore it */ | 217 | /* dispatch on incoming signal, then restore it */ |
| 172 | { | 218 | { |
| 173 | struct event *ep; | 219 | struct event *ep; |
| 174 | 220 | ||
| 175 | switch(sig) | 221 | switch (sig) |
| 176 | { | 222 | { |
| 177 | case SIGALRM: | 223 | case SIGALRM: |
| 178 | #ifdef DEBUG | 224 | notify (); |
| 179 | (void) fprintf(stderr, "Alarm signal received\n"); | 225 | break; |
| 180 | #endif /* DEBUG */ | ||
| 181 | notify(); | ||
| 182 | break; | ||
| 183 | case SIGIO: | 226 | case SIGIO: |
| 184 | getevent(); | 227 | getevent (); |
| 185 | break; | 228 | break; |
| 186 | case SIGTERM: | 229 | case SIGTERM: |
| 187 | (void) fprintf(stderr, "Events still queued:\n"); | 230 | fprintf (stderr, "Events still queued:\n"); |
| 188 | for (ep = events; ep < events + MAXEVENTS; ep++) | 231 | for (ep = events; ep < events + num_events; ep++) |
| 189 | if (ep->token) | 232 | fprintf (stderr, "%d = %ld @ %s", |
| 190 | (void) fprintf(stderr, "%d = %ld @ %s", | 233 | ep - events, ep->reply_at, ep->token); |
| 191 | ep - events, ep->reply_at, ep->token); | 234 | exit (0); |
| 192 | exit(0); | 235 | break; |
| 193 | break; | ||
| 194 | } | 236 | } |
| 195 | 237 | ||
| 196 | /* required on older UNIXes; harmless on newer ones */ | 238 | /* required on older UNIXes; harmless on newer ones */ |
| 197 | (void) signal(sig, sigcatch); | 239 | signal (sig, sigcatch); |
| 198 | } | 240 | } |
| 199 | 241 | ||
| 200 | /*ARGSUSED*/ | 242 | /*ARGSUSED*/ |
| 201 | int | 243 | int |
| 202 | main(argc, argv) | 244 | main (argc, argv) |
| 203 | int argc; | 245 | int argc; |
| 204 | char **argv; | 246 | char **argv; |
| 205 | { | 247 | { |
| 206 | for (pname = argv[0] + strlen(argv[0]); *pname != '/' && pname != argv[0]; | 248 | for (pname = argv[0] + strlen (argv[0]); |
| 249 | *pname != '/' && pname != argv[0]; | ||
| 207 | pname--); | 250 | pname--); |
| 208 | if (*pname == '/') pname++; | 251 | if (*pname == '/') |
| 252 | pname++; | ||
| 253 | |||
| 254 | events_size = 16; | ||
| 255 | events = ((struct event *) malloc (events_size * sizeof (*events))); | ||
| 256 | num_events = 0; | ||
| 209 | 257 | ||
| 210 | (void)signal(SIGIO, sigcatch); | 258 | signal (SIGIO, sigcatch); |
| 211 | (void)signal(SIGALRM, sigcatch); | 259 | signal (SIGALRM, sigcatch); |
| 212 | (void)signal(SIGTERM, sigcatch); | 260 | signal (SIGTERM, sigcatch); |
| 213 | 261 | ||
| 214 | #ifndef USG | 262 | #ifndef USG |
| 215 | (void)fcntl(0, F_SETFL, FASYNC); | 263 | fcntl (0, F_SETFL, FASYNC); |
| 216 | #endif /* USG */ | 264 | #endif /* USG */ |
| 217 | 265 | ||
| 218 | while (1) pause(); | 266 | while (1) pause (); |
| 219 | } | 267 | } |
| 220 | 268 | ||
| 221 | /* timer.c ends here */ | 269 | /* timer.c ends here */ |
diff --git a/lisp/calendar/solar.el b/lisp/calendar/solar.el index 6a6956ad81d..84b9dfe6ffb 100644 --- a/lisp/calendar/solar.el +++ b/lisp/calendar/solar.el | |||
| @@ -328,40 +328,40 @@ latitude, time zone, and date. | |||
| 328 | 328 | ||
| 329 | This function is suitable for execution in a .emacs file." | 329 | This function is suitable for execution in a .emacs file." |
| 330 | (interactive "p") | 330 | (interactive "p") |
| 331 | (if (< arg 16) | 331 | (if (and (< arg 16) |
| 332 | (if (not (and calendar-latitude calendar-longitude calendar-time-zone)) | 332 | (not (and calendar-latitude calendar-longitude calendar-time-zone))) |
| 333 | (solar-setup))) | 333 | (solar-setup)) |
| 334 | (let* ((calendar-longitude | 334 | (let* ((calendar-longitude |
| 335 | (if (< arg 16) | 335 | (if (< arg 16) calendar-longitude |
| 336 | calendar-longitude | ||
| 337 | (solar-get-number | 336 | (solar-get-number |
| 338 | "Enter longitude (decimal fraction; + east, - west): "))) | 337 | "Enter longitude (decimal fraction; + east, - west): "))) |
| 339 | (calendar-latitude | 338 | (calendar-latitude |
| 340 | (if (< arg 16) | 339 | (if (< arg 16) calendar-latitude |
| 341 | calendar-latitude | ||
| 342 | (solar-get-number | 340 | (solar-get-number |
| 343 | "Enter latitude (decimal fraction; + north, - south): "))) | 341 | "Enter latitude (decimal fraction; + north, - south): "))) |
| 344 | (calendar-time-zone | 342 | (calendar-time-zone |
| 345 | (if (< arg 16) | 343 | (if (< arg 16) calendar-time-zone |
| 346 | calendar-time-zone | ||
| 347 | (solar-get-number | 344 | (solar-get-number |
| 348 | "Enter difference from Universal Time (in minutes): "))) | 345 | "Enter difference from Universal Time (in minutes): "))) |
| 349 | (calendar-location-name | 346 | (calendar-location-name |
| 350 | (let ((float-output-format "%.1f")) | 347 | (if (< arg 16) calendar-location-name |
| 351 | (format "%s%s, %s%s" | 348 | (let ((float-output-format "%.1f")) |
| 352 | (abs calendar-latitude) | 349 | (format "%s%s, %s%s" |
| 353 | (if (> calendar-latitude 0) "N" "S") | 350 | (abs calendar-latitude) |
| 354 | (abs calendar-longitude) | 351 | (if (> calendar-latitude 0) "N" "S") |
| 355 | (if (> calendar-longitude 0) "E" "W")))) | 352 | (abs calendar-longitude) |
| 353 | (if (> calendar-longitude 0) "E" "W"))))) | ||
| 356 | (calendar-standard-time-zone-name | 354 | (calendar-standard-time-zone-name |
| 357 | (cond ((= calendar-time-zone 0) "UT") | 355 | (if (< arg 16) calendar-standard-time-zone-name |
| 358 | ((< calendar-time-zone 0) (format "UT%dmin" calendar-time-zone)) | 356 | (cond ((= calendar-time-zone 0) "UT") |
| 359 | (t (format "UT+%dmin" calendar-time-zone)))) | 357 | ((< calendar-time-zone 0) |
| 360 | (calendar-daylight-savings-starts nil) | 358 | (format "UT%dmin" calendar-time-zone)) |
| 361 | (calendar-daylight-savings-ends nil) | 359 | (t (format "UT+%dmin" calendar-time-zone))))) |
| 362 | (date (if (< arg 4) | 360 | (calendar-daylight-savings-starts |
| 363 | (calendar-current-date) | 361 | (if (< arg 16) calendar-daylight-savings-starts)) |
| 364 | (calendar-read-date))) | 362 | (calendar-daylight-savings-ends |
| 363 | (if (< arg 16) calendar-daylight-savings-ends)) | ||
| 364 | (date (if (< arg 4) (calendar-current-date) (calendar-read-date))) | ||
| 365 | (date-string (calendar-date-string date t)) | 365 | (date-string (calendar-date-string date t)) |
| 366 | (time-string (solar-sunrise-sunset date)) | 366 | (time-string (solar-sunrise-sunset date)) |
| 367 | (msg (format "%s: %s" date-string time-string)) | 367 | (msg (format "%s: %s" date-string time-string)) |
diff --git a/lisp/info.el b/lisp/info.el index a044aa77796..bf6dec805ea 100644 --- a/lisp/info.el +++ b/lisp/info.el | |||
| @@ -179,7 +179,7 @@ to read a file name from the minibuffer." | |||
| 179 | (insert-buffer-substring buf) | 179 | (insert-buffer-substring buf) |
| 180 | (set-marker Info-tag-table-marker | 180 | (set-marker Info-tag-table-marker |
| 181 | (match-end 0)))) | 181 | (match-end 0)))) |
| 182 | (set-marker Info-tag-table-marker pos)))) | 182 | (set-marker Info-tag-table-marker pos)))) |
| 183 | (setq Info-current-file | 183 | (setq Info-current-file |
| 184 | (file-name-sans-versions buffer-file-name)))) | 184 | (file-name-sans-versions buffer-file-name)))) |
| 185 | (if (equal nodename "*") | 185 | (if (equal nodename "*") |
diff --git a/lisp/progmodes/hideif.el b/lisp/progmodes/hideif.el index 16178c018e2..5e6f9adbd5f 100644 --- a/lisp/progmodes/hideif.el +++ b/lisp/progmodes/hideif.el | |||
| @@ -198,6 +198,7 @@ before `hide-ifdef-mode' modifies it.") | |||
| 198 | (cons '(hide-ifdef-mode " Ifdef") | 198 | (cons '(hide-ifdef-mode " Ifdef") |
| 199 | minor-mode-alist))) | 199 | minor-mode-alist))) |
| 200 | 200 | ||
| 201 | ;;;###autoload | ||
| 201 | (defun hide-ifdef-mode (arg) | 202 | (defun hide-ifdef-mode (arg) |
| 202 | "Toggle Hide-Ifdef mode. This is a minor mode, albeit a large one. | 203 | "Toggle Hide-Ifdef mode. This is a minor mode, albeit a large one. |
| 203 | With ARG, turn Hide-Ifdef mode on iff arg is positive. | 204 | With ARG, turn Hide-Ifdef mode on iff arg is positive. |
| @@ -845,6 +846,7 @@ to redo on a recursive entry." | |||
| 845 | 846 | ||
| 846 | ;===%%SF%% exports (Start) === | 847 | ;===%%SF%% exports (Start) === |
| 847 | 848 | ||
| 849 | ;;;###autoload | ||
| 848 | (defvar hide-ifdef-initially nil | 850 | (defvar hide-ifdef-initially nil |
| 849 | "*Non-nil if `hide-ifdefs' should be called when Hide-Ifdef mode | 851 | "*Non-nil if `hide-ifdefs' should be called when Hide-Ifdef mode |
| 850 | is first activated.") | 852 | is first activated.") |
| @@ -852,12 +854,14 @@ is first activated.") | |||
| 852 | (defvar hide-ifdef-hiding nil | 854 | (defvar hide-ifdef-hiding nil |
| 853 | "Non-nil if text might be hidden.") | 855 | "Non-nil if text might be hidden.") |
| 854 | 856 | ||
| 857 | ;;;###autoload | ||
| 855 | (defvar hide-ifdef-read-only nil | 858 | (defvar hide-ifdef-read-only nil |
| 856 | "*Set to non-nil if you want buffer to be read-only while hiding text.") | 859 | "*Set to non-nil if you want buffer to be read-only while hiding text.") |
| 857 | 860 | ||
| 858 | (defvar hif-outside-read-only nil | 861 | (defvar hif-outside-read-only nil |
| 859 | "Internal variable. Saves the value of `buffer-read-only' while hiding.") | 862 | "Internal variable. Saves the value of `buffer-read-only' while hiding.") |
| 860 | 863 | ||
| 864 | ;;;###autoload | ||
| 861 | (defvar hide-ifdef-lines nil | 865 | (defvar hide-ifdef-lines nil |
| 862 | "*Set to t if you don't want to see the #ifX, #else, and #endif lines.") | 866 | "*Set to t if you don't want to see the #ifX, #else, and #endif lines.") |
| 863 | 867 | ||
diff --git a/lisp/sort.el b/lisp/sort.el index dd238d326e5..4405b6e77c0 100644 --- a/lisp/sort.el +++ b/lisp/sort.el | |||
| @@ -29,9 +29,10 @@ | |||
| 29 | Arguments are REVERSE NEXTRECFUN ENDRECFUN &optional STARTKEYFUN ENDKEYFUN. | 29 | Arguments are REVERSE NEXTRECFUN ENDRECFUN &optional STARTKEYFUN ENDKEYFUN. |
| 30 | 30 | ||
| 31 | We divide the accessible portion of the buffer into disjoint pieces | 31 | We divide the accessible portion of the buffer into disjoint pieces |
| 32 | called sort records. A portion of each sort record (perhaps all of it) | 32 | called sort records. A portion of each sort record (perhaps all of |
| 33 | is designated as the sort key. The records are rearranged in the buffer | 33 | it) is designated as the sort key. The records are rearranged in the |
| 34 | in order by their sort keys. The records may or may not be contiguous. | 34 | buffer in order by their sort keys. The records may or may not be |
| 35 | contiguous. | ||
| 35 | 36 | ||
| 36 | Usually the records are rearranged in order of ascending sort key. | 37 | Usually the records are rearranged in order of ascending sort key. |
| 37 | If REVERSE is non-nil, they are rearranged in order of descending sort key. | 38 | If REVERSE is non-nil, they are rearranged in order of descending sort key. |
| @@ -78,19 +79,19 @@ same as ENDRECFUN." | |||
| 78 | 'buffer-substring-lessp) | 79 | 'buffer-substring-lessp) |
| 79 | (t | 80 | (t |
| 80 | 'string<))) | 81 | 'string<))) |
| 81 | (sort sort-lists | 82 | (sort sort-lists |
| 82 | (cond ((numberp (car (car sort-lists))) | 83 | (cond ((numberp (car (car sort-lists))) |
| 83 | (function | 84 | (function |
| 84 | (lambda (a b) | 85 | (lambda (a b) |
| 85 | (< (car a) (car b))))) | 86 | (< (car a) (car b))))) |
| 86 | ((consp (car (car sort-lists))) | 87 | ((consp (car (car sort-lists))) |
| 87 | (function | 88 | (function |
| 88 | (lambda (a b) | 89 | (lambda (a b) |
| 89 | (buffer-substring-lessp (car a) (car b))))) | 90 | (buffer-substring-lessp (car a) (car b))))) |
| 90 | (t | 91 | (t |
| 91 | (function | 92 | (function |
| 92 | (lambda (a b) | 93 | (lambda (a b) |
| 93 | (string< (car a) (car b))))))))) | 94 | (string< (car a) (car b))))))))) |
| 94 | (if reverse (setq sort-lists (nreverse sort-lists))) | 95 | (if reverse (setq sort-lists (nreverse sort-lists))) |
| 95 | (if messages (message "Reordering buffer...")) | 96 | (if messages (message "Reordering buffer...")) |
| 96 | (sort-reorder-buffer sort-lists old))) | 97 | (sort-reorder-buffer sort-lists old))) |
diff --git a/lisp/timer.el b/lisp/timer.el index 128d32c7d30..bbd0db72742 100644 --- a/lisp/timer.el +++ b/lisp/timer.el | |||
| @@ -50,7 +50,7 @@ the call to the function." | |||
| 50 | (continue-process timer-process))) | 50 | (continue-process timer-process))) |
| 51 | ;; There should be a living, breathing timer process now | 51 | ;; There should be a living, breathing timer process now |
| 52 | (let ((token (concat (current-time-string) "-" (length timer-alist)))) | 52 | (let ((token (concat (current-time-string) "-" (length timer-alist)))) |
| 53 | (send-string timer-process (concat time "\001" token "\n")) | 53 | (send-string timer-process (concat time "@" token "\n")) |
| 54 | (setq timer-alist (cons (list token repeat function args) timer-alist)))) | 54 | (setq timer-alist (cons (list token repeat function args) timer-alist)))) |
| 55 | 55 | ||
| 56 | (defun timer-process-filter (proc str) | 56 | (defun timer-process-filter (proc str) |
| @@ -63,9 +63,9 @@ the call to the function." | |||
| 63 | (cond | 63 | (cond |
| 64 | (do (apply (nth 2 do) (nth 3 do)) ; do it | 64 | (do (apply (nth 2 do) (nth 3 do)) ; do it |
| 65 | (if (natnump (nth 1 do)) ; reschedule it | 65 | (if (natnump (nth 1 do)) ; reschedule it |
| 66 | (send-string proc (concat (nth 1 do) " sec\001" (car do) "\n")) | 66 | (send-string proc (concat (nth 1 do) " sec@" (car do) "\n")) |
| 67 | (setq timer-alist (delq do timer-alist)))) | 67 | (setq timer-alist (delq do timer-alist)))) |
| 68 | ((string-match "timer: \\([^:]+\\): \\([^\001]*\\)\001\\(.*\\)$" token) | 68 | ((string-match "timer: \\([^:]+\\): \\([^@]*\\)@\\(.*\\)$" token) |
| 69 | (setq error (substring token (match-beginning 1) (match-end 1)) | 69 | (setq error (substring token (match-beginning 1) (match-end 1)) |
| 70 | do (substring token (match-beginning 2) (match-end 2)) | 70 | do (substring token (match-beginning 2) (match-end 2)) |
| 71 | token (assoc (substring token (match-beginning 3) (match-end 3)) | 71 | token (assoc (substring token (match-beginning 3) (match-end 3)) |
diff --git a/src/buffer.h b/src/buffer.h index a75d81bfd4a..a0e06025893 100644 --- a/src/buffer.h +++ b/src/buffer.h | |||
| @@ -1,11 +1,11 @@ | |||
| 1 | /* Header file for the buffer manipulation primitives. | 1 | /* Header file for the buffer manipulation primitives. |
| 2 | Copyright (C) 1985, 1986, 1990 Free Software Foundation, Inc. | 2 | Copyright (C) 1985, 1986, 1990, 1992 Free Software Foundation, Inc. |
| 3 | 3 | ||
| 4 | This file is part of GNU Emacs. | 4 | This file is part of GNU Emacs. |
| 5 | 5 | ||
| 6 | GNU Emacs is free software; you can redistribute it and/or modify | 6 | GNU Emacs is free software; you can redistribute it and/or modify |
| 7 | it under the terms of the GNU General Public License as published by | 7 | it under the terms of the GNU General Public License as published by |
| 8 | the Free Software Foundation; either version 1, or (at your option) | 8 | the Free Software Foundation; either version 2, or (at your option) |
| 9 | any later version. | 9 | any later version. |
| 10 | 10 | ||
| 11 | GNU Emacs is distributed in the hope that it will be useful, | 11 | GNU Emacs is distributed in the hope that it will be useful, |
| @@ -296,6 +296,15 @@ extern struct buffer buffer_local_flags; | |||
| 296 | 296 | ||
| 297 | extern struct buffer buffer_local_symbols; | 297 | extern struct buffer buffer_local_symbols; |
| 298 | 298 | ||
| 299 | /* This structure holds the required types for the values in the | ||
| 300 | buffer-local slots. If a slot contains Qnil, then the | ||
| 301 | corresponding buffer slot may contain a value of any type. If a | ||
| 302 | slot contains an integer, then prospective values' tags must be | ||
| 303 | equal to that integer. When a tag does not match, the function | ||
| 304 | buffer_slot_type_mismatch will signal an error. The value Qnil may | ||
| 305 | always be safely stored in any slot. */ | ||
| 306 | struct buffer buffer_local_types; | ||
| 307 | |||
| 299 | /* Point in the current buffer. */ | 308 | /* Point in the current buffer. */ |
| 300 | 309 | ||
| 301 | #define point (current_buffer->text.pt + 0) | 310 | #define point (current_buffer->text.pt + 0) |
diff --git a/src/frame.h b/src/frame.h index 8b46e591a20..1a87e6c618d 100644 --- a/src/frame.h +++ b/src/frame.h | |||
| @@ -73,7 +73,7 @@ struct frame | |||
| 73 | /* New height and width for pending size change. 0 if no change pending. */ | 73 | /* New height and width for pending size change. 0 if no change pending. */ |
| 74 | int new_height, new_width; | 74 | int new_height, new_width; |
| 75 | 75 | ||
| 76 | /* Name of this frame: a Lisp string. */ | 76 | /* Name of this frame: a Lisp string. See also `explicit_name'. */ |
| 77 | Lisp_Object name; | 77 | Lisp_Object name; |
| 78 | 78 | ||
| 79 | /* The frame which should recieve keystrokes that occur in this | 79 | /* The frame which should recieve keystrokes that occur in this |
| @@ -143,6 +143,12 @@ struct frame | |||
| 143 | /* True if frame's root window can't be split. */ | 143 | /* True if frame's root window can't be split. */ |
| 144 | char no_split; | 144 | char no_split; |
| 145 | 145 | ||
| 146 | /* If this is set, then Emacs won't change the frame name to indicate | ||
| 147 | the current buffer, etcetera. If the user explicitly sets the frame | ||
| 148 | name, this gets set. If the user sets the name to Qnil, this is | ||
| 149 | cleared. */ | ||
| 150 | char explicit_name; | ||
| 151 | |||
| 146 | /* Storage for messages to this frame. */ | 152 | /* Storage for messages to this frame. */ |
| 147 | char *message_buf; | 153 | char *message_buf; |
| 148 | 154 | ||
| @@ -285,8 +291,8 @@ extern int message_buf_print; | |||
| 285 | #define FRAME_NO_SPLIT_P(f) 0 | 291 | #define FRAME_NO_SPLIT_P(f) 0 |
| 286 | #define FRAME_WANTS_MODELINE_P(f) 1 | 292 | #define FRAME_WANTS_MODELINE_P(f) 1 |
| 287 | #define FRAME_ICONIFIED_P(f) 0 | 293 | #define FRAME_ICONIFIED_P(f) 0 |
| 288 | #define FRAME_MINIBUF_WINDOW(f) (minibuf_window) | 294 | #define FRAME_MINIBUF_WINDOW(f) (the_only_frame.root_window) |
| 289 | #define FRAME_ROOT_WINDOW(f) (XWINDOW (minibuf_window)->prev) | 295 | #define FRAME_ROOT_WINDOW(f) (the_only_frame.root_window) |
| 290 | #define FRAME_SELECTED_WINDOW(f) (selected_window) | 296 | #define FRAME_SELECTED_WINDOW(f) (selected_window) |
| 291 | #define SET_GLYPHS_FRAME(glyphs,frame) do ; while (0) | 297 | #define SET_GLYPHS_FRAME(glyphs,frame) do ; while (0) |
| 292 | #define FRAME_INSERT_COST(frame) (the_only_frame.insert_line_cost) | 298 | #define FRAME_INSERT_COST(frame) (the_only_frame.insert_line_cost) |
diff --git a/src/window.h b/src/window.h index 8cb36ef0a8d..aa4278623ca 100644 --- a/src/window.h +++ b/src/window.h | |||
| @@ -63,11 +63,12 @@ initially the root window is a leaf window, but if more windows | |||
| 63 | are created then that leaf window ceases to be root and a newly | 63 | are created then that leaf window ceases to be root and a newly |
| 64 | made combination window becomes root instead. | 64 | made combination window becomes root instead. |
| 65 | 65 | ||
| 66 | In any case, prev of the minibuf window is the root window and | 66 | In any case, on screens which have an ordinary window and a |
| 67 | next of the root window is the minibuf window. To find the | 67 | minibuffer, prev of the minibuf window is the root window and next of |
| 68 | root window at any time, do XWINDOW (minibuf_window)->prev. | 68 | the root window is the minibuf window. On minibufferless screens or |
| 69 | minibuffer-only screens, the root window and the minibuffer window are | ||
| 70 | one and the same, so its prev and next members are nil. */ | ||
| 69 | 71 | ||
| 70 | */ | ||
| 71 | 72 | ||
| 72 | struct window | 73 | struct window |
| 73 | { | 74 | { |
| @@ -174,8 +175,7 @@ extern int window_select_count; | |||
| 174 | 175 | ||
| 175 | /* The minibuffer window of the selected frame. | 176 | /* The minibuffer window of the selected frame. |
| 176 | Note that you cannot test for minibufferness of an arbitrary window | 177 | Note that you cannot test for minibufferness of an arbitrary window |
| 177 | by comparing against this; but you can test for minibufferness of | 178 | by comparing against this; use the MINI_WINDOW_P macro instead. */ |
| 178 | the selected window or of any window that is displayed. */ | ||
| 179 | 179 | ||
| 180 | extern Lisp_Object minibuf_window; | 180 | extern Lisp_Object minibuf_window; |
| 181 | 181 | ||
| @@ -247,3 +247,7 @@ extern int windows_or_buffers_changed; | |||
| 247 | /* Number of windows displaying the selected buffer. | 247 | /* Number of windows displaying the selected buffer. |
| 248 | Normally this is 1, but it can be more. */ | 248 | Normally this is 1, but it can be more. */ |
| 249 | extern int buffer_shared; | 249 | extern int buffer_shared; |
| 250 | |||
| 251 | /* If *ROWS or *COLS are too small a size for FRAME, set them to the | ||
| 252 | minimum allowable size. */ | ||
| 253 | extern void check_frame_size ( /* FRAME_PTR frame, int *rows, int *cols */ ); | ||