summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
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 @@
+2010-12-13 Eli Zaretskii <eliz@gnu.org>
+
+ * fileio.c (Fexpand_file_name): Doc fix. (Bug#7617)
+
+2010-12-13 Eli Zaretskii <eliz@gnu.org>
+
+ * xdisp.c (string_pos_nchars_ahead, c_string_pos)
+ (face_before_or_after_it_pos, next_element_from_string)
+ (next_element_from_c_string, produce_stretch_glyph): Remove unused
+ calculations of maximum string length before calling
+ string_char_and_length and STRING_CHAR_AND_LENGTH.
+ (string_char_and_length): Update commentary: MAXLEN is no longer
+ needed.
+
+2010-12-13 Jan Djärv <jan.h.d@swipnet.se>
+
+ * keyboard.c (kbd_buffer_get_event): Construct SAVE_SESSION_EVENT
+ as (Qsave_session arg).
+
+ * xsmfns.c (smc_interact_CB): Set arg to Qnil.
+ (smc_die_CB): Make an event with arg Qt.
+ (Fhandle_save_session): If event has Qt as argument,
+ call Fkill_emacs (Bug#7552).
+
+2010-12-13 Chong Yidong <cyd@stupidchicken.com>
+
+ * buffer.c (transient-mark-mode): Doc fix (Bug#7465).
+
+2010-12-13 Jan Djärv <jan.h.d@swipnet.se>
+
+ * xsmfns.c (smc_die_CB): Call Fkill_emacs (Bug#7552).
+
+2010-12-13 Chong Yidong <cyd@stupidchicken.com>
+
+ * dispextern.h (struct it): New member overlay_strings_charpos.
+
+ * xdisp.c (next_overlay_string, load_overlay_strings): Record the
+ charpos where we computed n_overlay_strings.
+ (next_overlay_string): Load overlay strings at recorded position,
+ which may not be the same as the iterator's charpos (Bug#7016).
+
+2010-12-13 Chong Yidong <cyd@stupidchicken.com>
+
+ * xdisp.c (try_scrolling): Avoid infloop if the first line is
+ obscured due to a vscroll (Bug#7537).
+
+2010-12-13 Jan Djärv <jhd@zeplinf.localdomain>
+
+ * nsterm.h (FRAME_NS_TOOLBAR_HEIGHT): Rename to FRAME_TOOLBAR_HEIGHT.
+
+ * nsterm.m (x_set_window_size, windowWillResize, initFrameFromEmacs):
+ Use FRAME_TOOLBAR_HEIGHT.
+ (x_set_offset): Handle XNegative and YNegative in
+ f->size_hint_flags (Bug#7510).
+
2010-12-11 Eli Zaretskii <eliz@gnu.org>
* 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.
The variable `highlight-nonselected-windows' controls whether to highlight
all windows or just the selected window.
-If the value is `lambda', that enables Transient Mark mode temporarily.
-After any subsequent action that would normally deactivate the mark
-\(such as buffer modification), Transient Mark mode is turned off.
-
-If the value is (only . OLDVAL), that enables Transient Mark mode
-temporarily. After any subsequent point motion command that is not
-shift-translated, or any other action that would normally deactivate
-the mark (such as buffer modification), the value of
-`transient-mark-mode' is set to OLDVAL. */);
+Lisp programs may give this variable certain special values:
+
+- A value of `lambda' enables Transient Mark mode temporarily.
+ It is disabled again after any subsequent action that would
+ normally deactivate the mark (e.g. buffer modification).
+
+- A value of (only . OLDVAL) enables Transient Mark mode
+ temporarily. After any subsequent point motion command that is
+ not shift-translated, or any other action that would normally
+ deactivate the mark (e.g. buffer modification), the value of
+ `transient-mark-mode' is set to OLDVAL. */);
Vtransient_mark_mode = Qnil;
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/>. */
/* Define to `int' if <sys/types.h> does not define. */
#undef pid_t
-/* Define to `unsigned int' if <sys/types.h> does not define. */
-#undef size_t
-
/* Define to any substitute for sys_siglist. */
#undef sys_siglist
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
OVERLAY_STRING_CHUNK_SIZE. */
int n_overlay_strings;
+ /* The charpos where n_overlay_strings was calculated. This should
+ be set at the same time as n_overlay_strings. It is needed
+ because we show before-strings at the start of invisible text;
+ see handle_invisible_prop in xdisp.c. */
+ int overlay_strings_charpos;
+
/* Vector of overlays to process. Overlay strings are processed
OVERLAY_STRING_CHUNK_SIZE at a time. */
#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
so are file name components followed by `..', along with the `..' itself;
note that these simplifications are done without checking the resulting
file names in the file system.
+Multiple consecutive slashes are collapsed into a single slash,
+except at the beginning of the file name when they are significant (e.g.,
+UNC file names on MS-Windows.)
An initial `~/' expands to your home directory.
An initial `~USER/' expands to USER's home directory.
See also the function `substitute-in-file-name'.
@@ -793,7 +796,7 @@ See also the function `substitute-in-file-name'.
For technical reasons, this function can return correct but
non-intuitive results for the root directory; for instance,
\(expand-file-name ".." "/") returns "/..". For this reason, use
-(directory-file-name (file-name-directory dirname)) to traverse a
+\(directory-file-name (file-name-directory dirname)) to traverse a
filesystem tree, not (expand-file-name ".." dirname). */)
(Lisp_Object name, Lisp_Object default_directory)
{
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,
#endif
else if (event->kind == SAVE_SESSION_EVENT)
{
- obj = Fcons (Qsave_session, Qnil);
+ obj = Fcons (Qsave_session, Fcons (event->arg, Qnil));
kbd_fetch_ptr = event + 1;
}
/* 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)
f->left_pos = xoff;
f->top_pos = yoff;
+
+ if (view != nil && (screen = [[view window] screen]))
+ {
+ f->left_pos = f->size_hint_flags & XNegative
+ ? [screen visibleFrame].size.width + f->left_pos - FRAME_PIXEL_WIDTH (f)
+ : f->left_pos;
+ /* We use visibleFrame here to take menu bar into account.
+ Ideally we should also adjust left/top with visibleFrame.offset. */
+
+ f->top_pos = f->size_hint_flags & YNegative
+ ? ([screen visibleFrame].size.height + f->top_pos
+ - FRAME_PIXEL_HEIGHT (f) - FRAME_NS_TITLEBAR_HEIGHT (f)
+ - FRAME_TOOLBAR_HEIGHT (f))
+ : f->top_pos;
#ifdef NS_IMPL_GNUSTEP
- if (xoff < 100)
- f->left_pos = 100; /* don't overlap menu */
+ if (f->left_pos < 100)
+ f->left_pos = 100; /* don't overlap menu */
#endif
+ [[view window] setFrameTopLeftPoint:
+ NSMakePoint (SCREENMAXBOUND (f->left_pos),
+ SCREENMAXBOUND ([screen frame].size.height
+ - NS_TOP_POS (f)))];
+ f->size_hint_flags &= ~(XNegative|YNegative);
+ }
- if (view != nil && (screen = [[view window] screen]))
- [[view window] setFrameTopLeftPoint:
- NSMakePoint (SCREENMAXBOUND (f->left_pos),
- SCREENMAXBOUND ([screen frame].size.height
- - NS_TOP_POS (f)))];
UNBLOCK_INPUT;
}
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,
}
-/* Return the next character from STR which is MAXLEN bytes long.
- Return in *LEN the length of the character. This is like
- STRING_CHAR_AND_LENGTH but never returns an invalid character. If
- we find one, we return a `?', but with the length of the invalid
- character. */
+/* Return the next character from STR. Return in *LEN the length of
+ the character. This is like STRING_CHAR_AND_LENGTH but never
+ returns an invalid character. If we find one, we return a `?', but
+ with the length of the invalid character. */
static INLINE int
string_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
if (STRING_MULTIBYTE (string))
{
- EMACS_INT rest = SBYTES (string) - BYTEPOS (pos);
const unsigned char *p = SDATA (string) + BYTEPOS (pos);
int len;
while (nchars--)
{
string_char_and_length (p, &len);
- p += len, rest -= len;
- xassert (rest >= 0);
+ p += len;
CHARPOS (pos) += 1;
BYTEPOS (pos) += len;
}
@@ -1625,15 +1622,13 @@ c_string_pos (EMACS_INT charpos, const unsigned char *s, int multibyte_p)
if (multibyte_p)
{
- EMACS_INT rest = strlen (s);
int len;
SET_TEXT_POS (pos, 0, 0);
while (charpos--)
{
string_char_and_length (s, &len);
- s += len, rest -= len;
- xassert (rest >= 0);
+ s += len;
CHARPOS (pos) += 1;
BYTEPOS (pos) += len;
}
@@ -4823,6 +4818,7 @@ next_overlay_string (struct it *it)
&& it->stop_charpos <= it->end_charpos));
it->current.overlay_string_index = -1;
it->n_overlay_strings = 0;
+ it->overlay_strings_charpos = -1;
/* If we're at the end of the buffer, record that we have
processed the overlay strings there already, so that
@@ -4835,11 +4831,13 @@ next_overlay_string (struct it *it)
/* There are more overlay strings to process. If
IT->current.overlay_string_index has advanced to a position
where we must load IT->overlay_strings with more strings, do
- it. */
+ it. We must load at the IT->overlay_strings_charpos where
+ IT->n_overlay_strings was originally computed; when invisible
+ text is present, this might not be IT_CHARPOS (Bug#7016). */
int i = it->current.overlay_string_index % OVERLAY_STRING_CHUNK_SIZE;
if (it->current.overlay_string_index && i == 0)
- load_overlay_strings (it, 0);
+ load_overlay_strings (it, it->overlay_strings_charpos);
/* Initialize IT to deliver display elements from the overlay
string. */
@@ -5051,8 +5049,9 @@ load_overlay_strings (struct it *it, EMACS_INT charpos)
if (n > 1)
qsort (entries, n, sizeof *entries, compare_overlay_entries);
- /* Record the total number of strings to process. */
+ /* Record number of overlay strings, and where we computed it. */
it->n_overlay_strings = n;
+ it->overlay_strings_charpos = charpos;
/* IT->current.overlay_string_index is the number of overlay strings
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,
/* If cursor ends up on a partially visible line,
treat that as being off the bottom of the screen. */
- if (! cursor_row_fully_visible_p (w, extra_scroll_margin_lines <= 1, 0))
+ if (! cursor_row_fully_visible_p (w, extra_scroll_margin_lines <= 1, 0)
+ /* It's possible that the cursor is on the first line of the
+ buffer, which is partially obscured due to a vscroll
+ (Bug#7537). In that case, avoid looping forever . */
+ && extra_scroll_margin_lines < w->desired_matrix->nrows - 1)
{
clear_glyph_matrix (w->desired_matrix);
++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)
{
doing_interact = True;
emacs_event.kind = SAVE_SESSION_EVENT;
+ emacs_event.arg = Qnil;
}
/* This is called when the session manager tells us to save ourselves.
@@ -308,8 +309,8 @@ smc_save_yourself_CB (SmcConn smcConn,
static void
smc_die_CB (SmcConn smcConn, SmPointer clientData)
{
- SmcCloseConnection (smcConn, 0, 0);
- ice_connection_closed ();
+ emacs_event.kind = SAVE_SESSION_EVENT;
+ emacs_event.arg = Qt;
}
/* 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.
Do not call this function yourself. */)
(Lisp_Object event)
{
+ int kill_emacs = CONSP (event) && CONSP (XCDR (event))
+ && EQ (Qt, XCAR (XCDR (event)));
+
/* Check doing_interact so that we don't do anything if someone called
this at the wrong time. */
- if (doing_interact)
+ if (doing_interact && ! kill_emacs)
{
Bool cancel_shutdown = False;
@@ -535,9 +539,20 @@ Do not call this function yourself. */)
doing_interact = False;
}
+ else if (kill_emacs)
+ {
+ /* We should not do user interaction here, but it is not easy to
+ prevent. Fix this in next version. */
+ Fkill_emacs (Qnil);
+ /* This will not be reached, but we want kill-emacs-hook to be run. */
+ SmcCloseConnection (smc_conn, 0, 0);
+ ice_connection_closed ();
+ }
+
return Qnil;
}
+
/***********************************************************************