aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Monnier2010-12-13 10:27:36 -0500
committerStefan Monnier2010-12-13 10:27:36 -0500
commitf49d1f52b2e368ef67dcfececd426de958548f4e (patch)
treece24ced92f2acc976daf4b69e3634c8bd600e44e /src
parent07176b2a9e63a0d3933b167f987475d8a18da5cc (diff)
parent11aad4e9f9f54ce8e9ecc66347e512b20a3cdf39 (diff)
downloademacs-f49d1f52b2e368ef67dcfececd426de958548f4e.tar.gz
emacs-f49d1f52b2e368ef67dcfececd426de958548f4e.zip
Merge from emacs-23
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog55
-rw-r--r--src/buffer.c20
-rw-r--r--src/config.in3
-rw-r--r--src/dispextern.h6
-rw-r--r--src/fileio.c5
-rw-r--r--src/keyboard.c2
-rw-r--r--src/nsterm.m29
-rw-r--r--src/xdisp.c33
-rw-r--r--src/xsmfns.c21
9 files changed, 135 insertions, 39 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 18c482c2e92..2db05fd1722 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,58 @@
12010-12-13 Eli Zaretskii <eliz@gnu.org>
2
3 * fileio.c (Fexpand_file_name): Doc fix. (Bug#7617)
4
52010-12-13 Eli Zaretskii <eliz@gnu.org>
6
7 * xdisp.c (string_pos_nchars_ahead, c_string_pos)
8 (face_before_or_after_it_pos, next_element_from_string)
9 (next_element_from_c_string, produce_stretch_glyph): Remove unused
10 calculations of maximum string length before calling
11 string_char_and_length and STRING_CHAR_AND_LENGTH.
12 (string_char_and_length): Update commentary: MAXLEN is no longer
13 needed.
14
152010-12-13 Jan Djärv <jan.h.d@swipnet.se>
16
17 * keyboard.c (kbd_buffer_get_event): Construct SAVE_SESSION_EVENT
18 as (Qsave_session arg).
19
20 * xsmfns.c (smc_interact_CB): Set arg to Qnil.
21 (smc_die_CB): Make an event with arg Qt.
22 (Fhandle_save_session): If event has Qt as argument,
23 call Fkill_emacs (Bug#7552).
24
252010-12-13 Chong Yidong <cyd@stupidchicken.com>
26
27 * buffer.c (transient-mark-mode): Doc fix (Bug#7465).
28
292010-12-13 Jan Djärv <jan.h.d@swipnet.se>
30
31 * xsmfns.c (smc_die_CB): Call Fkill_emacs (Bug#7552).
32
332010-12-13 Chong Yidong <cyd@stupidchicken.com>
34
35 * dispextern.h (struct it): New member overlay_strings_charpos.
36
37 * xdisp.c (next_overlay_string, load_overlay_strings): Record the
38 charpos where we computed n_overlay_strings.
39 (next_overlay_string): Load overlay strings at recorded position,
40 which may not be the same as the iterator's charpos (Bug#7016).
41
422010-12-13 Chong Yidong <cyd@stupidchicken.com>
43
44 * xdisp.c (try_scrolling): Avoid infloop if the first line is
45 obscured due to a vscroll (Bug#7537).
46
472010-12-13 Jan Djärv <jhd@zeplinf.localdomain>
48
49 * nsterm.h (FRAME_NS_TOOLBAR_HEIGHT): Rename to FRAME_TOOLBAR_HEIGHT.
50
51 * nsterm.m (x_set_window_size, windowWillResize, initFrameFromEmacs):
52 Use FRAME_TOOLBAR_HEIGHT.
53 (x_set_offset): Handle XNegative and YNegative in
54 f->size_hint_flags (Bug#7510).
55
12010-12-11 Eli Zaretskii <eliz@gnu.org> 562010-12-11 Eli Zaretskii <eliz@gnu.org>
2 57
3 * w32fns.c (Fx_show_tip): Call try_window with last argument 58 * w32fns.c (Fx_show_tip): Call try_window with last argument
diff --git a/src/buffer.c b/src/buffer.c
index 67192b4843b..1351dac3cd7 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -6106,15 +6106,17 @@ Non-nil also enables highlighting of the region whenever the mark is active.
6106The variable `highlight-nonselected-windows' controls whether to highlight 6106The variable `highlight-nonselected-windows' controls whether to highlight
6107all windows or just the selected window. 6107all windows or just the selected window.
6108 6108
6109If the value is `lambda', that enables Transient Mark mode temporarily. 6109Lisp programs may give this variable certain special values:
6110After any subsequent action that would normally deactivate the mark 6110
6111\(such as buffer modification), Transient Mark mode is turned off. 6111- A value of `lambda' enables Transient Mark mode temporarily.
6112 6112 It is disabled again after any subsequent action that would
6113If the value is (only . OLDVAL), that enables Transient Mark mode 6113 normally deactivate the mark (e.g. buffer modification).
6114temporarily. After any subsequent point motion command that is not 6114
6115shift-translated, or any other action that would normally deactivate 6115- A value of (only . OLDVAL) enables Transient Mark mode
6116the mark (such as buffer modification), the value of 6116 temporarily. After any subsequent point motion command that is
6117`transient-mark-mode' is set to OLDVAL. */); 6117 not shift-translated, or any other action that would normally
6118 deactivate the mark (e.g. buffer modification), the value of
6119 `transient-mark-mode' is set to OLDVAL. */);
6118 Vtransient_mark_mode = Qnil; 6120 Vtransient_mark_mode = Qnil;
6119 6121
6120 DEFVAR_LISP ("inhibit-read-only", &Vinhibit_read_only, 6122 DEFVAR_LISP ("inhibit-read-only", &Vinhibit_read_only,
diff --git a/src/config.in b/src/config.in
index 105f343870c..737d3827363 100644
--- a/src/config.in
+++ b/src/config.in
@@ -1053,9 +1053,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
1053/* Define to `int' if <sys/types.h> does not define. */ 1053/* Define to `int' if <sys/types.h> does not define. */
1054#undef pid_t 1054#undef pid_t
1055 1055
1056/* Define to `unsigned int' if <sys/types.h> does not define. */
1057#undef size_t
1058
1059/* Define to any substitute for sys_siglist. */ 1056/* Define to any substitute for sys_siglist. */
1060#undef sys_siglist 1057#undef sys_siglist
1061 1058
diff --git a/src/dispextern.h b/src/dispextern.h
index 7426c03b5ec..27d3c1583ca 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -2178,6 +2178,12 @@ struct it
2178 OVERLAY_STRING_CHUNK_SIZE. */ 2178 OVERLAY_STRING_CHUNK_SIZE. */
2179 int n_overlay_strings; 2179 int n_overlay_strings;
2180 2180
2181 /* The charpos where n_overlay_strings was calculated. This should
2182 be set at the same time as n_overlay_strings. It is needed
2183 because we show before-strings at the start of invisible text;
2184 see handle_invisible_prop in xdisp.c. */
2185 int overlay_strings_charpos;
2186
2181 /* Vector of overlays to process. Overlay strings are processed 2187 /* Vector of overlays to process. Overlay strings are processed
2182 OVERLAY_STRING_CHUNK_SIZE at a time. */ 2188 OVERLAY_STRING_CHUNK_SIZE at a time. */
2183#define OVERLAY_STRING_CHUNK_SIZE 16 2189#define OVERLAY_STRING_CHUNK_SIZE 16
diff --git a/src/fileio.c b/src/fileio.c
index 886e5ebc411..c2b93a6bd8b 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -786,6 +786,9 @@ File name components that are `.' are removed, and
786so are file name components followed by `..', along with the `..' itself; 786so are file name components followed by `..', along with the `..' itself;
787note that these simplifications are done without checking the resulting 787note that these simplifications are done without checking the resulting
788file names in the file system. 788file names in the file system.
789Multiple consecutive slashes are collapsed into a single slash,
790except at the beginning of the file name when they are significant (e.g.,
791UNC file names on MS-Windows.)
789An initial `~/' expands to your home directory. 792An initial `~/' expands to your home directory.
790An initial `~USER/' expands to USER's home directory. 793An initial `~USER/' expands to USER's home directory.
791See also the function `substitute-in-file-name'. 794See also the function `substitute-in-file-name'.
@@ -793,7 +796,7 @@ See also the function `substitute-in-file-name'.
793For technical reasons, this function can return correct but 796For technical reasons, this function can return correct but
794non-intuitive results for the root directory; for instance, 797non-intuitive results for the root directory; for instance,
795\(expand-file-name ".." "/") returns "/..". For this reason, use 798\(expand-file-name ".." "/") returns "/..". For this reason, use
796(directory-file-name (file-name-directory dirname)) to traverse a 799\(directory-file-name (file-name-directory dirname)) to traverse a
797filesystem tree, not (expand-file-name ".." dirname). */) 800filesystem tree, not (expand-file-name ".." dirname). */)
798 (Lisp_Object name, Lisp_Object default_directory) 801 (Lisp_Object name, Lisp_Object default_directory)
799{ 802{
diff --git a/src/keyboard.c b/src/keyboard.c
index 923ac1ad1d9..1023d34ca79 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -4102,7 +4102,7 @@ kbd_buffer_get_event (KBOARD **kbp,
4102#endif 4102#endif
4103 else if (event->kind == SAVE_SESSION_EVENT) 4103 else if (event->kind == SAVE_SESSION_EVENT)
4104 { 4104 {
4105 obj = Fcons (Qsave_session, Qnil); 4105 obj = Fcons (Qsave_session, Fcons (event->arg, Qnil));
4106 kbd_fetch_ptr = event + 1; 4106 kbd_fetch_ptr = event + 1;
4107 } 4107 }
4108 /* Just discard these, by returning nil. 4108 /* Just discard these, by returning nil.
diff --git a/src/nsterm.m b/src/nsterm.m
index 78d690c020d..87dc1195425 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -1106,16 +1106,31 @@ x_set_offset (struct frame *f, int xoff, int yoff, int change_grav)
1106 1106
1107 f->left_pos = xoff; 1107 f->left_pos = xoff;
1108 f->top_pos = yoff; 1108 f->top_pos = yoff;
1109
1110 if (view != nil && (screen = [[view window] screen]))
1111 {
1112 f->left_pos = f->size_hint_flags & XNegative
1113 ? [screen visibleFrame].size.width + f->left_pos - FRAME_PIXEL_WIDTH (f)
1114 : f->left_pos;
1115 /* We use visibleFrame here to take menu bar into account.
1116 Ideally we should also adjust left/top with visibleFrame.offset. */
1117
1118 f->top_pos = f->size_hint_flags & YNegative
1119 ? ([screen visibleFrame].size.height + f->top_pos
1120 - FRAME_PIXEL_HEIGHT (f) - FRAME_NS_TITLEBAR_HEIGHT (f)
1121 - FRAME_TOOLBAR_HEIGHT (f))
1122 : f->top_pos;
1109#ifdef NS_IMPL_GNUSTEP 1123#ifdef NS_IMPL_GNUSTEP
1110 if (xoff < 100) 1124 if (f->left_pos < 100)
1111 f->left_pos = 100; /* don't overlap menu */ 1125 f->left_pos = 100; /* don't overlap menu */
1112#endif 1126#endif
1127 [[view window] setFrameTopLeftPoint:
1128 NSMakePoint (SCREENMAXBOUND (f->left_pos),
1129 SCREENMAXBOUND ([screen frame].size.height
1130 - NS_TOP_POS (f)))];
1131 f->size_hint_flags &= ~(XNegative|YNegative);
1132 }
1113 1133
1114 if (view != nil && (screen = [[view window] screen]))
1115 [[view window] setFrameTopLeftPoint:
1116 NSMakePoint (SCREENMAXBOUND (f->left_pos),
1117 SCREENMAXBOUND ([screen frame].size.height
1118 - NS_TOP_POS (f)))];
1119 UNBLOCK_INPUT; 1134 UNBLOCK_INPUT;
1120} 1135}
1121 1136
diff --git a/src/xdisp.c b/src/xdisp.c
index 77e9db2e5eb..1c220647ba9 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -1544,11 +1544,10 @@ pos_visible_p (struct window *w, EMACS_INT charpos, int *x, int *y,
1544} 1544}
1545 1545
1546 1546
1547/* Return the next character from STR which is MAXLEN bytes long. 1547/* Return the next character from STR. Return in *LEN the length of
1548 Return in *LEN the length of the character. This is like 1548 the character. This is like STRING_CHAR_AND_LENGTH but never
1549 STRING_CHAR_AND_LENGTH but never returns an invalid character. If 1549 returns an invalid character. If we find one, we return a `?', but
1550 we find one, we return a `?', but with the length of the invalid 1550 with the length of the invalid character. */
1551 character. */
1552 1551
1553static INLINE int 1552static INLINE int
1554string_char_and_length (const unsigned char *str, int *len) 1553string_char_and_length (const unsigned char *str, int *len)
@@ -1577,15 +1576,13 @@ string_pos_nchars_ahead (struct text_pos pos, Lisp_Object string, EMACS_INT ncha
1577 1576
1578 if (STRING_MULTIBYTE (string)) 1577 if (STRING_MULTIBYTE (string))
1579 { 1578 {
1580 EMACS_INT rest = SBYTES (string) - BYTEPOS (pos);
1581 const unsigned char *p = SDATA (string) + BYTEPOS (pos); 1579 const unsigned char *p = SDATA (string) + BYTEPOS (pos);
1582 int len; 1580 int len;
1583 1581
1584 while (nchars--) 1582 while (nchars--)
1585 { 1583 {
1586 string_char_and_length (p, &len); 1584 string_char_and_length (p, &len);
1587 p += len, rest -= len; 1585 p += len;
1588 xassert (rest >= 0);
1589 CHARPOS (pos) += 1; 1586 CHARPOS (pos) += 1;
1590 BYTEPOS (pos) += len; 1587 BYTEPOS (pos) += len;
1591 } 1588 }
@@ -1625,15 +1622,13 @@ c_string_pos (EMACS_INT charpos, const unsigned char *s, int multibyte_p)
1625 1622
1626 if (multibyte_p) 1623 if (multibyte_p)
1627 { 1624 {
1628 EMACS_INT rest = strlen (s);
1629 int len; 1625 int len;
1630 1626
1631 SET_TEXT_POS (pos, 0, 0); 1627 SET_TEXT_POS (pos, 0, 0);
1632 while (charpos--) 1628 while (charpos--)
1633 { 1629 {
1634 string_char_and_length (s, &len); 1630 string_char_and_length (s, &len);
1635 s += len, rest -= len; 1631 s += len;
1636 xassert (rest >= 0);
1637 CHARPOS (pos) += 1; 1632 CHARPOS (pos) += 1;
1638 BYTEPOS (pos) += len; 1633 BYTEPOS (pos) += len;
1639 } 1634 }
@@ -4823,6 +4818,7 @@ next_overlay_string (struct it *it)
4823 && it->stop_charpos <= it->end_charpos)); 4818 && it->stop_charpos <= it->end_charpos));
4824 it->current.overlay_string_index = -1; 4819 it->current.overlay_string_index = -1;
4825 it->n_overlay_strings = 0; 4820 it->n_overlay_strings = 0;
4821 it->overlay_strings_charpos = -1;
4826 4822
4827 /* If we're at the end of the buffer, record that we have 4823 /* If we're at the end of the buffer, record that we have
4828 processed the overlay strings there already, so that 4824 processed the overlay strings there already, so that
@@ -4835,11 +4831,13 @@ next_overlay_string (struct it *it)
4835 /* There are more overlay strings to process. If 4831 /* There are more overlay strings to process. If
4836 IT->current.overlay_string_index has advanced to a position 4832 IT->current.overlay_string_index has advanced to a position
4837 where we must load IT->overlay_strings with more strings, do 4833 where we must load IT->overlay_strings with more strings, do
4838 it. */ 4834 it. We must load at the IT->overlay_strings_charpos where
4835 IT->n_overlay_strings was originally computed; when invisible
4836 text is present, this might not be IT_CHARPOS (Bug#7016). */
4839 int i = it->current.overlay_string_index % OVERLAY_STRING_CHUNK_SIZE; 4837 int i = it->current.overlay_string_index % OVERLAY_STRING_CHUNK_SIZE;
4840 4838
4841 if (it->current.overlay_string_index && i == 0) 4839 if (it->current.overlay_string_index && i == 0)
4842 load_overlay_strings (it, 0); 4840 load_overlay_strings (it, it->overlay_strings_charpos);
4843 4841
4844 /* Initialize IT to deliver display elements from the overlay 4842 /* Initialize IT to deliver display elements from the overlay
4845 string. */ 4843 string. */
@@ -5051,8 +5049,9 @@ load_overlay_strings (struct it *it, EMACS_INT charpos)
5051 if (n > 1) 5049 if (n > 1)
5052 qsort (entries, n, sizeof *entries, compare_overlay_entries); 5050 qsort (entries, n, sizeof *entries, compare_overlay_entries);
5053 5051
5054 /* Record the total number of strings to process. */ 5052 /* Record number of overlay strings, and where we computed it. */
5055 it->n_overlay_strings = n; 5053 it->n_overlay_strings = n;
5054 it->overlay_strings_charpos = charpos;
5056 5055
5057 /* IT->current.overlay_string_index is the number of overlay strings 5056 /* IT->current.overlay_string_index is the number of overlay strings
5058 that have already been consumed by IT. Copy some of the 5057 that have already been consumed by IT. Copy some of the
@@ -13426,7 +13425,11 @@ try_scrolling (Lisp_Object window, int just_this_one_p,
13426 13425
13427 /* If cursor ends up on a partially visible line, 13426 /* If cursor ends up on a partially visible line,
13428 treat that as being off the bottom of the screen. */ 13427 treat that as being off the bottom of the screen. */
13429 if (! cursor_row_fully_visible_p (w, extra_scroll_margin_lines <= 1, 0)) 13428 if (! cursor_row_fully_visible_p (w, extra_scroll_margin_lines <= 1, 0)
13429 /* It's possible that the cursor is on the first line of the
13430 buffer, which is partially obscured due to a vscroll
13431 (Bug#7537). In that case, avoid looping forever . */
13432 && extra_scroll_margin_lines < w->desired_matrix->nrows - 1)
13430 { 13433 {
13431 clear_glyph_matrix (w->desired_matrix); 13434 clear_glyph_matrix (w->desired_matrix);
13432 ++extra_scroll_margin_lines; 13435 ++extra_scroll_margin_lines;
diff --git a/src/xsmfns.c b/src/xsmfns.c
index 7b82fd4e61e..561fd5ee51a 100644
--- a/src/xsmfns.c
+++ b/src/xsmfns.c
@@ -172,6 +172,7 @@ smc_interact_CB (SmcConn smcConn, SmPointer clientData)
172{ 172{
173 doing_interact = True; 173 doing_interact = True;
174 emacs_event.kind = SAVE_SESSION_EVENT; 174 emacs_event.kind = SAVE_SESSION_EVENT;
175 emacs_event.arg = Qnil;
175} 176}
176 177
177/* This is called when the session manager tells us to save ourselves. 178/* This is called when the session manager tells us to save ourselves.
@@ -308,8 +309,8 @@ smc_save_yourself_CB (SmcConn smcConn,
308static void 309static void
309smc_die_CB (SmcConn smcConn, SmPointer clientData) 310smc_die_CB (SmcConn smcConn, SmPointer clientData)
310{ 311{
311 SmcCloseConnection (smcConn, 0, 0); 312 emacs_event.kind = SAVE_SESSION_EVENT;
312 ice_connection_closed (); 313 emacs_event.arg = Qt;
313} 314}
314 315
315/* We don't use the next two but they are mandatory, leave them empty. 316/* We don't use the next two but they are mandatory, leave them empty.
@@ -522,9 +523,12 @@ is told to abort the window system shutdown.
522Do not call this function yourself. */) 523Do not call this function yourself. */)
523 (Lisp_Object event) 524 (Lisp_Object event)
524{ 525{
526 int kill_emacs = CONSP (event) && CONSP (XCDR (event))
527 && EQ (Qt, XCAR (XCDR (event)));
528
525 /* Check doing_interact so that we don't do anything if someone called 529 /* Check doing_interact so that we don't do anything if someone called
526 this at the wrong time. */ 530 this at the wrong time. */
527 if (doing_interact) 531 if (doing_interact && ! kill_emacs)
528 { 532 {
529 Bool cancel_shutdown = False; 533 Bool cancel_shutdown = False;
530 534
@@ -535,9 +539,20 @@ Do not call this function yourself. */)
535 539
536 doing_interact = False; 540 doing_interact = False;
537 } 541 }
542 else if (kill_emacs)
543 {
544 /* We should not do user interaction here, but it is not easy to
545 prevent. Fix this in next version. */
546 Fkill_emacs (Qnil);
538 547
548 /* This will not be reached, but we want kill-emacs-hook to be run. */
549 SmcCloseConnection (smc_conn, 0, 0);
550 ice_connection_closed ();
551 }
552
539 return Qnil; 553 return Qnil;
540} 554}
555
541 556
542 557
543/*********************************************************************** 558/***********************************************************************