Commit graph

37926 commits

Author SHA1 Message Date
Paul Eggert
3b4d119c40 Fix bug in GC_CHECK_MARKED_OBJECTS check
* src/alloc.c (mark_object): Fix bug in checking code.
When GC_CHECK_MARKED_OBJECTS is defined, the bug caused
CHECK_ALLOCATED_AND_LIVE_SYMBOL to repeatedly do the
CHECK_ALLOCATED and CHECK_LIVE tests for the first symbol in each
bucket.  The bug did not affect behavior either in the normal case
where GC_CHECK_MARKED_OBJECTS is not defined, or where Emacs does
not have an internal error that a properly-written
CHECK_ALLOCATED_AND_LIVE_SYMBOL would detect.
2015-10-06 13:34:18 -07:00
Eli Zaretskii
e2b1ad428c Fix display of characters adjacent to ZWJ and ZWNJ
* src/bidi.c (bidi_resolve_neutral): Treat all Bn (a.k.a. "control")
characters the same as directional formatting controls.
(bidi_level_of_next_char): Include all Bn characters in rule L1,
as mandated by the UBA.
2015-10-06 19:08:21 +03:00
Andreas Schwab
0befeb0b7f Don't use XFASTINT on a negative number
* src/cmds.c (Fself_insert_command): Don't use XFASTINT on a negative
number.  (Bug#21633)
2015-10-06 11:52:06 +02:00
Xue Fuqiao
d62f03393b * src/buffer.c (syms_of_buffer): Typo fix. (Bug#21622) 2015-10-06 06:48:39 +08:00
K. Handa
47e9556c70 Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs 2015-10-05 22:56:26 +09:00
Eli Zaretskii
76d5122a51 Remove redundant redisplay code
* src/xdisp.c (redisplay_internal, try_cursor_movement)
(try_window_reusing_current_matrix, try_window_id): Remove
redundant restrictions on redisplay optimizations based on the
frame's 'redisplay' flag.  See
http://osdir.com/ml/general/2015-10/msg02110.html for the relevant
discussions.
2015-10-05 10:22:08 +03:00
Stefan Monnier
1fa9f86056 * src/xdisp.c (windows_or_buffers_changed): Improve docstring 2015-10-04 22:30:27 -04:00
YAMAMOTO Mitsuharu
6cdd3c6b65 * src/macfont.m (macfont_encode_char, syms_of_macfont): Remove unused vars. 2015-10-05 09:16:21 +09:00
Eli Zaretskii
2021680e9d ; Restore some of the recent deletions in fileio.c
* src/fileio.c (Finsert_file_contents, choose_write_coding_system):
Restore some of the recently deleted calls to CHECK_CODING_SYSTEM.
2015-10-04 12:23:45 +03:00
Andreas Schwab
9a05f0ac95 * src/coding.c (complement_process_encoding_system): Revert last
change.
2015-10-03 20:15:44 +02:00
Andreas Schwab
b235ceaaf6 More validatation of coding systems
* src/fileio.c (Finsert_file_contents): Remove redundant
coding-system check.
(choose_write_coding_system): Likewise.
* src/coding.c (complement_process_encoding_system): Check
argument for valid coding system.
2015-10-03 14:50:50 +02:00
Eli Zaretskii
272ca09635 Avoid crashes in coding_inherit_eol_type
* src/coding.c (coding_inherit_eol_type): Check the validity of
the arguments.  Suggested by Andreas Schwab <schwab@linux-m68k.org>.
(Bug#21602)
2015-10-03 15:39:17 +03:00
Eli Zaretskii
265d525a5e More validatation of coding system in 'write-region'
* src/coding.c (choose_write_coding_system): More validation of
coding-system from various sources.  Suggested by Andreas Schwab
<schwab@linux-m68k.org>.  (Bug#21602)
2015-10-03 14:49:16 +03:00
Eli Zaretskii
658f2c450d Avoid crashes due to invalid coding-system
* src/fileio.c (choose_write_coding_system)
(Finsert_file_contents): Check validity of coding-system-for-write
and coding-system-for-read bound by the caller.  (Bug#21602)
2015-10-03 13:44:44 +03:00
Tassilo Horn
de7fc458e9 Revert my two recent process.c changes
Revert "Improve last commit to process.c" and "Remove callback-handled
channels from Available set" because they did not fix bug#21313.

This reverts commits bfa1aa8e2b and
27f871907cc24f33a7d12ac3a4ab71a88f0bc554..
2015-10-03 06:02:11 +02:00
Paul Eggert
355ccbcf33 Fix problems found by clang 3.5.0
* src/cmds.c (Fdelete_char): Don’t assume XINT returns int.
* src/font.c (font_parse_family_registry):
Use &"str"[X] instead of "str"+X, to pacify clang -Wstring-plus-int.
2015-10-02 08:34:50 -07:00
Eli Zaretskii
6083f333ed Revert "Attempt to fix slow redisplay caused by last changes"
* src/xdisp.c (try_window_id, try_window_reusing_current_matrix)
(try_cursor_movement): Don't relax requirements for redisplay
optimizations for the selected frame.  (Bug#21597)

This reverts commit c4c1fb9772.
2015-10-01 21:03:10 +03:00
Eli Zaretskii
511a18ded3 Fix slow redisplay when daemon frame exists
* src/xdisp.c (redisplay_internal): Don't consider daemon frames
when looking for frames that need to be redisplayed.  (Bug#21597)
2015-10-01 20:21:28 +03:00
Eli Zaretskii
c4c1fb9772 Attempt to fix slow redisplay caused by last changes
* src/xdisp.c (try_window_id, try_window_reusing_current_matrix)
(try_cursor_movement): Relax requirements for redisplay
optimizations for the selected frame.  (Bug#21597)
2015-10-01 19:56:46 +03:00
Stephen Leake
7a94cf9656 Improve doc strings in dired.c
* src/dired.c (Ffile_name_completion, Ffile_name_all_completions):
Improve doc string.
2015-10-01 09:34:00 -05:00
Eli Zaretskii
4a6780ea89 Avoid assertion violations in push_prefix_prop
* src/xdisp.c (push_prefix_prop): Avoid assertion violations when
a line that has a line-prefix defined starts with an image.  (Bug#21428)
2015-09-30 22:43:42 +03:00
Eli Zaretskii
5c9304ea86 Disable some display optimizations when frames need redisplay
These optimizations were previously disabled by the
windows_or_buffers_changed flag, which now is not set
when only some frames need to be redrawn.
* src/xdisp.c (redisplay_internal): Redisplay any frame whose
'redisplay' flag is set.
(try_window_reusing_current_matrix, try_window_id)
(try_cursor_movement): Disable these optimizations when the
frame's 'redisplay' flag is set.
2015-09-30 22:32:14 +03:00
Stefan Monnier
8b1df96013 Try to avoid redisplaying all frames when creating a new one
* src/xfns.c (x_set_menu_bar_lines, x_change_tool_bar_height):
* src/xfaces.c (Finternal_make_lisp_face, Finternal_copy_lisp_face)
(Finternal_set_lisp_face_attribute, update_face_from_frame_parameter):
* src/frame.c (x_set_screen_gamma): Set the specific frame's
`redisplay' bit rather than windows_or_buffers_changed.

* src/window.c (apply_window_adjustment): Remove redundant setting of
windows_or_buffers_changed.

* src/xdisp.c (redisplay_internal): Set the specific frame's
`redisplay' bit rather than update_mode_lines in response to
cursor_type_changed.
(syms_of_xdisp): Use hash-tables for redisplay_*_cause tables.
(AINC): Adjust accordingly.
2015-09-30 10:00:13 -04:00
Eli Zaretskii
44298d3cf8 ; Yet another tweak of pos-visible-in-window-p doc string 2015-09-30 16:51:48 +03:00
YAMAMOTO Mitsuharu
ecedfd66fc * src/macfont.m (mac_font_descriptor_supports_languages): Regard "zh" as synonym of "zh-Hans". 2015-09-30 19:05:27 +09:00
YAMAMOTO Mitsuharu
d22634e518 Work around crash when displaying etc/HELLO on OS X 10.11
* src/macfont.m (mac_font_get_weight)
(mac_font_descriptor_get_adjusted_weight): New functions.
(macfont_store_descriptor_attributes): Adjust weight.
2015-09-30 18:56:30 +09:00
Eli Zaretskii
1c6a58705b ; Clarify docs of pos-visible-in-window-p some more 2015-09-30 12:46:17 +03:00
YAMAMOTO Mitsuharu
ecbb6aeb5f * src/macfont.m: Fix compilation with USE_CT_GLYPH_INFO. 2015-09-30 18:43:25 +09:00
Eli Zaretskii
47089e0cc8 Clarify documentation of pos-visible-in-window-p
* src/window.c (Fpos_visible_in_window_p): Clarify the meaning of
t for POS.  See
http://lists.gnu.org/archive/html/emacs-devel/2015-09/msg01040.html
for the original report.

* doc/lispref/windows.texi (Window Start and End): Clarify the
meaning of t for the POSITION argument of pos-visible-in-window-p.
2015-09-30 10:19:41 +03:00
Eli Zaretskii
3a0974d939 ; Remove unnecessary resetting of inhibit_free_realized_faces 2015-09-28 16:48:52 +03:00
Eli Zaretskii
85cd80bb16 ; Fix last commit 2015-09-28 16:00:13 +03:00
Eli Zaretskii
a11ae01df9 Another attempt to fix crashes due to prematurely freed faces
* src/xdisp.c (redisplay_internal): Inhibit freeing of realized
faces for as long as we might have desired matrices that reference
those faces.  (Bug#21428)
2015-09-28 15:50:29 +03:00
Anders Lindgren
e55460e53c Respect value of frame_resize_pixelwise when handling fullscreen state.
* src/nsterm.m (handleFS): Respect frame_resize_pixelwise when
setting size increments.
2015-09-28 08:11:14 +02:00
Michael Albinus
73b0901ce0 * src/gfilenotify.c (Fgfile_add_watch): Cleanup temporary variable. 2015-09-27 20:16:06 +02:00
K. Handa
52beda922d Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs 2015-09-27 17:06:12 +09:00
Eli Zaretskii
e573d08ef1 Make face realization be more frame-specific
* src/frame.h (struct f): New flag face_change.
* src/xfaces.c (Finternal_make_lisp_face)
(Finternal_copy_lisp_face, Finternal_set_lisp_face_attribute)
(update_face_from_frame_parameter): Set the face_change flag only
for the frame whose faces are affected.
* src/xdisp.c (init_iterator): If a frame's face_change flag is
set, free faces only on that frame.
(redisplay_internal): Disable "display optimization 1" if the
frame's face_change flag is set.
(redisplay_window): Don't allow skipping a window's redisplay if
its frame's face_change flag is set.
* src/frame.c (x_set_screen_gamma): Instead of calling
Fclear_face_cache, call clear_face_cache and set
windows_or_buffers_changed to a non-zero value.  This avoids
setting the global face_change flag that triggers face realization
on all frames and thorough redisplay of all of them.

* lisp/term/tty-colors.el (tty-register-default-colors): Don't
clear face cache if the selected frame is a GUI frame.
2015-09-26 09:50:58 +03:00
Eli Zaretskii
00908ee96e Avoid non-ASCII decoding errors in C src files
* src/nsterm.m:
* src/lisp.h:
* src/editfns.c:
* src/doprnt.c: Add 'coding' cookies -- these files include
Unicode characters and should be decoded as UTF-8.
2015-09-25 20:29:27 +03:00
Eli Zaretskii
58ecdad0b0 Prevent timers from messing up TTY menus
* src/term.c (tty_menu_activate): Inhibit redisplay for as long as
the TTY menu is open.  (Bug#21530)
2015-09-24 21:04:42 +03:00
Stefan Monnier
8f88db1494 Fix recent bootstrap problems
* src/syntax.c (parse_sexp_propertize): Fix last fix.
* lisp/nxml/nxml-mode.el (nxml-comment-quote-nested): Fix paren typo.
* lisp/emacs-lisp/lisp-mode.el: Require cl-lib for cl-progv.
2015-09-24 08:54:39 -04:00
Michael Albinus
8c909d7512 * src/gfilenotify.c (Fgfile_add_watch): Decrease polling rate. 2015-09-24 09:36:12 +02:00
Paul Eggert
791355fd40 Prefer CALLN in a few more places
* src/macfont.m (macfont_set_family_cache):
* src/nsterm.m (append2):
* src/xterm.c (x_cr_export_frames):
Prefer CALLN to allocating the arg arrays by hand.
2015-09-23 14:44:35 -07:00
Michael Albinus
cad8aef324 Continue gfilenotify.c implementation of missing parts
* lisp/filenotify.el (file-notify-add-watch): Append `flags' to
`gfile-add-watch' call.
(file-notify-rm-watch): Modify `file-notify-descriptors' only
after calling the low level functions.

* src/gfilenotify.c (dir_monitor_callback): Check, whether
event_type is expected.
(Fgfile_add_watch): Allow also `change'and `attribute-change' for FLAGS.
(Fgfile_rm_watch): Fix typo.
(syms_of_gfilenotify): Declare Qchange and Qattribute_change.
2015-09-23 20:34:22 +02:00
Stefan Monnier
4c0fed13e5 * src/syntax.c: Handle spurious e_property_truncated flag
* src/syntax.c (parse_sexp_propertize): Handle spurious
e_property_truncated flag.
(update_syntax_table_forward): Remove invalid assertion.
2015-09-23 12:33:48 -04:00
Eli Zaretskii
aab67529d2 Support ':relative-width' space display spec on text-mode terminals
* src/xdisp.c (produce_stretch_glyph): Support ':relative-width'
space display spec on text-mode terminals, by calling
PRODUCE_GLYPHS instead of x_produce_glyphs.  Remove the HAVE_WINDOW_SYSTEM
guards from the supporting code, as well as the test for a GUI frame.
2015-09-23 16:20:10 +03:00
Eli Zaretskii
62831e7c3f Fix 'current-column' in presence of :relative-width
* src/indent.c (check_display_width): Support ':relative-width'
in a display spec that specifies a stretch glyph.  (Bug#21533)
2015-09-22 19:33:47 +03:00
Tassilo Horn
bfa1aa8e2b Improve last commit to process.c 2015-09-22 10:20:17 +02:00
Michael Albinus
170ed29b43 Implement gfile-valid-p
* lisp/filenotify.el (file-notify-callback): Fix typo.
(gfile-valid-p): Remove defalias.

* src/gfilenotify.c (dir_monitor_callback): Cancel the monitor if
the file or directory to be watched is deleted.
(Fgfile_add_watch): Make watch_object a triple.
(Fgfile_rm_watch): Check, whether watch is cancelled already.
(Fgfile_valid_p): New defun.
(syms_of_gfilenotify): Declare Sgfile_valid_p.
2015-09-22 08:40:08 +02:00
Tassilo Horn
27f871907c Remove callback-handled channels from Available set
* src/process.c (wait_reading_process_output): Remove channel from
Available set if it is handled by a callback, e.g., dbus or
inotify (bug#21313).
2015-09-22 07:43:39 +02:00
Paul Eggert
cf91ea794b Pacify GCC -Wmaybe-uninitialized in xdisp.c
* src/xdisp.c (face_before_or_after_it_pos): Use do-while rather
than while loop to avoid GCC -Wmaybe-uninitialized diagnostic with
charpos.  The loop should always execute at least once anyway.
2015-09-21 07:45:53 -07:00
Eli Zaretskii
e2f0dd2f49 Avoid infinite recursion while displaying box face
* src/xdisp.c (face_before_or_after_it_pos): Fix calculation of
the previous string/buffer character position under bidi
iteration.  (Bug#21428)
2015-09-21 12:35:26 +03:00