1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-04-27 08:43:40 -07:00

Merge from emacs-23

This commit is contained in:
Stefan Monnier 2010-12-13 10:27:36 -05:00
commit f49d1f52b2
51 changed files with 1551 additions and 436 deletions

View file

@ -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

View file

@ -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.
Lisp programs may give this variable certain special values:
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. */);
- 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,

View file

@ -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

View file

@ -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

View file

@ -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)
{

View file

@ -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.

View file

@ -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;
#ifdef NS_IMPL_GNUSTEP
if (xoff < 100)
f->left_pos = 100; /* don't overlap menu */
#endif
if (view != nil && (screen = [[view window] screen]))
[[view window] setFrameTopLeftPoint:
NSMakePoint (SCREENMAXBOUND (f->left_pos),
SCREENMAXBOUND ([screen frame].size.height
- NS_TOP_POS (f)))];
{
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 (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);
}
UNBLOCK_INPUT;
}

View file

@ -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;

View file

@ -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;
}
/***********************************************************************