1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-27 07:41:28 -08:00
Commit graph

36534 commits

Author SHA1 Message Date
Paul Eggert
1c7b6b3e0a Spelling fixes. 2014-11-16 22:27:36 -08:00
Paul Eggert
0921dbc3ab Improve time stamp handling, and be more consistent about it.
This implements a suggestion made in:
http://lists.gnu.org/archive/html/emacs-devel/2014-10/msg00587.html
Among other things, this means timer.el no longer needs to
autoload the time-date module.
* doc/lispref/os.texi (Time of Day, Time Conversion, Time Parsing)
(Processor Run Time, Time Calculations):
Document the new behavior, plus be clearer about the old behavior.
(Idle Timers): Take advantage of new functionality.
* etc/NEWS: Document the changes.
* lisp/allout-widgets.el (allout-elapsed-time-seconds): Doc fix.
* lisp/arc-mode.el (archive-ar-summarize):
* lisp/calendar/time-date.el (seconds-to-time, days-to-time, time-since):
* lisp/emacs-lisp/timer.el (timer-relative-time, timer-event-handler)
(run-at-time, with-timeout-suspend, with-timeout-unsuspend):
* lisp/net/tramp.el (tramp-time-less-p, tramp-time-subtract):
* lisp/proced.el (proced-time-lessp):
* lisp/timezone.el (timezone-time-from-absolute):
* lisp/type-break.el (type-break-schedule, type-break-time-sum):
Simplify by using new functionality.
* lisp/calendar/cal-dst.el (calendar-next-time-zone-transition):
Do not return time values in obsolete and undocumented (HI . LO)
format; use (HI LO) instead.
* lisp/calendar/time-date.el (with-decoded-time-value):
Treat 'nil' as current time.  This is mostly for XEmacs.
(encode-time-value, with-decoded-time-value): Obsolete.
(time-add, time-subtract, time-less-p): Use no-op autoloads, for
XEmacs.  Define only if XEmacs, as they're now C builtins in Emacs.
* lisp/ldefs-boot.el: Update to match new time-date.el
* lisp/proced.el: Do not require time-date.
* src/editfns.c (invalid_time): New function.
Use it instead of 'error ("Invalid time specification")'.
(time_add, time_subtract, time_arith, Ftime_add, Ftime_less_p)
(decode_float_time, lisp_to_timespec, lisp_time_struct):
New functions.
(make_time_tail, make_time): Remove.  All uses changed to use
new functions or plain list4i.
(disassemble_lisp_time): Return effective length if successful.
Check that LOW is an integer, if it's combined with other components.
(decode_time_components): Decode into struct lisp_time, not
struct timespec, so that we can support a wide set of times
regardless of whether time_t is signed.  Decode plain numbers
as seconds since the Epoch, and nil as the current time.
(lisp_time_argument, lisp_seconds_argument, Ffloat_time):
Reimplement in terms of new functions.
(Fencode_time): Just use list2i.
(syms_of_editfns): Add time-add, time-subtract, time-less-p.
* src/keyboard.c (decode_timer): Don't allow the new formats (floating
point or nil) in timers.
* src/systime.h (LO_TIME_BITS): New constant.  Use it everywhere in
place of the magic number '16'.
(struct lisp_time): New type.
(decode_time_components): Use it.
(lisp_to_timespec): New decl.
2014-11-16 20:41:22 -08:00
Lars Magne Ingebrigtsen
d1b04a9e7a Implement an `inhibit-read-only' text property
* doc/lispref/text.texi (Special Properties): Mention `inhibit-read-only'.

* src/buffer.c (Fbarf_if_buffer_read_only): Don't raise an error if
the text at POSITION (new optional argument) has the
`inhibit-read-only' text property set.

* src/callint.c (Fcall_interactively): Pass in nil as argument to
Fbarf_if_buffer_read_only.

* src/fileio.c (Finsert_file_contents): Ditto.

* src/insdel.c (prepare_to_modify_buffer_1): Pass start region in.

* src/intervals.h (INTERVAL_WRITABLE_P): Check the `inhibit-read-only'
text property.

