From 7d0393cf12f2e50ee50e1a1fd73a60e9ef1f56ac Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Fri, 18 Oct 2002 10:09:43 +0000 Subject: [PATCH] Fix typo in comment. --- src/coding.c | 4 +- src/emacs.c | 2 +- src/intervals.c | 56 ++-- src/mac.c | 286 +++++++++--------- src/macfns.c | 12 +- src/syntax.c | 68 ++--- src/w32fns.c | 644 +++++++++++++++++++-------------------- src/xdisp.c | 24 +- src/xsmfns.c | 58 ++-- src/xterm.c | 786 ++++++++++++++++++++++++------------------------ 10 files changed, 970 insertions(+), 970 deletions(-) diff --git a/src/coding.c b/src/coding.c index 69e3b7e3e3d..3fa383ad7be 100644 --- a/src/coding.c +++ b/src/coding.c @@ -6313,7 +6313,7 @@ highest priority. */) the detecting source. Then code detectors can handle the tailing byte sequence more accurately. - Fix me: This is not an perfect solution. It is better that we + Fix me: This is not a perfect solution. It is better that we add one more argument, say LAST_BLOCK, to all detect_coding_XXX. */ if (to == Z || (to == GPT && GAP_SIZE > 0)) @@ -6538,7 +6538,7 @@ unencodable_char_position (safe_chars, pos, p, pend, n) { int len; int c = STRING_CHAR_AND_LENGTH (p, MAX_MULTIBYTE_LENGTH, len); - + if (c >= 128 && (CHAR_TABLE_P (safe_chars) ? NILP (CHAR_TABLE_REF (safe_chars, c)) diff --git a/src/emacs.c b/src/emacs.c index ccf2f93f93c..83bec92263e 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -158,7 +158,7 @@ Lisp_Object Vprevious_system_messages_locale; Lisp_Object Vsystem_time_locale; Lisp_Object Vprevious_system_time_locale; -/* If non-zero, emacs should not attempt to use an window-specific code, +/* If non-zero, emacs should not attempt to use a window-specific code, but instead should use the virtual terminal under which it was started. */ int inhibit_window_system; diff --git a/src/intervals.c b/src/intervals.c index 9ed2a651f55..3b8327b96d8 100644 --- a/src/intervals.c +++ b/src/intervals.c @@ -347,10 +347,10 @@ rotate_right (interval) /* Assuming that a right child exists, perform the following operation: - A B - / \ / \ + A B + / \ / \ B => A - / \ / \ + / \ / \ c c */ @@ -524,7 +524,7 @@ split_interval_right (interval, offset) new->total_length = new_length + new->right->total_length; balance_an_interval (new); } - + balance_possible_root_interval (interval); return new; @@ -569,7 +569,7 @@ split_interval_left (interval, offset) new->total_length = new_length + new->left->total_length; balance_an_interval (new); } - + balance_possible_root_interval (interval); return new; @@ -754,39 +754,39 @@ update_interval (i, pos) if (NULL_INTERVAL_P (i)) return NULL_INTERVAL; - while (1) + while (1) { - if (pos < i->position) + if (pos < i->position) { /* Move left. */ - if (pos >= i->position - TOTAL_LENGTH (i->left)) + if (pos >= i->position - TOTAL_LENGTH (i->left)) { i->left->position = i->position - TOTAL_LENGTH (i->left) + LEFT_TOTAL_LENGTH (i->left); i = i->left; /* Move to the left child */ } - else if (NULL_PARENT (i)) + else if (NULL_PARENT (i)) error ("Point before start of properties"); - else + else i = INTERVAL_PARENT (i); continue; } else if (pos >= INTERVAL_LAST_POS (i)) { /* Move right. */ - if (pos < INTERVAL_LAST_POS (i) + TOTAL_LENGTH (i->right)) + if (pos < INTERVAL_LAST_POS (i) + TOTAL_LENGTH (i->right)) { i->right->position = INTERVAL_LAST_POS (i) + LEFT_TOTAL_LENGTH (i->right); i = i->right; /* Move to the right child */ } - else if (NULL_PARENT (i)) + else if (NULL_PARENT (i)) error ("Point after end of properties"); - else + else i = INTERVAL_PARENT (i); continue; } - else + else return i; } } @@ -874,7 +874,7 @@ adjust_intervals_for_insertion (tree, position, length) int eobp = 0; Lisp_Object parent; int offset; - + if (TOTAL_LENGTH (tree) == 0) /* Paranoia */ abort (); @@ -989,7 +989,7 @@ adjust_intervals_for_insertion (tree, position, length) temp->total_length += length; temp = balance_possible_root_interval (temp); } - + /* If at least one interval has sticky properties, we check the stickiness property by property. @@ -1046,7 +1046,7 @@ adjust_intervals_for_insertion (tree, position, length) temp = balance_possible_root_interval (temp); } } - + return tree; } @@ -1212,7 +1212,7 @@ merge_properties_sticky (pleft, pright) cat = textget (props, Qcategory); if (! NILP (front) - && + && /* If we have inherited a front-stick category property that is t, we don't need to set up a detailed one. */ ! (! NILP (cat) && SYMBOLP (cat) @@ -1222,7 +1222,7 @@ merge_properties_sticky (pleft, pright) } -/* Delete an node I from its interval tree by merging its subtrees +/* Delete a node I from its interval tree by merging its subtrees into one subtree which is then returned. Caller is responsible for storing the resulting subtree into its parent. */ @@ -1351,7 +1351,7 @@ interval_deletion_adjustment (tree, from, amount) else { /* How much can we delete from this interval? */ - int my_amount = ((tree->total_length + int my_amount = ((tree->total_length - RIGHT_TOTAL_LENGTH (tree)) - relative_position); @@ -1361,7 +1361,7 @@ interval_deletion_adjustment (tree, from, amount) tree->total_length -= amount; if (LENGTH (tree) == 0) delete_interval (tree); - + return amount; } @@ -1780,7 +1780,7 @@ graft_intervals_into_buffer (source, position, length, buffer, inherit) The properties of under are the result of adjust_intervals_for_insertion, so stickiness has already been taken care of. */ - + while (! NULL_INTERVAL_P (over)) { if (LENGTH (over) < LENGTH (under)) @@ -1805,7 +1805,7 @@ graft_intervals_into_buffer (source, position, length, buffer, inherit) /* Get the value of property PROP from PLIST, which is the plist of an interval. - We check for direct properties, for categories with property PROP, + We check for direct properties, for categories with property PROP, and for PROP appearing on the default-text-properties list. */ Lisp_Object @@ -1887,7 +1887,7 @@ temp_set_point_both (buffer, charpos, bytepos) BUF_PT (buffer) = charpos; } -/* Set point in BUFFER to CHARPOS. If the target position is +/* Set point in BUFFER to CHARPOS. If the target position is before an intangible character, move to an ok place. */ void @@ -1907,7 +1907,7 @@ set_point (buffer, charpos) TEST_OFFS should be either 0 or -1, and ADJ should be either 1 or -1. Note that `stickiness' is determined by overlay marker insertion types, - if the invisible property comes from an overlay. */ + if the invisible property comes from an overlay. */ static int adjust_for_invis_intang (pos, test_offs, adj, test_intang) @@ -1945,7 +1945,7 @@ adjust_for_invis_intang (pos, test_offs, adj, test_intang) } /* Set point in BUFFER to CHARPOS, which corresponds to byte - position BYTEPOS. If the target position is + position BYTEPOS. If the target position is before an intangible character, move to an ok place. */ void @@ -2218,7 +2218,7 @@ move_if_not_intangible (position) } - /* If the whole stretch between PT and POSITION isn't intangible, + /* If the whole stretch between PT and POSITION isn't intangible, try moving to POSITION (which means we actually move farther if POSITION is inside of intangible text). */ @@ -2265,7 +2265,7 @@ get_property_and_range (pos, prop, val, start, end, object) *start = i->position; next = next_interval (i); - while (! NULL_INTERVAL_P (next) + while (! NULL_INTERVAL_P (next) && EQ (*val, textget (next->plist, prop))) i = next, next = next_interval (next); *end = i->position + LENGTH (i); diff --git a/src/mac.c b/src/mac.c index a28f513a707..833ee5f3bdc 100644 --- a/src/mac.c +++ b/src/mac.c @@ -91,7 +91,7 @@ string_cat_and_replace (char *s1, const char *s2, int n, char a, char b) int l2 = strlen (s2); char *p = s1 + l1; int i; - + strncat (s1, s2, n); for (i = 0; i < l2; i++) { @@ -104,27 +104,27 @@ string_cat_and_replace (char *s1, const char *s2, int n, char a, char b) /* Convert a Mac pathname to Posix form. A Mac full pathname is one that does not begin with a ':' and contains at least one ':'. A Mac - full pathname causes an '/' to be prepended to the Posix pathname. + full pathname causes a '/' to be prepended to the Posix pathname. The algorithm for the rest of the pathname is as follows: For each segment between two ':', if it is non-null, copy as is and then add a '/' at the end, otherwise, insert a "../" into the Posix pathname. Returns 1 if successful; 0 if fails. */ - + int mac_to_posix_pathname (const char *mfn, char *ufn, int ufnbuflen) { const char *p, *q, *pe; - + strcpy (ufn, ""); - + if (*mfn == '\0') return 1; - + p = strchr (mfn, ':'); if (p != 0 && p != mfn) /* full pathname */ strcat (ufn, "/"); - + p = mfn; if (*p == ':') p++; @@ -159,7 +159,7 @@ mac_to_posix_pathname (const char *mfn, char *ufn, int ufnbuflen) p = pe; } } - + return 1; } @@ -169,20 +169,20 @@ extern char *get_temp_dir_name (); /* Convert a Posix pathname to Mac form. Approximately reverse of the above in algorithm. */ - + int posix_to_mac_pathname (const char *ufn, char *mfn, int mfnbuflen) { const char *p, *q, *pe; char expanded_pathname[MAXPATHLEN+1]; - + strcpy (mfn, ""); - + if (*ufn == '\0') return 1; p = ufn; - + /* Check for and handle volume names. Last comparison: strangely somewhere "/.emacs" is passed. A temporary fix for now. */ if (*p == '/' && strchr (p+1, '/') == NULL && strcmp (p, "/.emacs") != 0) @@ -216,10 +216,10 @@ posix_to_mac_pathname (const char *ufn, char *mfn, int mfnbuflen) strcat (expanded_pathname, p); p = expanded_pathname; /* now p points to the pathname with emacs dir prefix */ - } + } else if (*p != '/') /* relative pathname */ strcat (mfn, ":"); - + if (*p == '/') p++; @@ -252,7 +252,7 @@ posix_to_mac_pathname (const char *ufn, char *mfn, int mfnbuflen) p = pe; } } - + return 1; } @@ -311,7 +311,7 @@ stat_noalias (const char *path, struct stat *buf) cipb.hFileInfo.ioDirID = 0; cipb.hFileInfo.ioFDirIndex = 0; /* set to 0 to get information about specific dir or file */ - + errno = PBGetCatInfo (&cipb, false); if (errno == -43) /* -43: fnfErr defined in Errors.h */ errno = ENOENT; @@ -321,7 +321,7 @@ stat_noalias (const char *path, struct stat *buf) if (cipb.hFileInfo.ioFlAttrib & 0x10) /* bit 4 = 1 for directories */ { buf->st_mode = S_IFDIR | S_IREAD | S_IEXEC; - + if (!(cipb.hFileInfo.ioFlAttrib & 0x1)) buf->st_mode |= S_IWRITE; /* bit 1 = 1 for locked files/directories */ buf->st_ino = cipb.dirInfo.ioDrDirID; @@ -377,7 +377,7 @@ lstat (const char *path, struct stat *buf) if (find_true_pathname (path, true_pathname, MAXPATHLEN+1) == -1) return -1; - + return stat_noalias (true_pathname, buf); } @@ -386,16 +386,16 @@ int stat (const char *path, struct stat *sb) { int result; - char true_pathname[MAXPATHLEN+1], fully_resolved_name[MAXPATHLEN+1]; + char true_pathname[MAXPATHLEN+1], fully_resolved_name[MAXPATHLEN+1]; int len; - + if ((result = stat_noalias (path, sb)) >= 0 && ! (sb->st_mode & S_IFLNK)) return result; if (find_true_pathname (path, true_pathname, MAXPATHLEN+1) == -1) return -1; - + len = readlink (true_pathname, fully_resolved_name, MAXPATHLEN); if (len > -1) { @@ -437,10 +437,10 @@ mkdir (const char *dirname, int mode) HFileParam hfpb; char true_pathname[MAXPATHLEN+1], mac_pathname[MAXPATHLEN+1]; - + if (find_true_pathname (dirname, true_pathname, MAXPATHLEN+1) == -1) return -1; - + if (posix_to_mac_pathname (true_pathname, mac_pathname, MAXPATHLEN+1) == 0) return -1; @@ -448,7 +448,7 @@ mkdir (const char *dirname, int mode) hfpb.ioNamePtr = mac_pathname; hfpb.ioVRefNum = 0; /* ignored unless name is invalid */ hfpb.ioDirID = 0; /* parent is the root */ - + errno = PBDirCreate ((HParmBlkPtr) &hfpb, false); /* just return the Mac OSErr code for now */ return errno == noErr ? 0 : -1; @@ -460,7 +460,7 @@ sys_rmdir (const char *dirname) { HFileParam hfpb; char mac_pathname[MAXPATHLEN+1]; - + if (posix_to_mac_pathname (dirname, mac_pathname, MAXPATHLEN+1) == 0) return -1; @@ -468,7 +468,7 @@ sys_rmdir (const char *dirname) hfpb.ioNamePtr = mac_pathname; hfpb.ioVRefNum = 0; /* ignored unless name is invalid */ hfpb.ioDirID = 0; /* parent is the root */ - + errno = PBHDelete ((HParmBlkPtr) &hfpb, false); return errno == noErr ? 0 : -1; } @@ -487,14 +487,14 @@ execvp (const char *path, ...) int utime (const char *path, const struct utimbuf *times) { - char true_pathname[MAXPATHLEN+1], fully_resolved_name[MAXPATHLEN+1]; + char true_pathname[MAXPATHLEN+1], fully_resolved_name[MAXPATHLEN+1]; int len; char mac_pathname[MAXPATHLEN+1]; CInfoPBRec cipb; - + if (find_true_pathname (path, true_pathname, MAXPATHLEN+1) == -1) return -1; - + len = readlink (true_pathname, fully_resolved_name, MAXPATHLEN); if (len > -1) fully_resolved_name[len] = '\0'; @@ -508,9 +508,9 @@ utime (const char *path, const struct utimbuf *times) cipb.hFileInfo.ioNamePtr = mac_pathname; cipb.hFileInfo.ioVRefNum = 0; cipb.hFileInfo.ioDirID = 0; - cipb.hFileInfo.ioFDirIndex = 0; + cipb.hFileInfo.ioFDirIndex = 0; /* set to 0 to get information about specific dir or file */ - + errno = PBGetCatInfo (&cipb, false); if (errno != noErr) return -1; @@ -549,14 +549,14 @@ utime (const char *path, const struct utimbuf *times) int access (const char *path, int mode) { - char true_pathname[MAXPATHLEN+1], fully_resolved_name[MAXPATHLEN+1]; + char true_pathname[MAXPATHLEN+1], fully_resolved_name[MAXPATHLEN+1]; int len; char mac_pathname[MAXPATHLEN+1]; CInfoPBRec cipb; - + if (find_true_pathname (path, true_pathname, MAXPATHLEN+1) == -1) return -1; - + len = readlink (true_pathname, fully_resolved_name, MAXPATHLEN); if (len > -1) fully_resolved_name[len] = '\0'; @@ -572,7 +572,7 @@ access (const char *path, int mode) cipb.hFileInfo.ioDirID = 0; cipb.hFileInfo.ioFDirIndex = 0; /* set to 0 to get information about specific dir or file */ - + errno = PBGetCatInfo (&cipb, false); if (errno != noErr) return -1; @@ -605,16 +605,16 @@ access (const char *path, int mode) int sys_open (const char *path, int oflag) { - char true_pathname[MAXPATHLEN+1], fully_resolved_name[MAXPATHLEN+1]; + char true_pathname[MAXPATHLEN+1], fully_resolved_name[MAXPATHLEN+1]; int len; char mac_pathname[MAXPATHLEN+1]; - + if (strcmp (path, "/dev/null") == 0) return DEV_NULL_FD; /* some bogus fd to be ignored in write */ - + if (find_true_pathname (path, true_pathname, MAXPATHLEN+1) == -1) return -1; - + len = readlink (true_pathname, fully_resolved_name, MAXPATHLEN); if (len > -1) fully_resolved_name[len] = '\0'; @@ -642,10 +642,10 @@ sys_open (const char *path, int oflag) int sys_creat (const char *path, mode_t mode) { - char true_pathname[MAXPATHLEN+1]; + char true_pathname[MAXPATHLEN+1]; int len; char mac_pathname[MAXPATHLEN+1]; - + if (find_true_pathname (path, true_pathname, MAXPATHLEN+1) == -1) return -1; @@ -668,13 +668,13 @@ sys_creat (const char *path, mode_t mode) int sys_unlink (const char *path) { - char true_pathname[MAXPATHLEN+1], fully_resolved_name[MAXPATHLEN+1]; + char true_pathname[MAXPATHLEN+1], fully_resolved_name[MAXPATHLEN+1]; int len; char mac_pathname[MAXPATHLEN+1]; - + if (find_true_pathname (path, true_pathname, MAXPATHLEN+1) == -1) return -1; - + len = readlink (true_pathname, fully_resolved_name, MAXPATHLEN); if (len > -1) fully_resolved_name[len] = '\0'; @@ -723,13 +723,13 @@ int sys_rename (const char * old_name, const char * new_name) { char true_old_pathname[MAXPATHLEN+1], true_new_pathname[MAXPATHLEN+1]; - char fully_resolved_old_name[MAXPATHLEN+1]; + char fully_resolved_old_name[MAXPATHLEN+1]; int len; char mac_old_name[MAXPATHLEN+1], mac_new_name[MAXPATHLEN+1]; - + if (find_true_pathname (old_name, true_old_pathname, MAXPATHLEN+1) == -1) return -1; - + len = readlink (true_old_pathname, fully_resolved_old_name, MAXPATHLEN); if (len > -1) fully_resolved_old_name[len] = '\0'; @@ -738,7 +738,7 @@ sys_rename (const char * old_name, const char * new_name) if (find_true_pathname (new_name, true_new_pathname, MAXPATHLEN+1) == -1) return -1; - + if (strcmp (fully_resolved_old_name, true_new_pathname) == 0) return 0; @@ -746,7 +746,7 @@ sys_rename (const char * old_name, const char * new_name) mac_old_name, MAXPATHLEN+1)) return -1; - + if (!posix_to_mac_pathname(true_new_pathname, mac_new_name, MAXPATHLEN+1)) return -1; @@ -754,7 +754,7 @@ sys_rename (const char * old_name, const char * new_name) file in Unix. CW version fails in these situation. So we add a call to unlink here. */ (void) unlink (mac_new_name); - + return rename (mac_old_name, mac_new_name); } @@ -764,13 +764,13 @@ extern FILE *fopen (const char *name, const char *mode); FILE * sys_fopen (const char *name, const char *mode) { - char true_pathname[MAXPATHLEN+1], fully_resolved_name[MAXPATHLEN+1]; + char true_pathname[MAXPATHLEN+1], fully_resolved_name[MAXPATHLEN+1]; int len; char mac_pathname[MAXPATHLEN+1]; - + if (find_true_pathname (name, true_pathname, MAXPATHLEN+1) == -1) return 0; - + len = readlink (true_pathname, fully_resolved_name, MAXPATHLEN); if (len > -1) fully_resolved_name[len] = '\0'; @@ -843,7 +843,7 @@ select (n, rfds, wfds, efds, timeout) EMACS_GET_TIME (end_time); EMACS_ADD_TIME (end_time, end_time, *timeout); - + do { /* Also return true if an event other than a keyDown has @@ -858,7 +858,7 @@ select (n, rfds, wfds, efds, timeout) { Point mouse_pos; static Point old_mouse_pos = {-1, -1}; - + GetMouse (&mouse_pos); if (!EqualPt (mouse_pos, old_mouse_pos)) { @@ -866,10 +866,10 @@ select (n, rfds, wfds, efds, timeout) return 1; } } - + WaitNextEvent (0, &e, 1UL, NULL); /* Accept no event; wait 1 tic. by T.I. */ - + EMACS_GET_TIME (now); EMACS_SUB_TIME (now, end_time, now); } @@ -887,18 +887,18 @@ pause () { EventRecord e; unsigned long tick; - + if (!target_ticks) /* no alarm pending */ return -1; if ((tick = TickCount ()) < target_ticks) WaitNextEvent (0, &e, target_ticks - tick, NULL); /* Accept no event; just wait. by T.I. */ - + target_ticks = 0; if (alarm_signal_func) (*alarm_signal_func)(SIGALRM); - + return 0; } @@ -907,9 +907,9 @@ int alarm (int seconds) { long remaining = target_ticks ? (TickCount () - target_ticks) / 60 : 0; - + target_ticks = seconds ? TickCount () + 60 * seconds : 0; - + return (remaining < 0) ? 0 : (unsigned int) remaining; } @@ -932,9 +932,9 @@ sys_signal (int signal_num, __signal_func_ptr signal_func) else { #ifdef __MRC__ - __sigfun old_signal_func; + __sigfun old_signal_func; #elif __MWERKS__ - __signal_func_ptr old_signal_func; + __signal_func_ptr old_signal_func; #else You lose!!! #endif @@ -979,7 +979,7 @@ gettimeofday (tp) /* Get time since boot */ Microseconds (&uw_microseconds); - + /* Convert to time since midnight*/ w_microseconds.hi = uw_microseconds.hi; w_microseconds.lo = uw_microseconds.lo; @@ -1019,7 +1019,7 @@ struct tm * sys_gmtime (const time_t *timer) { time_t unix_time = *timer + CW_OR_MPW_UNIX_EPOCH_DIFF; - + return gmtime (&unix_time); } @@ -1034,7 +1034,7 @@ sys_localtime (const time_t *timer) #else time_t unix_time = *timer + CW_OR_MPW_UNIX_EPOCH_DIFF; #endif - + return localtime (&unix_time); } @@ -1049,7 +1049,7 @@ sys_ctime (const time_t *timer) #else time_t unix_time = *timer + CW_OR_MPW_UNIX_EPOCH_DIFF; #endif - + return ctime (&unix_time); } @@ -1067,7 +1067,7 @@ sys_time (time_t *timer) if (timer) *timer = mac_time; - + return mac_time; } @@ -1130,23 +1130,23 @@ mktemp (char *template) { int len, k; static seqnum = 0; - + len = strlen (template); k = len - 1; while (k >= 0 && template[k] == 'X') k--; - + k++; /* make k index of first 'X' */ - + if (k < len) { /* Zero filled, number of digits equal to the number of X's. */ sprintf (&template[k], "%0*d", len-k, seqnum++); - + return template; } else - return 0; + return 0; } @@ -1157,7 +1157,7 @@ mktemp (char *template) static char my_passwd_name[PASSWD_FIELD_SIZE]; static char my_passwd_dir[MAXPATHLEN+1]; -static struct passwd my_passwd = +static struct passwd my_passwd = { my_passwd_name, my_passwd_dir, @@ -1201,7 +1201,7 @@ init_emacs_passwd_dir () } } } - + if (!found) { /* Setting to "/" probably won't work but set it to something @@ -1212,7 +1212,7 @@ init_emacs_passwd_dir () } -static struct passwd emacs_passwd = +static struct passwd emacs_passwd = { "emacs", emacs_passwd_dir, @@ -1248,11 +1248,11 @@ struct passwd * getpwuid (uid_t uid) { if (!my_passwd_inited) - { + { init_my_passwd (); my_passwd_inited = 1; } - + return &my_passwd; } @@ -1264,11 +1264,11 @@ getpwnam (const char *name) return &emacs_passwd; if (!my_passwd_inited) - { + { init_my_passwd (); my_passwd_inited = 1; } - + return &my_passwd; } @@ -1310,7 +1310,7 @@ int sigblock (int mask) { return 0; -} +} void @@ -1392,7 +1392,7 @@ path_from_vol_dir_name (char *path, int man_path_len, short vol_ref_num, err = PBGetCatInfo (&cipb, false); if (err != noErr) return 0; - + p2cstr (dir_name); if (strlen (dir_name) + strlen (path) + 1 >= man_path_len) return 0; @@ -1404,7 +1404,7 @@ path_from_vol_dir_name (char *path, int man_path_len, short vol_ref_num, } while (cipb.dirInfo.ioDrDirID != fsRtDirID); /* stop when we see the volume's root directory */ - + return 1; /* success */ } @@ -1468,7 +1468,7 @@ find_true_pathname (const char *path, char *buf, int bufsiz) return -1; buf[0] = '\0'; - + p = path; if (*p == '/') q = strchr (p + 1, '/'); @@ -1492,10 +1492,10 @@ find_true_pathname (const char *path, char *buf, int bufsiz) p = q + 1; q = strchr(p, '/'); } - + if (len + strlen (p) + 1 >= bufsiz) return -1; - + strcat (buf, p); return len + strlen (p); } @@ -1543,7 +1543,7 @@ int dup2 (int oldd, int newd) { int fd, ret; - + close (newd); fd = dup (oldd); @@ -1654,7 +1654,7 @@ get_temp_dir_name () CInfoPBRec cpb; char unix_dir_name[MAXPATHLEN+1]; DIR *dir; - + /* Cache directory name with pointer temp_dir_name. Look for it only the first time. */ if (!temp_dir_name) @@ -1663,18 +1663,18 @@ get_temp_dir_name () &vol_ref_num, &dir_id); if (err != noErr) return NULL; - + if (!path_from_vol_dir_name (full_path, 255, vol_ref_num, dir_id, "\p")) return NULL; if (strlen (full_path) + 6 <= MAXPATHLEN) strcat (full_path, "Emacs:"); - else + else return NULL; if (!mac_to_posix_pathname (full_path, unix_dir_name, MAXPATHLEN+1)) return NULL; - + dir = opendir (unix_dir_name); /* check whether temp directory exists */ if (dir) closedir (dir); @@ -1693,7 +1693,7 @@ get_temp_dir_name () /* Allocate and construct an array of pointers to strings from a list of strings stored in a 'STR#' resource. The returned pointer array is stored in the style of argv and environ: if the 'STR#' resource - contains numString strings, an pointer array with numString+1 + contains numString strings, a pointer array with numString+1 elements is returned in which the last entry contains a null pointer. The pointer to the pointer array is passed by pointer in parameter t. The resource ID of the 'STR#' resource is passed in @@ -1747,19 +1747,19 @@ get_path_to_system_folder () CInfoPBRec cpb; static char system_folder_unix_name[MAXPATHLEN+1]; DIR *dir; - + err = FindFolder (kOnSystemDisk, kSystemFolderType, kDontCreateFolder, &vol_ref_num, &dir_id); if (err != noErr) return NULL; - + if (!path_from_vol_dir_name (full_path, 255, vol_ref_num, dir_id, "\p")) return NULL; if (!mac_to_posix_pathname (full_path, system_folder_unix_name, MAXPATHLEN+1)) return NULL; - + return system_folder_unix_name; } @@ -1774,7 +1774,7 @@ void init_environ () { int i; - + get_string_list (&environ, ENVIRON_STRING_LIST_ID); i = 0; @@ -1918,7 +1918,7 @@ mystrchr (char *s, char c) char * mystrtok (char *s) -{ +{ while (*s) s++; @@ -1974,7 +1974,7 @@ run_mac_command (argv, workdir, infn, outfn, errfn) RgnHandle cursor_region_handle; TargetID targ; unsigned long ref_con, len; - + if (posix_to_mac_pathname (workdir, macworkdir, MAXPATHLEN+1) == 0) return -1; if (posix_to_mac_pathname (infn, macinfn, MAXPATHLEN+1) == 0) @@ -1983,7 +1983,7 @@ run_mac_command (argv, workdir, infn, outfn, errfn) return -1; if (posix_to_mac_pathname (errfn, macerrfn, MAXPATHLEN+1) == 0) return -1; - + paramlen = strlen (macworkdir) + strlen (macinfn) + strlen (macoutfn) + strlen (macerrfn) + 4; /* count nulls at end of strings */ @@ -2002,14 +2002,14 @@ run_mac_command (argv, workdir, infn, outfn, errfn) && argc == 3 && strcmp (argv[1], "-c") == 0) { char *command, *t, tempmacpathname[MAXPATHLEN+1]; - + /* The arguments for the command in argv[2] are separated by spaces. Count them and put the count in newargc. */ command = (char *) alloca (strlen (argv[2])+2); strcpy (command, argv[2]); if (command[strlen (command) - 1] != ' ') strcat (command, " "); - + t = command; newargc = 0; t = mystrchr (t, ' '); @@ -2018,9 +2018,9 @@ run_mac_command (argv, workdir, infn, outfn, errfn) newargc++; t = mystrchr (t+1, ' '); } - + newargv = (char **) alloca (sizeof (char *) * newargc); - + t = command; for (j = 0; j < newargc; j++) { @@ -2030,7 +2030,7 @@ run_mac_command (argv, workdir, infn, outfn, errfn) t = mystrtok (t); paramlen += strlen (newargv[j]) + 1; } - + if (strncmp (newargv[0], "~emacs/", 7) == 0) { if (posix_to_mac_pathname (newargv[0], tempmacpathname, MAXPATHLEN+1) @@ -2057,12 +2057,12 @@ run_mac_command (argv, workdir, infn, outfn, errfn) strcpy (macappname, tempmacpathname); } else - { + { if (posix_to_mac_pathname (argv[0], macappname, MAXPATHLEN+1) == 0) return -1; newargv = (char **) alloca (sizeof (char *) * argc); - newargc = argc; + newargc = argc; for (j = 1; j < argc; j++) { if (strncmp (argv[j], "~emacs/", 7) == 0) @@ -2092,7 +2092,7 @@ run_mac_command (argv, workdir, infn, outfn, errfn) } } else - newargv[j] = argv[j]; + newargv[j] = argv[j]; paramlen += strlen (newargv[j]) + 1; } } @@ -2113,24 +2113,24 @@ run_mac_command (argv, workdir, infn, outfn, errfn) /* null terminate strings sent so it's possible to use strcpy over there */ strcpy (p, macinfn); p += strlen (macinfn); - *p++ = '\0'; + *p++ = '\0'; strcpy (p, macoutfn); p += strlen (macoutfn); - *p++ = '\0'; + *p++ = '\0'; strcpy (p, macerrfn); p += strlen (macerrfn); - *p++ = '\0'; + *p++ = '\0'; for (j = 1; j < newargc; j++) { strcpy (p, newargv[j]); p += strlen (newargv[j]); - *p++ = '\0'; + *p++ = '\0'; } - + c2pstr (macappname); - + iErr = FSMakeFSSpec (0, 0, macappname, &spec); - + if (iErr != noErr) { free (param); @@ -2171,7 +2171,7 @@ run_mac_command (argv, workdir, infn, outfn, errfn) } cursor_region_handle = NewRgn (); - + /* Wait for the subprocess to finish, when it will send us a ERPY high level event. */ while (1) @@ -2179,7 +2179,7 @@ run_mac_command (argv, workdir, infn, outfn, errfn) cursor_region_handle) && reply_event.message == kEmacsSubprocessReply) break; - + /* The return code is sent through the refCon */ iErr = AcceptHighLevelEvent (&targ, &ref_con, NULL, &len); if (iErr != noErr) @@ -2188,7 +2188,7 @@ run_mac_command (argv, workdir, infn, outfn, errfn) free (param); return -1; } - + DisposeHandle ((Handle) cursor_region_handle); free (param); @@ -2200,16 +2200,16 @@ run_mac_command (argv, workdir, infn, outfn, errfn) DIR * opendir (const char *dirname) { - char true_pathname[MAXPATHLEN+1], fully_resolved_name[MAXPATHLEN+1]; + char true_pathname[MAXPATHLEN+1], fully_resolved_name[MAXPATHLEN+1]; char mac_pathname[MAXPATHLEN+1], vol_name[MAXPATHLEN+1]; DIR *dirp; CInfoPBRec cipb; HVolumeParam vpb; int len, vol_name_len; - + if (find_true_pathname (dirname, true_pathname, MAXPATHLEN+1) == -1) return 0; - + len = readlink (true_pathname, fully_resolved_name, MAXPATHLEN); if (len > -1) fully_resolved_name[len] = '\0'; @@ -2237,7 +2237,7 @@ opendir (const char *dirname) len = strlen (mac_pathname); if (mac_pathname[len - 1] != ':' && len < MAXPATHLEN) strcat (mac_pathname, ":"); - + /* Extract volume name */ vol_name_len = strchr (mac_pathname, ':') - mac_pathname; strncpy (vol_name, mac_pathname, vol_name_len); @@ -2251,7 +2251,7 @@ opendir (const char *dirname) cipb.hFileInfo.ioDirID = 0; cipb.hFileInfo.ioFDirIndex = 0; /* set to 0 to get information about specific dir or file */ - + errno = PBGetCatInfo (&cipb, false); if (errno != noErr) { @@ -2279,7 +2279,7 @@ opendir (const char *dirname) } dirp->vol_ref_num = vpb.ioVRefNum; - + return dirp; } @@ -2312,14 +2312,14 @@ readdir (DIR *dp) hpblock.volumeParam.ioNamePtr = s_name; hpblock.volumeParam.ioVRefNum = 0; hpblock.volumeParam.ioVolIndex = dp->current_index; - + errno = PBHGetVInfo (&hpblock, false); if (errno != noErr) { errno = ENOENT; return 0; } - + p2cstr (s_name); strcat (s_name, "/"); /* need "/" for stat to work correctly */ @@ -2327,7 +2327,7 @@ readdir (DIR *dp) s_dirent.d_ino = hpblock.volumeParam.ioVRefNum; s_dirent.d_name = s_name; - + return &s_dirent; } else @@ -2343,25 +2343,25 @@ readdir (DIR *dp) cipb.hFileInfo.ioDirID = dp->dir_id; /* directory ID found by opendir */ cipb.hFileInfo.ioFDirIndex = dp->current_index; - + errno = PBGetCatInfo (&cipb, false); if (errno != noErr) { errno = ENOENT; return 0; } - - /* insist on an visibile entry */ + + /* insist on a visible entry */ if (cipb.hFileInfo.ioFlAttrib & 0x10) /* directory? */ done = !(cipb.dirInfo.ioDrUsrWds.frFlags & fInvisible); else done = !(cipb.hFileInfo.ioFlFndrInfo.fdFlags & fInvisible); - + dp->current_index++; } p2cstr (s_name); - + p = s_name; while (*p) { @@ -2373,7 +2373,7 @@ readdir (DIR *dp) s_dirent.d_ino = cipb.dirInfo.ioDrDirID; /* value unimportant: non-zero for valid file */ s_dirent.d_name = s_name; - + return &s_dirent; } } @@ -2404,7 +2404,7 @@ initialize_applescript () { AEDesc null_desc; OSAError osaerror; - + /* if open fails, as_scripting_component is set to NULL. Its subsequent use in OSA calls will fail with badComponentInstance error. */ @@ -2530,7 +2530,7 @@ component. */) long status; CHECK_STRING (script); - + status = do_applescript (SDATA (script), &result); if (status) { @@ -2567,7 +2567,7 @@ DEFUN ("mac-file-name-to-posix", Fmac_file_name_to_posix, char posix_filename[MAXPATHLEN+1]; CHECK_STRING (mac_filename); - + if (mac_to_posix_pathname (SDATA (mac_filename), posix_filename, MAXPATHLEN)) return build_string (posix_filename); @@ -2585,7 +2585,7 @@ DEFUN ("posix-file-name-to-mac", Fposix_file_name_to_mac, char mac_filename[MAXPATHLEN+1]; CHECK_STRING (posix_filename); - + if (posix_to_mac_pathname (SDATA (posix_filename), mac_filename, MAXPATHLEN)) return build_string (mac_filename); @@ -2622,7 +2622,7 @@ DEFUN ("mac-paste-function", Fmac_paste_function, Smac_paste_function, 0, 0, 0, if (GetScrapFlavorData (scrap, kScrapFlavorTypeText, &s, data) != noErr || s == 0) return Qnil; - + /* Emacs expects clipboard contents have Unix-style eol's */ for (i = 0; i < s; i++) if (data[i] == '\r') @@ -2650,7 +2650,7 @@ DEFUN ("mac-paste-function", Fmac_paste_function, Smac_paste_function, 0, 0, 0, value = make_string (*my_handle, rc); HUnlock (my_handle); - + DisposeHandle (my_handle); return value; @@ -2671,12 +2671,12 @@ DEFUN ("mac-cut-function", Fmac_cut_function, Smac_cut_function, 1, 2, 0, /* fixme: ignore the push flag for now */ CHECK_STRING (value); - + len = SCHARS (value); buf = (char *) alloca (len+1); bcopy (SDATA (value), buf, len); buf[len] = '\0'; - + /* convert to Mac-style eol's before sending to clipboard */ for (i = 0; i < len; i++) if (buf[i] == '\n') @@ -2697,7 +2697,7 @@ DEFUN ("mac-cut-function", Fmac_cut_function, Smac_cut_function, 1, 2, 0, ZeroScrap (); PutScrap (len, 'TEXT', buf); #endif /* not TARGET_API_MAC_CARBON */ - + return Qnil; } @@ -2911,7 +2911,7 @@ syms_of_mac () { QCLIPBOARD = intern ("CLIPBOARD"); staticpro (&QCLIPBOARD); - + defsubr (&Smac_paste_function); defsubr (&Smac_cut_function); defsubr (&Sx_selection_exists_p); diff --git a/src/macfns.c b/src/macfns.c index f1e42d17aec..44bbb3130e2 100644 --- a/src/macfns.c +++ b/src/macfns.c @@ -326,7 +326,7 @@ check_x_frame (frame) return f; } -/* Let the user specify an display with a frame. +/* Let the user specify a display with a frame. nil stands for the selected frame--or, if that is not a mac frame, the first display on the list. */ @@ -363,7 +363,7 @@ check_x_display_info (frame) } } -/* Return the Emacs frame-object corresponding to an mac window. +/* Return the Emacs frame-object corresponding to a mac window. It could be the frame's main window or an icon window. */ /* This function can be called during GC, so use GC_xxx type test macros. */ @@ -1969,7 +1969,7 @@ x_to_mac_color (colorname) if (value < 0.0 || value > 1.0) break; val = (unsigned long)(0x100 * value); - /* We used 0x100 instead of 0xFF to give an continuous + /* We used 0x100 instead of 0xFF to give a continuous range between 0.0 and 1.0 inclusive. The next statement fixes the 1.0 case. */ if (val == 0x100) @@ -2355,7 +2355,7 @@ x_set_cursor_color (f, arg, oldval) /* Set the border-color of frame F to pixel value PIX. Note that this does not fully take effect if done before - F has an window. */ + F has a window. */ void x_set_border_pixel (f, pix) struct frame *f; @@ -3011,7 +3011,7 @@ x_set_scroll_bar_width (f, arg, oldval) XWINDOW (FRAME_SELECTED_WINDOW (f))->cursor.x = 0; } -/* Subroutines of creating an frame. */ +/* Subroutines of creating a frame. */ /* Make sure that Vx_resource_name is set to a reasonable value. Fix it up, or set it to `emacs' if it is too hopeless. */ @@ -9471,7 +9471,7 @@ x_create_tip_frame (dpyinfo, parms) f->height = 0; SET_FRAME_WIDTH (f, 0); change_frame_size (f, height, width, 1, 0, 0); - + /* Add `tooltip' frame parameter's default value. */ if (NILP (Fframe_parameter (frame, intern ("tooltip")))) Fmodify_frame_parameters (frame, Fcons (Fcons (intern ("tooltip"), Qt), diff --git a/src/syntax.c b/src/syntax.c index 0f2cda592aa..f7b45cd6acc 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -199,7 +199,7 @@ update_syntax_table (charpos, count, init, object) if (invalidate) invalidate = !EQ (tmp_table, gl_state.old_prop); /* Need to invalidate? */ - + if (invalidate) /* Did not get to adjacent interval. */ { /* with the same table => */ /* invalidate the old range. */ @@ -222,13 +222,13 @@ update_syntax_table (charpos, count, init, object) if (EQ (Fsyntax_table_p (tmp_table), Qt)) { gl_state.use_global = 0; - } + } else if (CONSP (tmp_table)) { gl_state.use_global = 1; gl_state.global_code = tmp_table; } - else + else { gl_state.use_global = 0; gl_state.current_syntax_table = current_buffer->syntax_table; @@ -251,7 +251,7 @@ update_syntax_table (charpos, count, init, object) } return; } - else if (cnt == INTERVALS_AT_ONCE) + else if (cnt == INTERVALS_AT_ONCE) { if (count > 0) { @@ -428,7 +428,7 @@ prev_char_comend_first (pos, pos_byte) * int pos, pos_byte; * { * int c, val; - * + * * DEC_BOTH (pos, pos_byte); * UPDATE_SYNTAX_TABLE_BACKWARD (pos); * c = FETCH_CHAR (pos_byte); @@ -468,7 +468,7 @@ back_comment (from, from_byte, stop, comnested, comstyle, charpos_ptr, bytepos_p int string_style = -1; /* Presumed outside of any string. */ int string_lossage = 0; /* Not a real lossage: indicates that we have passed a matching comment - starter plus an non-matching comment-ender, meaning that any matching + starter plus a non-matching comment-ender, meaning that any matching comment-starter we might see later could be a false positive (hidden inside another comment). Test case: { a (* b } c (* d *) */ @@ -584,7 +584,7 @@ back_comment (from, from_byte, stop, comnested, comstyle, charpos_ptr, bytepos_p There's no way to grok this scanning backwards. */ string_lossage = 1; break; - + case Scomment: /* We've already checked that it is the relevant comstyle. */ if (string_style != -1 || comment_lossage || string_lossage) @@ -705,7 +705,7 @@ back_comment (from, from_byte, stop, comnested, comstyle, charpos_ptr, bytepos_p from_byte = CHAR_TO_BYTE (from); UPDATE_SYNTAX_TABLE_FORWARD (from - 1); } - + done: *charpos_ptr = from; *bytepos_ptr = from_byte; @@ -732,7 +732,7 @@ check_syntax_table (obj) if (!(CHAR_TABLE_P (obj) && EQ (XCHAR_TABLE (obj)->purpose, Qsyntax_table))) wrong_type_argument (Qsyntax_table_p, obj); -} +} DEFUN ("syntax-table", Fsyntax_table, Ssyntax_table, 0, 0, 0, doc: /* Return the current syntax table. @@ -961,7 +961,7 @@ text property. */) val |= 1 << 22; break; } - + if (val < XVECTOR (Vsyntax_code_object)->size && NILP (match)) return XVECTOR (Vsyntax_code_object)->contents[val]; else @@ -971,7 +971,7 @@ text property. */) /* I really don't know why this is interactive help-form should at least be made useful whilst reading the second arg. */ -DEFUN ("modify-syntax-entry", Fmodify_syntax_entry, Smodify_syntax_entry, 2, 3, +DEFUN ("modify-syntax-entry", Fmodify_syntax_entry, Smodify_syntax_entry, 2, 3, "cSet syntax for character: \nsSet syntax for %s to: ", doc: /* Set syntax for character CHAR according to string NEWENTRY. The syntax is changed only for table SYNTAX_TABLE, which defaults to @@ -1293,7 +1293,7 @@ and the function returns nil. Field boundaries are not noticed if /* Avoid jumping out of an input field. */ val = XFASTINT (Fconstrain_to_field (make_number (val), make_number (PT), Qt, Qnil, Qnil)); - + SET_PT (val); return val == orig_val ? Qt : Qnil; } @@ -1729,7 +1729,7 @@ forw_comment (from, from_byte, stop, nesting, style, prev_syntax, nesting++; INC_BOTH (from, from_byte); UPDATE_SYNTAX_TABLE_FORWARD (from); - + forw_incomment: if (from < stop && SYNTAX_FLAGS_COMEND_FIRST (syntax) && SYNTAX_FLAGS_COMMENT_STYLE (syntax) == style @@ -1826,7 +1826,7 @@ between them, return t; otherwise return nil. */) && (c1 = FETCH_CHAR (from_byte), SYNTAX_COMSTART_SECOND (c1))) { - /* We have encountered a comment start sequence and we + /* We have encountered a comment start sequence and we are ignoring all text inside comments. We must record the comment style this sequence begins so that later, only a comment end of the same style actually ends @@ -1907,7 +1907,7 @@ between them, return t; otherwise return nil. */) { /* Skip until first preceding unquoted comment_fence. */ int found = 0, ini = from, ini_byte = from_byte; - + while (1) { DEC_BOTH (from, from_byte); @@ -1916,9 +1916,9 @@ between them, return t; otherwise return nil. */) UPDATE_SYNTAX_TABLE_BACKWARD (from); c = FETCH_CHAR (from_byte); if (SYNTAX (c) == Scomment_fence - && !char_quoted (from, from_byte)) + && !char_quoted (from, from_byte)) { - found = 1; + found = 1; break; } } @@ -2036,7 +2036,7 @@ scan_lists (from, count, depth, sexpflag) && SYNTAX_COMSTART_SECOND (FETCH_CHAR (from_byte)) && parse_sexp_ignore_comments) { - /* we have encountered a comment start sequence and we + /* we have encountered a comment start sequence and we are ignoring all text inside comments. We must record the comment style this sequence begins so that later, only a comment end of the same style actually ends @@ -2048,7 +2048,7 @@ scan_lists (from, count, depth, sexpflag) INC_BOTH (from, from_byte); UPDATE_SYNTAX_TABLE_FORWARD (from); } - + if (prefix) continue; @@ -2209,7 +2209,7 @@ scan_lists (from, count, depth, sexpflag) comstyle = SYNTAX_COMMENT_STYLE (c1); comnested = comnested || SYNTAX_COMMENT_NESTED (c1); } - + /* Quoting turns anything except a comment-ender into a word character. Note that this cannot be true if we decremented FROM in the if-statement above. */ @@ -2310,14 +2310,14 @@ scan_lists (from, count, depth, sexpflag) DEC_BOTH (from, from_byte); if (from == stop) goto lose; UPDATE_SYNTAX_TABLE_BACKWARD (from); - if (!char_quoted (from, from_byte) + if (!char_quoted (from, from_byte) && (c = FETCH_CHAR (from_byte), SYNTAX_WITH_MULTIBYTE_CHECK (c) == code)) break; } if (code == Sstring_fence && !depth && sexpflag) goto done2; break; - + case Sstring: stringterm = FETCH_CHAR (from_byte); while (1) @@ -2425,7 +2425,7 @@ This includes chars with "quote" or "prefix" syntax (' or p). */) int pos_byte = PT_BYTE; int c; - if (pos <= beg) + if (pos <= beg) { SET_PT_BOTH (opoint, opoint_byte); @@ -2533,8 +2533,8 @@ do { prev_from = from; \ oldstate = Fcdr (oldstate); tem = Fcar (oldstate); /* Check whether we are inside string_fence-style string: */ - state.instring = (!NILP (tem) - ? (INTEGERP (tem) ? XINT (tem) : ST_STRING_STYLE) + state.instring = (!NILP (tem) + ? (INTEGERP (tem) ? XINT (tem) : ST_STRING_STYLE) : -1); oldstate = Fcdr (oldstate); @@ -2552,7 +2552,7 @@ do { prev_from = from; \ oldstate = Fcdr (oldstate); oldstate = Fcdr (oldstate); tem = Fcar (oldstate); - state.comstyle = NILP (tem) ? 0 : (EQ (tem, Qsyntax_table) + state.comstyle = NILP (tem) ? 0 : (EQ (tem, Qsyntax_table) ? ST_COMMENT_STYLE : 1); oldstate = Fcdr (oldstate); @@ -2735,14 +2735,14 @@ do { prev_from = from; \ state.comstr_start = from - 1; if (stopbefore) goto stop; /* this arg means stop at sexp start */ curlevel->last = prev_from; - state.instring = (code == Sstring + state.instring = (code == Sstring ? (FETCH_CHAR (prev_from_byte)) : ST_STRING_STYLE); if (boundary_stop) goto done; startinstring: { nofence = state.instring != ST_STRING_STYLE; - + while (1) { int c; @@ -2824,7 +2824,7 @@ Value is a list of ten elements describing final state of parsing: 3. non-nil if inside a string. (it is the character that will terminate the string, or t if the string should be terminated by a generic string delimiter.) - 4. nil if outside a comment, t if inside a non-nestable comment, + 4. nil if outside a comment, t if inside a non-nestable comment, else an integer (the current comment nesting). 5. t if following a quote character. 6. the minimum paren-depth encountered during this scan. @@ -2860,23 +2860,23 @@ Sixth arg COMMENTSTOP non-nil means stop at the start of a comment. scan_sexps_forward (&state, XINT (from), CHAR_TO_BYTE (XINT (from)), XINT (to), target, !NILP (stopbefore), oldstate, - (NILP (commentstop) + (NILP (commentstop) ? 0 : (EQ (commentstop, Qsyntax_table) ? -1 : 1))); SET_PT (state.location); - + return Fcons (make_number (state.depth), Fcons (state.prevlevelstart < 0 ? Qnil : make_number (state.prevlevelstart), Fcons (state.thislevelstart < 0 ? Qnil : make_number (state.thislevelstart), - Fcons (state.instring >= 0 - ? (state.instring == ST_STRING_STYLE + Fcons (state.instring >= 0 + ? (state.instring == ST_STRING_STYLE ? Qt : make_number (state.instring)) : Qnil, Fcons (state.incomment < 0 ? Qt : (state.incomment == 0 ? Qnil : make_number (state.incomment)), Fcons (state.quoted ? Qt : Qnil, Fcons (make_number (state.mindepth), - Fcons ((state.comstyle + Fcons ((state.comstyle ? (state.comstyle == ST_COMMENT_STYLE ? Qsyntax_table : Qt) : Qnil), diff --git a/src/w32fns.c b/src/w32fns.c index 2e0352ab68a..f4dd0421694 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -296,7 +296,7 @@ static HWND track_mouse_window; FARPROC track_mouse_event_fn; /* W95 mousewheel handler */ -unsigned int msh_mousewheel = 0; +unsigned int msh_mousewheel = 0; /* Timers */ #define MOUSE_BUTTON_ID 1 @@ -346,7 +346,7 @@ check_w32 () /* Nonzero if we can use mouse menus. You should not call this unless HAVE_MENUS is defined. */ - + int have_menus_p () { @@ -371,7 +371,7 @@ check_x_frame (frame) return f; } -/* Let the user specify an display with a frame. +/* Let the user specify a display with a frame. nil stands for the selected frame--or, if that is not a w32 frame, the first display on the list. */ @@ -382,7 +382,7 @@ check_x_display_info (frame) if (NILP (frame)) { struct frame *sf = XFRAME (selected_frame); - + if (FRAME_W32_P (sf) && FRAME_LIVE_P (sf)) return FRAME_W32_DISPLAY_INFO (sf); else @@ -590,7 +590,7 @@ x_create_bitmap_from_file (f, file) if (hinst == NULL) return -1; - + result = XReadBitmapFile (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f), filename, &width, &height, &bitmap, &xhot, &yhot); if (result != BitmapSuccess) @@ -863,7 +863,7 @@ x_set_frame_parameters (f, alist) They are independent of other properties, but other properties (e.g., cursor_color) are dependent upon them. */ /* Process default font as well, since fringe widths depends on it. */ - for (p = 0; p < i; p++) + for (p = 0; p < i; p++) { Lisp_Object prop, val; @@ -882,7 +882,7 @@ x_set_frame_parameters (f, alist) if (NILP (Fequal (val, old_value))) { store_frame_param (f, prop, val); - + param_index = Fget (prop, Qx_frame_parameter); if (NATNUMP (param_index) && (XFASTINT (param_index) @@ -978,7 +978,7 @@ x_set_frame_parameters (f, alist) position. Resize of the frame is taken care of in the code after this if-statement. */ int new_left, new_top; - + x_fullscreen_adjust (f, &width, &height, &new_top, &new_left); x_fullscreen_move (f, new_top, new_left); } @@ -1245,13 +1245,13 @@ where R,G,B are numbers between 0 and 255 and name is an arbitrary string. */) } /* The default colors for the w32 color map */ -typedef struct colormap_t +typedef struct colormap_t { char *name; COLORREF colorref; } colormap_t; -colormap_t w32_color_map[] = +colormap_t w32_color_map[] = { {"snow" , PALETTERGB (255,250,250)}, {"ghost white" , PALETTERGB (248,248,255)}, @@ -1502,36 +1502,36 @@ DEFUN ("w32-default-color-map", Fw32_default_color_map, Sw32_default_color_map, int i; colormap_t *pc = w32_color_map; Lisp_Object cmap; - + BLOCK_INPUT; - + cmap = Qnil; - - for (i = 0; i < sizeof (w32_color_map) / sizeof (w32_color_map[0]); + + for (i = 0; i < sizeof (w32_color_map) / sizeof (w32_color_map[0]); pc++, i++) cmap = Fcons (Fcons (build_string (pc->name), make_number (pc->colorref)), cmap); - + UNBLOCK_INPUT; - + return (cmap); } -Lisp_Object +Lisp_Object w32_to_x_color (rgb) Lisp_Object rgb; { Lisp_Object color; - + CHECK_NUMBER (rgb); - + BLOCK_INPUT; - + color = Frassq (rgb, Vw32_color_map); - + UNBLOCK_INPUT; - + if (!NILP (color)) return (Fcar (color)); else @@ -1570,7 +1570,7 @@ w32_color_map_lookup (colorname) return ret; } -COLORREF +COLORREF x_to_w32_color (colorname) char * colorname; { @@ -1584,7 +1584,7 @@ x_to_w32_color (colorname) char *color; int size; color = colorname + 1; - + size = strlen(color); if (size == 3 || size == 6 || size == 9 || size == 12) { @@ -1593,7 +1593,7 @@ x_to_w32_color (colorname) pos = 0; size /= 3; colorval = 0; - + for (i = 0; i < 3; i++) { char *end; @@ -1649,7 +1649,7 @@ x_to_w32_color (colorname) { char *end; unsigned long value; - + /* The check for 'x' in the following conditional takes into account the fact that strtol allows a "0x" in front of our numbers, and we don't. */ @@ -1712,7 +1712,7 @@ x_to_w32_color (colorname) if (value < 0.0 || value > 1.0) break; val = (UINT)(0x100 * value); - /* We used 0x100 instead of 0xFF to give an continuous + /* We used 0x100 instead of 0xFF to give a continuous range between 0.0 and 1.0 inclusive. The next statement fixes the 1.0 case. */ if (val == 0x100) @@ -1736,27 +1736,27 @@ x_to_w32_color (colorname) RGB. */ /* If we fail to lookup the color name in w32_color_map, then check the - colorname to see if it can be crudely approximated: If the X color + colorname to see if it can be crudely approximated: If the X color ends in a number (e.g., "darkseagreen2"), strip the number and return the result of looking up the base color name. */ ret = w32_color_map_lookup (colorname); - if (NILP (ret)) + if (NILP (ret)) { int len = strlen (colorname); - if (isdigit (colorname[len - 1])) + if (isdigit (colorname[len - 1])) { char *ptr, *approx = alloca (len + 1); strcpy (approx, colorname); ptr = &approx[len - 1]; - while (ptr > approx && isdigit (*ptr)) + while (ptr > approx && isdigit (*ptr)) *ptr-- = '\0'; ret = w32_color_map_lookup (approx); } } - + UNBLOCK_INPUT; return ret; } @@ -1911,7 +1911,7 @@ w32_defined_color (f, color, color_def, alloc) tem = x_to_w32_color (color); - if (!NILP (tem)) + if (!NILP (tem)) { if (f) { @@ -1928,7 +1928,7 @@ w32_defined_color (f, color, color_def, alloc) one_w32_display_info.color_list; struct w32_palette_entry ** prev = &one_w32_display_info.color_list; - + /* check if color is already mapped */ while (entry) { @@ -1964,7 +1964,7 @@ w32_defined_color (f, color, color_def, alloc) return 1; } - else + else { return 0; } @@ -2166,7 +2166,7 @@ x_set_mouse_color (f, arg, oldval) else hourglass_cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f), XC_watch); x_check_errors (FRAME_W32_DISPLAY (f), "bad busy pointer cursor: %s"); - + x_check_errors (FRAME_W32_DISPLAY (f), "bad nontext pointer cursor: %s"); if (!EQ (Qnil, Vx_mode_pointer_shape)) { @@ -2249,7 +2249,7 @@ x_set_mouse_color (f, arg, oldval) && f->output_data.w32->modeline_cursor != 0) XFreeCursor (FRAME_W32_DISPLAY (f), f->output_data.w32->modeline_cursor); f->output_data.w32->modeline_cursor = mode_cursor; - + if (cross_cursor != f->output_data.w32->cross_cursor && f->output_data.w32->cross_cursor != 0) XFreeCursor (FRAME_W32_DISPLAY (f), f->output_data.w32->cross_cursor); @@ -2279,7 +2279,7 @@ x_set_cursor_color (f, arg, oldval) fore_pixel = FRAME_BACKGROUND_PIXEL (f); pixel = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f)); - + /* Make sure that the cursor color differs from the background color. */ if (pixel == FRAME_BACKGROUND_PIXEL (f)) { @@ -2312,7 +2312,7 @@ x_set_cursor_color (f, arg, oldval) /* Set the border-color of frame F to pixel value PIX. Note that this does not fully take effect if done before - F has an window. */ + F has a window. */ void x_set_border_pixel (f, pix) struct frame *f; @@ -2369,7 +2369,7 @@ x_set_icon_type (f, arg, oldval) if (NILP (arg) && NILP (oldval)) return; - if (STRINGP (arg) && STRINGP (oldval) + if (STRINGP (arg) && STRINGP (oldval) && EQ (Fstring_equal (oldval, arg), Qt)) return; @@ -2474,7 +2474,7 @@ x_set_font (f, arg, oldval) ? x_new_fontset (f, SDATA (fontset_name)) : x_new_font (f, SDATA (arg))); UNBLOCK_INPUT; - + if (EQ (result, Qnil)) error ("Font `%s' is not defined", SDATA (arg)); else if (EQ (result, Qt)) @@ -2741,7 +2741,7 @@ x_set_name (f, name, explicit) Lisp_Object name; int explicit; { - /* Make sure that requests from lisp code override requests from + /* Make sure that requests from lisp code override requests from Emacs redisplay code. */ if (explicit) { @@ -2889,7 +2889,7 @@ x_set_vertical_scroll_bars (f, arg, oldval) /* Put scroll bars on the right by default, as is conventional on MS-Windows. */ EQ (Qleft, arg) - ? vertical_scroll_bar_left + ? vertical_scroll_bar_left : vertical_scroll_bar_right; /* We set this parameter before creating the window for the @@ -2930,10 +2930,10 @@ x_set_scroll_bar_width (f, arg, oldval) } change_frame_size (f, 0, FRAME_WIDTH (f), 0, 0, 0); XWINDOW (FRAME_SELECTED_WINDOW (f))->cursor.hpos = 0; - XWINDOW (FRAME_SELECTED_WINDOW (f))->cursor.x = 0; + XWINDOW (FRAME_SELECTED_WINDOW (f))->cursor.x = 0; } -/* Subroutines of creating an frame. */ +/* Subroutines of creating a frame. */ /* Make sure that Vx_resource_name is set to a reasonable value. Fix it up, or set it to `emacs' if it is too hopeless. */ @@ -3160,7 +3160,7 @@ w32_get_arg (alist, param, attribute, class, type) if (!strcmp (SDATA (tem), "on") || !strcmp (SDATA (tem), "true")) return Qt; - else + else return Qnil; case RES_TYPE_STRING: @@ -3425,7 +3425,7 @@ x_figure_window_size (f, parms) extern LRESULT CALLBACK w32_wnd_proc (); -BOOL +BOOL w32_init_class (hinst) HINSTANCE hinst; { @@ -3445,7 +3445,7 @@ w32_init_class (hinst) return (RegisterClass (&wc)); } -HWND +HWND w32_createscrollbar (f, bar) struct frame *f; struct scroll_bar * bar; @@ -3453,7 +3453,7 @@ w32_createscrollbar (f, bar) return (CreateWindow ("SCROLLBAR", "", SBS_VERT | WS_CHILD | WS_VISIBLE, /* Position and size of scroll bar. */ XINT(bar->left) + VERTICAL_SCROLL_BAR_WIDTH_TRIM, - XINT(bar->top), + XINT(bar->top), XINT(bar->width) - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2, XINT(bar->height), FRAME_W32_WINDOW (f), @@ -3462,7 +3462,7 @@ w32_createscrollbar (f, bar) NULL)); } -void +void w32_createwindow (f) struct frame *f; { @@ -3472,17 +3472,17 @@ w32_createwindow (f) rect.left = rect.top = 0; rect.right = PIXEL_WIDTH (f); rect.bottom = PIXEL_HEIGHT (f); - + AdjustWindowRect (&rect, f->output_data.w32->dwStyle, FRAME_EXTERNAL_MENU_BAR (f)); - + /* Do first time app init */ - + if (!hprevinst) { w32_init_class (hinst); } - + FRAME_W32_WINDOW (f) = hwnd = CreateWindow (EMACS_CLASS, f->namebuf, @@ -3506,13 +3506,13 @@ w32_createwindow (f) /* Enable drag-n-drop. */ DragAcceptFiles (hwnd, TRUE); - + /* Do this to discard the default setting specified by our parent. */ ShowWindow (hwnd, SW_HIDE); } } -void +void my_post_msg (wmsg, hwnd, msg, wParam, lParam) W32Msg * wmsg; HWND hwnd; @@ -3609,7 +3609,7 @@ record_keyup (unsigned int wparam, unsigned int lparam) } /* Emacs can lose focus while a modifier key has been pressed. When - it regains focus, be conservative and clear all modifiers since + it regains focus, be conservative and clear all modifiers since we cannot reconstruct the left and right modifier state. */ static void reset_modifiers () @@ -3664,10 +3664,10 @@ sync_modifiers () if (!modifiers_recorded) return; - if (!(GetKeyState (VK_CONTROL) & 0x8000)) + if (!(GetKeyState (VK_CONTROL) & 0x8000)) modifiers[EMACS_RCONTROL] = modifiers[EMACS_LCONTROL] = 0; - if (!(GetKeyState (VK_MENU) & 0x8000)) + if (!(GetKeyState (VK_MENU) & 0x8000)) modifiers[EMACS_RMENU] = modifiers[EMACS_LMENU] = 0; } @@ -3877,7 +3877,7 @@ w32_msg_pump (deferred_msg * msg_buf) HWND focus_window; msh_mousewheel = RegisterWindowMessage (MSH_MOUSEWHEEL); - + while (GetMessage (&msg, NULL, 0, 0)) { if (msg.hwnd == NULL) @@ -4067,7 +4067,7 @@ cancel_all_deferred_msgs () PostThreadMessage (dwWindowsThreadId, WM_NULL, 0, 0); } -DWORD +DWORD w32_msg_worker (dw) DWORD dw; { @@ -4075,9 +4075,9 @@ w32_msg_worker (dw) deferred_msg dummy_buf; /* Ensure our message queue is created */ - + PeekMessage (&msg, NULL, 0, 0, PM_NOREMOVE); - + if (!PostThreadMessage (dwMainThreadId, WM_EMACS_DONE, 0, 0)) abort (); @@ -4156,7 +4156,7 @@ post_character_message (hwnd, msg, wParam, lParam, modifiers) /* Main window procedure */ -LRESULT CALLBACK +LRESULT CALLBACK w32_wnd_proc (hwnd, msg, wParam, lParam) HWND hwnd; UINT msg; @@ -4185,7 +4185,7 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) w32_clear_rect, because these functions must obtain a DC handle from the frame struct using get_frame_dc which is thread-aware. */ - switch (msg) + switch (msg) { case WM_ERASEBKGND: f = x_window_to_frame (dpyinfo, hwnd); @@ -4254,7 +4254,7 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) leave_crit (); my_post_msg (&wmsg, hwnd, msg, wParam, lParam); - + return 0; } @@ -4374,13 +4374,13 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) return 0; break; case VK_MENU: - if (NILP (Vw32_pass_alt_to_system)) + if (NILP (Vw32_pass_alt_to_system)) /* Prevent DefWindowProc from activating the menu bar if an Alt key is pressed and released by itself. */ return 0; windows_translate = 1; break; - case VK_CAPITAL: + case VK_CAPITAL: /* Decide whether to treat as modifier or function key. */ if (NILP (Vw32_enable_caps_lock)) goto disable_lock_key; @@ -4417,7 +4417,7 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) w32_get_key_modifiers (wParam, lParam)); windows_translate = 1; break; - case VK_CONTROL: + case VK_CONTROL: case VK_SHIFT: case VK_PROCESSKEY: /* Generated by IME. */ windows_translate = 1; @@ -4475,7 +4475,7 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) int add; int isdead = 0; KEY_EVENT_RECORD key; - + key.bKeyDown = TRUE; key.wRepeatCount = 1; key.wVirtualKeyCode = wParam; @@ -4516,7 +4516,7 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) } /* Fall through */ - + case WM_SYSCHAR: case WM_CHAR: post_character_message (hwnd, msg, wParam, lParam, @@ -4652,7 +4652,7 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) { if (up) ReleaseCapture (); else SetCapture (hwnd); - button = (button == 0) ? LMOUSE : + button = (button == 0) ? LMOUSE : ((button == 1) ? MMOUSE : RMOUSE); if (up) button_state &= ~button; @@ -4660,7 +4660,7 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) button_state |= button; } } - + wmsg.dwModifiers = w32_get_modifiers (); my_post_msg (&wmsg, hwnd, msg, wParam, lParam); @@ -4693,7 +4693,7 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) my_post_msg (&wmsg, hwnd, msg, wParam, lParam); return 0; } - + /* Hang onto mouse move and scroll messages for a bit, to avoid sending such events to Emacs faster than it can process them. If we get more events before the timer from the first message @@ -4711,7 +4711,7 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) saved_mouse_move_msg.msg.lParam = lParam; saved_mouse_move_msg.msg.time = GetMessageTime (); saved_mouse_move_msg.dwModifiers = w32_get_modifiers (); - + return 0; case WM_MOUSEWHEEL: @@ -4759,7 +4759,7 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) } } return 0; - + case WM_NCACTIVATE: /* Windows doesn't send us focus messages when putting up and taking down a system popup dialog as for Ctrl-Alt-Del on Windows 95. @@ -4963,7 +4963,7 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) if (menu_free_timer) { KillTimer (hwnd, menu_free_timer); - menu_free_timer = 0; + menu_free_timer = 0; } } case WM_MOVE: @@ -4988,7 +4988,7 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) wp.length = sizeof (WINDOWPLACEMENT); GetWindowPlacement (hwnd, &wp); - + if (wp.showCmd != SW_SHOWMINIMIZED && (lppos->flags & SWP_NOSIZE) == 0) { RECT rect; @@ -4999,21 +4999,21 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) DWORD internal_border; DWORD scrollbar_extra; RECT wr; - + wp.length = sizeof(wp); GetWindowRect (hwnd, &wr); - + enter_crit (); - + font_width = GetWindowLong (hwnd, WND_FONTWIDTH_INDEX); line_height = GetWindowLong (hwnd, WND_LINEHEIGHT_INDEX); internal_border = GetWindowLong (hwnd, WND_BORDER_INDEX); scrollbar_extra = GetWindowLong (hwnd, WND_SCROLLBAR_INDEX); - + leave_crit (); - + memset (&rect, 0, sizeof (rect)); - AdjustWindowRect (&rect, GetWindowLong (hwnd, GWL_STYLE), + AdjustWindowRect (&rect, GetWindowLong (hwnd, GWL_STYLE), GetMenu (hwnd) != NULL); /* Force width and height of client area to be exact @@ -5024,17 +5024,17 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) hdiff = (lppos->cy - (rect.bottom - rect.top) - 2 * internal_border) % line_height; - + if (wdiff || hdiff) { - /* For right/bottom sizing we can just fix the sizes. - However for top/left sizing we will need to fix the X + /* For right/bottom sizing we can just fix the sizes. + However for top/left sizing we will need to fix the X and Y positions as well. */ - + lppos->cx -= wdiff; lppos->cy -= hdiff; - - if (wp.showCmd != SW_SHOWMAXIMIZED + + if (wp.showCmd != SW_SHOWMAXIMIZED && (lppos->flags & SWP_NOMOVE) == 0) { if (lppos->x != wr.left || lppos->y != wr.top) @@ -5047,12 +5047,12 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) lppos->flags |= SWP_NOMOVE; } } - + return 0; } } } - + goto dflt; case WM_GETMINMAXINFO: @@ -5130,7 +5130,7 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) CreateCaret (hwnd, NULL, 0, w32_system_caret_height); } - + if (!SetCaretPos (w32_system_caret_x, w32_system_caret_y)) return 0; /* Ensure visible caret gets turned on when requested. */ @@ -5161,7 +5161,7 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) flags |= TPM_LEFTBUTTON; else if (button_state & RMOUSE) flags |= TPM_RIGHTBUTTON; - + /* Remember we did a SetCapture on the initial mouse down event, so for safety, we make sure the capture is cancelled now. */ ReleaseCapture (); @@ -5172,8 +5172,8 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) f = x_window_to_frame (dpyinfo, hwnd); if (f) f->output_data.w32->menubar_active = 1; - - if (TrackPopupMenu ((HMENU)wParam, flags, pos->x, pos->y, + + if (TrackPopupMenu ((HMENU)wParam, flags, pos->x, pos->y, 0, hwnd, NULL)) { MSG amsg; @@ -5206,17 +5206,17 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) my_post_msg (&wmsg, hwnd, msg, wParam, lParam); return 0; } - + dflt: return DefWindowProc (hwnd, msg, wParam, lParam); } - + /* The most common default return code for handled messages is 0. */ return 0; } -void +void my_create_window (f) struct frame * f; { @@ -5232,7 +5232,7 @@ my_create_window (f) indirectly via the Window thread, as we do not need to process Window messages for the tooltip. Creating tooltips indirectly also creates deadlocks when tooltips are created for menu items. */ -void +void my_create_tip_window (f) struct frame *f; { @@ -5289,7 +5289,7 @@ w32_window (f, window_prompting, minibuffer_only) for the window manager, so GC relocation won't bother it. Elsewhere we specify the window name for the window manager. */ - + { char *str = (char *) SDATA (Vx_resource_name); f->namebuf = (char *) xmalloc (strlen (str) + 1); @@ -5413,7 +5413,7 @@ unwind_create_frame (frame) #ifdef GLYPH_DEBUG struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f); #endif - + x_free_frame_resources (f); /* Check that reference counts are indeed correct. */ @@ -5422,7 +5422,7 @@ unwind_create_frame (frame) return Qt; } - + return Qnil; } @@ -5586,7 +5586,7 @@ This function is an internal primitive--use `make-frame' instead. */) if (! STRINGP (font)) font = build_string ("Fixedsys"); - x_default_parameter (f, parms, Qfont, font, + x_default_parameter (f, parms, Qfont, font, "font", "Font", RES_TYPE_STRING); } @@ -5639,7 +5639,7 @@ This function is an internal primitive--use `make-frame' instead. */) end up in init_iterator with a null face cache, which should not happen. */ init_frame_faces (f); - + x_default_parameter (f, parms, Qmenu_bar_lines, make_number (1), "menuBar", "MenuBar", RES_TYPE_NUMBER); x_default_parameter (f, parms, Qtool_bar_lines, make_number (1), @@ -5664,7 +5664,7 @@ This function is an internal primitive--use `make-frame' instead. */) if (FRAME_TOOL_BAR_LINES (f)) { int margin, relief, bar_height; - + relief = (tool_bar_button_relief >= 0 ? tool_bar_button_relief : DEFAULT_TOOL_BAR_BUTTON_RELIEF); @@ -5678,7 +5678,7 @@ This function is an internal primitive--use `make-frame' instead. */) margin = XFASTINT (XCDR (Vtool_bar_button_margin)); else margin = 0; - + bar_height = DEFAULT_TOOL_BAR_IMAGE_HEIGHT + 2 * margin + 2 * relief; f->height += (bar_height + CANON_Y_UNIT (f) - 1) / CANON_Y_UNIT (f); } @@ -5776,11 +5776,11 @@ This function is an internal primitive--use `make-frame' instead. */) ; } UNGCPRO; - + /* Make sure windows on this frame appear in calls to next-window and similar functions. */ Vwindow_list = Qnil; - + return unbind_to (count, frame); } @@ -5917,11 +5917,11 @@ w32_load_system_font (f,fontname,size) font->hfont = CreateFontIndirect (&lf); - if (font->hfont == NULL) + if (font->hfont == NULL) { ok = FALSE; - } - else + } + else { HDC hdc; HANDLE oldobj; @@ -6090,12 +6090,12 @@ int size; } -void +void w32_unload_font (dpyinfo, font) struct w32_display_info *dpyinfo; XFontStruct * font; { - if (font) + if (font) { if (font->per_char) xfree (font->per_char); if (font->bdf) w32_free_bdf_font (font->bdf); @@ -6128,7 +6128,7 @@ w32_unload_font (dpyinfo, font) * ) */ -static LONG +static LONG x_to_w32_weight (lpw) char * lpw; { @@ -6149,7 +6149,7 @@ x_to_w32_weight (lpw) } -static char * +static char * w32_to_x_weight (fnweight) int fnweight; { @@ -6336,7 +6336,7 @@ w32_to_x_charset (fncharset) sprintf (buf, "*-#%u", fncharset); return buf; } - + { Lisp_Object rest; char * best_match = NULL; @@ -6390,7 +6390,7 @@ w32_to_x_charset (fncharset) int this_enc = atoi (x_charset + 8); if (this_enc > 0 && this_enc < best_enc) best_match = x_charset; - } + } } } @@ -6497,7 +6497,7 @@ w32_to_all_x_charsets (fncharset) sprintf (buf, "*-#%u", fncharset); return Fcons (build_string (buf), Qnil); } - + { Lisp_Object rest; /* Look through w32-charset-info-alist for the character set. @@ -6548,7 +6548,7 @@ w32_to_all_x_charsets (fncharset) /* Get the Windows codepage corresponding to the specified font. The charset info in the font name is used to look up w32-charset-to-codepage-alist. */ -int +int w32_codepage_for_font (char *fontname) { Lisp_Object codepage, entry; @@ -6599,7 +6599,7 @@ w32_codepage_for_font (char *fontname) } -static BOOL +static BOOL w32_to_x_font (lplogfont, lpxstr, len, specific_charset) LOGFONT * lplogfont; char * lpxstr; @@ -6682,7 +6682,7 @@ w32_to_x_font (lplogfont, lpxstr, len, specific_charset) ? 'p' : 'c', /* spacing */ width_pixels, /* avg width */ specific_charset ? specific_charset - : w32_to_x_charset (lplogfont->lfCharSet) + : w32_to_x_charset (lplogfont->lfCharSet) /* charset registry and encoding */ ); @@ -6690,7 +6690,7 @@ w32_to_x_font (lplogfont, lpxstr, len, specific_charset) return (TRUE); } -static BOOL +static BOOL x_to_w32_font (lpxstr, lplogfont) char * lpxstr; LOGFONT * lplogfont; @@ -6725,7 +6725,7 @@ x_to_w32_font (lpxstr, lplogfont) * format: * "[:height in pixels[:width in pixels[:weight]]]" */ - + if (*lpxstr == '-') { int fields, tem; @@ -6993,7 +6993,7 @@ xlfd_strip_height (char *fontname) } /* Assume parameter 1 is fully qualified, no wildcards. */ -static BOOL +static BOOL w32_font_match (fontname, pattern) char * fontname; char * pattern; @@ -7055,7 +7055,7 @@ w32_font_match (fontname, pattern) font from each family, the second pass lists all the fonts from each family. */ -typedef struct enumfont_t +typedef struct enumfont_t { HDC hdc; int numFonts; @@ -7070,7 +7070,7 @@ static void enum_font_maybe_add_to_list (enumfont_t *, LOGFONT *, char *, Lisp_Object); -static int CALLBACK +static int CALLBACK enum_font_cb2 (lplf, lptm, FontType, lpef) ENUMLOGFONT * lplf; NEWTEXTMETRIC * lptm; @@ -7226,7 +7226,7 @@ enum_font_maybe_add_to_list (lpef, logfont, match_charset, width) } -static int CALLBACK +static int CALLBACK enum_font_cb1 (lplf, lptm, FontType, lpef) ENUMLOGFONT * lplf; NEWTEXTMETRIC * lptm; @@ -7413,7 +7413,7 @@ w32_list_fonts (f, pattern, size, maxnames) newlist = second_best = Qnil; - /* Make a list of the fonts that have the right width. */ + /* Make a list of the fonts that have the right width. */ for (; CONSP (list); list = XCDR (list)) { int found_size; @@ -7475,7 +7475,7 @@ w32_list_fonts (f, pattern, size, maxnames) { if (NILP (second_best)) second_best = tem; - + else if (found_size < size) { if (XINT (XCDR (second_best)) > size @@ -7761,9 +7761,9 @@ If omitted or nil, that stands for the selected frame's display. */) and because probably is more meaningful on Windows anyway */ if (cap < 0) cap = 1 << min(dpyinfo->n_planes * dpyinfo->n_cbits, 24); - + ReleaseDC (dpyinfo->root_window, hdc); - + return make_number (cap); } @@ -7835,11 +7835,11 @@ If omitted or nil, that stands for the selected frame's display. */) int cap; hdc = GetDC (dpyinfo->root_window); - + cap = GetDeviceCaps (hdc, VERTSIZE); - + ReleaseDC (dpyinfo->root_window, hdc); - + return make_number (cap); } @@ -7857,11 +7857,11 @@ If omitted or nil, that stands for the selected frame's display. */) int cap; hdc = GetDC (dpyinfo->root_window); - + cap = GetDeviceCaps (hdc, HORZSIZE); - + ReleaseDC (dpyinfo->root_window, hdc); - + return make_number (cap); } @@ -8226,7 +8226,7 @@ valid_image_p (object) Lisp_Object object; { int valid_p = 0; - + if (CONSP (object) && EQ (XCAR (object), Qimage)) { Lisp_Object tem; @@ -8361,7 +8361,7 @@ parse_image_spec (spec, keywords, nkeywords, type) was found more than once, it's an error. */ keywords[i].value = value; ++keywords[i].count; - + if (keywords[i].count > 1) return 0; @@ -8416,7 +8416,7 @@ parse_image_spec (spec, keywords, nkeywords, type) case IMAGE_FUNCTION_VALUE: value = indirect_function (value); - if (SUBRP (value) + if (SUBRP (value) || COMPILEDP (value) || (CONSP (value) && EQ (XCAR (value), Qlambda))) break; @@ -8465,7 +8465,7 @@ image_spec_value (spec, key, found) int *found; { Lisp_Object tail; - + xassert (valid_image_p (spec)); for (tail = XCDR (spec); @@ -8479,12 +8479,12 @@ image_spec_value (spec, key, found) return XCAR (XCDR (tail)); } } - + if (found) *found = 0; return Qnil; } - + DEFUN ("image-size", Fimage_size, Simage_size, 1, 3, 0, doc: /* Return the size of image SPEC as pair (WIDTH . HEIGHT). @@ -8505,7 +8505,7 @@ or omitted means use the selected frame. */) struct image *img = IMAGE_FROM_ID (f, id); int width = img->width + 2 * img->hmargin; int height = img->height + 2 * img->vmargin; - + if (NILP (pixels)) size = Fcons (make_float ((double) width / CANON_X_UNIT (f)), make_float ((double) height / CANON_Y_UNIT (f))); @@ -8561,7 +8561,7 @@ make_image (spec, hash) unsigned hash; { struct image *img = (struct image *) xmalloc (sizeof *img); - + xassert (valid_image_p (spec)); bzero (img, sizeof *img); img->type = lookup_image_type (image_spec_value (spec, QCtype, NULL)); @@ -8622,7 +8622,7 @@ prepare_image_for_display (f, img) if (img->pixmap == 0 && !img->load_failed_p) img->load_failed_p = img->type->load (f, img) == 0; } - + /* Value is the number of pixels for the ascent of image IMG when drawn in face FACE. */ @@ -8673,7 +8673,7 @@ four_corners_best (ximg, width, height) for (i = best_count = 0; i < 4; ++i) { int j, n; - + for (j = n = 0; j < 4; ++j) if (corners[i] == corners[j]) ++n; @@ -8793,7 +8793,7 @@ x_clear_image_1 (f, img, pixmap_p, mask_p, colors_p) img->mask = NULL; img->background_transparent_valid = 0; } - + if (colors_p && img->ncolors) { #if 0 /* TODO: color table support. */ @@ -8825,7 +8825,7 @@ x_clear_image (f, img) #if 0 /* TODO: color table support */ int class = FRAME_W32_DISPLAY_INFO (f)->visual->class; - + /* If display has an immutable color map, freeing colors is not necessary and some servers don't allow it. So don't do it. */ if (class != StaticColor @@ -8840,7 +8840,7 @@ x_clear_image (f, img) UNBLOCK_INPUT; } #endif - + xfree (img->colors); img->colors = NULL; img->ncolors = 0; @@ -8899,7 +8899,7 @@ make_image_cache () { struct image_cache *c = (struct image_cache *) xmalloc (sizeof *c); int size; - + bzero (c, sizeof *c); c->size = 50; c->images = (struct image **) xmalloc (c->size * sizeof *c->images); @@ -8924,7 +8924,7 @@ free_image_cache (f) /* Cache should not be referenced by any frame when freed. */ xassert (c->refcount == 0); - + for (i = 0; i < c->used; ++i) free_image (f, c->images[i]); xfree (c->images); @@ -8957,11 +8957,11 @@ clear_image_cache (f, force_p) EMACS_GET_TIME (t); old = EMACS_SECS (t) - XFASTINT (Vimage_cache_eviction_delay); - + /* Block input so that we won't be interrupted by a SIGIO while being in an inconsistent state. */ BLOCK_INPUT; - + for (i = nfreed = 0; i < c->used; ++i) { struct image *img = c->images[i]; @@ -8980,7 +8980,7 @@ clear_image_cache (f, force_p) if (nfreed) { Lisp_Object tail, frame; - + FOR_EACH_FRAME (tail, frame) { struct frame *f = XFRAME (frame); @@ -9008,7 +9008,7 @@ FRAME t means clear the image caches of all frames. */) if (EQ (frame, Qt)) { Lisp_Object tail; - + FOR_EACH_FRAME (tail, frame) if (FRAME_W32_P (XFRAME (frame))) clear_image_cache (XFRAME (frame), 1); @@ -9036,7 +9036,7 @@ postprocess_image (f, img) Lisp_Object mask; spec = img->spec; - + /* `:heuristic-mask t' `:mask heuristic' means build a mask heuristically. @@ -9046,16 +9046,16 @@ postprocess_image (f, img) image. `:mask nil' means remove a mask, if any. */ - + mask = image_spec_value (spec, QCheuristic_mask, NULL); if (!NILP (mask)) x_build_heuristic_mask (f, img, mask); else { int found_p; - + mask = image_spec_value (spec, QCmask, &found_p); - + if (EQ (mask, Qheuristic)) x_build_heuristic_mask (f, img, Qt); else if (CONSP (mask) @@ -9072,8 +9072,8 @@ postprocess_image (f, img) img->mask = NULL; } } - - + + /* Should we apply an image transformation algorithm? */ conversion = image_spec_value (spec, QCconversion, NULL); if (EQ (conversion, Qdisabled)) @@ -9116,7 +9116,7 @@ lookup_image (f, spec) specification. */ xassert (FRAME_WINDOW_P (f)); xassert (valid_image_p (spec)); - + GCPRO1 (spec); /* Look up SPEC in the hash table of the image cache. */ @@ -9175,7 +9175,7 @@ lookup_image (f, spec) if (XINT (XCDR (margin)) > 0) img->vmargin = XFASTINT (XCDR (margin)); } - + relief = image_spec_value (spec, QCrelief, NULL); if (INTEGERP (relief)) { @@ -9209,9 +9209,9 @@ lookup_image (f, spec) /* We're using IMG, so set its timestamp to `now'. */ EMACS_GET_TIME (now); img->timestamp = EMACS_SECS (now); - + UNGCPRO; - + /* Value is the image id. */ return img->id; } @@ -9436,7 +9436,7 @@ x_find_image_file (file) /* Try to find FILE in data-directory, then x-bitmap-file-path. */ fd = openp (search_path, file, Qnil, &file_found, Qnil); - + if (fd == -1) file_found = Qnil; else @@ -9478,7 +9478,7 @@ slurp_file (file, size) buf = NULL; } } - + return buf; } @@ -9557,7 +9557,7 @@ enum xbm_token XBM_TK_NUMBER }; - + /* Return non-zero if OBJECT is a valid XBM-type image specification. A valid specification is a list starting with the symbol `image' The rest of the list is a property list which must contain an @@ -9592,7 +9592,7 @@ xbm_image_p (object) Lisp_Object object; { struct image_keyword kw[XBM_LAST]; - + bcopy (xbm_format, kw, sizeof kw); if (!parse_image_spec (object, kw, XBM_LAST, Qxbm)) return 0; @@ -9624,13 +9624,13 @@ xbm_image_p (object) data = kw[XBM_DATA].value; width = XFASTINT (kw[XBM_WIDTH].value); height = XFASTINT (kw[XBM_HEIGHT].value); - + /* Check type of data, and width and height against contents of data. */ if (VECTORP (data)) { int i; - + /* Number of elements of the vector must be >= height. */ if (XVECTOR (data)->size < height) return 0; @@ -9700,7 +9700,7 @@ xbm_scan (s, end, sval, ival) else if (isdigit (c)) { int value = 0, digit; - + if (c == '0' && *s < end) { c = *(*s)++; @@ -9838,7 +9838,7 @@ xbm_read_bitmap_data (contents, end, width, height, data) if (LA1 != (TOKEN)) \ goto failure; \ else \ - match () + match () #define expect_ident(IDENT) \ if (LA1 == XBM_TK_IDENT && strcmp (buffer, (IDENT)) == 0) \ @@ -9881,7 +9881,7 @@ xbm_read_bitmap_data (contents, end, width, height, data) { if (strcmp (buffer, "unsigned") == 0) { - match (); + match (); expect_ident ("char"); } else if (strcmp (buffer, "short") == 0) @@ -9896,7 +9896,7 @@ xbm_read_bitmap_data (contents, end, width, height, data) else goto failure; } - else + else goto failure; expect (XBM_TK_IDENT); @@ -9919,7 +9919,7 @@ xbm_read_bitmap_data (contents, end, width, height, data) *p++ = val; if (!padding_p || ((i + 2) % bytes_per_line)) *p++ = value >> 8; - + if (LA1 == ',' || LA1 == '}') match (); else @@ -9932,7 +9932,7 @@ xbm_read_bitmap_data (contents, end, width, height, data) { int val = value; expect (XBM_TK_NUMBER); - + *p++ = val; if (LA1 == ',' || LA1 == '}') @@ -9973,14 +9973,14 @@ xbm_load_image (f, img, contents, end) int rc; unsigned char *data; int success_p = 0; - + rc = xbm_read_bitmap_data (contents, end, &img->width, &img->height, &data); if (rc) { unsigned long foreground = FRAME_FOREGROUND_PIXEL (f); unsigned long background = FRAME_BACKGROUND_PIXEL (f); Lisp_Object value; - + xassert (img->width > 0 && img->height > 0); /* Get foreground and background colors, maybe allocate colors. */ @@ -10028,7 +10028,7 @@ xbm_file_p (data) &w, &h, NULL)); } - + /* Fill image IMG which is used on frame F with pixmap data. Value is non-zero if successful. */ @@ -10120,7 +10120,7 @@ xbm_load (f, img) int i; char *p; int nbytes = (img->width + BITS_PER_CHAR - 1) / BITS_PER_CHAR; - + p = bits = (char *) alloca (nbytes * img->height); for (i = 0; i < img->height; ++i, p += nbytes) { @@ -10155,14 +10155,14 @@ xbm_load (f, img) return success_p; } - + /*********************************************************************** XPM images ***********************************************************************/ -#if HAVE_XPM +#if HAVE_XPM static int xpm_image_p P_ ((Lisp_Object object)); static int xpm_load P_ ((struct frame *f, struct image *img)); @@ -10300,7 +10300,7 @@ xpm_load (f, img) Lisp_Object tail; XpmColorSymbol *xpm_syms; int i, size; - + attrs.valuemask |= XpmColorSymbols; /* Count number of symbols. */ @@ -10341,7 +10341,7 @@ xpm_load (f, img) UNBLOCK_INPUT; return 0; } - + rc = XpmReadFileToPixmap (NULL, FRAME_W32_WINDOW (f), SDATA (file), &img->pixmap, &img->mask, &attrs); @@ -10381,19 +10381,19 @@ xpm_load (f, img) case XpmOpenFailed: image_error ("Error opening XPM file (%s)", img->spec, Qnil); break; - + case XpmFileInvalid: image_error ("Invalid XPM file (%s)", img->spec, Qnil); break; - + case XpmNoMemory: image_error ("Out of memory (%s)", img->spec, Qnil); break; - + case XpmColorFailed: image_error ("Color allocation error (%s)", img->spec, Qnil); break; - + default: image_error ("Unknown error (%s)", img->spec, Qnil); break; @@ -10542,7 +10542,7 @@ lookup_pixel_color (f, pixel) int rc; BLOCK_INPUT; - + cmap = DefaultColormapOfScreen (FRAME_X_SCREEN (f)); color.pixel = pixel; XQueryColor (NULL, cmap, &color); @@ -10552,7 +10552,7 @@ lookup_pixel_color (f, pixel) if (rc) { ++ct_colors_allocated; - + p = (struct ct_color *) xmalloc (sizeof *p); p->r = color.red; p->g = color.green; @@ -10589,7 +10589,7 @@ colors_in_color_table (n) colors = (unsigned long *) xmalloc (ct_colors_allocated * sizeof *colors); *n = ct_colors_allocated; - + for (i = j = 0; i < CT_SIZE; ++i) for (p = ct_table[i]; p; p = p->next) colors[j++] = p->pixel; @@ -10665,7 +10665,7 @@ x_to_xcolors (f, img, rgb_p) for (y = 0; y < img->height; ++y) { XColor *row = p; - + for (x = 0; x < img->width; ++x, ++p) p->pixel = XGetPixel (ximg, x, y); @@ -10755,7 +10755,7 @@ x_from_xcolors (f, img, colors) MATRIX is a nine-element array specifying the transformation matrix. See emboss_matrix for an example. - + COLOR_ADJUST is a color adjustment added to each pixel of the outgoing image. */ @@ -10783,7 +10783,7 @@ x_detect_edges (f, img, matrix, color_adjust) p = COLOR (new, img->width - 1, y); p->red = p->green = p->blue = 0xffff/2; } - + for (x = 1; x < img->width - 1; ++x) { p = COLOR (new, x, 0); @@ -10795,7 +10795,7 @@ x_detect_edges (f, img, matrix, color_adjust) for (y = 1; y < img->height - 1; ++y) { p = COLOR (new, 1, y); - + for (x = 1; x < img->width - 1; ++x, ++p) { int r, g, b, y1, x1; @@ -10869,7 +10869,7 @@ x_edge_detection (f, img, matrix, color_adjust) { int i = 0; int trans[9]; - + if (CONSP (matrix)) { for (i = 0; @@ -10992,7 +10992,7 @@ x_build_heuristic_mask (f, img, how) /* Determine the background color of ximg. If HOW is `(R G B)' take that as color. Otherwise, use the image's background color. */ use_img_background = 1; - + if (CONSP (how)) { int rgb[3], i; @@ -11011,7 +11011,7 @@ x_build_heuristic_mask (f, img, how) use_img_background = 0; } } - + if (use_img_background) bg = four_corners_best (ximg, img->width, img->height); @@ -11103,11 +11103,11 @@ pbm_image_p (object) Lisp_Object object; { struct image_keyword fmt[PBM_LAST]; - + bcopy (pbm_format, fmt, sizeof fmt); - + if (!parse_image_spec (object, fmt, PBM_LAST, Qpbm) - || (fmt[PBM_ASCENT].count + || (fmt[PBM_ASCENT].count && XFASTINT (fmt[PBM_ASCENT].value) > 100)) return 0; @@ -11185,14 +11185,14 @@ pbm_read_file (file, size) buf = NULL; } } - + return buf; } /* Load PBM image IMG for use on frame F. */ -static int +static int pbm_load (f, img) struct frame *f; struct image *img; @@ -11255,7 +11255,7 @@ pbm_load (f, img) case '1': raw_p = 0, type = PBM_MONO; break; - + case '2': raw_p = 0, type = PBM_GRAY; break; @@ -11267,11 +11267,11 @@ pbm_load (f, img) case '4': raw_p = 1, type = PBM_MONO; break; - + case '5': raw_p = 1, type = PBM_GRAY; break; - + case '6': raw_p = 1, type = PBM_COLOR; break; @@ -11292,7 +11292,7 @@ pbm_load (f, img) if (raw_p && max_color_idx > 255) max_color_idx = 255; } - + if (width < 0 || height < 0 || (type != PBM_MONO && max_color_idx < 0)) @@ -11316,7 +11316,7 @@ pbm_load (f, img) /* Parse the image specification. */ bcopy (pbm_format, fmt, sizeof fmt); parse_image_spec (img->spec, fmt, PBM_LAST, Qpbm); - + /* Get foreground and background colors, maybe allocate colors. */ if (fmt[PBM_FOREGROUND].count && STRINGP (fmt[PBM_FOREGROUND].value)) @@ -11351,7 +11351,7 @@ pbm_load (f, img) for (x = 0; x < width; ++x) { int r, g, b; - + if (type == PBM_GRAY) r = g = b = raw_p ? *p++ : pbm_scan_number (&p, end); else if (raw_p) @@ -11366,7 +11366,7 @@ pbm_load (f, img) g = pbm_scan_number (&p, end); b = pbm_scan_number (&p, end); } - + if (r < 0 || g < 0 || b < 0) { x_destroy_x_image (ximg); @@ -11374,7 +11374,7 @@ pbm_load (f, img) img->spec, Qnil); goto error; } - + /* RGB values are now in the range 0..max_color_idx. Scale this to the range 0..0xff supported by W32. */ r = (int) ((double) r * 255 / max_color_idx); @@ -11398,11 +11398,11 @@ pbm_load (f, img) /* Maybe fill in the background field while we have ximg handy. */ if (NILP (image_spec_value (img->spec, QCbackground, NULL))) IMAGE_BACKGROUND (img, f, ximg); - + /* Put the image into a pixmap. */ x_put_x_image (f, ximg, img->pixmap, width, height); x_destroy_x_image (ximg); - + img->width = width; img->height = height; @@ -11483,9 +11483,9 @@ png_image_p (object) { struct image_keyword fmt[PNG_LAST]; bcopy (png_format, fmt, sizeof fmt); - + if (!parse_image_spec (object, fmt, PNG_LAST, Qpng) - || (fmt[PNG_ASCENT].count + || (fmt[PNG_ASCENT].count && XFASTINT (fmt[PNG_ASCENT].value) > 100)) return 0; @@ -11542,7 +11542,7 @@ png_read_from_memory (png_ptr, data, length) if (length > tbr->len - tbr->index) png_error (png_ptr, "Read error"); - + bcopy (tbr->bytes + tbr->index, data, length); tbr->index = tbr->index + length; } @@ -11685,14 +11685,14 @@ png_load (f, img) png_get_IHDR (png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, &interlace_type, NULL, NULL); - /* If image contains simply transparency data, we prefer to + /* If image contains simply transparency data, we prefer to construct a clipping mask. */ if (png_get_valid (png_ptr, info_ptr, PNG_INFO_tRNS)) transparent_p = 1; else transparent_p = 0; - /* This function is easier to write if we only have to handle + /* This function is easier to write if we only have to handle one data format: RGB or RGBA with 8 bits per channel. Let's transform other formats into that format. */ @@ -11705,7 +11705,7 @@ png_load (f, img) png_set_expand (png_ptr); /* Convert grayscale images to RGB. */ - if (color_type == PNG_COLOR_TYPE_GRAY + if (color_type == PNG_COLOR_TYPE_GRAY || color_type == PNG_COLOR_TYPE_GRAY_ALPHA) png_set_gray_to_rgb (png_ptr); @@ -11756,14 +11756,14 @@ png_load (f, img) } } else if (png_get_bKGD (png_ptr, info_ptr, &image_background)) - /* Image contains a background color with which to + /* Image contains a background color with which to combine the image. */ png_set_background (png_ptr, image_background, PNG_BACKGROUND_GAMMA_FILE, 1, 1.0); else { /* Image does not contain a background color with which - to combine the image data via an alpha channel. Use + to combine the image data via an alpha channel. Use the frame's background instead. */ XColor color; Colormap cmap; @@ -11816,7 +11816,7 @@ png_load (f, img) if (!x_create_x_image_and_pixmap (f, width, height, 0, &ximg, &img->pixmap)) goto error; - + /* Create an image and pixmap serving as mask if the PNG image contains an alpha channel. */ if (channels == 4 @@ -11847,16 +11847,16 @@ png_load (f, img) XPutPixel (ximg, x, y, lookup_rgb_color (f, r, g, b)); /* An alpha channel, aka mask channel, associates variable - transparency with an image. Where other image formats - support binary transparency---fully transparent or fully + transparency with an image. Where other image formats + support binary transparency---fully transparent or fully opaque---PNG allows up to 254 levels of partial transparency. The PNG library implements partial transparency by combining the image with a specified background color. I'm not sure how to handle this here nicely: because the background on which the image is displayed may change, for - real alpha channel support, it would be necessary to create - a new image for each possible background. + real alpha channel support, it would be necessary to create + a new image for each possible background. What I'm doing now is that a mask is created if we have boolean transparency information. Otherwise I'm using @@ -12002,11 +12002,11 @@ jpeg_image_p (object) Lisp_Object object; { struct image_keyword fmt[JPEG_LAST]; - + bcopy (jpeg_format, fmt, sizeof fmt); - + if (!parse_image_spec (object, fmt, JPEG_LAST, Qjpeg) - || (fmt[JPEG_ASCENT].count + || (fmt[JPEG_ASCENT].count && XFASTINT (fmt[JPEG_ASCENT].value) > 100)) return 0; @@ -12075,7 +12075,7 @@ our_skip_input_data (cinfo, num_bytes) { if (num_bytes > src->bytes_in_buffer) ERREXIT (cinfo, JERR_INPUT_EOF); - + src->bytes_in_buffer -= num_bytes; src->next_input_byte += num_bytes; } @@ -12113,7 +12113,7 @@ jpeg_memory_src (cinfo, data, len) src = (struct jpeg_source_mgr *) cinfo->src; src->next_input_byte = data; } - + src = (struct jpeg_source_mgr *) cinfo->src; src->init_source = our_init_source; src->fill_input_buffer = our_fill_input_buffer; @@ -12128,7 +12128,7 @@ jpeg_memory_src (cinfo, data, len) /* Load image IMG for use on frame F. Patterned after example.c from the JPEG lib. */ -static int +static int jpeg_load (f, img) struct frame *f; struct image *img; @@ -12161,7 +12161,7 @@ jpeg_load (f, img) UNGCPRO; return 0; } - + fp = fopen (SDATA (file), "r"); if (fp == NULL) { @@ -12170,12 +12170,12 @@ jpeg_load (f, img) return 0; } } - + /* Customize libjpeg's error handling to call my_error_exit when an error is detected. This function will perform a longjmp. */ cinfo.err = jpeg_std_error (&mgr.pub); mgr.pub.error_exit = my_error_exit; - + if ((rc = setjmp (mgr.setjmp_buffer)) != 0) { if (rc == 1) @@ -12186,18 +12186,18 @@ jpeg_load (f, img) image_error ("Error reading JPEG image `%s': %s", img->spec, build_string (buffer)); } - + /* Close the input file and destroy the JPEG object. */ if (fp) fclose (fp); jpeg_destroy_decompress (&cinfo); - + /* If we already have an XImage, free that. */ x_destroy_x_image (ximg); /* Free pixmap and colors. */ x_clear_image (f, img); - + UNGCPRO; return 0; } @@ -12248,7 +12248,7 @@ jpeg_load (f, img) init_color_table (); colors = (unsigned long *) alloca (cinfo.actual_number_of_colors * sizeof *colors); - + for (i = 0; i < cinfo.actual_number_of_colors; ++i) { /* Multiply RGB values with 255 because X expects RGB values @@ -12280,11 +12280,11 @@ jpeg_load (f, img) jpeg_destroy_decompress (&cinfo); if (fp) fclose (fp); - + /* Maybe fill in the background field while we have ximg handy. */ if (NILP (image_spec_value (img->spec, QCbackground, NULL))) IMAGE_BACKGROUND (img, f, ximg); - + /* Put the image into the pixmap. */ x_put_x_image (f, ximg, img->pixmap, width, height); x_destroy_x_image (ximg); @@ -12366,12 +12366,12 @@ tiff_image_p (object) { struct image_keyword fmt[TIFF_LAST]; bcopy (tiff_format, fmt, sizeof fmt); - + if (!parse_image_spec (object, fmt, TIFF_LAST, Qtiff) - || (fmt[TIFF_ASCENT].count + || (fmt[TIFF_ASCENT].count && XFASTINT (fmt[TIFF_ASCENT].value) > 100)) return 0; - + /* Must specify either the :data or :file keyword. */ return fmt[TIFF_FILE].count + fmt[TIFF_DATA].count == 1; } @@ -12432,22 +12432,22 @@ tiff_seek_in_memory (data, off, whence) case SEEK_SET: /* Go from beginning of source. */ idx = off; break; - + case SEEK_END: /* Go from end of source. */ idx = src->len + off; break; - + case SEEK_CUR: /* Go from current position. */ idx = src->index + off; break; - + default: /* Invalid `whence'. */ return -1; } - + if (idx > src->len || idx < 0) return -1; - + src->index = idx; return src->index; } @@ -12494,7 +12494,7 @@ tiff_error_handler (title, format, ap) { char buf[512]; int len; - + len = sprintf (buf, "TIFF error: %s ", title); vsprintf (buf + len, format, ap); add_to_log (buf, Qnil, Qnil); @@ -12508,7 +12508,7 @@ tiff_warning_handler (title, format, ap) { char buf[512]; int len; - + len = sprintf (buf, "TIFF warning: %s ", title); vsprintf (buf + len, format, ap); add_to_log (buf, Qnil, Qnil); @@ -12551,7 +12551,7 @@ tiff_load (f, img) UNGCPRO; return 0; } - + /* Try to open the image file. */ tiff = TIFFOpen (SDATA (file), "r"); if (tiff == NULL) @@ -12590,7 +12590,7 @@ tiff_load (f, img) TIFFGetField (tiff, TIFFTAG_IMAGEWIDTH, &width); TIFFGetField (tiff, TIFFTAG_IMAGELENGTH, &height); buf = (uint32 *) xmalloc (width * height * sizeof *buf); - + rc = TIFFReadRGBAImage (tiff, width, height, buf, 0); TIFFClose (tiff); if (!rc) @@ -12616,14 +12616,14 @@ tiff_load (f, img) for (y = 0; y < height; ++y) { uint32 *row = buf + y * width; - + for (x = 0; x < width; ++x) { uint32 abgr = row[x]; int r = TIFFGetR (abgr) << 8; int g = TIFFGetG (abgr) << 8; int b = TIFFGetB (abgr) << 8; - XPutPixel (ximg, x, height - 1 - y, lookup_rgb_color (f, r, g, b)); + XPutPixel (ximg, x, height - 1 - y, lookup_rgb_color (f, r, g, b)); } } @@ -12721,12 +12721,12 @@ gif_image_p (object) { struct image_keyword fmt[GIF_LAST]; bcopy (gif_format, fmt, sizeof fmt); - + if (!parse_image_spec (object, fmt, GIF_LAST, Qgif) - || (fmt[GIF_ASCENT].count + || (fmt[GIF_ASCENT].count && XFASTINT (fmt[GIF_ASCENT].value) > 100)) return 0; - + /* Must specify either the :data or :file keyword. */ return fmt[GIF_FILE].count + fmt[GIF_DATA].count == 1; } @@ -12799,7 +12799,7 @@ gif_load (f, img) UNGCPRO; return 0; } - + /* Open the GIF file. */ gif = DGifOpenFileName (SDATA (file)); if (gif == NULL) @@ -12857,14 +12857,14 @@ gif_load (f, img) UNGCPRO; return 0; } - + /* Allocate colors. */ gif_color_map = gif->SavedImages[ino].ImageDesc.ColorMap; if (!gif_color_map) gif_color_map = gif->SColorMap; init_color_table (); bzero (pixel_colors, sizeof pixel_colors); - + for (i = 0; i < gif_color_map->ColorCount; ++i) { int r = gif_color_map->Colors[i].Red << 8; @@ -12877,7 +12877,7 @@ gif_load (f, img) free_color_table (); /* Clear the part of the screen image that are not covered by - the image from the GIF file. Full animated GIF support + the image from the GIF file. Full animated GIF support requires more than can be done here (see the gif89 spec, disposal methods). Let's simply assume that the part not covered by a sub-image is in the frame's background color. */ @@ -12924,14 +12924,14 @@ gif_load (f, img) while (row >= image_height) row = interlace_start[++pass]; } - + for (x = 0; x < image_width; x++) { int i = raster[(y * image_width) + x]; XPutPixel (ximg, x + image_left, row + image_top, pixel_colors[i]); } - + row += interlace_increment[pass]; } } @@ -12944,7 +12944,7 @@ gif_load (f, img) XPutPixel (ximg, x + image_left, y + image_top, pixel_colors[i]); } } - + DGifCloseFile (gif); /* Maybe fill in the background field while we have ximg handy. */ @@ -12954,7 +12954,7 @@ gif_load (f, img) /* Put the image into the pixmap, then free the X image and its buffer. */ x_put_x_image (f, ximg, img->pixmap, width, height); x_destroy_x_image (ximg); - + UNGCPRO; return 1; } @@ -13055,11 +13055,11 @@ gs_image_p (object) struct image_keyword fmt[GS_LAST]; Lisp_Object tem; int i; - + bcopy (gs_format, fmt, sizeof fmt); - + if (!parse_image_spec (object, fmt, GS_LAST, Qpostscript) - || (fmt[GS_ASCENT].count + || (fmt[GS_ASCENT].count && XFASTINT (fmt[GS_ASCENT].value) > 100)) return 0; @@ -13127,7 +13127,7 @@ gs_load (f, img) image_error ("Unable to create pixmap for `%s'", img->spec, Qnil); return 0; } - + /* Call the loader to fill the pixmap. It returns a process object if successful. We do not record_unwind_protect here because other places in redisplay like calling window scroll functions @@ -13138,12 +13138,12 @@ gs_load (f, img) (unsigned long) FRAME_W32_WINDOW (f), (unsigned long) img->pixmap); window_and_pixmap_id = build_string (buffer); - + sprintf (buffer, "%lu %lu", FRAME_FOREGROUND_PIXEL (f), FRAME_BACKGROUND_PIXEL (f)); pixel_colors = build_string (buffer); - + XSETFRAME (frame, f); loader = image_spec_value (img->spec, QCloader, NULL); if (NILP (loader)) @@ -13205,10 +13205,10 @@ x_kill_gs_process (pixmap, f) if (ximg) { int x, y; - + /* Initialize the color table. */ init_color_table (); - + /* For each pixel of the image, look its color up in the color table. After having done so, the color table will contain an entry for each color used by the image. */ @@ -13238,7 +13238,7 @@ x_kill_gs_process (pixmap, f) else image_error ("Cannot get X image of `%s'; colors will not be freed", img->spec, Qnil); - + UNBLOCK_INPUT; } @@ -13350,8 +13350,8 @@ value. */) rc = XGetWindowProperty (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f), prop_atom, 0, bytes_remaining, False, XA_STRING, - &actual_type, &actual_format, - &actual_size, &bytes_remaining, + &actual_type, &actual_format, + &actual_size, &bytes_remaining, (unsigned char **) &tmp_data); if (rc == Success) prop_value = make_string (tmp_data, size); @@ -13405,7 +13405,7 @@ start_hourglass () #if 0 /* TODO: cursor shape changes. */ EMACS_TIME delay; int secs, usecs = 0; - + cancel_hourglass (); if (INTEGERP (Vhourglass_delay) @@ -13421,7 +13421,7 @@ start_hourglass () } else secs = DEFAULT_HOURGLASS_DELAY; - + EMACS_SET_SECS_USECS (delay, secs, usecs); hourglass_atimer = start_atimer (ATIMER_RELATIVE, delay, show_hourglass, NULL); @@ -13440,7 +13440,7 @@ cancel_hourglass () cancel_atimer (hourglass_atimer); hourglass_atimer = NULL; } - + if (hourglass_shown_p) hide_hourglass (); } @@ -13467,23 +13467,23 @@ show_hourglass (timer) if (!hourglass_shown_p) { Lisp_Object rest, frame; - + BLOCK_INPUT; - + FOR_EACH_FRAME (rest, frame) if (FRAME_W32_P (XFRAME (frame))) { struct frame *f = XFRAME (frame); - + f->output_data.w32->hourglass_p = 1; - + if (!f->output_data.w32->hourglass_window) { unsigned long mask = CWCursor; XSetWindowAttributes attrs; - + attrs.cursor = f->output_data.w32->hourglass_cursor; - + f->output_data.w32->hourglass_window = XCreateWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), @@ -13492,7 +13492,7 @@ show_hourglass (timer) CopyFromParent, mask, &attrs); } - + XMapRaised (FRAME_X_DISPLAY (f), f->output_data.w32->hourglass_window); XFlush (FRAME_X_DISPLAY (f)); @@ -13519,7 +13519,7 @@ hide_hourglass () FOR_EACH_FRAME (rest, frame) { struct frame *f = XFRAME (frame); - + if (FRAME_W32_P (f) /* Watch out for newly created frames. */ && f->output_data.x->hourglass_window) @@ -13549,7 +13549,7 @@ static Lisp_Object x_create_tip_frame P_ ((struct w32_display_info *, Lisp_Object, Lisp_Object)); static void compute_tip_xy P_ ((struct frame *, Lisp_Object, Lisp_Object, Lisp_Object, int, int, int *, int *)); - + /* The frame of a currently visible tooltip. */ Lisp_Object tip_frame; @@ -13582,7 +13582,7 @@ unwind_create_tip_frame (frame) tip_window = NULL; tip_frame = Qnil; } - + return deleted; } @@ -13648,7 +13648,7 @@ x_create_tip_frame (dpyinfo, parms, text) Ferase_buffer (); Finsert (1, &text); set_buffer_internal_1 (old_buffer); - + FRAME_CAN_HAVE_SCROLL_BARS (f) = 0; record_unwind_protect (unwind_create_tip_frame, frame); @@ -13706,7 +13706,7 @@ x_create_tip_frame (dpyinfo, parms, text) else font = x_new_font (f, SDATA (font)); } - + /* Try out a font which we hope has bold and italic variations. */ if (!STRINGP (font)) font = x_new_font (f, "-*-Courier New-normal-r-*-*-*-100-*-*-c-*-iso8859-1"); @@ -13816,7 +13816,7 @@ x_create_tip_frame (dpyinfo, parms, text) if (NILP (Fframe_parameter (frame, intern ("tooltip")))) Fmodify_frame_parameters (frame, Fcons (Fcons (intern ("tooltip"), Qt), Qnil)); - + /* Set up faces after all frame parameters are known. This call also merges in face attributes specified for new frames. @@ -13831,12 +13831,12 @@ x_create_tip_frame (dpyinfo, parms, text) /* Set tip_frame here, so that */ tip_frame = frame; call1 (Qface_set_after_frame_default, frame); - + if (!EQ (bg, Fframe_parameter (frame, Qbackground_color))) Fmodify_frame_parameters (frame, Fcons (Fcons (Qbackground_color, bg), Qnil)); } - + f->no_split = 1; UNGCPRO; @@ -13876,11 +13876,11 @@ compute_tip_xy (f, parms, dx, dy, width, height, root_x, root_y) int *root_x, *root_y; { Lisp_Object left, top; - + /* User-specified position? */ left = Fcdr (Fassq (Qleft, parms)); top = Fcdr (Fassq (Qtop, parms)); - + /* Move the tooltip window where the mouse pointer is. Resize and show it. */ if (!INTEGERP (left) || !INTEGERP (top)) @@ -13952,7 +13952,7 @@ Text larger than the specified size is clipped. */) struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; int old_windows_or_buffers_changed = windows_or_buffers_changed; int count = SPECPDL_INDEX (); - + specbind (Qinhibit_redisplay, Qt); GCPRO4 (string, parms, frame, timeout); @@ -13968,7 +13968,7 @@ Text larger than the specified size is clipped. */) dx = make_number (5); else CHECK_NUMBER (dx); - + if (NILP (dy)) dy = make_number (-10); else @@ -13988,7 +13988,7 @@ Text larger than the specified size is clipped. */) && !NILP (Fequal (last_parms, parms))) { struct frame *f = XFRAME (tip_frame); - + /* Only DX and DY have changed. */ if (!NILP (tip_timer)) { @@ -14063,7 +14063,7 @@ Text larger than the specified size is clipped. */) w->width = make_number (80); w->height = make_number (40); } - + f->window_width = XINT (w->width); adjust_glyphs (f); w->pseudo_window_p = 1; @@ -14104,7 +14104,7 @@ Text larger than the specified size is clipped. */) else #endif row_width = row->pixel_width; - + /* TODO: find why tips do not draw along baseline as instructed. */ height += row->height; width = max (width, row_width); @@ -14176,16 +14176,16 @@ Value is t if tooltip was open, nil otherwise. */) /* Return quickly if nothing to do. */ if (NILP (tip_timer) && NILP (tip_frame)) return Qnil; - + frame = tip_frame; timer = tip_timer; GCPRO2 (frame, timer); tip_frame = tip_timer = deleted = Qnil; - + count = SPECPDL_INDEX (); specbind (Qinhibit_redisplay, Qt); specbind (Qinhibit_quit, Qt); - + if (!NILP (timer)) call1 (Qcancel_timer, timer); @@ -14953,13 +14953,13 @@ When nil, Emacs will translate the alt key to the Alt modifier, and not Meta. * doc: /* If non-zero, the virtual key code for an alternative quit key. */); XSETINT (Vw32_quit_key, 0); - DEFVAR_LISP ("w32-pass-lwindow-to-system", + DEFVAR_LISP ("w32-pass-lwindow-to-system", &Vw32_pass_lwindow_to_system, doc: /* Non-nil if the left \"Windows\" key is passed on to Windows. When non-nil, the Start menu is opened by tapping the key. */); Vw32_pass_lwindow_to_system = Qt; - DEFVAR_LISP ("w32-pass-rwindow-to-system", + DEFVAR_LISP ("w32-pass-rwindow-to-system", &Vw32_pass_rwindow_to_system, doc: /* Non-nil if the right \"Windows\" key is passed on to Windows. When non-nil, the Start menu is opened by tapping the key. */); @@ -14977,13 +14977,13 @@ acting on \"Windows\" key events when `w32-pass-lwindow-to-system' or means that this hack won't interfere with any real key code. */ Vw32_phantom_key_code = 255; - DEFVAR_LISP ("w32-enable-num-lock", + DEFVAR_LISP ("w32-enable-num-lock", &Vw32_enable_num_lock, doc: /* Non-nil if Num Lock should act normally. Set to nil to see Num Lock as the key `kp-numlock'. */); Vw32_enable_num_lock = Qt; - DEFVAR_LISP ("w32-enable-caps-lock", + DEFVAR_LISP ("w32-enable-caps-lock", &Vw32_enable_caps_lock, doc: /* Non-nil if Caps Lock should act normally. Set to nil to see Caps Lock as the key `capslock'. */); @@ -15090,7 +15090,7 @@ or when you set the mouse color. */); DEFVAR_BOOL ("display-hourglass", &display_hourglass_p, doc: /* Non-zero means Emacs displays an hourglass pointer on window systems. */); display_hourglass_p = 1; - + DEFVAR_LISP ("hourglass-delay", &Vhourglass_delay, doc: /* *Seconds to wait before displaying an hourglass pointer. Value must be an integer or float. */); @@ -15118,7 +15118,7 @@ or when you set the mouse color. */); doc: /* Maximum size for tooltips. Value is a pair (COLUMNS . ROWS). Text larger than this is clipped. */); Vx_max_tooltip_size = Fcons (make_number (80), make_number (40)); - + DEFVAR_LISP ("x-no-window-manager", &Vx_no_window_manager, doc: /* Non-nil if no window manager is in use. Emacs doesn't try to figure this out; this is always nil @@ -15349,16 +15349,16 @@ versions of Windows) characters. */); Qxpm = intern ("xpm"); staticpro (&Qxpm); #endif - + #if HAVE_JPEG Qjpeg = intern ("jpeg"); staticpro (&Qjpeg); -#endif +#endif #if HAVE_TIFF Qtiff = intern ("tiff"); staticpro (&Qtiff); -#endif +#endif #if HAVE_GIF Qgif = intern ("gif"); @@ -15406,15 +15406,15 @@ init_xfns () #if 0 /* TODO : Image support for W32 */ define_image_type (&gs_type); #endif - + #if HAVE_XPM define_image_type (&xpm_type); #endif - + #if HAVE_JPEG define_image_type (&jpeg_type); #endif - + #if HAVE_TIFF define_image_type (&tiff_type); #endif @@ -15422,7 +15422,7 @@ init_xfns () #if HAVE_GIF define_image_type (&gif_type); #endif - + #if HAVE_PNG define_image_type (&png_type); #endif @@ -15430,7 +15430,7 @@ init_xfns () #undef abort -void +void w32_abort() { int button; diff --git a/src/xdisp.c b/src/xdisp.c index 64e94a9d6d1..e3f2ecc134b 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -1531,7 +1531,7 @@ init_iterator (it, w, charpos, bytepos, row, base_face_id) /* If face attributes have been changed since the last redisplay, free realized faces now because they depend on face definitions - that might have changed. Don't free faces while there might be + that might have changed. Don't free faces while there might be desired matrices pending which reference these faces. */ if (face_change_count && !inhibit_free_realized_faces) { @@ -4215,7 +4215,7 @@ int get_next_display_element (it) struct it *it; { - /* Non-zero means that we found an display element. Zero means that + /* Non-zero means that we found a display element. Zero means that we hit the end of what we iterate over. Performance note: the function pointer `method' used here turns out to be faster than using a sequence of if-statements. */ @@ -9033,7 +9033,7 @@ redisplay_internal (preserve_echo_area) redisplay_window_error); /* Compare desired and current matrices, perform output. */ - + update: /* If fonts changed, display again. */ if (fonts_changed_p) @@ -13751,7 +13751,7 @@ static Lisp_Object mode_line_string_face_prop; PROPS is a property list to add to any string we encounter. - If RISKY is nonzero, remove (disregard) any properties in any string + If RISKY is nonzero, remove (disregard) any properties in any string we encounter, and ignore :eval and :propertize. If the global variable `frame_title_ptr' is non-NULL, then the output @@ -14165,7 +14165,7 @@ display_mode_element (it, depth, field_width, precision, elt, props, risky) If COPY_STRING is non-zero, make a copy of LISP_STRING before adding properties to the string. - PROPS are the properties to add to the string. + PROPS are the properties to add to the string. The mode_line_string_face face property is always added to the string. */ @@ -14201,7 +14201,7 @@ static int store_mode_line_string (string, lisp_string, copy_string, field_width Fadd_text_properties (make_number (0), make_number (len), props, lisp_string); } - else + else { len = XFASTINT (Flength (lisp_string)); if (precision > 0 && len > precision) @@ -14232,7 +14232,7 @@ static int store_mode_line_string (string, lisp_string, copy_string, field_width if (len > 0) { mode_line_string_list = Fcons (lisp_string, mode_line_string_list); - n += len; + n += len; } if (field_width > len) @@ -14243,7 +14243,7 @@ static int store_mode_line_string (string, lisp_string, copy_string, field_width Fadd_text_properties (make_number (0), make_number (field_width), props, lisp_string); mode_line_string_list = Fcons (lisp_string, mode_line_string_list); - n += field_width; + n += field_width; } return n; @@ -14305,7 +14305,7 @@ If third optional arg NO-PROPS is non-nil, string is not propertized. */) /* We need a dummy last element in mode_line_string_list to indicate we are building the propertized mode-line string. Using mode_line_string_face_prop here GC protects it. */ - mode_line_string_list = + mode_line_string_list = Fcons (mode_line_string_face_prop, Qnil); frame_title_ptr = NULL; } @@ -15214,7 +15214,7 @@ get_specified_cursor_type (arg, width) int *width; { enum text_cursor_kinds type; - + if (NILP (arg)) return NO_CURSOR; @@ -15369,8 +15369,8 @@ get_window_cursor_type (w, width) *width = FRAME_BLINK_OFF_CURSOR_WIDTH (f); return FRAME_BLINK_OFF_CURSOR (f); } - - /* Finally perform built-in cursor blinking: + + /* Finally perform built-in cursor blinking: filled box <-> hollow box wide [h]bar <-> narrow [h]bar narrow [h]bar <-> no cursor diff --git a/src/xsmfns.c b/src/xsmfns.c index 6db774e7a9f..c2640e87ffb 100644 --- a/src/xsmfns.c +++ b/src/xsmfns.c @@ -98,7 +98,7 @@ Lisp_Object Vx_session_previous_id; open to a session manager, just return 0. Otherwise returns the number of events stored in buffer BUFP, which can hold up to *NUMCHARS characters. At most one event is - stored, an SAVE_SESSION_EVENT. */ + stored, a SAVE_SESSION_EVENT. */ int x_session_check_input (bufp, numchars) struct input_event *bufp; @@ -106,15 +106,15 @@ x_session_check_input (bufp, numchars) { SELECT_TYPE read_fds; EMACS_TIME tmout; - + if (ice_fd == -1) return 0; - + FD_ZERO (&read_fds); FD_SET (ice_fd, &read_fds); - + tmout.tv_sec = 0; tmout.tv_usec = 0; - + /* Reset this so wo can check kind after callbacks have been called by IceProcessMessages. The smc_interact_CB sets the kind to SAVE_SESSION_EVENT, but we don't know beforehand if that callback @@ -127,13 +127,13 @@ x_session_check_input (bufp, numchars) ice_fd = -1; return 0; } - + if (FD_ISSET (ice_fd, &read_fds)) IceProcessMessages (SmcGetIceConnection (smc_conn), (IceReplyWaitInfo *)0, (Bool *)0); - + /* Check if smc_interact_CB was called and we shall generate a SAVE_SESSION_EVENT. */ if (*numchars > 0 && emacs_event.kind != NO_EVENT) @@ -189,14 +189,14 @@ smc_save_yourself_CB (smcConn, Bool fast; { #define NR_PROPS 5 - + SmProp *props[NR_PROPS]; SmProp prop_ptr[NR_PROPS]; - + SmPropValue values[20]; int val_idx = 0; int props_idx = 0; - + char cwd[MAXPATHLEN+1]; char *smid_opt; @@ -219,7 +219,7 @@ smc_save_yourself_CB (smcConn, props[props_idx]->vals[0].length = strlen (SDATA (Vinvocation_name)); props[props_idx]->vals[0].value = SDATA (Vinvocation_name); ++props_idx; - + /* How to restart Emacs (i.e.: /path/to/emacs --smid=xxxx). */ props[props_idx] = &prop_ptr[props_idx]; props[props_idx]->name = SmRestartCommand; @@ -232,7 +232,7 @@ smc_save_yourself_CB (smcConn, smid_opt = xmalloc (strlen (SMID_OPT) + strlen (client_id) + 1); strcpy (smid_opt, SMID_OPT); strcat (smid_opt, client_id); - + props[props_idx]->vals[1].length = strlen (smid_opt); props[props_idx]->vals[1].value = smid_opt; val_idx += 2; @@ -264,8 +264,8 @@ smc_save_yourself_CB (smcConn, props[props_idx]->vals[0].value = cwd; ++props_idx; } - - + + SmcSetProperties (smcConn, props_idx, props); xfree (smid_opt); @@ -375,7 +375,7 @@ ice_conn_watch_CB (iceConn, clientData, opening, watchData) ice_fd = -1; return; } - + ice_fd = IceConnectionNumber (iceConn); #ifndef F_SETOWN_BUG #ifdef F_SETOWN @@ -403,7 +403,7 @@ x_session_initialize () char* previous_id = NULL; SmcCallbacks callbacks; int name_len = 0; - + /* Check if we where started by the session manager. If so, we will have a previous id. */ if (! EQ (Vx_session_previous_id, Qnil) && STRINGP (Vx_session_previous_id)) @@ -422,7 +422,7 @@ x_session_initialize () if (! EQ (Vinvocation_directory, Qnil)) strcpy (emacs_program, SDATA (Vinvocation_directory)); strcat (emacs_program, SDATA (Vinvocation_name)); - + /* The SM protocol says all callbacks are mandatory, so set up all here and in the mask passed to SmcOpenConnection */ callbacks.save_yourself.callback = smc_save_yourself_CB; @@ -464,7 +464,7 @@ x_session_initialize () DEFUN ("handle-save-session", Fhandle_save_session, Shandle_save_session, 1, 1, "e", doc: /* Handle the save_yourself event from a session manager. -A session manager can tell Emacs that the window system is shutting down +A session manager can tell Emacs that the window system is shutting down by sending Emacs a save_yourself message. Emacs executes this function when such an event occurs. This function then executes `emacs-session-save'. After that, this function informs the session manager that it can continue @@ -510,27 +510,27 @@ See also `x-session-previous-id', `emacs-save-session-functions', DEFVAR_LISP ("x-session-previous-id", &Vx_session_previous_id, doc: /* The previous session id Emacs got from session manager. -If Emacs is running on a window system that has a session manager, the -session manager gives Emacs a session id. It is feasible for Emacs lisp -code to use the session id to save configuration in, for example, a file -with a file name based on the session id. If Emacs is running when the -window system is shut down, the session manager remembers that Emacs was +If Emacs is running on a window system that has a session manager, the +session manager gives Emacs a session id. It is feasible for Emacs lisp +code to use the session id to save configuration in, for example, a file +with a file name based on the session id. If Emacs is running when the +window system is shut down, the session manager remembers that Emacs was running and saves the session id Emacs had. -When the window system is started again, the session manager restarts -Emacs and hands Emacs the session id it had the last time it was -running. This is now the previous session id and the value of this -variable. If configuration was saved in a file as stated above, the +When the window system is started again, the session manager restarts +Emacs and hands Emacs the session id it had the last time it was +running. This is now the previous session id and the value of this +variable. If configuration was saved in a file as stated above, the previous session id shall be used to reconstruct the file name. -The session id Emacs has while it is running is in the variable +The session id Emacs has while it is running is in the variable `x-session-id'. The value of this variable and `x-session-id' may be the same, depending on how the session manager works. See also `emacs-save-session-functions', `emacs-session-save' and `emacs-session-restore'." */); Vx_session_previous_id = Qnil; - + defsubr (&Shandle_save_session); } diff --git a/src/xterm.c b/src/xterm.c index eded4c8d9fa..36325e3973d 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -238,7 +238,7 @@ Lisp_Object Vx_toolkit_scroll_bars; /* If a string, XTread_socket generates an event to display that string. (The display is done in read_char.) */ - + static Lisp_Object help_echo; static Lisp_Object help_echo_window; static Lisp_Object help_echo_object; @@ -299,7 +299,7 @@ XtAppContext Xt_app_con; static String Xt_default_resources[] = {0}; #endif /* USE_X_TOOLKIT */ -/* Nominal cursor position -- where to draw output. +/* Nominal cursor position -- where to draw output. HPOS and VPOS are window relative glyph matrix coordinates. X and Y are window relative pixel coordinates. */ @@ -496,7 +496,7 @@ static void x_update_cursor_in_window_tree P_ ((struct window *, int)); static void x_update_window_cursor P_ ((struct window *, int)); static void x_erase_phys_cursor P_ ((struct window *)); void x_display_and_set_cursor P_ ((struct window *, int, int, int, int, int)); -static void x_draw_fringe_bitmap P_ ((struct window *, struct glyph_row *, +static void x_draw_fringe_bitmap P_ ((struct window *, struct glyph_row *, enum fringe_bitmap_type, int left_p)); static void x_clip_to_row P_ ((struct window *, struct glyph_row *, @@ -546,7 +546,7 @@ x_flush (f) XTread_socket calls XPending. Removing XFlush improves performance. */ -#define XFlush(DISPLAY) (void) 0 +#define XFlush(DISPLAY) (void) 0 /*********************************************************************** @@ -558,7 +558,7 @@ x_flush (f) /* This is a function useful for recording debugging information about the sequence of occurrences in this file. */ -struct record +struct record { char *locus; int type; @@ -604,7 +604,7 @@ x_display_info_for_display (dpy) /*********************************************************************** Starting and ending an update ***********************************************************************/ - + /* Start an update of frame F. This function is installed as a hook for update_begin, i.e. it is called when update_begin is called. This function is called prior to calls to x_update_window_begin for @@ -629,7 +629,7 @@ x_update_window_begin (w) { struct frame *f = XFRAME (WINDOW_FRAME (w)); struct x_display_info *display_info = FRAME_X_DISPLAY_INFO (f); - + updated_window = w; set_output_cursor (&w->cursor); @@ -651,7 +651,7 @@ x_update_window_begin (w) flag set. So, rows containing mouse-face glyphs are never scrolled, and we don't have to switch the mouse highlight off here to prevent it from being scrolled. */ - + /* Can we tell that this update does not affect the window where the mouse highlight is? If so, no need to turn off. Likewise, don't do anything if the frame is garbaged; @@ -684,7 +684,7 @@ x_draw_vertical_border (w) struct window *w; { struct frame *f = XFRAME (WINDOW_FRAME (w)); - + /* Redraw borders between horizontally adjacent windows. Don't do it for frames with vertical scroll bars because either the right scroll bar of a window, or the left scroll bar of its @@ -697,13 +697,13 @@ x_draw_vertical_border (w) window_box_edges (w, -1, &x0, &y0, &x1, &y1); x1 += FRAME_X_RIGHT_FRINGE_WIDTH (f); y1 -= 1; - - XDrawLine (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), + + XDrawLine (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), f->output_data.x->normal_gc, x1, y0, x1, y1); } } - - + + /* End update of window W (which is equal to updated_window). Draw vertical borders between horizontally adjacent windows, and @@ -723,7 +723,7 @@ x_update_window_end (w, cursor_on_p, mouse_face_overwritten_p) int cursor_on_p, mouse_face_overwritten_p; { struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (XFRAME (w->frame)); - + if (!w->pseudo_window_p) { BLOCK_INPUT; @@ -732,11 +732,11 @@ x_update_window_end (w, cursor_on_p, mouse_face_overwritten_p) x_display_and_set_cursor (w, 1, output_cursor.hpos, output_cursor.vpos, output_cursor.x, output_cursor.y); - + x_draw_vertical_border (w); UNBLOCK_INPUT; } - + /* If a row with mouse-face was overwritten, arrange for XTframe_up_to_date to redisplay the mouse highlight. */ if (mouse_face_overwritten_p) @@ -745,7 +745,7 @@ x_update_window_end (w, cursor_on_p, mouse_face_overwritten_p) dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_end_col = -1; dpyinfo->mouse_face_window = Qnil; } - + updated_window = NULL; } @@ -807,16 +807,16 @@ x_after_update_window_line (desired_row) struct window *w = updated_window; struct frame *f; int width, height; - + xassert (w); - + if (!desired_row->mode_line_p && !w->pseudo_window_p) { BLOCK_INPUT; x_draw_row_fringe_bitmaps (w, desired_row); UNBLOCK_INPUT; } - + /* When a window has disappeared, make sure that no rest of full-width rows stays visible in the internal border. Could check here if updated_window is the leftmost/rightmost window, @@ -837,7 +837,7 @@ x_after_update_window_line (desired_row) if (WINDOWP (f->tool_bar_window) && w == XWINDOW (f->tool_bar_window)) y -= width; - + BLOCK_INPUT; x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 0, y, width, height, False); @@ -890,13 +890,13 @@ x_draw_fringe_bitmap (w, row, which, left_p) h = left_height; bits = left_bits; break; - + case OVERLAY_ARROW_BITMAP: wd = ov_width; h = ov_height; bits = ov_bits; break; - + case RIGHT_TRUNCATION_BITMAP: wd = right_width; h = right_height; @@ -908,7 +908,7 @@ x_draw_fringe_bitmap (w, row, which, left_p) h = continued_height; bits = continued_bits; break; - + case CONTINUATION_LINE_BITMAP: wd = continuation_width; h = continuation_height; @@ -975,7 +975,7 @@ x_draw_fringe_bitmap (w, row, which, left_p) if (b1 >= 0) { int header_line_height = WINDOW_DISPLAY_HEADER_LINE_HEIGHT (w); - + /* In case the same realized face is used for fringes and for something displayed in the text (e.g. face `region' on mono-displays, the fill style may have been changed to @@ -984,7 +984,7 @@ x_draw_fringe_bitmap (w, row, which, left_p) XSetFillStyle (display, face->gc, FillOpaqueStippled); else XSetForeground (display, face->gc, face->background); - + XFillRectangle (display, window, face->gc, b1, WINDOW_TO_FRAME_PIXEL_Y (w, max (header_line_height, @@ -1005,7 +1005,7 @@ x_draw_fringe_bitmap (w, row, which, left_p) XCopyArea (display, pixmap, window, gc, 0, 0, wd, h, x, y + dy); XFreePixmap (display, pixmap); } - + XSetClipMask (display, gc, None); } @@ -1105,7 +1105,7 @@ set_output_cursor (cursor) HPOS and VPOS are column/row positions in a window glyph matrix. X and Y are window text area relative pixel positions. - + If this is done during an update, updated_window will contain the window that is being updated and the position is the future output cursor position for that window. If updated_window is null, use @@ -1268,9 +1268,9 @@ x_encode_char (c, char2b, font_info) ccl->reg[1] = char2b->byte1; ccl->reg[2] = char2b->byte2; } - + ccl_driver (ccl, NULL, NULL, 0, 0, NULL); - + /* We assume that MSBs are appropriately set/reset by CCL program. */ if (font->max_byte1 == 0) /* 1-byte font */ @@ -1283,11 +1283,11 @@ x_encode_char (c, char2b, font_info) /* Fixed encoding scheme. See fontset.h for the meaning of the encoding numbers. */ int enc = font_info->encoding[charset]; - + if ((enc == 1 || enc == 2) && CHARSET_DIMENSION (charset) == 2) char2b->byte1 |= 0x80; - + if (enc == 1 || enc == 3) char2b->byte2 |= 0x80; } @@ -1328,7 +1328,7 @@ x_get_char_face_and_encoding (f, c, face_id, char2b, multibyte_p, display_p) else { int c1, c2, charset; - + /* Split characters into bytes. If c2 is -1 afterwards, C is really a one-byte character so that byte1 is zero. */ SPLIT_CHAR (c, charset, c1, c2); @@ -1353,7 +1353,7 @@ x_get_char_face_and_encoding (f, c, face_id, char2b, multibyte_p, display_p) xassert (face != NULL); PREPARE_FACE_FOR_DISPLAY (f, face); } - + return face; } @@ -1394,7 +1394,7 @@ x_get_glyph_face_and_encoding (f, glyph, char2b, two_byte_p) else { int c1, c2, charset; - + /* Split characters into bytes. If c2 is -1 afterwards, C is really a one-byte character so that byte1 is zero. */ SPLIT_CHAR (glyph->u.ch, charset, c1, c2); @@ -1425,7 +1425,7 @@ x_get_glyph_face_and_encoding (f, glyph, char2b, two_byte_p) } -/* Store one glyph for IT->char_to_display in IT->glyph_row. +/* Store one glyph for IT->char_to_display in IT->glyph_row. Called from x_produce_glyphs when IT->glyph_row is non-null. */ static INLINE void @@ -1434,10 +1434,10 @@ x_append_glyph (it) { struct glyph *glyph; enum glyph_row_area area = it->area; - + xassert (it->glyph_row); xassert (it->char_to_display != '\n' && it->char_to_display != '\t'); - + glyph = it->glyph_row->glyphs[area] + it->glyph_row->used[area]; if (glyph < it->glyph_row->glyphs[area + 1]) { @@ -1459,7 +1459,7 @@ x_append_glyph (it) } } -/* Store one glyph for the composition IT->cmp_id in IT->glyph_row. +/* Store one glyph for the composition IT->cmp_id in IT->glyph_row. Called from x_produce_glyphs when IT->glyph_row is non-null. */ static INLINE void @@ -1468,9 +1468,9 @@ x_append_composite_glyph (it) { struct glyph *glyph; enum glyph_row_area area = it->area; - + xassert (it->glyph_row); - + glyph = it->glyph_row->glyphs[area] + it->glyph_row->used[area]; if (glyph < it->glyph_row->glyphs[area + 1]) { @@ -1540,7 +1540,7 @@ x_produce_image_glyph (it) it->pixel_width = img->width + 2 * img->hmargin; it->nglyphs = 1; - + if (face->box != FACE_NO_BOX) { if (face->box_line_width > 0) @@ -1548,7 +1548,7 @@ x_produce_image_glyph (it) it->ascent += face->box_line_width; it->descent += face->box_line_width; } - + if (it->start_of_box_run_p) it->pixel_width += abs (face->box_line_width); if (it->end_of_box_run_p) @@ -1556,12 +1556,12 @@ x_produce_image_glyph (it) } take_vertical_position_into_account (it); - + if (it->glyph_row) { struct glyph *glyph; enum glyph_row_area area = it->area; - + glyph = it->glyph_row->glyphs[area] + it->glyph_row->used[area]; if (glyph < it->glyph_row->glyphs[area + 1]) { @@ -1585,10 +1585,10 @@ x_produce_image_glyph (it) /* Append a stretch glyph to IT->glyph_row. OBJECT is the source - of the glyph, WIDTH and HEIGHT are the width and height of the - stretch. ASCENT is the percentage/100 of HEIGHT to use for the + of the glyph, WIDTH and HEIGHT are the width and height of the + stretch. ASCENT is the percentage/100 of HEIGHT to use for the ascent of the glyph (0 <= ASCENT <= 1). */ - + static void x_append_stretch_glyph (it, object, width, height, ascent) struct it *it; @@ -1600,7 +1600,7 @@ x_append_stretch_glyph (it, object, width, height, ascent) enum glyph_row_area area = it->area; xassert (ascent >= 0 && ascent <= 1); - + glyph = it->glyph_row->glyphs[area] + it->glyph_row->used[area]; if (glyph < it->glyph_row->glyphs[area + 1]) { @@ -1629,7 +1629,7 @@ x_append_stretch_glyph (it, object, width, height, ascent) being recognized: 1. `:width WIDTH' specifies that the space should be WIDTH * - canonical char width wide. WIDTH may be an integer or floating + canonical char width wide. WIDTH may be an integer or floating point number. 2. `:relative-width FACTOR' specifies that the width of the stretch @@ -1639,7 +1639,7 @@ x_append_stretch_glyph (it, object, width, height, ascent) 3. `:align-to HPOS' specifies that the space should be wide enough to reach HPOS, a value in canonical character units. - Exactly one of the above pairs must be present. + Exactly one of the above pairs must be present. 4. `:height HEIGHT' specifies that the height of the stretch produced should be HEIGHT, measured in canonical character units. @@ -1677,7 +1677,7 @@ x_produce_stretch_glyph (it) XFontStruct *font = face->font ? face->font : FRAME_FONT (it->f); PREPARE_FACE_FOR_DISPLAY (it->f, face); - + /* List should start with `space'. */ xassert (CONSP (it->object) && EQ (XCAR (it->object), Qspace)); plist = XCDR (it->object); @@ -1695,7 +1695,7 @@ x_produce_stretch_glyph (it) property. */ struct it it2; unsigned char *p = BYTE_POS_ADDR (IT_BYTEPOS (*it)); - + it2 = *it; if (it->multibyte_p) { @@ -1717,7 +1717,7 @@ x_produce_stretch_glyph (it) else /* Nothing specified -> width defaults to canonical char width. */ width = CANON_X_UNIT (it->f); - + /* Compute height. */ if (prop = Fplist_get (plist, QCheight), NUMVAL (prop) > 0) @@ -1728,7 +1728,7 @@ x_produce_stretch_glyph (it) else height = FONT_HEIGHT (font); - /* Compute percentage of height used for ascent. If + /* Compute percentage of height used for ascent. If `:ascent ASCENT' is present and valid, use that. Otherwise, derive the ascent from the font in use. */ if (prop = Fplist_get (plist, QCascent), @@ -1762,13 +1762,13 @@ x_produce_stretch_glyph (it) it->ascent += face->box_line_width; it->descent += face->box_line_width; } - + if (it->start_of_box_run_p) it->pixel_width += abs (face->box_line_width); if (it->end_of_box_run_p) it->pixel_width += abs (face->box_line_width); } - + take_vertical_position_into_account (it); } @@ -1859,7 +1859,7 @@ x_produce_glyphs (it) face = FACE_FROM_ID (it->f, it->face_id); } } - + /* Get font to use. Encode IT->char_to_display. */ x_get_char_face_and_encoding (it->f, it->char_to_display, it->face_id, &char2b, @@ -1920,7 +1920,7 @@ x_produce_glyphs (it) if (face->box != FACE_NO_BOX) { int thick = face->box_line_width; - + if (thick > 0) { it->ascent += thick; @@ -1941,7 +1941,7 @@ x_produce_glyphs (it) it->ascent += 2; take_vertical_position_into_account (it); - + /* If we have to actually produce glyphs, do it. */ if (it->glyph_row) { @@ -1950,7 +1950,7 @@ x_produce_glyphs (it) /* Translate a space with a `space-width' property into a stretch glyph. */ double ascent = (double) font->ascent / FONT_HEIGHT (font); - x_append_stretch_glyph (it, it->object, it->pixel_width, + x_append_stretch_glyph (it, it->object, it->pixel_width, it->ascent + it->descent, ascent); } else @@ -1970,7 +1970,7 @@ x_produce_glyphs (it) it->nglyphs = 0; it->ascent = it->phys_ascent = font->ascent + boff; it->descent = it->phys_descent = font->descent - boff; - + if (face->box != FACE_NO_BOX && face->box_line_width > 0) { @@ -1989,20 +1989,20 @@ x_produce_glyphs (it) tab stop after that. */ if (next_tab_x - x < CANON_X_UNIT (it->f)) next_tab_x += tab_width; - + it->pixel_width = next_tab_x - x; it->nglyphs = 1; it->ascent = it->phys_ascent = font->ascent + boff; it->descent = it->phys_descent = font->descent - boff; - + if (it->glyph_row) { double ascent = (double) it->ascent / (it->ascent + it->descent); - x_append_stretch_glyph (it, it->object, it->pixel_width, + x_append_stretch_glyph (it, it->object, it->pixel_width, it->ascent + it->descent, ascent); } } - else + else { /* A multi-byte character. Assume that the display width of the character is the width of the character multiplied by the @@ -2048,20 +2048,20 @@ x_produce_glyphs (it) } else thick = - thick; - + if (it->start_of_box_run_p) it->pixel_width += thick; if (it->end_of_box_run_p) it->pixel_width += thick; } - + /* If face has an overline, add the height of the overline (1 pixel) and a 1 pixel margin to the character height. */ if (face->overline_p) it->ascent += 2; take_vertical_position_into_account (it); - + if (it->glyph_row) x_append_glyph (it); } @@ -2090,7 +2090,7 @@ x_produce_glyphs (it) { it->char_to_display = unibyte_char_to_multibyte (it->c); } - + /* Get face and font to use. Encode IT->char_to_display. */ it->face_id = FACE_FOR_CHAR (it->f, face, it->char_to_display); face = FACE_FROM_ID (it->f, it->face_id); @@ -2155,12 +2155,12 @@ x_produce_glyphs (it) ascent = font->ascent; descent = font->descent; } - + rightmost = width; lowest = - descent + boff; highest = ascent + boff; leftmost = 0; - + if (font_info && font_info->default_ascent && CHAR_TABLE_P (Vuse_default_ascent) @@ -2180,7 +2180,7 @@ x_produce_glyphs (it) int left, right, btm, top; int ch = COMPOSITION_GLYPH (cmp, i); int face_id = FACE_FOR_CHAR (it->f, face, ch); - + face = FACE_FROM_ID (it->f, face_id); x_get_char_face_and_encoding (it->f, ch, face->id, &char2b, it->multibyte_p, 0); @@ -2321,20 +2321,20 @@ x_produce_glyphs (it) } else thick = - thick; - + if (it->start_of_box_run_p) it->pixel_width += thick; if (it->end_of_box_run_p) it->pixel_width += thick; } - + /* If face has an overline, add the height of the overline (1 pixel) and a 1 pixel margin to the character height. */ if (face->overline_p) it->ascent += 2; take_vertical_position_into_account (it); - + if (it->glyph_row) x_append_composite_glyph (it); } @@ -2348,9 +2348,9 @@ x_produce_glyphs (it) xassert (it->ascent >= 0 && it->descent >= 0); if (it->area == TEXT_AREA) it->current_x += it->pixel_width; - + it->descent += it->extra_line_spacing; - + it->max_ascent = max (it->max_ascent, it->ascent); it->max_descent = max (it->max_descent, it->descent); it->max_phys_ascent = max (it->max_phys_ascent, it->phys_ascent); @@ -2381,7 +2381,7 @@ x_estimate_mode_line_height (f, face_id) height += 2 * face->box_line_width; } } - + return height; } @@ -2551,7 +2551,7 @@ static int x_fill_glyph_string P_ ((struct glyph_string *, int, int, int, static void x_init_glyph_string P_ ((struct glyph_string *, XChar2b *, struct window *, struct glyph_row *, - enum glyph_row_area, int, + enum glyph_row_area, int, enum draw_glyphs_face)); static int x_draw_glyphs P_ ((struct window *, int , struct glyph_row *, enum glyph_row_area, int, int, @@ -2707,11 +2707,11 @@ x_set_cursor_gc (s) /* Set up S->gc of glyph string S for drawing text in mouse face. */ - + static void x_set_mouse_face_gc (s) struct glyph_string *s; -{ +{ int face_id; struct face *face; @@ -2720,7 +2720,7 @@ x_set_mouse_face_gc (s) face = FACE_FROM_ID (s->f, face_id); if (face == NULL) face = FACE_FROM_ID (s->f, MOUSE_FACE_ID); - + if (s->first_glyph->type == CHAR_GLYPH) face_id = FACE_FOR_CHAR (s->f, face, s->first_glyph->u.ch); else @@ -2737,21 +2737,21 @@ x_set_mouse_face_gc (s) but font FONT. */ XGCValues xgcv; unsigned long mask; - + xgcv.background = s->face->background; xgcv.foreground = s->face->foreground; IF_DEBUG (x_check_font (s->f, s->font)); xgcv.font = s->font->fid; xgcv.graphics_exposures = False; mask = GCForeground | GCBackground | GCFont | GCGraphicsExposures; - + if (FRAME_X_DISPLAY_INFO (s->f)->scratch_cursor_gc) XChangeGC (s->display, FRAME_X_DISPLAY_INFO (s->f)->scratch_cursor_gc, mask, &xgcv); else FRAME_X_DISPLAY_INFO (s->f)->scratch_cursor_gc = XCreateGC (s->display, s->window, mask, &xgcv); - + s->gc = FRAME_X_DISPLAY_INFO (s->f)->scratch_cursor_gc; } @@ -2766,7 +2766,7 @@ x_set_mouse_face_gc (s) static INLINE void x_set_mode_line_face_gc (s) struct glyph_string *s; -{ +{ s->gc = s->face->gc; } @@ -2780,7 +2780,7 @@ x_set_glyph_string_gc (s) struct glyph_string *s; { PREPARE_FACE_FOR_DISPLAY (s->f, s->face); - + if (s->hl == DRAW_NORMAL_TEXT) { s->gc = s->face->gc; @@ -2829,7 +2829,7 @@ x_get_glyph_string_clip_rect (s, r) { /* Draw full-width. X coordinates are relative to S->w->left. */ int canon_x = CANON_X_UNIT (s->f); - + r->x = WINDOW_LEFT_MARGIN (s->w) * canon_x; r->width = XFASTINT (s->w->width) * canon_x; @@ -2839,9 +2839,9 @@ x_get_glyph_string_clip_rect (s, r) if (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (s->f)) r->x -= width; } - + r->x += FRAME_INTERNAL_BORDER_WIDTH (s->f); - + /* Unless displaying a mode or menu bar line, which are always fully visible, clip to the visible part of the row. */ if (s->w->pseudo_window_p) @@ -2922,7 +2922,7 @@ x_compute_glyph_string_overhangs (s) /* Compute overhangs and x-positions for glyph string S and its predecessors, or successors. X is the starting x-position for S. BACKWARD_P non-zero means process predecessors. */ - + static void x_compute_overhangs_and_x (s, x, backward_p) struct glyph_string *s; @@ -2963,7 +2963,7 @@ x_get_glyph_overhangs (glyph, f, left, right) int *left, *right; { *left = *right = 0; - + if (glyph->type == CHAR_GLYPH) { XFontStruct *font; @@ -2996,7 +2996,7 @@ x_left_overwritten (s) struct glyph_string *s; { int k; - + if (s->left_overhang) { int x = 0, i; @@ -3058,7 +3058,7 @@ x_right_overwritten (s) struct glyph *glyphs = s->row->glyphs[s->area]; int first = (s->first_glyph - glyphs) + (s->cmp ? 1 : s->nchars); int end = s->row->used[s->area]; - + for (i = first; i < end && s->right_overhang > x; ++i) x += glyphs[i].pixel_width; @@ -3283,9 +3283,9 @@ x_frame_of_widget (widget) struct x_display_info *dpyinfo; Lisp_Object tail; struct frame *f; - + dpyinfo = x_display_info_for_display (XtDisplay (widget)); - + /* Find the top-level shell of the widget. Note that this function can be called when the widget is not yet realized, so XtWindow (widget) == 0. That's the reason we can't simply use @@ -3426,7 +3426,7 @@ cvt_string_to_pixel (dpy, args, nargs, from, to, closure_ret) { String params[1]; Cardinal nparams = 1; - + params[0] = color_name; XtAppWarningMsg (XtDisplayToApplicationContext (dpy), "badValue", "cvt_string_to_pixel", @@ -3442,7 +3442,7 @@ cvt_string_to_pixel (dpy, args, nargs, from, to, closure_ret) to->size = sizeof (Pixel); return False; } - + *(Pixel *) to->addr = pixel; } else @@ -3450,7 +3450,7 @@ cvt_string_to_pixel (dpy, args, nargs, from, to, closure_ret) cvt_string_to_pixel_value = pixel; to->addr = (XtPointer) &cvt_string_to_pixel_value; } - + to->size = sizeof (Pixel); return True; } @@ -3513,16 +3513,16 @@ x_color_cells (dpy, ncells) { Screen *screen = dpyinfo->screen; int i; - + dpyinfo->ncolor_cells = XDisplayCells (dpy, XScreenNumberOfScreen (screen)); dpyinfo->color_cells = (XColor *) xmalloc (dpyinfo->ncolor_cells * sizeof *dpyinfo->color_cells); - + for (i = 0; i < dpyinfo->ncolor_cells; ++i) dpyinfo->color_cells[i].pixel = i; - + XQueryColors (dpy, dpyinfo->cmap, dpyinfo->color_cells, dpyinfo->ncolor_cells); } @@ -3569,7 +3569,7 @@ x_query_color (f, color) { x_query_colors (f, color, 1); } - + /* Allocate the color COLOR->pixel on DISPLAY, colormap CMAP. If an exact match can't be allocated, try the nearest color available. @@ -3609,7 +3609,7 @@ x_alloc_nearest_color_1 (dpy, cmap, color) nearest_delta = delta; } } - + color->red = cells[nearest].red; color->green = cells[nearest].green; color->blue = cells[nearest].blue; @@ -3622,7 +3622,7 @@ x_alloc_nearest_color_1 (dpy, cmap, color) change in the colormap, so clear the color cache. */ struct x_display_info *dpyinfo = x_display_info_for_display (dpy); XColor *cached_color; - + if (dpyinfo->color_cells && (cached_color = &dpyinfo->color_cells[color->pixel], (cached_color->red != color->red @@ -3639,7 +3639,7 @@ x_alloc_nearest_color_1 (dpy, cmap, color) if (rc) register_color (color->pixel); #endif /* DEBUG_X_COLORS */ - + return rc; } @@ -3788,7 +3788,7 @@ x_alloc_lighter_color (f, display, cmap, pixel, factor, delta) /* If we end up with the same color as before, try adding delta to the RGB values. */ x_free_colors (f, &new.pixel, 1); - + new.red = min (0xffff, delta + color.red); new.green = min (0xffff, delta + color.green); new.blue = min (0xffff, delta + color.blue); @@ -3798,7 +3798,7 @@ x_alloc_lighter_color (f, display, cmap, pixel, factor, delta) success_p = 1; *pixel = new.pixel; } - + return success_p; } @@ -3809,7 +3809,7 @@ x_alloc_lighter_color (f, display, cmap, pixel, factor, delta) DELTA lighter or darker than the relief's background which is found in S->f->output_data.x->relief_background. If such a color cannot be allocated, use DEFAULT_PIXEL, instead. */ - + static void x_setup_relief_color (f, relief, factor, delta, default_pixel) struct frame *f; @@ -3849,7 +3849,7 @@ x_setup_relief_color (f, relief, factor, delta, default_pixel) relief->allocated_p = 1; xgcv.foreground = relief->pixel = pixel; } - + if (relief->gc == 0) { xgcv.stipple = dpyinfo->gray; @@ -3879,7 +3879,7 @@ x_setup_relief_colors (s) else { XGCValues xgcv; - + /* Get the background color of the face. */ XGetGCValues (s->display, s->gc, GCBackground, &xgcv); color = xgcv.background; @@ -3916,7 +3916,7 @@ x_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width, Window window = FRAME_X_WINDOW (f); int i; GC gc; - + if (raised_p) gc = f->output_data.x->white_relief.gc; else @@ -3941,13 +3941,13 @@ x_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width, else gc = f->output_data.x->white_relief.gc; XSetClipRectangles (dpy, gc, 0, 0, clip_rect, 1, Unsorted); - + /* Bottom. */ for (i = 0; i < width; ++i) XDrawLine (dpy, window, gc, left_x + i * left_p, bottom_y - i, right_x + 1 - i * right_p, bottom_y - i); - + /* Right. */ if (right_p) for (i = 0; i < width; ++i) @@ -3973,11 +3973,11 @@ x_draw_box_rect (s, left_x, top_y, right_x, bottom_y, width, XRectangle *clip_rect; { XGCValues xgcv; - + XGetGCValues (s->display, s->gc, GCForeground, &xgcv); XSetForeground (s->display, s->gc, s->face->box_color); XSetClipRectangles (s->display, s->gc, 0, 0, clip_rect, 1, Unsorted); - + /* Top. */ XFillRectangle (s->display, s->window, s->gc, left_x, top_y, right_x - left_x + 1, width); @@ -3990,7 +3990,7 @@ x_draw_box_rect (s, left_x, top_y, right_x, bottom_y, width, /* Bottom. */ XFillRectangle (s->display, s->window, s->gc, left_x, bottom_y - width + 1, right_x - left_x + 1, width); - + /* Right. */ if (right_p) XFillRectangle (s->display, s->window, s->gc, @@ -4020,7 +4020,7 @@ x_draw_glyph_string_box (s) if (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (s->f)) last_x += FRAME_SCROLL_BAR_WIDTH (s->f) * CANON_X_UNIT (s->f); } - + /* The glyph that may have a right box line. */ last_glyph = (s->cmp || s->img ? s->first_glyph @@ -4099,7 +4099,7 @@ x_draw_image_foreground (s) xgcv.clip_y_origin = y; xgcv.function = GXcopy; XChangeGC (s->display, s->gc, mask, &xgcv); - + x_get_glyph_string_clip_rect (s, &clip_rect); image_rect.x = x; image_rect.y = y; @@ -4121,7 +4121,7 @@ x_draw_image_foreground (s) if (x_intersect_rectangles (&clip_rect, &image_rect, &r)) XCopyArea (s->display, s->img->pixmap, s->window, s->gc, r.x - x, r.y - y, r.width, r.height, r.x, r.y); - + /* When the image has a mask, we can expect that at least part of a mouse highlight or a block cursor will be visible. If the image doesn't have a mask, make @@ -4154,7 +4154,7 @@ x_draw_image_relief (s) XRectangle r; int x; int y = s->ybase - image_ascent (s->img, s->face); - + /* If first glyph of S has a left box line, start drawing it to the right of that line. */ if (s->face->box != FACE_NO_BOX @@ -4162,12 +4162,12 @@ x_draw_image_relief (s) x = s->x + abs (s->face->box_line_width); else x = s->x; - + /* If there is a margin around the image, adjust x- and y-position by that margin. */ x += s->img->hmargin; y += s->img->vmargin; - + if (s->hl == DRAW_IMAGE_SUNKEN || s->hl == DRAW_IMAGE_RAISED) { @@ -4179,12 +4179,12 @@ x_draw_image_relief (s) thick = abs (s->img->relief); raised_p = s->img->relief > 0; } - + x0 = x - thick; y0 = y - thick; x1 = x + s->img->width + thick - 1; y1 = y + s->img->height + thick - 1; - + x_setup_relief_colors (s); x_get_glyph_string_clip_rect (s, &r); x_draw_relief_rect (s->f, x0, y0, x1, y1, thick, raised_p, 1, 1, &r); @@ -4241,7 +4241,7 @@ x_draw_image_foreground_1 (s, pixmap) { XCopyArea (s->display, s->img->pixmap, pixmap, s->gc, 0, 0, s->img->width, s->img->height, x, y); - + /* When the image has a mask, we can expect that at least part of a mouse highlight or a block cursor will be visible. If the image doesn't have a mask, make @@ -4284,7 +4284,7 @@ x_draw_glyph_string_bg_rect (s, x, y, w, h) } -/* Draw image glyph string S. +/* Draw image glyph string S. s->y s->x +------------------------- @@ -4325,9 +4325,9 @@ x_draw_image_glyph_string (s) x = s->x + box_line_hwidth; else x = s->x; - + y = s->y + box_line_vwidth; - + if (s->img->mask) { /* Create a pixmap as large as the glyph string. Fill it @@ -4340,7 +4340,7 @@ x_draw_image_glyph_string (s) pixmap = XCreatePixmap (s->display, s->window, s->background_width, s->height, depth); - + /* Don't clip in the following because we're working on the pixmap. */ XSetClipMask (s->display, s->gc, None); @@ -4367,7 +4367,7 @@ x_draw_image_glyph_string (s) } else x_draw_glyph_string_bg_rect (s, x, y, s->background_width, height); - + s->background_filled_p = 1; } @@ -4426,10 +4426,10 @@ x_draw_stretch_glyph_string (s) } else gc = s->face->gc; - + x_get_glyph_string_clip_rect (s, &r); XSetClipRectangles (s->display, gc, 0, 0, &r, 1, Unsorted); - + if (s->face->stipple) { /* Fill background with a stipple pattern. */ @@ -4450,7 +4450,7 @@ x_draw_stretch_glyph_string (s) else if (!s->background_filled_p) x_draw_glyph_string_bg_rect (s, s->x, s->y, s->background_width, s->height); - + s->background_filled_p = 1; } @@ -4543,7 +4543,7 @@ x_draw_glyph_string (s) ROUND ((maximum descent) / 2), with ROUND(x) = floor (x + 0.5) */ - + if (x_use_underline_position_properties && XGetFontProperty (s->font, XA_UNDERLINE_POSITION, &tem)) y = s->ybase + (long) tem; @@ -4551,7 +4551,7 @@ x_draw_glyph_string (s) y = s->ybase + (s->face->font->max_bounds.descent + 1) / 2; else y = s->y + s->height - h; - + if (s->face->underline_defaulted_p) XFillRectangle (s->display, s->window, s->gc, s->x, y, s->width, h); @@ -4584,7 +4584,7 @@ x_draw_glyph_string (s) XSetForeground (s->display, s->gc, xgcv.foreground); } } - + /* Draw strike-through. */ if (s->face->strike_through_p) { @@ -4604,12 +4604,12 @@ x_draw_glyph_string (s) XSetForeground (s->display, s->gc, xgcv.foreground); } } - + /* Draw relief if not yet drawn. */ if (!relief_drawn_p && s->face->box != FACE_NO_BOX) x_draw_glyph_string_box (s); } - + /* Reset clipping. */ XSetClipMask (s->display, s->gc, None); } @@ -4620,7 +4620,7 @@ static int x_fill_composite_glyph_string P_ ((struct glyph_string *, /* Fill glyph string S with composition components specified by S->cmp. - + FACES is an array of faces for all components of this composition. S->gidx is the index of the first component for S. OVERLAPS_P non-zero means S should draw the foreground only, and @@ -4639,7 +4639,7 @@ x_fill_composite_glyph_string (s, faces, overlaps_p) xassert (s); s->for_overlaps_p = overlaps_p; - + s->face = faces[s->gidx]; s->font = s->face->font; s->font_info = FONT_INFO_FROM_ID (s->f, s->face->font_info_id); @@ -4668,7 +4668,7 @@ x_fill_composite_glyph_string (s, faces, overlaps_p) /* Adjust base line for subscript/superscript text. */ s->ybase += s->first_glyph->voffset; - + xassert (s->face && s->face->gc); /* This glyph string must always be drawn with 16-bit functions. */ @@ -4679,7 +4679,7 @@ x_fill_composite_glyph_string (s, faces, overlaps_p) /* Fill glyph string S from a sequence of character glyphs. - + FACE_ID is the face id of the string. START is the index of the first glyph to consider, END is the index of the last + 1. OVERLAPS_P non-zero means S should draw the foreground only, and @@ -4696,7 +4696,7 @@ x_fill_glyph_string (s, face_id, start, end, overlaps_p) struct glyph *glyph, *last; int voffset; int glyph_not_available_p; - + xassert (s->f == XFRAME (s->w->frame)); xassert (s->nchars == 0); xassert (start >= 0 && end > start); @@ -4705,7 +4705,7 @@ x_fill_glyph_string (s, face_id, start, end, overlaps_p) glyph = s->row->glyphs[s->area] + start; last = s->row->glyphs[s->area] + end; voffset = glyph->voffset; - + glyph_not_available_p = glyph->glyph_not_available_p; while (glyph < last @@ -4729,7 +4729,7 @@ x_fill_glyph_string (s, face_id, start, end, overlaps_p) s->font = s->face->font; s->font_info = FONT_INFO_FROM_ID (s->f, s->face->font_info_id); - + /* If the specified font could not be loaded, use the frame's font, but record the fact that we couldn't load it in S->font_not_found_p so that we can draw rectangles for the @@ -4760,7 +4760,7 @@ x_fill_image_glyph_string (s) s->face = FACE_FROM_ID (s->f, s->first_glyph->face_id); s->font = s->face->font; s->width = s->first_glyph->pixel_width; - + /* Adjust base line for subscript/superscript text. */ s->ybase += s->first_glyph->voffset; } @@ -4783,9 +4783,9 @@ x_fill_stretch_glyph_string (s, row, area, start, end) { struct glyph *glyph, *last; int voffset, face_id; - + xassert (s->first_glyph->type == STRETCH_GLYPH); - + glyph = s->row->glyphs[s->area] + start; last = s->row->glyphs[s->area] + end; face_id = glyph->face_id; @@ -4802,7 +4802,7 @@ x_fill_stretch_glyph_string (s, row, area, start, end) && glyph->face_id == face_id); ++glyph) s->width += glyph->pixel_width; - + /* Adjust base line for subscript/superscript text. */ s->ybase += voffset; @@ -4820,7 +4820,7 @@ x_fill_stretch_glyph_string (s, row, area, start, end) and area within the row from which S is constructed. START is the index of the first glyph structure covered by S. HL is a face-override for drawing S. */ - + static void x_init_glyph_string (s, char2b, w, row, area, start, hl) struct glyph_string *s; @@ -4847,7 +4847,7 @@ x_init_glyph_string (s, char2b, w, row, area, start, hl) /* Display the internal border below the tool-bar window. */ if (s->w == XWINDOW (s->f->tool_bar_window)) s->y -= s->f->output_data.x->internal_border_width; - + s->ybase = s->y + row->ascent; } @@ -4865,7 +4865,7 @@ x_set_glyph_string_background_width (s, start, last_x) /* If the face of this glyph string has to be drawn to the end of the drawing area, set S->extends_to_end_of_line_p. */ struct face *default_face = FACE_FROM_ID (s->f, DEFAULT_FACE_ID); - + if (start == s->row->used[s->area] && s->area == TEXT_AREA && ((s->hl == DRAW_NORMAL_TEXT @@ -4877,7 +4877,7 @@ x_set_glyph_string_background_width (s, start, last_x) || ((s->hl == DRAW_IMAGE_RAISED || s->hl == DRAW_IMAGE_SUNKEN) && s->row->fill_line_p))) s->extends_to_end_of_line_p = 1; - + /* If S extends its face to the end of the line, set its background_width to the distance to the right edge of the drawing area. */ @@ -4958,7 +4958,7 @@ x_set_glyph_string_background_width (s, start, last_x) OVERLAPS_P); \ } \ while (0) - + /* Add a glyph string for a composite sequence to the list of strings between HEAD and TAIL. START is the index of the first glyph in @@ -5014,7 +5014,7 @@ x_set_glyph_string_background_width (s, start, last_x) ++START; \ s = first_s; \ } while (0) - + /* Build a list of glyph strings between HEAD and TAIL for the glyphs of AREA of glyph row ROW on window W between indices START and END. @@ -5083,7 +5083,7 @@ x_set_glyph_string_background_width (s, start, last_x) and clip to the physical height of ROW. Value is the x-position reached, relative to AREA of W. */ - + static int x_draw_glyphs (w, x, row, area, start, end, hl, overlaps_p) struct window *w; @@ -5164,7 +5164,7 @@ x_draw_glyphs (w, x, row, area, start, end, hl, overlaps_p) /* Prepend glyph strings for glyphs in front of the first glyph string that are overwritten because of the first glyph string's left overhang. The background of all strings - prepended must be drawn because the first glyph string + prepended must be drawn because the first glyph string draws over it. */ i = x_left_overwritten (head); if (i >= 0) @@ -5242,10 +5242,10 @@ x_draw_glyphs (w, x, row, area, start, end, hl, overlaps_p) { int x0 = head ? head->x : x; int x1 = tail ? tail->x + tail->background_width : x; - + x0 = FRAME_TO_WINDOW_PIXEL_X (w, x0); x1 = FRAME_TO_WINDOW_PIXEL_X (w, x1); - + if (XFASTINT (w->left_margin_width) != 0) { int left_area_width = window_box_width (w, LEFT_MARGIN_AREA); @@ -5267,7 +5267,7 @@ x_draw_glyphs (w, x, row, area, start, end, hl, overlaps_p) if (area > TEXT_AREA) x_reached -= window_box_width (w, TEXT_AREA); } - + return x_reached; } @@ -5281,9 +5281,9 @@ x_fix_overlapping_area (w, row, area) enum glyph_row_area area; { int i, x; - + BLOCK_INPUT; - + if (area == LEFT_MARGIN_AREA) x = 0; else if (area == TEXT_AREA) @@ -5315,7 +5315,7 @@ x_fix_overlapping_area (w, row, area) ++i; } } - + UNBLOCK_INPUT; } @@ -5335,7 +5335,7 @@ x_write_glyphs (start, len) xassert (updated_window && updated_row); BLOCK_INPUT; - + /* Write glyphs. */ hpos = start - updated_row->glyphs[updated_area]; @@ -5353,7 +5353,7 @@ x_write_glyphs (start, len) updated_window->phys_cursor_on_p = 0; UNBLOCK_INPUT; - + /* Advance the output cursor. */ output_cursor.hpos += len; output_cursor.x = x; @@ -5406,7 +5406,7 @@ x_insert_glyphs (start, len) hpos = start - row->glyphs[updated_area]; x_draw_glyphs (w, output_cursor.x, row, updated_area, hpos, hpos + len, DRAW_NORMAL_TEXT, 0); - + /* Advance the output cursor. */ output_cursor.hpos += len; output_cursor.x += shift_by_width; @@ -5456,10 +5456,10 @@ x_clear_end_of_line (to_x) struct window *w = updated_window; int max_x, min_y, max_y; int from_x, from_y, to_y; - + xassert (updated_window && updated_row); f = XFRAME (w->frame); - + if (updated_row->full_width_p) { max_x = XFASTINT (w->width) * CANON_X_UNIT (f); @@ -5481,7 +5481,7 @@ x_clear_end_of_line (to_x) to_x = min (to_x, max_x); to_y = min (max_y, output_cursor.y + updated_row->height); - + /* Notice if the cursor will be cleared by this operation. */ if (!updated_row->full_width_p) notice_overwritten_cursor (w, updated_area, @@ -5490,7 +5490,7 @@ x_clear_end_of_line (to_x) MATRIX_ROW_BOTTOM_Y (updated_row)); from_x = output_cursor.x; - + /* Translate to frame coordinates. */ if (updated_row->full_width_p) { @@ -5502,11 +5502,11 @@ x_clear_end_of_line (to_x) from_x = WINDOW_AREA_TO_FRAME_PIXEL_X (w, updated_area, from_x); to_x = WINDOW_AREA_TO_FRAME_PIXEL_X (w, updated_area, to_x); } - + min_y = WINDOW_DISPLAY_HEADER_LINE_HEIGHT (w); from_y = WINDOW_TO_FRAME_PIXEL_Y (w, max (min_y, output_cursor.y)); to_y = WINDOW_TO_FRAME_PIXEL_Y (w, to_y); - + /* Prevent inadvertently clearing to end of the X window. */ if (to_x > from_x && to_y > from_y) { @@ -5576,7 +5576,7 @@ timeval_subtract (result, x, y) y.tv_usec -= 1000000 * nsec; y.tv_sec += nsec; } - + if (x.tv_usec - y.tv_usec > 1000000) { int nsec = (y.tv_usec - x.tv_usec) / 1000000; @@ -5660,7 +5660,7 @@ XTflash (f) width, flash_height); } else - /* If it is short, flash it all. */ + /* If it is short, flash it all. */ XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), gc, flash_left, FRAME_INTERNAL_BORDER_WIDTH (f), width, height - 2 * FRAME_INTERNAL_BORDER_WIDTH (f)); @@ -5714,7 +5714,7 @@ XTflash (f) width, flash_height); } else - /* If it is short, flash it all. */ + /* If it is short, flash it all. */ XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), gc, flash_left, FRAME_INTERNAL_BORDER_WIDTH (f), width, height - 2 * FRAME_INTERNAL_BORDER_WIDTH (f)); @@ -5736,7 +5736,7 @@ void XTring_bell () { struct frame *f = SELECTED_FRAME (); - + if (FRAME_X_DISPLAY (f)) { #if defined (HAVE_TIMEVAL) && defined (HAVE_SELECT) @@ -5824,7 +5824,7 @@ x_scroll_run (w, run) } BLOCK_INPUT; - + /* Cursor off. Will be switched on again in x_update_window_end. */ updated_window = w; x_clear_cursor (w); @@ -5835,7 +5835,7 @@ x_scroll_run (w, run) x, from_y, width, height, x, to_y); - + UNBLOCK_INPUT; } @@ -5844,7 +5844,7 @@ x_scroll_run (w, run) /*********************************************************************** Exposure Events ***********************************************************************/ - + /* Redisplay an exposed area of frame F. X and Y are the upper-left corner of the exposed rectangle. W and H are width and height of the exposed area. All are pixel values. W or H zero means redraw @@ -5939,7 +5939,7 @@ expose_window_tree (w, r) { struct frame *f = XFRAME (w->frame); int mouse_face_overwritten_p = 0; - + while (w && !FRAME_GARBAGED_P (f)) { if (!NILP (w->hchild)) @@ -5950,7 +5950,7 @@ expose_window_tree (w, r) |= expose_window_tree (XWINDOW (w->vchild), r); else mouse_face_overwritten_p |= expose_window (w, r); - + w = NILP (w->next) ? NULL : XWINDOW (w->next); } @@ -5998,7 +5998,7 @@ expose_area (w, row, r, area) x += first->pixel_width; ++first; } - + /* Find the last one. */ last = first; first_x = x; @@ -6008,7 +6008,7 @@ expose_area (w, row, r, area) x += last->pixel_width; ++last; } - + /* Repaint. */ if (last > first) x_draw_glyphs (w, first_x - start_x, row, area, @@ -6017,7 +6017,7 @@ expose_area (w, row, r, area) DRAW_NORMAL_TEXT, 0); } } - + /* Redraw the parts of the glyph row ROW on window W intersecting rectangle R. R is in window-relative coordinates. Value is @@ -6030,7 +6030,7 @@ expose_line (w, row, r) XRectangle *r; { xassert (row->enabled_p); - + if (row->mode_line_p || w->pseudo_window_p) x_draw_glyphs (w, 0, row, TEXT_AREA, 0, row->used[TEXT_AREA], DRAW_NORMAL_TEXT, 0); @@ -6088,18 +6088,18 @@ expose_overlaps (w, first_overlapping_row, last_overlapping_row) struct glyph_row *last_overlapping_row; { struct glyph_row *row; - + for (row = first_overlapping_row; row <= last_overlapping_row; ++row) if (row->overlapping_p) { xassert (row->enabled_p && !row->mode_line_p); - + if (row->used[LEFT_MARGIN_AREA]) x_fix_overlapping_area (w, row, LEFT_MARGIN_AREA); - + if (row->used[TEXT_AREA]) x_fix_overlapping_area (w, row, TEXT_AREA); - + if (row->used[RIGHT_MARGIN_AREA]) x_fix_overlapping_area (w, row, RIGHT_MARGIN_AREA); } @@ -6148,7 +6148,7 @@ expose_window (w, fr) struct glyph_row *row; int cursor_cleared_p; struct glyph_row *first_overlapping_row, *last_overlapping_row; - + TRACE ((stderr, "expose_window (%d, %d, %d, %d)\n", r.x, r.y, r.width, r.height)); @@ -6174,7 +6174,7 @@ expose_window (w, fr) { int y0 = row->y; int y1 = MATRIX_ROW_BOTTOM_Y (row); - + if ((y0 >= r.y && y0 < r.y + r.height) || (y1 > r.y && y1 < r.y + r.height) || (r.y >= y0 && r.y < y1) @@ -6186,11 +6186,11 @@ expose_window (w, fr) first_overlapping_row = row; last_overlapping_row = row; } - + if (expose_line (w, row, &r)) mouse_face_overwritten_p = 1; } - + if (y1 >= yb) break; } @@ -6210,10 +6210,10 @@ expose_window (w, fr) /* Fix the display of overlapping rows. */ if (first_overlapping_row) expose_overlaps (w, first_overlapping_row, last_overlapping_row); - + /* Draw border between windows. */ x_draw_vertical_border (w); - + /* Turn the cursor on again. */ if (cursor_cleared_p) x_update_window_cursor (w, 1); @@ -6235,7 +6235,7 @@ x_intersect_rectangles (r1, r2, result) XRectangle *left, *right; XRectangle *upper, *lower; int intersection_p = 0; - + /* Rearrange so that R1 is the left-most rectangle. */ if (r1->x < r2->x) left = r1, right = r2; @@ -6247,7 +6247,7 @@ x_intersect_rectangles (r1, r2, result) if (right->x <= left->x + left->width) { result->x = right->x; - + /* The right end of the intersection is the minimum of the the right ends of left and right. */ result->width = (min (left->x + left->width, right->x + right->width) @@ -6264,10 +6264,10 @@ x_intersect_rectangles (r1, r2, result) if (lower->y <= upper->y + upper->height) { result->y = lower->y; - + /* The lower end of the intersection is the minimum of the lower ends of upper and lower. */ - result->height = (min (lower->y + lower->height, + result->height = (min (lower->y + lower->height, upper->y + upper->height) - result->y); intersection_p = 1; @@ -6352,7 +6352,7 @@ x_new_focus_frame (dpyinfo, frame) /* Handle FocusIn and FocusOut state changes for FRAME. If FRAME has focus and there exists more than one frame, puts - an FOCUS_IN_EVENT into BUFP. + a FOCUS_IN_EVENT into BUFP. Returns number of events inserted into BUFP. */ static int @@ -6372,7 +6372,7 @@ x_focus_changed (type, state, dpyinfo, frame, bufp, numchars) { x_new_focus_frame (dpyinfo, frame); dpyinfo->x_focus_event_frame = frame; - + /* Don't stop displaying the initial startup message for a switch-frame event we don't need. */ if (numchars > 0 @@ -6399,7 +6399,7 @@ x_focus_changed (type, state, dpyinfo, frame, bufp, numchars) else if (type == FocusOut) { frame->output_data.x->focus_state &= ~state; - + if (dpyinfo->x_focus_event_frame == frame) { dpyinfo->x_focus_event_frame = 0; @@ -6429,10 +6429,10 @@ x_detect_focus_change (dpyinfo, event, bufp, numchars) { struct frame *frame; int nr_events = 0; - + frame = x_top_window_to_frame (dpyinfo, event->xany.window); if (! frame) return nr_events; - + switch (event->type) { case EnterNotify: @@ -6638,7 +6638,7 @@ x_x_to_emacs_modifiers (dpyinfo, state) EMACS_UINT mod_hyper = hyper_modifier; EMACS_UINT mod_super = super_modifier; Lisp_Object tem; - + tem = Fget (Vx_alt_keysym, Qmodifier_value); if (! EQ (tem, Qnil)) mod_alt = XUINT (tem); tem = Fget (Vx_meta_keysym, Qmodifier_value); @@ -6647,7 +6647,7 @@ x_x_to_emacs_modifiers (dpyinfo, state) if (! EQ (tem, Qnil)) mod_hyper = XUINT (tem); tem = Fget (Vx_super_keysym, Qmodifier_value); if (! EQ (tem, Qnil)) mod_super = XUINT (tem); - + return ( ((state & (ShiftMask | dpyinfo->shift_lock_mask)) ? shift_modifier : 0) | ((state & ControlMask) ? ctrl_modifier : 0) @@ -6666,9 +6666,9 @@ x_emacs_to_x_modifiers (dpyinfo, state) EMACS_UINT mod_alt = alt_modifier; EMACS_UINT mod_hyper = hyper_modifier; EMACS_UINT mod_super = super_modifier; - + Lisp_Object tem; - + tem = Fget (Vx_alt_keysym, Qmodifier_value); if (! EQ (tem, Qnil)) mod_alt = XUINT (tem); tem = Fget (Vx_meta_keysym, Qmodifier_value); @@ -6677,8 +6677,8 @@ x_emacs_to_x_modifiers (dpyinfo, state) if (! EQ (tem, Qnil)) mod_hyper = XUINT (tem); tem = Fget (Vx_super_keysym, Qmodifier_value); if (! EQ (tem, Qnil)) mod_super = XUINT (tem); - - + + return ( ((state & mod_alt) ? dpyinfo->alt_mod_mask : 0) | ((state & mod_super) ? dpyinfo->super_mod_mask : 0) | ((state & mod_hyper) ? dpyinfo->hyper_mod_mask : 0) @@ -6947,7 +6947,7 @@ x_y_to_hpos_vpos (w, x, y, hpos, vpos, area, buffer_only_p) else if (!buffer_only_p || BUFFERP (glyph->object)) break; } - + x0 += glyph->pixel_width; ++glyph; } @@ -6991,7 +6991,7 @@ frame_to_window_pixel_xy (w, x, y) display area of W, so the width of bitmap areas and scroll bars must be subtracted to get a position relative to the start of the mode line. */ - + static void note_mode_line_or_margin_highlight (w, x, y, portion) struct window *w; @@ -7011,7 +7011,7 @@ note_mode_line_or_margin_highlight (w, x, y, portion) if (STRINGP (string)) { pos = make_number (charpos); - + /* If we're on a string with `help-echo' text property, arrange for the help to be displayed. This is done by setting the global variable help_echo to the help string. */ @@ -7031,7 +7031,7 @@ note_mode_line_or_margin_highlight (w, x, y, portion) if (KEYMAPP (map)) cursor = f->output_data.x->nontext_cursor; } - + XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), cursor); } @@ -7105,7 +7105,7 @@ note_mouse_highlight (f, x, y) note_mode_line_or_margin_highlight (w, x, y, portion); return; } - + if (portion == 2) cursor = f->output_data.x->horizontal_drag_cursor; else @@ -7214,13 +7214,13 @@ note_mouse_highlight (f, x, y) if (!NILP (mouse_face)) overlay = overlay_vec[i]; } - + /* If we're actually highlighting the same overlay as before, there's no need to do that again. */ if (!NILP (overlay) && EQ (overlay, dpyinfo->mouse_face_overlay)) goto check_help_echo; - + dpyinfo->mouse_face_overlay = overlay; /* Clear the display of the old active region, if any. */ @@ -7247,7 +7247,7 @@ note_mouse_highlight (f, x, y) &dpyinfo->mouse_face_beg_row, &dpyinfo->mouse_face_beg_x, &dpyinfo->mouse_face_beg_y, Qnil); - + dpyinfo->mouse_face_past_end = !fast_find_position (w, XFASTINT (after), &dpyinfo->mouse_face_end_col, @@ -7281,7 +7281,7 @@ note_mouse_highlight (f, x, y) after = Fnext_single_property_change (position, Qmouse_face, object, end); - + /* Record this as the current active region. */ fast_find_position (w, XFASTINT (before), &dpyinfo->mouse_face_beg_col, @@ -7309,7 +7309,7 @@ note_mouse_highlight (f, x, y) { Lisp_Object b, e; int ignore; - + b = Fprevious_single_property_change (make_number (pos + 1), Qmouse_face, object, Qnil); @@ -7343,7 +7343,7 @@ note_mouse_highlight (f, x, y) the text ``under'' it might have. */ struct glyph_row *r = MATRIX_ROW (w->current_matrix, vpos); int start = MATRIX_ROW_START_CHARPOS (r); - + pos = string_buffer_position (w, object, start); if (pos > 0) mouse_face = get_char_property_and_overlay (make_number (pos), @@ -7367,7 +7367,7 @@ note_mouse_highlight (f, x, y) &dpyinfo->mouse_face_beg_x, &dpyinfo->mouse_face_beg_y, object); - + dpyinfo->mouse_face_past_end = !fast_find_position (w, XFASTINT (after), &dpyinfo->mouse_face_end_col, @@ -7412,7 +7412,7 @@ note_mouse_highlight (f, x, y) { Lisp_Object object = glyph->object; int charpos = glyph->charpos; - + /* Try text properties. */ if (STRINGP (object) && charpos >= 0 @@ -7445,7 +7445,7 @@ note_mouse_highlight (f, x, y) && charpos < ZV) help = Fget_text_property (make_number (charpos), Qhelp_echo, object); - + if (!NILP (help)) { help_echo = help; @@ -7455,14 +7455,14 @@ note_mouse_highlight (f, x, y) } } } - + BEGV = obegv; ZV = ozv; current_buffer = obuf; } set_cursor: - + if (cursor != None) XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), cursor); } @@ -7533,7 +7533,7 @@ x_tool_bar_item (f, x, y, glyph, hpos, vpos, prop_idx) || *hpos < dpyinfo->mouse_face_end_col || dpyinfo->mouse_face_past_end)) return 0; - + return 1; } @@ -7554,7 +7554,7 @@ x_handle_tool_bar_click (f, button_event) Lisp_Object enabled_p; int x = button_event->x; int y = button_event->y; - + /* If not on the highlighted tool-bar item, return. */ frame_to_window_pixel_xy (w, &x, &y); if (x_tool_bar_item (f, x, y, &glyph, &hpos, &vpos, &prop_idx) != 0) @@ -7564,7 +7564,7 @@ x_handle_tool_bar_click (f, button_event) enabled_p = AREF (f->tool_bar_items, prop_idx + TOOL_BAR_ITEM_ENABLED_P); if (NILP (enabled_p)) return; - + if (button_event->type == ButtonPress) { /* Show item in pressed state. */ @@ -7640,7 +7640,7 @@ note_tool_bar_highlight (f, x, y) goto set_help_echo; clear_mouse_face (dpyinfo); - + /* Mouse is down, but on different tool-bar item? */ mouse_down_p = (dpyinfo->grabbed && f == last_mouse_frame @@ -7651,7 +7651,7 @@ note_tool_bar_highlight (f, x, y) dpyinfo->mouse_face_image_state = DRAW_NORMAL_TEXT; draw = mouse_down_p ? DRAW_IMAGE_SUNKEN : DRAW_IMAGE_RAISED; - + /* If tool-bar item is not enabled, don't highlight it. */ enabled_p = AREF (f->tool_bar_items, prop_idx + TOOL_BAR_ITEM_ENABLED_P); if (!NILP (enabled_p)) @@ -7661,28 +7661,28 @@ note_tool_bar_highlight (f, x, y) row = MATRIX_ROW (w->current_matrix, vpos); for (i = x = 0; i < hpos; ++i) x += row->glyphs[TEXT_AREA][i].pixel_width; - + /* Record this as the current active region. */ dpyinfo->mouse_face_beg_col = hpos; dpyinfo->mouse_face_beg_row = vpos; dpyinfo->mouse_face_beg_x = x; dpyinfo->mouse_face_beg_y = row->y; dpyinfo->mouse_face_past_end = 0; - + dpyinfo->mouse_face_end_col = hpos + 1; dpyinfo->mouse_face_end_row = vpos; dpyinfo->mouse_face_end_x = x + glyph->pixel_width; dpyinfo->mouse_face_end_y = row->y; dpyinfo->mouse_face_window = window; dpyinfo->mouse_face_face_id = TOOL_BAR_FACE_ID; - + /* Display it as active. */ show_mouse_face (dpyinfo, draw); dpyinfo->mouse_face_image_state = draw; } - + set_help_echo: - + /* Set help_echo to a help string to display for this tool-bar item. XTread_socket does the rest. */ help_echo_object = help_echo_window = Qnil; @@ -7704,7 +7704,7 @@ note_tool_bar_highlight (f, x, y) #if 0 /* This is a version of fast_find_position that's more correct in the presence of hscrolling, for example. I didn't install it right away because the problem fixed is minor, it failed - in 20.x as well, and I think it's too risky to install + in 20.x as well, and I think it's too risky to install so near the release of 21.1. 2001-09-25 gerd. */ static int @@ -7737,10 +7737,10 @@ fast_find_position (w, charpos, hpos, vpos, x, y, stop) *x = row->x; *y = row->y; *vpos = MATRIX_ROW_VPOS (row, w->current_matrix); - + glyph = row->glyphs[TEXT_AREA]; end = glyph + row->used[TEXT_AREA]; - + /* Skip over glyphs not having an object at the start of the row. These are special glyphs like truncation marks on terminal frames. */ @@ -7814,11 +7814,11 @@ fast_find_position (w, pos, hpos, vpos, x, y, stop) if (row->y + row->height >= yb) break; - + ++row; ++row_vpos; } - + /* Find the right column within BEST_ROW. */ lastcol = 0; current_x = best_row->x; @@ -7942,7 +7942,7 @@ fast_find_string_pos (w, pos, object, hpos, vpos, x, y, right_p) *x += best_glyph->pixel_width; ++*hpos; } - + *y = best_row->y; *vpos = best_row - w->current_matrix->rows; } @@ -7976,7 +7976,7 @@ show_mouse_face (dpyinfo, draw) first = MATRIX_ROW (w->current_matrix, dpyinfo->mouse_face_beg_row); last = MATRIX_ROW (w->current_matrix, dpyinfo->mouse_face_end_row); - + for (row = first; row <= last && row->enabled_p; ++row) { int start_hpos, end_hpos, start_x; @@ -8000,7 +8000,7 @@ show_mouse_face (dpyinfo, draw) if (end_hpos > start_hpos) { - x_draw_glyphs (w, start_x, row, TEXT_AREA, + x_draw_glyphs (w, start_x, row, TEXT_AREA, start_hpos, end_hpos, draw, 0); row->mouse_face_p @@ -8037,7 +8037,7 @@ clear_mouse_face (dpyinfo) struct x_display_info *dpyinfo; { int cleared = 0; - + if (!NILP (dpyinfo->mouse_face_window)) { show_mouse_face (dpyinfo, DRAW_NORMAL_TEXT); @@ -8116,14 +8116,14 @@ glyph_rect (f, x, y, rect) struct glyph_row *end = r + w->current_matrix->nrows - 1; frame_to_window_pixel_xy (w, &x, &y); - + for (; !found && r < end && r->enabled_p; ++r) if (r->y >= y) { struct glyph *g = r->glyphs[TEXT_AREA]; struct glyph *end = g + r->used[TEXT_AREA]; int gx; - + for (gx = r->x; !found && g < end; gx += g->pixel_width, ++g) if (gx >= x) { @@ -8326,7 +8326,7 @@ XTmouse_position (fp, insist, bar_window, part, x, y, time) int width, height, gx, gy; XRectangle rect; - + if (glyph_rect (f1, win_x, win_y, &rect)) last_mouse_glyph = rect; else @@ -8335,7 +8335,7 @@ XTmouse_position (fp, insist, bar_window, part, x, y, time) height = FRAME_SMALLEST_FONT_HEIGHT (f1); gx = win_x; gy = win_y; - + /* Arrange for the division in PIXEL_TO_CHAR_COL etc. to round down even for negative values. */ if (gx < 0) @@ -8344,7 +8344,7 @@ XTmouse_position (fp, insist, bar_window, part, x, y, time) gy -= height - 1; gx = (gx + width - 1) / width * width; gy = (gy + height - 1) / height * height; - + last_mouse_glyph.width = width; last_mouse_glyph.height = height; last_mouse_glyph.x = gx; @@ -8439,14 +8439,14 @@ x_window_to_menu_bar (window) Window window; { Lisp_Object tail; - + for (tail = Vframe_list; XGCTYPE (tail) == Lisp_Cons; tail = XCDR (tail)) { Lisp_Object frame = XCAR (tail); Widget menu_bar = XFRAME (frame)->output_data.x->menubar_widget; - + if (menu_bar && xlwmenu_window_p (menu_bar, window)) return menu_bar; } @@ -8513,7 +8513,7 @@ xt_action_hook (widget, client_data, action_name, event, params, { int scroll_bar_p; char *end_action; - + #ifdef USE_MOTIF scroll_bar_p = XmIsScrollBar (widget); end_action = "Release"; @@ -8527,7 +8527,7 @@ xt_action_hook (widget, client_data, action_name, event, params, && WINDOWP (window_being_scrolled)) { struct window *w; - + x_send_scroll_bar_event (window_being_scrolled, scroll_bar_end_scroll, 0, 0); w = XWINDOW (window_being_scrolled); @@ -8564,7 +8564,7 @@ x_send_scroll_bar_event (window, part, portion, whole) int i; BLOCK_INPUT; - + /* Construct a ClientMessage event to send to the frame. */ ev->type = ClientMessage; ev->message_type = FRAME_X_DISPLAY_INFO (f)->Xatom_Scrollbar; @@ -8585,7 +8585,7 @@ x_send_scroll_bar_event (window, part, portion, whole) int new_size = max (10, 2 * scroll_bar_windows_size); size_t nbytes = new_size * sizeof *scroll_bar_windows; size_t old_nbytes = scroll_bar_windows_size * sizeof *scroll_bar_windows; - + scroll_bar_windows = (struct window **) xrealloc (scroll_bar_windows, nbytes); bzero (&scroll_bar_windows[i], nbytes - old_nbytes); @@ -8622,13 +8622,13 @@ x_scroll_bar_to_input_event (event, ievent) Lisp_Object window; struct frame *f; struct window *w; - + w = scroll_bar_windows[ev->data.l[0]]; scroll_bar_windows[ev->data.l[0]] = NULL; XSETWINDOW (window, w); f = XFRAME (w->frame); - + ievent->kind = SCROLL_BAR_CLICK_EVENT; ievent->frame_or_window = window; ievent->arg = Qnil; @@ -8689,7 +8689,7 @@ xm_scroll_callback (widget, client_data, call_data) bar->dragging = Qnil; part = scroll_bar_to_top; break; - + case XmCR_TO_BOTTOM: bar->dragging = Qnil; part = scroll_bar_to_bottom; @@ -8712,7 +8712,7 @@ xm_scroll_callback (widget, client_data, call_data) bar->dragging = make_number (cs->value); } break; - + case XmCR_VALUE_CHANGED: break; }; @@ -8846,14 +8846,14 @@ x_create_toolkit_scroll_bar (f, bar) XtSetArg (av[ac], XmNforeground, pixel); ++ac; } - + pixel = f->output_data.x->scroll_bar_background_pixel; if (pixel != -1) { XtSetArg (av[ac], XmNbackground, pixel); ++ac; } - + widget = XmCreateScrollBar (f->output_data.x->edit_widget, scroll_bar_name, av, ac); @@ -8872,7 +8872,7 @@ x_create_toolkit_scroll_bar (f, bar) (XtPointer) bar); XtAddCallback (widget, XmNtoTopCallback, xm_scroll_callback, (XtPointer) bar); - + /* Realize the widget. Only after that is the X window created. */ XtRealizeWidget (widget); @@ -8880,9 +8880,9 @@ x_create_toolkit_scroll_bar (f, bar) And I'm wondering why it hasn't an arrow cursor by default. */ XDefineCursor (XtDisplay (widget), XtWindow (widget), f->output_data.x->nontext_cursor); - + #else /* !USE_MOTIF i.e. use Xaw */ - + /* Set resources. Create the widget. The background of the Xaw3d scroll bar widget is a little bit light for my taste. We don't alter it here to let users change it according @@ -8891,14 +8891,14 @@ x_create_toolkit_scroll_bar (f, bar) XtSetArg (av[ac], XtNorientation, XtorientVertical); ++ac; /* For smoother scrolling with Xaw3d -sm */ /* XtSetArg (av[ac], XtNpickTop, True); ++ac; */ - + pixel = f->output_data.x->scroll_bar_foreground_pixel; if (pixel != -1) { XtSetArg (av[ac], XtNforeground, pixel); ++ac; } - + pixel = f->output_data.x->scroll_bar_background_pixel; if (pixel != -1) { @@ -8975,22 +8975,22 @@ x_create_toolkit_scroll_bar (f, bar) XtVaSetValues (widget, XtNcursorName, "top_left_arrow", NULL); } } - + /* Define callbacks. */ XtAddCallback (widget, XtNjumpProc, xaw_jump_callback, (XtPointer) bar); XtAddCallback (widget, XtNscrollProc, xaw_scroll_callback, (XtPointer) bar); - + /* Realize the widget. Only after that is the X window created. */ XtRealizeWidget (widget); - + #endif /* !USE_MOTIF */ /* Install an action hook that lets us detect when the user finishes interacting with a scroll bar. */ if (action_hook_id == 0) action_hook_id = XtAppAddActionHook (Xt_app_con, xt_action_hook, 0); - + /* Remember X window and widget in the scroll bar vector. */ SET_SCROLL_BAR_X_WIDGET (bar, widget); xwindow = XtWindow (widget); @@ -9055,7 +9055,7 @@ x_set_toolkit_scroll_bar_thumb (bar, portion, position, whole) value = top * XM_SB_RANGE; value = min (value, XM_SB_MAX - size); value = max (value, XM_SB_MIN); - + XmScrollBarSetValues (widget, value, size, 0, 0, False); } #else /* !USE_MOTIF i.e. use Xaw */ @@ -9097,7 +9097,7 @@ x_set_toolkit_scroll_bar_thumb (bar, portion, position, whole) #ifdef HAVE_XAW3D ScrollbarWidget sb = (ScrollbarWidget) widget; int scroll_mode = 0; - + /* `scroll_mode' only exists with Xaw3d + ARROW_SCROLLBAR. */ if (xaw3d_arrow_scroll) { @@ -9111,9 +9111,9 @@ x_set_toolkit_scroll_bar_thumb (bar, portion, position, whole) /* Try to make the scrolling a tad smoother. */ if (!xaw3d_pick_top) shown = min (shown, old_shown); - + XawScrollbarSetThumb (widget, top, shown); - + #ifdef HAVE_XAW3D if (xaw3d_arrow_scroll && scroll_mode == 2) sb->scrollbar.scroll_mode = scroll_mode; @@ -9133,7 +9133,7 @@ x_set_toolkit_scroll_bar_thumb (bar, portion, position, whole) /************************************************************************ Scroll bars, general ************************************************************************/ - + /* Create a scroll bar and return the scroll bar vector for it. W is the Emacs window on which to create the scroll bar. TOP, LEFT, WIDTH and HEIGHT are the pixel coordinates and dimensions of the @@ -9161,7 +9161,7 @@ x_scroll_bar_create (w, top, left, width, height) a.background_pixel = f->output_data.x->scroll_bar_background_pixel; if (a.background_pixel == -1) a.background_pixel = f->output_data.x->background_pixel; - + a.event_mask = (ButtonPressMask | ButtonReleaseMask | ButtonMotionMask | PointerMotionHintMask | ExposureMask); @@ -9231,7 +9231,7 @@ x_scroll_bar_create (w, top, left, width, height) /* Draw BAR's handle in the proper position. - + If the handle is already drawn from START to END, don't bother redrawing it, unless REBUILD is non-zero; in that case, always redraw it. (REBUILD is handy for drawing the handle after expose @@ -9358,7 +9358,7 @@ x_scroll_bar_remove (bar) #else XDestroyWindow (FRAME_X_DISPLAY (f), SCROLL_BAR_X_WINDOW (bar)); #endif - + /* Disassociate this scroll bar from its window. */ XWINDOW (bar->window)->vertical_scroll_bar = Qnil; @@ -9405,16 +9405,16 @@ XTset_vertical_scroll_bar (w, portion, whole, position) /* Compute the left edge of the scroll bar. */ #ifdef USE_TOOLKIT_SCROLL_BARS if (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (f)) - sb_left = left + width - sb_width - (width - sb_width) / 2; + sb_left = left + width - sb_width - (width - sb_width) / 2; else sb_left = left + (width - sb_width) / 2; #else if (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (f)) - sb_left = left + width - sb_width; + sb_left = left + width - sb_width; else sb_left = left; #endif - + /* Does the scroll bar exist yet? */ if (NILP (w->vertical_scroll_bar)) { @@ -9425,14 +9425,14 @@ XTset_vertical_scroll_bar (w, portion, whole, position) left, top, width, height, False); UNBLOCK_INPUT; } - + bar = x_scroll_bar_create (w, top, sb_left, sb_width, height); } else { /* It may just need to be moved and resized. */ unsigned int mask = 0; - + bar = XSCROLL_BAR (w->vertical_scroll_bar); BLOCK_INPUT; @@ -9443,9 +9443,9 @@ XTset_vertical_scroll_bar (w, portion, whole, position) mask |= CWY; if (sb_width != XINT (bar->width)) mask |= CWWidth; - if (height != XINT (bar->height)) + if (height != XINT (bar->height)) mask |= CWHeight; - + #ifdef USE_TOOLKIT_SCROLL_BARS /* Since toolkit scroll bars are smaller than the space reserved @@ -9463,7 +9463,7 @@ XTset_vertical_scroll_bar (w, portion, whole, position) max (height, 1), 0); #else /* not USE_TOOLKIT_SCROLL_BARS */ - + /* Clear areas not covered by the scroll bar because of VERTICAL_SCROLL_BAR_WIDTH_TRIM. */ if (VERTICAL_SCROLL_BAR_WIDTH_TRIM) @@ -9495,12 +9495,12 @@ XTset_vertical_scroll_bar (w, portion, whole, position) left, top, rest, height, False); } } - + /* Move/size the scroll bar window. */ if (mask) { XWindowChanges wc; - + wc.x = sb_left + VERTICAL_SCROLL_BAR_WIDTH_TRIM; wc.y = top; wc.width = sb_width - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2; @@ -9508,7 +9508,7 @@ XTset_vertical_scroll_bar (w, portion, whole, position) XConfigureWindow (FRAME_X_DISPLAY (f), SCROLL_BAR_X_WINDOW (bar), mask, &wc); } - + #endif /* not USE_TOOLKIT_SCROLL_BARS */ /* Remember new settings. */ @@ -9516,7 +9516,7 @@ XTset_vertical_scroll_bar (w, portion, whole, position) XSETINT (bar->top, top); XSETINT (bar->width, sb_width); XSETINT (bar->height, height); - + UNBLOCK_INPUT; } @@ -9680,7 +9680,7 @@ x_scroll_bar_expose (bar, event) 0, 0, XINT (bar->width) - 1 - width_trim - width_trim, XINT (bar->height) - 1); - + UNBLOCK_INPUT; #endif /* not USE_TOOLKIT_SCROLL_BARS */ @@ -9706,7 +9706,7 @@ x_scroll_bar_handle_click (bar, event, emacs_event) emacs_event->kind = SCROLL_BAR_CLICK_EVENT; emacs_event->code = event->xbutton.button - Button1; emacs_event->modifiers - = (x_x_to_emacs_modifiers (FRAME_X_DISPLAY_INFO + = (x_x_to_emacs_modifiers (FRAME_X_DISPLAY_INFO (XFRAME (WINDOW_FRAME (XWINDOW (bar->window)))), event->xbutton.state) | (event->type == ButtonRelease @@ -10125,7 +10125,7 @@ XTread_socket (sd, bufp, numchars, expected) abort (); /* Don't think this happens. */ ++handling_signal; - + /* Find the display we are supposed to read input for. It's the one communicating on descriptor SD. */ for (dpyinfo = x_display_list; dpyinfo; dpyinfo = dpyinfo->next) @@ -10221,7 +10221,7 @@ XTread_socket (sd, bufp, numchars, expected) below are temporally close (on a fast machine), the call below can generate additional FocusIn events which confuse Emacs. */ - + /* Since we set WM_TAKE_FOCUS, we must call XSetInputFocus explicitly. But not if f is null, since that might be an event for a deleted frame. */ @@ -10240,7 +10240,7 @@ XTread_socket (sd, bufp, numchars, expected) if there is an error. */ XSync (d, False); x_uncatch_errors (d, count); - } + } /* Not certain about handling scroll bars here */ #endif /* 0 */ } @@ -10528,7 +10528,7 @@ XTread_socket (sd, bufp, numchars, expected) tip_window = 0; redo_mouse_highlight (); } - + f = x_top_window_to_frame (dpyinfo, event.xunmap.window); if (f) /* F may no longer exist if the frame was deleted. */ @@ -10562,7 +10562,7 @@ XTread_socket (sd, bufp, numchars, expected) /* The tooltip has been drawn already. Avoid the SET_FRAME_GARBAGED below. */ goto OTHER; - + /* We use x_top_window_to_frame because map events can come for sub-windows and they don't mean that the frame is visible. */ @@ -10881,7 +10881,7 @@ XTread_socket (sd, bufp, numchars, expected) else c = STRING_CHAR_AND_LENGTH (copy_bufptr + i, nbytes - i, len); - + bufp->kind = (SINGLE_BYTE_CHAR_P (c) ? ASCII_KEYSTROKE_EVENT : MULTIBYTE_CHAR_KEYSTROKE_EVENT); @@ -10935,7 +10935,7 @@ XTread_socket (sd, bufp, numchars, expected) { bufp += n, count += n, numchars -= n; } - + f = x_any_window_to_frame (dpyinfo, event.xcrossing.window); #if 0 @@ -11033,7 +11033,7 @@ XTread_socket (sd, bufp, numchars, expected) previous_help_echo = help_echo; help_echo = help_echo_object = help_echo_window = Qnil; help_echo_pos = -1; - + if (dpyinfo->grabbed && last_mouse_frame && FRAME_LIVE_P (last_mouse_frame)) f = last_mouse_frame; @@ -11111,7 +11111,7 @@ XTread_socket (sd, bufp, numchars, expected) help_echo_pos); bufp += n, count += n, numchars -= n; } - + goto OTHER; } @@ -11131,7 +11131,7 @@ XTread_socket (sd, bufp, numchars, expected) int columns = PIXEL_TO_CHAR_WIDTH (f, event.xconfigure.width); if (dont_resize) goto OTHER; - + /* In the toolkit version, change_frame_size is called by the code that handles resizing of the EmacsFrame widget. */ @@ -11184,7 +11184,7 @@ XTread_socket (sd, bufp, numchars, expected) by the rest of Emacs, we put it here. */ struct input_event emacs_event; int tool_bar_p = 0; - + emacs_event.kind = NO_EVENT; bzero (&compose_status, sizeof (compose_status)); @@ -11242,7 +11242,7 @@ XTread_socket (sd, bufp, numchars, expected) the ButtonPress. */ if (f != 0) f->mouse_moved = 0; - + if (!tool_bar_p) last_tool_bar_item = -1; } @@ -11306,7 +11306,7 @@ XTread_socket (sd, bufp, numchars, expected) case CirculateNotify: goto OTHER; - + case CirculateRequest: goto OTHER; @@ -11420,7 +11420,7 @@ notice_overwritten_cursor (w, area, x0, x1, y0, y1) the buffer and window end because update_text_area doesn't draw that row. (Except when it does, but that's handled in update_text_area.) */ - + if (((y0 >= cy0 && y0 < cy1) || (y1 > cy0 && y1 < cy1)) && w->current_matrix->rows[w->phys_cursor.vpos].displays_text_p) w->phys_cursor_on_p = 0; @@ -11506,7 +11506,7 @@ x_draw_hollow_cursor (w, row) && !x_stretch_cursor_p) wd = min (CANON_X_UNIT (f), wd); w->phys_cursor_width = wd; - + /* The foreground of cursor_gc is typically the same as the normal background color, which can cause the cursor box to be invisible. */ xgcv.foreground = f->output_data.x->cursor_pixel; @@ -11540,7 +11540,7 @@ x_draw_bar_cursor (w, row, width, kind) { struct frame *f = XFRAME (w->frame); struct glyph *cursor_glyph; - + /* If cursor is out of bounds, don't draw garbage. This can happen in mini-buffer windows when switching between echo area glyphs and mini-buffer. */ @@ -11576,7 +11576,7 @@ x_draw_bar_cursor (w, row, width, kind) else xgcv.background = xgcv.foreground = f->output_data.x->cursor_pixel; xgcv.graphics_exposures = 0; - + if (gc) XChangeGC (dpy, gc, mask, &xgcv); else @@ -11584,14 +11584,14 @@ x_draw_bar_cursor (w, row, width, kind) gc = XCreateGC (dpy, window, mask, &xgcv); FRAME_X_DISPLAY_INFO (f)->scratch_cursor_gc = gc; } - + if (width < 0) width = FRAME_CURSOR_WIDTH (f); width = min (cursor_glyph->pixel_width, width); - + w->phys_cursor_width = width; x_clip_to_row (w, row, gc, 0); - + if (kind == BAR_CURSOR) XFillRectangle (dpy, window, gc, WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x), @@ -11639,7 +11639,7 @@ x_draw_phys_cursor_glyph (w, row, hl) { int on_p = w->phys_cursor_on_p; int x1; - + x1 = x_draw_glyphs (w, w->phys_cursor.x, row, TEXT_AREA, w->phys_cursor.hpos, w->phys_cursor.hpos + 1, hl, 0); @@ -11685,7 +11685,7 @@ x_erase_phys_cursor (w) screen. */ if (w->phys_cursor_type == NO_CURSOR) goto mark_cursor_off; - + /* VPOS >= active_glyphs->nrows means that window has been resized. Don't bother to erase the cursor. */ if (vpos >= active_glyphs->nrows) @@ -11696,13 +11696,13 @@ x_erase_phys_cursor (w) cursor_row = MATRIX_ROW (active_glyphs, vpos); if (!cursor_row->enabled_p) goto mark_cursor_off; - + /* If row is completely invisible, don't attempt to delete a cursor which isn't there. This can happen if cursor is at top of a window, and we switch to a buffer with a header line in that window. */ if (cursor_row->visible_height <= 0) goto mark_cursor_off; - + /* This can happen when the new row is shorter than the old one. In this case, either x_draw_glyphs or clear_end_of_line should have cleared the cursor. Note that we wouldn't be @@ -11710,7 +11710,7 @@ x_erase_phys_cursor (w) cursor glyph at hand. */ if (w->phys_cursor.hpos >= cursor_row->used[TEXT_AREA]) goto mark_cursor_off; - + /* If the cursor is in the mouse face area, redisplay that when we clear the cursor. */ if (! NILP (dpyinfo->mouse_face_window) @@ -11738,7 +11738,7 @@ x_erase_phys_cursor (w) goto mark_cursor_off; x = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x); - + x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), x, WINDOW_TO_FRAME_PIXEL_Y (w, max (header_line_height, @@ -11747,7 +11747,7 @@ x_erase_phys_cursor (w) cursor_row->visible_height, False); } - + /* Erase the cursor by redrawing the character underneath it. */ if (mouse_face_here_p) hl = DRAW_MOUSE_FACE; @@ -11769,7 +11769,7 @@ cursor_in_mouse_face_p (w) { struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (XFRAME (w->frame)); int in_mouse_face = 0; - + if (WINDOWP (dpyinfo->mouse_face_window) && XWINDOW (dpyinfo->mouse_face_window) == w) { @@ -11823,8 +11823,8 @@ x_display_and_set_cursor (w, on, hpos, vpos, x, y) current_glyphs = w->current_matrix; glyph_row = MATRIX_ROW (current_glyphs, vpos); glyph = glyph_row->glyphs[TEXT_AREA] + hpos; - - /* If cursor row is not enabled, we don't really know where to + + /* If cursor row is not enabled, we don't really know where to display the cursor. */ if (!glyph_row->enabled_p) { @@ -11858,7 +11858,7 @@ x_display_and_set_cursor (w, on, hpos, vpos, x, y) { w->phys_cursor_ascent = glyph_row->ascent; w->phys_cursor_height = glyph_row->height; - + /* Set phys_cursor_.* before x_draw_.* is called because some of them may need the information. */ w->phys_cursor.x = x; @@ -11893,7 +11893,7 @@ x_display_and_set_cursor (w, on, hpos, vpos, x, y) default: abort (); } - + #ifdef HAVE_X_I18N if (w == XWINDOW (f->selected_window)) if (FRAME_XIC (f) && (FRAME_XIC_STYLE (f) & XIMPreeditPosition)) @@ -12188,10 +12188,10 @@ x_trace_wire () /* Handle SIGPIPE, which can happen when the connection to a server simply goes away. SIGPIPE is handled by x_connection_signal. - Don't need to do anything, because the write which caused the + Don't need to do anything, because the write which caused the SIGPIPE will fail, causing Xlib to invoke the X IO error handler, which will do the appropriate cleanup for us. */ - + static SIGTYPE x_connection_signal (signalnum) /* If we don't have an argument, */ int signalnum; /* some compilers complain in signal calls. */ @@ -12234,17 +12234,17 @@ x_connection_closed (dpy, error_message) struct x_display_info *dpyinfo = x_display_info_for_display (dpy); Lisp_Object frame, tail; int count; - + error_msg = (char *) alloca (strlen (error_message) + 1); strcpy (error_msg, error_message); handling_signal = 0; - + /* Prevent being called recursively because of an error condition below. Otherwise, we might end up with printing ``can't find per display information'' in the recursive call instead of printing the original message here. */ count = x_catch_errors (dpy); - + /* We have to close the display to inform Xt that it doesn't exist anymore. If we don't, Xt will continue to wait for events from the display. As a consequence, a sequence of @@ -12259,7 +12259,7 @@ x_connection_closed (dpy, error_message) Closing the display is reported to lead to a bus error on OpenWindows in certain situations. I suspect that is a bug in OpenWindows. I don't know how to cicumvent it here. */ - + #ifdef USE_X_TOOLKIT /* If DPYINFO is null, this means we didn't open the display in the first place, so don't try to close it. */ @@ -12307,7 +12307,7 @@ x_connection_closed (dpy, error_message) x_delete_display (dpyinfo); x_uncatch_errors (dpy, count); - + if (x_display_list == 0) { fprintf (stderr, "%s\n", error_msg); @@ -12475,7 +12475,7 @@ x_new_fontset (f, fontsetname) && (FRAME_XIC_STYLE (f) & (XIMPreeditPosition | XIMStatusArea))) xic_set_xfontset (f, SDATA (fontset_ascii (fontset))); #endif - + return build_string (fontsetname); } @@ -12584,9 +12584,9 @@ xim_destroy_callback (xim, client_data, call_data) { struct x_display_info *dpyinfo = (struct x_display_info *) client_data; Lisp_Object frame, tail; - + BLOCK_INPUT; - + /* No need to call XDestroyIC.. */ FOR_EACH_FRAME (tail, frame) { @@ -12601,7 +12601,7 @@ xim_destroy_callback (xim, client_data, call_data) } } } - + /* No need to call XCloseIM. */ dpyinfo->xim = NULL; XFree (dpyinfo->xim_styles); @@ -12629,10 +12629,10 @@ xim_open_dpy (dpyinfo, resource_name) #ifdef HAVE_X11R6 XIMCallback destroy; #endif - + /* Get supported styles and XIM values. */ XGetIMValues (xim, XNQueryInputStyle, &dpyinfo->xim_styles, NULL); - + #ifdef HAVE_X11R6 destroy.callback = xim_destroy_callback; destroy.client_data = (XPointer)dpyinfo; @@ -12640,7 +12640,7 @@ xim_open_dpy (dpyinfo, resource_name) XSetIMValues (xim, XNDestroyCallback, &destroy, NULL); #endif } - + #else /* not USE_XIM */ dpyinfo->xim = NULL; #endif /* not USE_XIM */ @@ -12672,7 +12672,7 @@ xim_instantiate_callback (display, client_data, call_data) /* We don't support multiple XIM connections. */ if (dpyinfo->xim) return; - + xim_open_dpy (dpyinfo, xim_inst->resource_name); /* Create XIC for the existing frames on the same display, as long @@ -12685,7 +12685,7 @@ xim_instantiate_callback (display, client_data, call_data) FOR_EACH_FRAME (tail, frame) { struct frame *f = XFRAME (frame); - + if (FRAME_X_DISPLAY_INFO (f) == xim_inst->dpyinfo) if (FRAME_XIC (f) == NULL) { @@ -12699,7 +12699,7 @@ xim_instantiate_callback (display, client_data, call_data) } } } - + UNBLOCK_INPUT; } } @@ -12721,7 +12721,7 @@ xim_initialize (dpyinfo, resource_name) #ifdef HAVE_X11R6_XIM struct xim_inst_t *xim_inst; int len; - + dpyinfo->xim = NULL; xim_inst = (struct xim_inst_t *) xmalloc (sizeof (struct xim_inst_t)); xim_inst->dpyinfo = dpyinfo; @@ -12739,7 +12739,7 @@ xim_initialize (dpyinfo, resource_name) dpyinfo->xim = NULL; xim_open_dpy (dpyinfo, resource_name); #endif /* not HAVE_X11R6_XIM */ - + #else /* not USE_XIM */ dpyinfo->xim = NULL; #endif /* not USE_XIM */ @@ -12861,7 +12861,7 @@ x_calc_absolute_position (f) It's not obvious where the initial small difference comes from. 2000-12-01, gerd. */ - + XtVaGetValues (f->output_data.x->column_widget, XtNheight, &height, NULL); #endif @@ -12872,7 +12872,7 @@ x_calc_absolute_position (f) - height + f->output_data.x->top_pos); } - + /* The left_pos and top_pos are now relative to the top and left screen edges, so the flags should correspond. */ @@ -12941,12 +12941,12 @@ x_check_fullscreen (f) if (f->output_data.x->want_fullscreen & FULLSCREEN_BOTH) { int width, height, ign; - + x_real_positions (f, &f->output_data.x->left_pos, &f->output_data.x->top_pos); x_fullscreen_adjust (f, &width, &height, &ign, &ign); - + /* We do not need to move the window, it shall be taken care of when setting WM manager hints. If the frame is visible already, the position is checked by @@ -12959,7 +12959,7 @@ x_check_fullscreen (f) /* Wait for the change of frame size to occur */ f->output_data.x->want_fullscreen |= FULLSCREEN_WAIT; - + } } } @@ -12983,7 +12983,7 @@ x_check_fullscreen_move (f) expect_top = 0; if (f->output_data.x->want_fullscreen & FULLSCREEN_WIDTH) expect_left = 0; - + if (expect_top != f->output_data.x->top_pos || expect_left != f->output_data.x->left_pos) x_set_offset (f, expect_left, expect_top, 1); @@ -13011,11 +13011,11 @@ x_fullscreen_adjust (f, width, height, top_pos, left_pos) *top_pos = f->output_data.x->top_pos; *left_pos = f->output_data.x->left_pos; - + if (f->output_data.x->want_fullscreen & FULLSCREEN_HEIGHT) { int ph; - + ph = FRAME_X_DISPLAY_INFO (f)->height; newheight = PIXEL_TO_CHAR_HEIGHT (f, ph); ph = CHAR_TO_PIXEL_HEIGHT (f, newheight) @@ -13027,7 +13027,7 @@ x_fullscreen_adjust (f, width, height, top_pos, left_pos) if (f->output_data.x->want_fullscreen & FULLSCREEN_WIDTH) { int pw; - + pw = FRAME_X_DISPLAY_INFO (f)->width; newwidth = PIXEL_TO_CHAR_WIDTH (f, pw); pw = CHAR_TO_PIXEL_WIDTH (f, newwidth) @@ -13115,7 +13115,7 @@ x_set_window_size (f, change_gravity, cols, rows) BLOCK_INPUT; #ifdef USE_X_TOOLKIT - + if (f->output_data.x->widget != NULL) { /* The x and y position of the widget is clobbered by the @@ -13130,18 +13130,18 @@ x_set_window_size (f, change_gravity, cols, rows) } else x_set_window_size_1 (f, change_gravity, cols, rows); - + #else /* not USE_X_TOOLKIT */ - + x_set_window_size_1 (f, change_gravity, cols, rows); - + #endif /* not USE_X_TOOLKIT */ /* If cursor was outside the new size, mark it as off. */ mark_window_cursors_off (XWINDOW (f->root_window)); /* Clear out any recollection of where the mouse highlighting was, - since it might be in a place that's outside the new frame size. + since it might be in a place that's outside the new frame size. Actually checking whether it is outside is a pain in the neck, so don't try--just let the highlighting be done afresh with new size. */ cancel_mouse_face (f); @@ -13357,7 +13357,7 @@ x_make_frame_visible (f) Drawable rootw; int x, y; unsigned int width, height, border, depth; - + BLOCK_INPUT; /* On some window managers (such as FVWM) moving an existing @@ -13420,7 +13420,7 @@ x_make_frame_visible (f) FreeBSD, Linux and Solaris. It turns out that, for some unknown reason, the call to XtMapWidget is completely ignored. Mapping the widget a second time works. */ - + if (!FRAME_VISIBLE_P (f) && --retry_count > 0) goto retry; } @@ -13697,7 +13697,7 @@ x_free_frame_resources (f) if (FRAME_FACE_CACHE (f)) free_frame_faces (f); - + x_free_gcs (f); XFlush (FRAME_X_DISPLAY (f)); } @@ -13707,7 +13707,7 @@ x_free_frame_resources (f) xfree (f->output_data.x); f->output_data.x = NULL; - + if (f == dpyinfo->x_focus_frame) dpyinfo->x_focus_frame = 0; if (f == dpyinfo->x_focus_event_frame) @@ -13961,7 +13961,7 @@ x_wm_set_icon_pixmap (f, pixmap_id) } #else /* not USE_X_TOOLKIT */ - + f->output_data.x->wm_hints.flags |= IconPixmapHint; XSetWMHints (FRAME_X_DISPLAY (f), window, &f->output_data.x->wm_hints); @@ -14141,7 +14141,7 @@ x_list_fonts (f, pattern, size, maxnames) int width = 0; char *p = names[i]; int average_width = -1, dashes = 0; - + /* Count the number of dashes in NAMES[I]. If there are 14 dashes, and the field value following 12th dash (AVERAGE_WIDTH) is 0, this is a auto-scaled font which @@ -14156,7 +14156,7 @@ x_list_fonts (f, pattern, size, maxnames) else if (dashes == 12) /* AVERAGE_WIDTH field */ average_width = atoi (p); } - + if (allow_scalable_fonts_p || dashes < 14 || average_width != 0) { @@ -14176,7 +14176,7 @@ x_list_fonts (f, pattern, size, maxnames) } } } - + if (!try_XLoadQueryFont) { BLOCK_INPUT; @@ -14276,7 +14276,7 @@ x_list_fonts (f, pattern, size, maxnames) } return newlist; -} +} #if GLYPH_DEBUG @@ -14295,7 +14295,7 @@ x_check_font (f, font) xassert (font != NULL); for (i = 0; i < dpyinfo->n_fonts; i++) - if (dpyinfo->font_table[i].name + if (dpyinfo->font_table[i].name && font == dpyinfo->font_table[i].font) break; @@ -14341,20 +14341,20 @@ x_compute_min_glyph_bounds (f) XFontStruct *font; int old_width = dpyinfo->smallest_char_width; int old_height = dpyinfo->smallest_font_height; - + dpyinfo->smallest_font_height = 100000; dpyinfo->smallest_char_width = 100000; - + for (i = 0; i < dpyinfo->n_fonts; ++i) if (dpyinfo->font_table[i].name) { struct font_info *fontp = dpyinfo->font_table + i; int w, h; - + font = (XFontStruct *) fontp->font; xassert (font != (XFontStruct *) ~0); x_font_min_bounds (font, &w, &h); - + dpyinfo->smallest_font_height = min (dpyinfo->smallest_font_height, h); dpyinfo->smallest_char_width = min (dpyinfo->smallest_char_width, w); } @@ -14489,7 +14489,7 @@ x_load_font (f, fontname, size) XFree (name); } - + if (full_name != 0) fontp->full_name = full_name; else @@ -14621,7 +14621,7 @@ x_find_ccl_program (fontp) >= 0))) break; } - + if (! NILP (list)) { struct ccl_program *ccl @@ -14824,7 +14824,7 @@ x_term_init (display_name, xrm_option, resource_name) dpyinfo->next = x_display_list; x_display_list = dpyinfo; - /* Put it on x_display_name_list as well, to keep them parallel. */ + /* Put it on x_display_name_list as well, to keep them parallel. */ x_display_name_list = Fcons (Fcons (display_name, Qnil), x_display_name_list); dpyinfo->name_list_element = XCAR (x_display_name_list); @@ -14911,7 +14911,7 @@ x_term_init (display_name, xrm_option, resource_name) else dpyinfo->cmap = XCreateColormap (dpyinfo->display, dpyinfo->root_window, dpyinfo->visual, AllocNone); - + { int screen_number = XScreenNumberOfScreen (dpyinfo->screen); double pixels = DisplayHeight (dpyinfo->display, screen_number); @@ -14921,7 +14921,7 @@ x_term_init (display_name, xrm_option, resource_name) mm = DisplayWidthMM (dpyinfo->display, screen_number); dpyinfo->resx = pixels * 25.4 / mm; } - + dpyinfo->Xatom_wm_protocols = XInternAtom (dpyinfo->display, "WM_PROTOCOLS", False); dpyinfo->Xatom_wm_take_focus @@ -14975,7 +14975,7 @@ x_term_init (display_name, xrm_option, resource_name) /* Ghostscript support. */ dpyinfo->Xatom_PAGE = XInternAtom (dpyinfo->display, "PAGE", False); dpyinfo->Xatom_DONE = XInternAtom (dpyinfo->display, "DONE", False); - + dpyinfo->Xatom_Scrollbar = XInternAtom (dpyinfo->display, "SCROLLBAR", False); @@ -14990,7 +14990,7 @@ x_term_init (display_name, xrm_option, resource_name) null_bits[0] = 0x00; dpyinfo->null_pixel - = XCreatePixmapFromBitmapData (dpyinfo->display, dpyinfo->root_window, + = XCreatePixmapFromBitmapData (dpyinfo->display, dpyinfo->root_window, null_bits, 1, 1, (long) 0, (long) 0, 1); } @@ -15008,7 +15008,7 @@ x_term_init (display_name, xrm_option, resource_name) #ifdef HAVE_X_I18N xim_initialize (dpyinfo, resource_name); #endif - + #ifdef subprocesses /* This is only needed for distinguishing keyboard and process input. */ if (connection != 0) @@ -15040,7 +15040,7 @@ x_term_init (display_name, xrm_option, resource_name) XrmValue d, fr, to; Font font; int count; - + d.addr = (XPointer)&dpy; d.size = sizeof (Display *); fr.addr = XtDefaultFont; @@ -15070,7 +15070,7 @@ x_term_init (display_name, xrm_option, resource_name) || !strcmp (SDATA (value), "on"))) XSynchronize (dpyinfo->display, True); } - + UNBLOCK_INPUT; return dpyinfo; @@ -15133,7 +15133,7 @@ x_delete_display (dpyinfo) if (dpyinfo->xim) xim_close_dpy (dpyinfo); #endif - + xfree (dpyinfo->font_table); xfree (dpyinfo->x_id_name); xfree (dpyinfo->color_cells); @@ -15196,7 +15196,7 @@ x_initialize () x_noop_count = 0; last_tool_bar_item = -1; any_help_event_p = 0; - + /* Try to use interrupt input; if we can't, then start polling. */ Fset_input_mode (Qt, Qnil, Qt, Qnil); @@ -15204,7 +15204,7 @@ x_initialize () XtToolkitInitialize (); Xt_app_con = XtCreateApplicationContext (); - + /* Register a converter from strings to pixels, which uses Emacs' color allocation infrastructure. */ XtAppSetTypeConverter (Xt_app_con, @@ -15226,7 +15226,7 @@ x_initialize () start_atimer (ATIMER_CONTINUOUS, interval, x_process_timeouts, 0); } #endif - + #ifdef USE_TOOLKIT_SCROLL_BARS xaw3d_arrow_scroll = False; xaw3d_pick_top = True; @@ -15319,7 +15319,7 @@ Otherwise, value is a symbol describing the X toolkit. */); staticpro (&last_mouse_motion_frame); last_mouse_motion_frame = Qnil; - + Qmodifier_value = intern ("modifier-value"); Qalt = intern ("alt"); Fput (Qalt, Qmodifier_value, make_number (alt_modifier)); @@ -15329,28 +15329,28 @@ Otherwise, value is a symbol describing the X toolkit. */); Fput (Qmeta, Qmodifier_value, make_number (meta_modifier)); Qsuper = intern ("super"); Fput (Qsuper, Qmodifier_value, make_number (super_modifier)); - + DEFVAR_LISP ("x-alt-keysym", &Vx_alt_keysym, doc: /* Which keys Emacs uses for the alt modifier. This should be one of the symbols `alt', `hyper', `meta', `super'. For example, `alt' means use the Alt_L and Alt_R keysyms. The default is nil, which is the same as `alt'. */); Vx_alt_keysym = Qnil; - + DEFVAR_LISP ("x-hyper-keysym", &Vx_hyper_keysym, doc: /* Which keys Emacs uses for the hyper modifier. This should be one of the symbols `alt', `hyper', `meta', `super'. For example, `hyper' means use the Hyper_L and Hyper_R keysyms. The default is nil, which is the same as `hyper'. */); Vx_hyper_keysym = Qnil; - + DEFVAR_LISP ("x-meta-keysym", &Vx_meta_keysym, doc: /* Which keys Emacs uses for the meta modifier. This should be one of the symbols `alt', `hyper', `meta', `super'. For example, `meta' means use the Meta_L and Meta_R keysyms. The default is nil, which is the same as `meta'. */); Vx_meta_keysym = Qnil; - + DEFVAR_LISP ("x-super-keysym", &Vx_super_keysym, doc: /* Which keys Emacs uses for the super modifier. This should be one of the symbols `alt', `hyper', `meta', `super'. -- 2.39.2