Stefan Monnier [Wed, 26 Sep 2012 04:02:21 +0000 (00:02 -0400)]
* lisp/profiler.el (profiler-start): Don't prompt for choice when there
isn't any.
(profiler-stop): Use new semantics of profiler-*-stop.
(profiler-reset, profiler--report-cpu): Don't signal an error if the
cpu profiler is not available.
* src/profiler.c (Fprofiler_cpu_stop, Fprofiler_memory_stop):
Return whether the profiler was running, instead of signaling an error
if it wasn't.
Stefan Monnier [Tue, 25 Sep 2012 02:30:46 +0000 (22:30 -0400)]
* src/profiler.c: Rename sample_profiler_* to profiler_cpu_* and
memory_profiler_* to profiler_memory_*. Move sigprof_handler before
its first use, inside the PROFILER_CPU_SUPPORT conditional.
Stefan Monnier [Mon, 24 Sep 2012 21:15:53 +0000 (17:15 -0400)]
Try to let it compile on other platforms
* src/profiler.c (evict_lower_half): Fix typo.
(PROFILER_CPU_SUPPORT): Check and define if cpu-profiler is supported.
Don't compile the cpu-profiler code, if not supported.
(malloc_probe): Presume memory_log is non-nil.
(syms_of_profiler): Don't defsubr functions when they aren't defined.
* src/lisp.h (sample_profiler_running, gc_probe): Don't declare.
Stefan Monnier [Mon, 24 Sep 2012 14:38:10 +0000 (10:38 -0400)]
Rewrite sampler to use Elisp hash-tables.
* src/profiler.c: Remove filtering functionality.
(is_in_trace, Qgc): Remove vars.
(make_log, record_backtrace, Fsample_profiler_log):
Rewrite, using Elisp hash-tables.
(approximate_median, evict_lower_half): New functions.
(cpu_log): Rename from sample_log.
(cpu_gc_count): New var.
(Fsample_profiler_reset, Fmemory_profiler_reset): Remove.
(sigprof_handler): Add count to cpu_gc_count during GC, detected via
backtrace_list.
(block_sigprof, unblock_sigprof): Remove.
(gc_probe, mark_profiler): Remove functions.
(syms_of_profiler): Staticpro cpu_log and memory_log.
* lisp/profiler.el (profiler-sample-interval): Move before first use.
Change default to 1ms.
(profiler-entry=, profiler-backtrace-reverse, profiler-log-fixup-slot)
(profiler-calltree-elapsed<, profiler-calltree-elapsed>): Remove functions.
(profiler-entry-format): Don't use type-of.
(profiler-slot, profiler-log): Remove structs.
(profiler-log-timestamp, profiler-log-type, profiler-log-diff-p):
Redefine for new log representation.
(profiler-log-diff, profiler-log-fixup, profiler-calltree-build-1):
Rewrite for new log representation.
(profiler-calltree): Remove `elapsed' fields.
(profiler-calltree-count<, profiler-report-make-entry-part):
Remove gc special case.
(profiler-calltree-find): Use equal.
(profiler-calltree-walk): Remove `args'; rely on closures instead.
(profiler-calltree-compute-percentages-1): Remove; inlined.
(profiler-calltree-compute-percentages): Simplify.
(profiler-report-log, profiler-report-reversed)
(profiler-report-order): Use defvar-local.
(profiler-report-line-format): Remove `elapsed', do a bit of CSE.
(profiler-report-mode-map): Remove up/down bindings.
(profiler-report-make-buffer-name): Simplify by CSE.
(profiler-report-mode): Remove redundant code.
(profiler-report-expand-entry, profiler-report-collapse-entry):
Use inhibit-read-only.
(profiler-report-render-calltree-1): Simplify by CSE.
(profiler-reset): Rewrite for new subroutines.
(profiler--report-cpu): Rename from sample-profiler-report.
(profiler--report-memory): Rename from memory-profiler-report.
* src/alloc.c (Fgarbage_collect): Record itself in backtrace_list.
Don't set is_in_trace any more. Don't call mark_profiler.
Only call gc_probe for the memory profiler.
(syms_of_alloc): Define Qautomatic_gc.
* src/lisp.h (SXHASH_COMBINE): Move back to...
* src/fns.c (SXHASH_COMBINE): ...here.
* src/xdisp.c (Qautomatic_redisplay): New constant.
(redisplay_internal): Record itself in backtrace_list.
(syms_of_xdisp): Define Qautomatic_redisplay.
* .dir-locals.el (indent-tabs-mode): Remove personal preference.
Paul Eggert [Tue, 21 Aug 2012 23:09:01 +0000 (16:09 -0700)]
Make recently-introduced setters macros.
* fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
(set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
(set_fontset_default, set_fontset_fallback): Rename from their
upper-case counterparts, and make them functions rather than macros.
This is more consistent with the other recently-introduced setters.
These don't need to be inline, since they're local.
Paul Eggert [Tue, 21 Aug 2012 17:18:21 +0000 (10:18 -0700)]
* lisp.h (vcopy): Use memcpy rather than our own loop.
This fixes a performance regression introduced by the recent
addition of vcopy. This means 'vcopy' will need to be modified
for a copying collector, but that's OK. Also, tighten the
checking in the assertion.
Eli Zaretskii [Tue, 21 Aug 2012 17:14:08 +0000 (20:14 +0300)]
Fix bug #11860 with displaying composite RTL characters on MS-Windows.
src/w32uniscribe.c (uniscribe_shape): Fix producing gstring
components for RTL text. Adjust X-OFFSET of each non-base glyph
for the width of the base character, according to what
x_draw_composite_glyph_string_foreground expects. Generate
WADJUST value according to composition_gstring_width's
expectations, to produce correct width of the composed character.
Reverse the sign of the DU offset produced by ScriptPlace.
Dmitry Antipov [Tue, 21 Aug 2012 10:21:04 +0000 (14:21 +0400)]
Avoid direct writes to contents member of struct Lisp_Vector.
* lisp.h (vcopy): New function to copy data into vector.
* dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
* fns.c (Ffillarray): Use ASET.
* keyboard.c (timer_check_2): Use AREF and ASET.
(append_tool_bar_item, Frecent_keys): Use vcopy.
* lread.c (read_vector): Use ASET.
* msdos.c (Frecent_doskeys): Use vcopy.
* xface.c (Finternal_copy_lisp_face): Use vcopy.
(Finternal_merge_in_global_face): Use ASET and vcopy.
* xfont.c (xfont_list_pattern): Likewise.
Martin Rudalics [Tue, 21 Aug 2012 09:27:07 +0000 (11:27 +0200)]
For selected window have (set-)window-point always operate on buffer's point.
* window.c (Fwindow_point): For the selected window always return
the position of its buffer's point.
(Fset_window_point): For the selected window always go in its
buffer to the specified position.
* window.el (window-point-1, set-window-point-1): Remove.
(window-in-direction, record-window-buffer)
(set-window-buffer-start-and-point, split-window-below)
(window--state-get-1, display-buffer-record-window): Replace
calls to window-point-1 and set-window-point-1 by calls to
window-point and set-window-point respectively.
Glenn Morris [Tue, 21 Aug 2012 02:29:25 +0000 (22:29 -0400)]
Reduce some cal-tex code duplication
* lisp/calendar/cal-tex.el (cal-tex-filofax-paper): New function.
(cal-tex-cursor-filofax-year, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily): Use it.
(cal-tex-weekly-paper): New function.
(cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-cursor-week-monday)
(cal-tex-cursor-day): Use it.
Glenn Morris [Tue, 21 Aug 2012 01:36:27 +0000 (21:36 -0400)]
Remove some blank pages from cal-tex output
* lisp/calendar/cal-tex.el (cal-tex-cursor-week-at-a-glance)
(cal-tex-cursor-filofax-week): Remove leading blank page.
(Were these supposed to serve some purpose? Printing?)
Glenn Morris [Tue, 21 Aug 2012 01:32:26 +0000 (21:32 -0400)]
cal-tex-cursor-week-at-a-glance small fixes
* lisp/calendar/cal-tex.el (cal-tex-cursor-week-at-a-glance):
Add autoload cookie.
For now at least, don't use color, since no other cal-tex function does.
Juri Linkov [Tue, 21 Aug 2012 00:12:42 +0000 (03:12 +0300)]
* lisp/info.el (Info-file-attributes): New variable.
(info-insert-file-contents): Add file attributes to
`Info-file-attributes'. Clear the caches `Info-index-nodes' and
`Info-toc-nodes' when previous modtime of the Info file is less
than new modtime.
(Info-toc-nodes, Info-index-nodes): Move definitions up to the top
of info.el.
Glenn Morris [Mon, 20 Aug 2012 23:57:35 +0000 (19:57 -0400)]
* src/Makefile.in: Don't assume that `ln -f' works.
Presumably it does work fine on all platforms currently building
Emacs, but the autoconf manual says not to rely on it.
Glenn Morris [Mon, 20 Aug 2012 18:13:03 +0000 (14:13 -0400)]
Use display-warning in a few places in calendar
* lisp/calendar/diary-lib.el (diary-include-files, diary-sexp-entry):
* lisp/calendar/holidays.el (calendar-holiday-list):
Report errors with display-warning rather than beep'n'sleep.
Eli Zaretskii [Mon, 20 Aug 2012 17:32:31 +0000 (20:32 +0300)]
Avoid GDB 7.5 warnings about "set main" in src/.gdbinit.
src/.gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
and later about non-assignments with no effect. See discussion at
http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
details.
Josh Feinstein [Mon, 20 Aug 2012 16:08:51 +0000 (09:08 -0700)]
Hide specified message types sent by lurkers
* erc.el (erc-display-message): Abstract message hiding decision
to new function erc-hide-current-message-p.
(erc-lurker): New customization group.
(erc-lurker-state, erc-lurker-trim-nicks, erc-lurker-ignore-chars)
(erc-lurker-hide-list, erc-lurker-cleanup-interval)
(erc-lurker-threshold-time): New variables.
(erc-lurker-maybe-trim, erc-lurker-initialize, erc-lurker-cleanup)
(erc-hide-current-message-p, erc-canonicalize-server-name)
(erc-lurker-update-status, erc-lurker-p): New functions. Together
they maintain state about which users have spoken in the last
erc-lurker-threshold-time, with all other users being considered
lurkers whose messages of types in erc-lurker-hide-list will not
be displayed by erc-display-message.
Dmitry Antipov [Mon, 20 Aug 2012 08:20:25 +0000 (12:20 +0400)]
Use AREF and ASET for docstrings of category tables.
* category.h (CATEGORY_DOCSTRING): Use AREF.
(SET_CATEGORY_DOCSTRING): Use ASET.
* category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
Edward Reingold [Mon, 20 Aug 2012 07:23:51 +0000 (00:23 -0700)]
* calendar/cal-tex.el (cal-tex-cursor-week-at-a-glance): New function.
(This is basically cal-tex-cursor-filofax-week with a different
papersize, mini-calendars, and color.)
Paul Eggert [Sun, 19 Aug 2012 21:00:09 +0000 (14:00 -0700)]
Rely on <unistd.h> to declare 'environ',
as gnulib does this if the system doesn't.
* lib-src/emacsclient.c (environ): Remove decl.
* src/callproc.c, src/editfns.c, src/process.c (environ) [!USE_CRT_DLL]:
* src/emacs.c (environ) [DOUG_LEA_MALLOC]:
* src/vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
* src/vm-limit.c: Include <unistd.h>, for 'environ'.
Alp Aker [Sun, 19 Aug 2012 00:53:29 +0000 (20:53 -0400)]
* nsfont.m (ns_ascii_average_width): Ensure the string
ascii_printable is initialized with a null-terminated character
array. Otherwise, it can contain undesired extra characters.
Paul Eggert [Sat, 18 Aug 2012 23:53:43 +0000 (16:53 -0700)]
port new setting code to Sun C 5.8 2005/10/13
* chartab.c, lisp.h (char_table_set, char_table_set_range):
Return void, not Lisp_Object. Otherwise, the compiler
complains about (A?B:C) where B is void and C is Lisp_Object
when compiling CHAR_TABLE_SET, due to the recent change to
the API of sub_char_table_set_contents.
Chong Yidong [Sat, 18 Aug 2012 05:11:38 +0000 (13:11 +0800)]
Add yank-handled-properties; use it for `font-lock-face' and `category'
properties, instead of hard-coding these properties' special handling.
* lisp/simple.el (yank-handled-properties): New defcustom.
(yank-excluded-properties): Add font-lock-face and category.
(yank): Doc fix.
* lisp/subr.el (remove-yank-excluded-properties): Obey
yank-handled-properties. The special handling of font-lock-face
and category is now done this way, instead of being hard-coded.
(insert-for-yank-1): Remove font-lock-face handling.
(yank-handle-font-lock-face-property)
(yank-handle-category-property): New function.
Paul Eggert [Sat, 18 Aug 2012 02:49:24 +0000 (19:49 -0700)]
* process.h (PSET): Remove.
Replace all uses with calls to new setter functions.
Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
(PROCESS_INLINE): New macro.
(pset_childp): New setter function.
(pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
* process.c (PROCESS_INLINE):
Define to EXTERN_INLINE, so that the corresponding functions
are compiled into code.
(pset_buffer, pset_command, pset_decode_coding_system)
(pset_decoding_buf, pset_encode_coding_system)
(pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
(pset_plist, pset_sentinel, pset_status, pset_tty_name)
(pset_type, pset_write_queue): New setter functions.
Paul Eggert [Sat, 18 Aug 2012 00:07:52 +0000 (17:07 -0700)]
* termhooks.h (TSET): Remove.
Replace all uses with calls to new setter functions.
Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
(TERMHOOKS_INLINE): New macro.
(tset_charset_list, tset_selection_alist): New setter functions.
* terminal.c (TERMHOOKS_INLINE):
Define to EXTERN_INLINE, so that the corresponding functions
are compiled into code.
(tset_param_alist): New setter function.
Paul Eggert [Fri, 17 Aug 2012 23:38:43 +0000 (16:38 -0700)]
* keyboard.h (KSET): Remove.
Replace all uses with calls to new setter functions.
Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
(KEYBOARD_INLINE): New macro.
(kset_default_minibuffer_frame, kset_defining_kbd_macro)
(kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
(kset_prefix_arg, kset_system_key_alist, kset_window_system):
New setter functions.
* keyboard.c (KEYBOARD_INLINE):
Define to EXTERN_INLINE, so that the corresponding functions
are compiled into code.
(kset_echo_string, kset_kbd_queue)
(kset_keyboard_translate_table, kset_last_prefix_arg)
(kset_last_repeatable_command, kset_local_function_key_map)
(kset_overriding_terminal_local_map, kset_real_last_command)
(kset_system_key_syms): New setter functions.
Paul Eggert [Fri, 17 Aug 2012 21:52:15 +0000 (14:52 -0700)]
* frame.h (FSET): Remove (Bug#12215).
Replace all uses with calls to new setter functions.
Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
(FRAME_INLINE): New macro.
(fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
(fset_current_tool_bar_string, fset_desired_tool_bar_string)
(fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
(fset_menu_bar_vector, fset_menu_bar_window, fset_name)
(fset_param_alist, fset_root_window, fset_scroll_bars)
(fset_selected_window, fset_title, fset_tool_bar_items)
(fset_tool_bar_position, fset_tool_bar_window): New functions.
* frame.c (FRAME_INLINE):
Define to EXTERN_INLINE, so that the corresponding functions
are compiled into code.
(fset_buffer_predicate, fset_minibuffer_window): New setter functions.
Paul Eggert [Fri, 17 Aug 2012 21:12:11 +0000 (14:12 -0700)]
A few more naming-convention fixes for getters and setters.
* buffer.c (set_buffer_overlays_before): Move here from buffer.h,
and rename from buffer_overlays_set_before.
(set_buffer_overlays_after): Move here from buffer.h, and rename
from buffer_overlays_set_after.
* buffer.h (buffer_intervals): Rename from buffer_get_intervals.
All uses changed.
(set_buffer_intervals): Rename from buffer_set_intervals.
* intervals.c (set_interval_object): Move here from intervals.h,
and rename from interval_set_object.
(set_interval_left): Move here from intervals.h, and rename from
interval_set_left.
(set_interval_right): Move here from intervals.h, and rename from
interval_set_right.
(copy_interval_parent): Move here from intervals.h, and rename from
interval_copy_parent.
* intervals.h (set_interval_parent): Rename from interval_set_parent.
(set_interval_plist): Rename from interval_set_plist.
Return void, not Lisp_Object, since no caller uses the result.
* lisp.h (string_intervals): Rename from string_get_intervals.
(set_string_intervals): Rename from string_set_intervals.
Glenn Morris [Fri, 17 Aug 2012 20:38:47 +0000 (16:38 -0400)]
rmail-output-read-file-name fix for bug#12214
This resembles the 2001-05-07 change to rmail-output-read-rmail-file-name,
which was never copied to rmail-output-read-file-name.
It's more complicated now due to Rmail's buffer swapping.
* lisp/mail/rmailout.el (rmail-output-read-file-name):
Check rmail-output-file-alist against the full message body
in the correct rmail buffer.
Paul Eggert [Fri, 17 Aug 2012 17:08:30 +0000 (10:08 -0700)]
* lisp.h (set_char_table_extras): Rename from char_table_set_extras.
(set_char_table_contents): Rename from char_table_set_contents.
(set_sub_char_table_contents): Rename from sub_char_table_sub_contents.
All uses changed. See the end of
<http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
Paul Eggert [Fri, 17 Aug 2012 16:48:22 +0000 (09:48 -0700)]
* lisp.h (CSET): Remove.
(set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
(set_char_table_purpose): New functions,
replacing CSET. All uses changed. For example, replace
"CSET (XCHAR_TABLE (char_table), parent, parent);" with
"char_table_set_parent (char_table, parent);".
The old version was confusing because it used the same name
'parent' for two different things.
Chong Yidong [Fri, 17 Aug 2012 09:10:31 +0000 (17:10 +0800)]
Allow face-remapping using :font, and use it in mouse-appearance-menu.
* mouse.el (mouse-appearance-menu): If x-select-font returns a
font spec, set the font directly.
* xfaces.c (merge_face_vectors): If the target font specfies a
font spec, make the font's attributes take precedence over
directly-specified attributes.
(merge_face_ref): Recognize :font.
Daniel Bergey [Fri, 17 Aug 2012 07:28:23 +0000 (00:28 -0700)]
quail-define-inscript-package tiny change
* leim/quail/indian.el (quail-define-inscript-package):
Set kbd-translate for all Inscript layouts. It's a positional
layout: vowels should be on the left hand regardless of the
underlying characters produced by those keys.
Dmitry Antipov [Fri, 17 Aug 2012 05:35:39 +0000 (09:35 +0400)]
Do not use memcpy for copying intervals.
* intervals.c (reproduce_interval): New function.
(reproduce_tree, reproduce_tree_obj): Use it.
(reproduce_tree_obj): Remove prototype.