* src/textprop.c (verify_interval_modification): Check buffer
readedness after the last interval.
2014-11-16 23:41:55 +01:00
Stefan Monnier
9075fcc193 Merge from emacs-24 2014-11-16 00:22:20 -05:00
Jan D
a6b42789b5 Backport: Fix for 18993.
* nsterm.m (ns_send_appdefined): Check for application defined
event on Cocoa (Bug#18993).  Backport from trunk.
2014-11-15 19:20:37 +01:00
Jan D
0d9bf9725a Redo the fix, the old takes too much CPU.
Fixes: 18993

* nsterm.m (ns_send_appdefined): Check for application defined
event on Cocoa (Bug#18993).
(run): Restore code before the previous 18993 fix.
2014-11-15 19:09:58 +01:00
Eli Zaretskii
1fb97e79d2 Fix bug #19060 with inaccurate pixel-based scrolling.
src/window.c (window_scroll_pixel_based): Avoid truncation/rounding
 errors in computing the number of pixels to scroll.  Suggested by
 Kelly Dean <kelly@prtime.org>.
2014-11-15 19:04:17 +02:00
Jan D
b8c9a4e36d Fix getting frame size wrong when restoring desktop.
* nsmenu.m (update_frame_tool_bar): If tool bar changes height,
call updateFrameSize.
2014-11-15 14:35:15 +01:00
Jan D
836c444db7 Fixes: 18757
* nsterm.m (setFrame:): Remove call to display (Bug#18757).
2014-11-15 13:39:30 +01:00
Eli Zaretskii
71e866c066 src/window.h (WINDOW_FRAME_LINE_HEIGHT): Fix a typo in a comment.
Reported by Kelly Dean <kelly@prtime.org>.
2014-11-15 11:25:16 +02:00
David Reitter
658b768a65 Time-out NS event loop
OS X 10.10 will, at times, not send us the application-defined
event that is used to terminate the event loop.  As a workaround,
we define a timeout and react accordingly.  Leaving it in place
for other OSX and NS versions as a safety net.

Partial revert of 2014-11-08T16:32:37Z!jan.h.d@swipnet.se.

Fixes debbugs:18993
2014-11-14 18:07:31 -05:00
Paul Eggert
9bcde6cdca * .gitignore: Add emacs-[1-9]*, to ignore files like emacs-25.0.50.1. 2014-11-14 12:25:10 -08:00
Dmitry Antipov
a5cbb7d9cc Attempt to allocate less font entity objects in xfont_list_pattern
* xfont.c (xfont_list_pattern): Do not allocate font entity object
for each candidate font but attempt to reuse it from previous improper
candidate, if any.
2014-11-14 13:40:24 +03:00
Jan Djärv
6688117e79 Fixes: 19036
* nsfns.m (x_set_foreground_color, x_set_background_color)
(x_set_cursor_color, Fxw_color_values): Block/unblock input,
use SET_FRAME_GARBAGED instead of redraw_frame (Bug#19036).
2014-11-14 08:41:53 +01:00
Paul Eggert
911ad4a15e Avoid undefined behavior in color table hashing.
* image.c (CT_HASH_RGB) [COLOR_TABLE_SUPPORT]: Remove, replacing with ...
(ct_hash_rgb) [COLOR_TABLE_SUPPORT]: New function.  All uses changed.
This function avoids undefined behavior with signed shift overflow.
2014-11-12 22:35:22 -08:00
Glenn Morris
c832df2ec2 Merge from emacs-24; up to 117698 2014-11-09 23:39:35 -08:00
Stefan Monnier
eca1ea9655 * lisp/help.el (view-lossage): Include the actual commands run.
* src/keyboard.c (command_loop_1): Record this-command in recent-keys.
(Frecent_keys): Rewrite. and add optional `include-cmds' arg.
2014-11-09 21:58:52 -05:00
Eli Zaretskii
ea75a0e069 Fix bug #18982 with assertion violations when reverting buffers.
src/fileio.c (Finsert_file_contents): Invalidate buffer caches also
 when the inserted text does not need decoding.
2014-11-09 18:40:43 +02:00
Eli Zaretskii
2ae1e0d427 Fix bug #18995 with compiling w32heap.c with -funroll-loops.
src/w32heap.c (allocate_heap): Set the lower limit of heap at 8MB.
2014-11-09 17:57:37 +02:00
Jan Djärv
d29658759a * nsterm.h (EmacsScroller): judge returns bool.
* nsterm.m (ns_set_vertical_scroll_bar): Release bar.
(ns_judge_scroll_bars): Only set removed if judge returns true.
(judge): Returns bool == condemned.  Remove self from window.
(setPosition:portion:whole:): Remove raise SIGIO.

Fixes: debbugs:18757
2014-11-09 14:47:02 +01:00
Jan Djärv
1af3b1135a Clean up merge error.
* nsterm.m (ns_set_vertical_scroll_bar)
(ns_set_horizontal_scroll_bar): Cleanup merge error.
2014-11-09 11:23:46 +01:00
Paul Eggert
f862694141 * xgselect.c (xg_select): Don't assume n_gfds is nonnegative
merely because tmo_in_millisec is nonnegative.  The 1st call
to g_main_context_query could succeed while the 2nd one fails.
2014-11-08 20:19:54 -08:00
Paul Eggert
0cd3403ff4 * frame.c (Fcan_run_window_configuration_change_hook): Return a value. 2014-11-08 20:04:12 -08:00
Glenn Morris
089c6aab18 Merge from emacs-24; up to 117689 2014-11-08 13:32:10 -08:00
Jan Djärv
d244e9bf03 * nsterm.m (ns_set_vertical_scroll_bar): Don't call bar setPosition: unless
needed (Bug#18757).

Fixes: debbugs:18993
2014-11-08 20:40:17 +01:00
Glenn Morris
416148257a Merge from emacs-24; up to 117687 2014-11-08 10:21:38 -08:00
Jan Djärv
86b1c771e1 Attempt to fix NS hang. Will probably cause merge conflicts.
* nsterm.m (init): Replace OSX 10.9 check with IMPL_COCOA.
(run): Ditto.  Only use non-system event loop if OSX version is
exactly 10.9.

Fixes: debbugs:18993
2014-11-08 17:32:37 +01:00
Martin Rudalics
c936cbbc83 Run `window-configuration-change-hook' only after all faces have been realized.
* frame.c (adjust_frame_size): Call x_set_window_size only if
f->can_x_set_window_size is set.
(make_frame): Initialize f->can_x_set_window_size and
f->can_run_window_configuration_change_hook.
(Fcan_run_window_configuration_change_hook): New function.
* frame.h (frame): Split `official' into `can_x_set_window_size'
and `can_run_window_configuration_change_hook'.
* nsfns.m (Fx_create_frame): Set f->can_x_set_window_size.
* w32fns.c (Fx_create_frame, x_create_tip_frame): Set
f->can_x_set_window_size.
* window.c (run_window_configuration_change_hook): Return
immediately if either f->can_x_set_window_size or
f->can_run_window_configuration_change_hook are false.
(Fset_window_configuration): Instead of f->official set
f->can_x_set_window_size.
* xfns.c (Fx_create_frame, x_create_tip_frame): Set
f->can_x_set_window_size.
* faces.el (face-set-after-frame-default): Enable running
`window-configuration-change-hook'.
2014-11-08 12:11:50 +01:00
Jan Djärv
a05fd1fc78 * nsterm.m (EmacsScroller.dealloc): Reinstate, removed at merge
cleanup from 2014-11-01.

Fixes: debbugs:18972
2014-11-08 09:47:45 +01:00
Michael Albinus
499a7f1cdb * callproc.c (encode_current_directory): Encode dir at the end. 2014-11-07 21:09:34 +01:00
Glenn Morris
2a1f6afdfe * src/callproc.c (encode_current_directory): Fix thinko in previous. 2014-11-07 09:04:10 -08:00
Stefan Monnier
3946aeb962 * src/keyboard.c: Call gui-set-selection instead of x-set-selection.
* src/xdisp.c (window-scroll-functions): Improve docstring.
2014-11-07 11:25:35 -05:00
Paul Eggert
0e44a2d233 Uniquify the 'size' symbol.
* frame.c (Qsize):
* w32notify.c (Qsize): Remove.
* lisp.h (Qsize): New decl.
* lread.c (Qsize): Now extern.
* w32notify.c (syms_of_w32notify): No need to defsym.
2014-11-07 07:40:06 -08:00
Michael Albinus
5282dec1ec * callproc.c (encode_current_directory): Support handling of file
names prepended by "/:".

Fixes: debbugs:18891
2014-11-07 15:45:34 +01:00
Martin Rudalics
1c50b3adb6 Improve inhibiting of implied frame resizes.
* frames.texi (Size and Position): Rewrite description of
`frame-inhibit-implied-resize'.
* cus-start.el (frame-resize-pixelwise): Fix group.
(frame-inhibit-implied-resize): Add entry.
* dispnew.c (change_frame_size_1): Fix call of
adjust_frame_size.
* frame.c (Qsize, Qframe_position, Qframe_outer_size)
(Qframe_inner_size, Qexternal_border_size, Qtitle_height)
(Qmenu_bar_external, Qmenu_bar_size, Qtool_bar_external)
(Qtool_bar_size): New constants.
(frame_inhibit_resize, adjust_frame_size): New argument to
handle case where frame_inhibit_implied_resize is a list.
(Fmake_terminal_frame, Fset_frame_height, Fset_frame_width)
(Fset_frame_size, x_set_left_fringe, x_set_right_fringe)
(x_set_right_divider_width, x_set_bottom_divider_width)
(x_set_vertical_scroll_bars, x_set_horizontal_scroll_bars)
(x_set_scroll_bar_width, x_set_scroll_bar_height): Update
callers.
(frame-inhibit-implied-resize): Rewrite doc-string.
* frame.h (frame_inhibit_resize, adjust_frame_size): Fix
external declarations.
(Qframe_position, Qframe_outer_size)
(Qframe_inner_size, Qexternal_border_size, Qtitle_height)
(Qmenu_bar_external, Qmenu_bar_size, Qtool_bar_external)
(Qtool_bar_size): Extern them.
* gtkutil.c (FRAME_TOTAL_PIXEL_HEIGHT, FRAME_TOTAL_PIXEL_WIDTH)
(xg_height_or_width_changed): Remove.
(xg_frame_set_char_size): Adjust adjust_frame_size calls.
(menubar_map_cb, xg_update_frame_menubar, free_frame_menubar)
(tb_size_cb, update_frame_tool_bar, free_frame_tool_bar)
(xg_change_toolbar_position): Call adjust_frame_size directly.
* nsfns.m (x_set_internal_border_width, Fx_create_frame): Fix
calls of adjust_frame_size.
* w32fns.c (x_set_internal_border_width, x_set_menu_bar_lines)
(Fx_create_frame, x_create_tip_frame): Adjust adjust_frame_size
calls.
(x_set_tool_bar_lines, x_change_tool_bar_height): Make sure that
frame can get resized when tool-bar-lines parameter changes from
or to zero.
(Fw32_frame_menu_bar_size): Return fourth value.
(Fw32_frame_rect): Block input around system calls
(Fx_frame_geometry): New function.
* w32menu.c (set_frame_menubar): Adjust adjust_frame_size call.
* w32term.c (x_new_font): Adjust adjust_frame_size call.
* widget.c (EmacsFrameSetCharSize): Adjust frame_inhibit_resize
call.
* window.c (Fset_window_configuration): Adjust adjust_frame_size
call.
* xfns.c (x_set_menu_bar_lines, x_set_internal_border_width)
(Fx_create_frame): Adjust adjust_frame_size calls.
(x_set_tool_bar_lines, x_change_tool_bar_height): Make sure that
frame can get resized when tool-bar-lines parameter changes from
or to zero.
(Fx_frame_geometry): New function.
* xmenu.c (update_frame_menubar): On Lucid call
adjust_frame_size with one pixel less height to avoid that
repeatedly adding/removing the menu bar grows the frame.
(free_frame_menubar): On Motif arrange to optionally preserve
the old frame height when removing the menu bar.
* xterm.c (x_new_font): Adjust adjust_frame_size call.
2014-11-07 11:49:22 +01:00
Alan Mackenzie
10c5eacef0 * src/syntax.c (back_comment): Fix off-by-one error.
Fixes: debbugs:18022
2014-11-06 09:05:58 -05:00
Dima Kogan
5b9c3a5767 * src/xgselect.c (xg_select): Use g_main_context_acquire.
Fixes: debbugs:18861
2014-11-05 22:02:11 -05:00
Michael Albinus
076582fde3 * dired.c (Ffile_attributes): Return Qnil, if Fexpand_file_name
raises an error.

Fixes: debbugs:18891
2014-11-05 12:23:10 +01:00
Glenn Morris
41e962982d Merge from emacs-24; up to 2014-08-07T11:49:36Z!rrt@sc3d.org 2014-11-03 16:49:37 -05:00
Eli Zaretskii
3247e0eae0 src/window.c (window_scroll_pixel_based): Fix a typo in a comment. 2014-11-03 20:22:07 +02:00
Eli Zaretskii
29a13e2afe Fix minor issues with functions that dump glyph matrices.
src/xdisp.c (Fdump_glyph_matrix, Fdump_frame_glyph_matrix): Doc fix.
 (Fdump_frame_glyph_matrix): Don't segfault if invoked on a GUI
 frame; instead, print an error message.
2014-11-03 19:14:50 +02:00
Jan Djärv
c33070f492 * nsfns.m (ns_set_doc_edited): Check for FRAME_NS.
Fixes: debbugs:18925
2014-11-03 08:15:11 +01:00
Jan Djärv
860ae4521f Fix memory leak
* nsimage.m (allocInitFromFile:): Initialize bmRep.
(dealloc): Release bmRep.
2014-11-02 19:45:50 +01:00
Jan Djärv
65bb8d055c * nsimage.m (ImageList, imageListNext, imageListSetNext:)
(reference): Remove.
(allocInitFromFile:): Remove searching ImageList and calling
reference.
(dealloc): Remove handling if ImageList.

* nsterm.h (EmacsImage): Remove imageListNext, refCount, reference,
imageListSetNext, imageListNext.

Fixes: debbugs:18918
2014-11-02 19:43:22 +01:00
Andreas Schwab
f26d02a625 Fix incorrect assertion
* process.c (catch_child_signal): Fix incorrect assertion.
2014-11-02 18:02:32 +01:00
Jan Djärv
bf7ded963c Clean up merge conflict.
* macfont.m (macfont_draw):
* nsterm.m (ns_mouse_position, judge): Clean up merge conflict.
2014-11-01 21:06:49 +01:00
Glenn Morris
d5d8ca30e5 Merge from emacs-24; up to 117656 2014-11-01 11:05:30 -07:00
Eli Zaretskii
614beeecf2 Ignore BUFFER_SWITCH_EVENT events for the purposes of input-pending-p.
src/keyboard.c (readable_events): When FLAGS include
 READABLE_EVENTS_FILTER_EVENTS, ignore BUFFER_SWITCH_EVENT events.
 This avoids returning non-nil from input-pending-p when only such
 events are in the queue.

Fixes: debbugs:18856
2014-11-01 16:22:32 +02:00
Jan Djärv
711066c8c1 nsselect.m cleanup, remove unused, declare vars static.
* nsselect.m (QCLIPBOARD, QSECONDARY, QTEXT, QFILE_NAME)
(NXPrimaryPboard, NXSecondaryPboard): Declare static.
(Qforeign_selection): Remove.
(ns_get_local_selection): Identation fix.
(syms_of_nsselect): Remove Qforeign_selection, ns-lost-selection-hooks
2014-11-01 12:41:50 +01:00
Jan Djärv
722afcab51 * lisp/select.el (gui-get-selection): Comment: data-type ignored on NS.
* src/nsselect.m (ns_get_local_selection): Remove calling of
functions in Vselection_converter_alist.
(syms_of_nsselect): Remove Vselection_converter_alist.

Fixes: debbugs:18911
2014-11-01 12:37:14 +01:00