Now on revision 110316. ------------------------------------------------------------ revno: 110316 committer: Glenn Morris branch nick: trunk timestamp: Sun 2012-09-30 23:59:22 -0700 message: Remove info on deleted emacs22 icons diff: === modified file 'etc/images/icons/README' --- etc/images/icons/README 2012-01-19 07:21:25 +0000 +++ etc/images/icons/README 2012-10-01 06:59:22 +0000 @@ -9,13 +9,6 @@ License: GNU General Public License version 3 or later (see COPYING) -Files: hicolor/16x16/apps/emacs22.png hicolor/24x24/apps/emacs22.png - hicolor/32x32/apps/emacs22.png hicolor/48x48/apps/emacs22.png - -Author: Andrew Zhilin -Copyright (C) 2005-2012 Free Software Foundation, Inc. -License: GNU General Public License version 3 or later (see COPYING) - Files: allout-widgets-dark-bg/closed.png allout-widgets-dark-bg/closed.xpm allout-widgets-dark-bg/empty.png ------------------------------------------------------------ revno: 110315 fixes bug: http://debbugs.gnu.org/12541 committer: Paul Eggert branch nick: trunk timestamp: Sun 2012-09-30 23:36:54 -0700 message: Prefer plain 'static' to 'static inline'. With static functions, modern compilers inline pretty well by themselves; advice from programmers often hurts as much as it helps. On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'), this change shrinks the text size of the Emacs executable by 1.1% without affecting CPU significantly in my benchmark. * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p) (live_float_p, live_misc_p, live_vector_p, live_buffer_p) (mark_maybe_object, mark_maybe_pointer, bounded_number): * buffer.c (bset_abbrev_mode, bset_abbrev_table) (bset_auto_fill_function, bset_auto_save_file_format) (bset_auto_save_file_name, bset_backed_up, bset_begv_marker) (bset_bidi_display_reordering, bset_buffer_file_coding_system) (bset_cache_long_line_scans, bset_case_fold_search) (bset_ctl_arrow, bset_cursor_in_non_selected_windows) (bset_cursor_type, bset_display_table, bset_extra_line_spacing) (bset_file_format, bset_file_truename, bset_fringe_cursor_alist) (bset_fringe_indicator_alist, bset_fringes_outside_margins) (bset_header_line_format, bset_indicate_buffer_boundaries) (bset_indicate_empty_lines, bset_invisibility_spec) (bset_left_fringe_width, bset_major_mode, bset_mark) (bset_minor_modes, bset_mode_line_format, bset_mode_name) (bset_name, bset_overwrite_mode, bset_pt_marker) (bset_right_fringe_width, bset_save_length) (bset_scroll_bar_width, bset_scroll_down_aggressively) (bset_scroll_up_aggressively, bset_selective_display) (bset_selective_display_ellipses, bset_vertical_scroll_bar_type) (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before) (set_buffer_overlays_after): * category.c (bset_category_table): * charset.c (read_hex): * coding.c (produce_composition, produce_charset) (handle_composition_annotation, handle_charset_annotation) (char_encodable_p): * dispnew.c (swap_glyph_pointers, copy_row_except_pointers) (assign_row, set_frame_matrix_frame, make_current) (add_row_entry): * eval.c (set_specpdl_symbol, set_specpdl_old_value): * fns.c (maybe_resize_hash_table): * frame.c (fset_buffer_predicate, fset_minibuffer_window): * gmalloc.c (register_heapinfo): * image.c (lookup_image_type): * intervals.c (set_interval_object, set_interval_left) (set_interval_right, copy_interval_parent, rotate_right) (rotate_left, balance_possible_root_interval): * keyboard.c (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, clear_event, set_prop): * lread.c (digit_to_number): * marker.c (attach_marker, live_buffer, set_marker_internal): * nsterm.m (ns_compute_glyph_string_overhangs): * process.c (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): * syntax.c (bset_syntax_table, dec_bytepos): * terminal.c (tset_param_alist): * textprop.c (interval_has_some_properties) (interval_has_some_properties_list): * window.c (wset_combination_limit, wset_dedicated) (wset_display_table, wset_hchild, wset_left_fringe_width) (wset_left_margin_cols, wset_new_normal, wset_new_total) (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm) (wset_right_fringe_width, wset_right_margin_cols) (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild) (wset_vertical_scroll_bar_type, wset_window_parameters): * xdisp.c (wset_base_line_number, wset_base_line_pos) (wset_column_number_displayed, wset_region_showing) (window_box_edges, run_window_scroll_functions) (append_glyph_string_lists, prepend_glyph_string_lists) (append_glyph_string, set_glyph_string_background_width) (append_glyph, append_composite_glyph) (take_vertical_position_into_account): * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors) (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive) (lface_hash, lface_same_font_attributes_p, lookup_face): * xml.c (libxml2_loaded_p): * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc) (x_set_glyph_string_clipping, x_clear_glyph_string_rect): Now 'static', not 'static inline'. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-10-01 06:19:52 +0000 +++ src/ChangeLog 2012-10-01 06:36:54 +0000 @@ -1,5 +1,89 @@ 2012-10-01 Paul Eggert + Prefer plain 'static' to 'static inline' (Bug#12541). + With static functions, modern compilers inline pretty well by + themselves; advice from programmers often hurts as much as it helps. + On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'), + this change shrinks the text size of the Emacs executable by 1.1% + without affecting CPU significantly in my benchmark. + * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p) + (live_float_p, live_misc_p, live_vector_p, live_buffer_p) + (mark_maybe_object, mark_maybe_pointer, bounded_number): + * buffer.c (bset_abbrev_mode, bset_abbrev_table) + (bset_auto_fill_function, bset_auto_save_file_format) + (bset_auto_save_file_name, bset_backed_up, bset_begv_marker) + (bset_bidi_display_reordering, bset_buffer_file_coding_system) + (bset_cache_long_line_scans, bset_case_fold_search) + (bset_ctl_arrow, bset_cursor_in_non_selected_windows) + (bset_cursor_type, bset_display_table, bset_extra_line_spacing) + (bset_file_format, bset_file_truename, bset_fringe_cursor_alist) + (bset_fringe_indicator_alist, bset_fringes_outside_margins) + (bset_header_line_format, bset_indicate_buffer_boundaries) + (bset_indicate_empty_lines, bset_invisibility_spec) + (bset_left_fringe_width, bset_major_mode, bset_mark) + (bset_minor_modes, bset_mode_line_format, bset_mode_name) + (bset_name, bset_overwrite_mode, bset_pt_marker) + (bset_right_fringe_width, bset_save_length) + (bset_scroll_bar_width, bset_scroll_down_aggressively) + (bset_scroll_up_aggressively, bset_selective_display) + (bset_selective_display_ellipses, bset_vertical_scroll_bar_type) + (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before) + (set_buffer_overlays_after): + * category.c (bset_category_table): + * charset.c (read_hex): + * coding.c (produce_composition, produce_charset) + (handle_composition_annotation, handle_charset_annotation) + (char_encodable_p): + * dispnew.c (swap_glyph_pointers, copy_row_except_pointers) + (assign_row, set_frame_matrix_frame, make_current) + (add_row_entry): + * eval.c (set_specpdl_symbol, set_specpdl_old_value): + * fns.c (maybe_resize_hash_table): + * frame.c (fset_buffer_predicate, fset_minibuffer_window): + * gmalloc.c (register_heapinfo): + * image.c (lookup_image_type): + * intervals.c (set_interval_object, set_interval_left) + (set_interval_right, copy_interval_parent, rotate_right) + (rotate_left, balance_possible_root_interval): + * keyboard.c (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, clear_event, set_prop): + * lread.c (digit_to_number): + * marker.c (attach_marker, live_buffer, set_marker_internal): + * nsterm.m (ns_compute_glyph_string_overhangs): + * process.c (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): + * syntax.c (bset_syntax_table, dec_bytepos): + * terminal.c (tset_param_alist): + * textprop.c (interval_has_some_properties) + (interval_has_some_properties_list): + * window.c (wset_combination_limit, wset_dedicated) + (wset_display_table, wset_hchild, wset_left_fringe_width) + (wset_left_margin_cols, wset_new_normal, wset_new_total) + (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm) + (wset_right_fringe_width, wset_right_margin_cols) + (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild) + (wset_vertical_scroll_bar_type, wset_window_parameters): + * xdisp.c (wset_base_line_number, wset_base_line_pos) + (wset_column_number_displayed, wset_region_showing) + (window_box_edges, run_window_scroll_functions) + (append_glyph_string_lists, prepend_glyph_string_lists) + (append_glyph_string, set_glyph_string_background_width) + (append_glyph, append_composite_glyph) + (take_vertical_position_into_account): + * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors) + (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive) + (lface_hash, lface_same_font_attributes_p, lookup_face): + * xml.c (libxml2_loaded_p): + * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc) + (x_set_glyph_string_clipping, x_clear_glyph_string_rect): + Now 'static', not 'static inline'. + * bidi.c: Tune. (bidi_copy_it): Do the whole copy with a single memcpy. (bidi_char_at_pos): Merge the two STRING_CHAR calls into one. === modified file 'src/alloc.c' --- src/alloc.c 2012-09-30 21:36:42 +0000 +++ src/alloc.c 2012-10-01 06:36:54 +0000 @@ -355,7 +355,7 @@ static void mem_rotate_right (struct mem_node *); static void mem_delete (struct mem_node *); static void mem_delete_fixup (struct mem_node *); -static inline struct mem_node *mem_find (void *); +static struct mem_node *mem_find (void *); #endif @@ -3550,7 +3550,7 @@ /* Value is a pointer to the mem_node containing START. Value is MEM_NIL if there is no node in the tree containing START. */ -static inline struct mem_node * +static struct mem_node * mem_find (void *start) { struct mem_node *p; @@ -3926,7 +3926,7 @@ /* Value is non-zero if P is a pointer to a live Lisp string on the heap. M is a pointer to the mem_block for P. */ -static inline bool +static bool live_string_p (struct mem_node *m, void *p) { if (m->type == MEM_TYPE_STRING) @@ -3949,7 +3949,7 @@ /* Value is non-zero if P is a pointer to a live Lisp cons on the heap. M is a pointer to the mem_block for P. */ -static inline bool +static bool live_cons_p (struct mem_node *m, void *p) { if (m->type == MEM_TYPE_CONS) @@ -3975,7 +3975,7 @@ /* Value is non-zero if P is a pointer to a live Lisp symbol on the heap. M is a pointer to the mem_block for P. */ -static inline bool +static bool live_symbol_p (struct mem_node *m, void *p) { if (m->type == MEM_TYPE_SYMBOL) @@ -4001,7 +4001,7 @@ /* Value is non-zero if P is a pointer to a live Lisp float on the heap. M is a pointer to the mem_block for P. */ -static inline bool +static bool live_float_p (struct mem_node *m, void *p) { if (m->type == MEM_TYPE_FLOAT) @@ -4025,7 +4025,7 @@ /* Value is non-zero if P is a pointer to a live Lisp Misc on the heap. M is a pointer to the mem_block for P. */ -static inline bool +static bool live_misc_p (struct mem_node *m, void *p) { if (m->type == MEM_TYPE_MISC) @@ -4051,7 +4051,7 @@ /* Value is non-zero if P is a pointer to a live vector-like object. M is a pointer to the mem_block for P. */ -static inline bool +static bool live_vector_p (struct mem_node *m, void *p) { if (m->type == MEM_TYPE_VECTOR_BLOCK) @@ -4087,7 +4087,7 @@ /* Value is non-zero if P is a pointer to a live buffer. M is a pointer to the mem_block for P. */ -static inline bool +static bool live_buffer_p (struct mem_node *m, void *p) { /* P must point to the start of the block, and the buffer @@ -4153,7 +4153,7 @@ /* Mark OBJ if we can prove it's a Lisp_Object. */ -static inline void +static void mark_maybe_object (Lisp_Object obj) { void *po; @@ -4222,7 +4222,7 @@ /* If P points to Lisp data, mark that as live if it isn't already marked. */ -static inline void +static void mark_maybe_pointer (void *p) { struct mem_node *m; @@ -5052,7 +5052,7 @@ /* Used to avoid possible overflows when converting from C to Lisp integers. */ -static inline Lisp_Object +static Lisp_Object bounded_number (EMACS_INT number) { return make_number (min (MOST_POSITIVE_FIXNUM, number)); === modified file 'src/buffer.c' --- src/buffer.c 2012-09-23 08:44:20 +0000 +++ src/buffer.c 2012-10-01 06:36:54 +0000 @@ -150,222 +150,222 @@ static Lisp_Object buffer_lisp_local_variables (struct buffer *, bool); /* These setters are used only in this file, so they can be private. */ -static inline void +static void bset_abbrev_mode (struct buffer *b, Lisp_Object val) { b->INTERNAL_FIELD (abbrev_mode) = val; } -static inline void +static void bset_abbrev_table (struct buffer *b, Lisp_Object val) { b->INTERNAL_FIELD (abbrev_table) = val; } -static inline void +static void bset_auto_fill_function (struct buffer *b, Lisp_Object val) { b->INTERNAL_FIELD (auto_fill_function) = val; } -static inline void +static void bset_auto_save_file_format (struct buffer *b, Lisp_Object val) { b->INTERNAL_FIELD (auto_save_file_format) = val; } -static inline void +static void bset_auto_save_file_name (struct buffer *b, Lisp_Object val) { b->INTERNAL_FIELD (auto_save_file_name) = val; } -static inline void +static void bset_backed_up (struct buffer *b, Lisp_Object val) { b->INTERNAL_FIELD (backed_up) = val; } -static inline void +static void bset_begv_marker (struct buffer *b, Lisp_Object val) { b->INTERNAL_FIELD (begv_marker) = val; } -static inline void +static void bset_bidi_display_reordering (struct buffer *b, Lisp_Object val) { b->INTERNAL_FIELD (bidi_display_reordering) = val; } -static inline void +static void bset_buffer_file_coding_system (struct buffer *b, Lisp_Object val) { b->INTERNAL_FIELD (buffer_file_coding_system) = val; } -static inline void +static void bset_cache_long_line_scans (struct buffer *b, Lisp_Object val) { b->INTERNAL_FIELD (cache_long_line_scans) = val; } -static inline void +static void bset_case_fold_search (struct buffer *b, Lisp_Object val) { b->INTERNAL_FIELD (case_fold_search) = val; } -static inline void +static void bset_ctl_arrow (struct buffer *b, Lisp_Object val) { b->INTERNAL_FIELD (ctl_arrow) = val; } -static inline void +static void bset_cursor_in_non_selected_windows (struct buffer *b, Lisp_Object val) { b->INTERNAL_FIELD (cursor_in_non_selected_windows) = val; } -static inline void +static void bset_cursor_type (struct buffer *b, Lisp_Object val) { b->INTERNAL_FIELD (cursor_type) = val; } -static inline void +static void bset_display_table (struct buffer *b, Lisp_Object val) { b->INTERNAL_FIELD (display_table) = val; } -static inline void +static void bset_extra_line_spacing (struct buffer *b, Lisp_Object val) { b->INTERNAL_FIELD (extra_line_spacing) = val; } -static inline void +static void bset_file_format (struct buffer *b, Lisp_Object val) { b->INTERNAL_FIELD (file_format) = val; } -static inline void +static void bset_file_truename (struct buffer *b, Lisp_Object val) { b->INTERNAL_FIELD (file_truename) = val; } -static inline void +static void bset_fringe_cursor_alist (struct buffer *b, Lisp_Object val) { b->INTERNAL_FIELD (fringe_cursor_alist) = val; } -static inline void +static void bset_fringe_indicator_alist (struct buffer *b, Lisp_Object val) { b->INTERNAL_FIELD (fringe_indicator_alist) = val; } -static inline void +static void bset_fringes_outside_margins (struct buffer *b, Lisp_Object val) { b->INTERNAL_FIELD (fringes_outside_margins) = val; } -static inline void +static void bset_header_line_format (struct buffer *b, Lisp_Object val) { b->INTERNAL_FIELD (header_line_format) = val; } -static inline void +static void bset_indicate_buffer_boundaries (struct buffer *b, Lisp_Object val) { b->INTERNAL_FIELD (indicate_buffer_boundaries) = val; } -static inline void +static void bset_indicate_empty_lines (struct buffer *b, Lisp_Object val) { b->INTERNAL_FIELD (indicate_empty_lines) = val; } -static inline void +static void bset_invisibility_spec (struct buffer *b, Lisp_Object val) { b->INTERNAL_FIELD (invisibility_spec) = val; } -static inline void +static void bset_left_fringe_width (struct buffer *b, Lisp_Object val) { b->INTERNAL_FIELD (left_fringe_width) = val; } -static inline void +static void bset_major_mode (struct buffer *b, Lisp_Object val) { b->INTERNAL_FIELD (major_mode) = val; } -static inline void +static void bset_mark (struct buffer *b, Lisp_Object val) { b->INTERNAL_FIELD (mark) = val; } -static inline void +static void bset_minor_modes (struct buffer *b, Lisp_Object val) { b->INTERNAL_FIELD (minor_modes) = val; } -static inline void +static void bset_mode_line_format (struct buffer *b, Lisp_Object val) { b->INTERNAL_FIELD (mode_line_format) = val; } -static inline void +static void bset_mode_name (struct buffer *b, Lisp_Object val) { b->INTERNAL_FIELD (mode_name) = val; } -static inline void +static void bset_name (struct buffer *b, Lisp_Object val) { b->INTERNAL_FIELD (name) = val; } -static inline void +static void bset_overwrite_mode (struct buffer *b, Lisp_Object val) { b->INTERNAL_FIELD (overwrite_mode) = val; } -static inline void +static void bset_pt_marker (struct buffer *b, Lisp_Object val) { b->INTERNAL_FIELD (pt_marker) = val; } -static inline void +static void bset_right_fringe_width (struct buffer *b, Lisp_Object val) { b->INTERNAL_FIELD (right_fringe_width) = val; } -static inline void +static void bset_save_length (struct buffer *b, Lisp_Object val) { b->INTERNAL_FIELD (save_length) = val; } -static inline void +static void bset_scroll_bar_width (struct buffer *b, Lisp_Object val) { b->INTERNAL_FIELD (scroll_bar_width) = val; } -static inline void +static void bset_scroll_down_aggressively (struct buffer *b, Lisp_Object val) { b->INTERNAL_FIELD (scroll_down_aggressively) = val; } -static inline void +static void bset_scroll_up_aggressively (struct buffer *b, Lisp_Object val) { b->INTERNAL_FIELD (scroll_up_aggressively) = val; } -static inline void +static void bset_selective_display (struct buffer *b, Lisp_Object val) { b->INTERNAL_FIELD (selective_display) = val; } -static inline void +static void bset_selective_display_ellipses (struct buffer *b, Lisp_Object val) { b->INTERNAL_FIELD (selective_display_ellipses) = val; } -static inline void +static void bset_vertical_scroll_bar_type (struct buffer *b, Lisp_Object val) { b->INTERNAL_FIELD (vertical_scroll_bar_type) = val; } -static inline void +static void bset_word_wrap (struct buffer *b, Lisp_Object val) { b->INTERNAL_FIELD (word_wrap) = val; } -static inline void +static void bset_zv_marker (struct buffer *b, Lisp_Object val) { b->INTERNAL_FIELD (zv_marker) = val; @@ -651,13 +651,13 @@ /* Set an appropriate overlay of B. */ -static inline void +static void set_buffer_overlays_before (struct buffer *b, struct Lisp_Overlay *o) { b->overlays_before = o; } -static inline void +static void set_buffer_overlays_after (struct buffer *b, struct Lisp_Overlay *o) { b->overlays_after = o; === modified file 'src/category.c' --- src/category.c 2012-09-15 07:06:56 +0000 +++ src/category.c 2012-10-01 06:36:54 +0000 @@ -40,7 +40,7 @@ #include "keymap.h" /* This setter is used only in this file, so it can be private. */ -static inline void +static void bset_category_table (struct buffer *b, Lisp_Object val) { b->INTERNAL_FIELD (category_table) = val; === modified file 'src/charset.c' --- src/charset.c 2012-09-26 20:00:29 +0000 +++ src/charset.c 2012-10-01 06:36:54 +0000 @@ -421,7 +421,7 @@ /* Read a hexadecimal number (preceded by "0x") from the file FP while paying attention to comment character '#'. */ -static inline unsigned +static unsigned read_hex (FILE *fp, bool *eof, bool *overflow) { int c; === modified file 'src/coding.c' --- src/coding.c 2012-09-30 14:39:46 +0000 +++ src/coding.c 2012-10-01 06:36:54 +0000 @@ -6822,7 +6822,7 @@ [ -LENGTH ANNOTATION_MASK NCHARS NBYTES METHOD [ COMPONENTS... ] ] */ -static inline void +static void produce_composition (struct coding_system *coding, int *charbuf, ptrdiff_t pos) { int len; @@ -6866,7 +6866,7 @@ [ -LENGTH ANNOTATION_MASK NCHARS CHARSET-ID ] */ -static inline void +static void produce_charset (struct coding_system *coding, int *charbuf, ptrdiff_t pos) { ptrdiff_t from = pos - charbuf[2]; @@ -7101,7 +7101,7 @@ position of a composition after POS (if any) or to LIMIT, and return BUF. */ -static inline int * +static int * handle_composition_annotation (ptrdiff_t pos, ptrdiff_t limit, struct coding_system *coding, int *buf, ptrdiff_t *stop) @@ -7184,7 +7184,7 @@ If the property value is nil, set *STOP to the position where the property value is non-nil (limiting by LIMIT), and return BUF. */ -static inline int * +static int * handle_charset_annotation (ptrdiff_t pos, ptrdiff_t limit, struct coding_system *coding, int *buf, ptrdiff_t *stop) @@ -8429,7 +8429,7 @@ } -static inline bool +static bool char_encodable_p (int c, Lisp_Object attrs) { Lisp_Object tail; === modified file 'src/dispnew.c' --- src/dispnew.c 2012-09-23 08:44:20 +0000 +++ src/dispnew.c 2012-10-01 06:36:54 +0000 @@ -1028,7 +1028,7 @@ these should all go together for the row's hash value to be correct. */ -static inline void +static void swap_glyph_pointers (struct glyph_row *a, struct glyph_row *b) { int i; @@ -1057,7 +1057,7 @@ that glyph pointers, the `used' counts, and the hash values in the structures are left unchanged. */ -static inline void +static void copy_row_except_pointers (struct glyph_row *to, struct glyph_row *from) { struct glyph *pointers[1 + LAST_AREA]; @@ -1084,7 +1084,7 @@ exchanged between TO and FROM. Pointers must be exchanged to avoid a memory leak. */ -static inline void +static void assign_row (struct glyph_row *to, struct glyph_row *from) { swap_glyph_pointers (to, from); @@ -1249,7 +1249,7 @@ /* Return true if the glyph rows A and B have equal contents. MOUSE_FACE_P means compare the mouse_face_p flags of A and B, too. */ -static inline bool +static bool row_equal_p (struct glyph_row *a, struct glyph_row *b, bool mouse_face_p) { eassert (verify_row_hash (a)); @@ -2657,7 +2657,7 @@ function must be called before updates to make explicit that we are working on frame matrices or not. */ -static inline void +static void set_frame_matrix_frame (struct frame *f) { frame_matrix_frame = f; @@ -2672,7 +2672,7 @@ done in frame matrices, and that we have to perform analogous operations in window matrices of frame_matrix_frame. */ -static inline void +static void make_current (struct glyph_matrix *desired_matrix, struct glyph_matrix *current_matrix, int row) { struct glyph_row *current_row = MATRIX_ROW (current_matrix, row); @@ -4158,7 +4158,7 @@ /* Add glyph row ROW to the scrolling hash table. */ -static inline struct row_entry * +static struct row_entry * add_row_entry (struct glyph_row *row) { struct row_entry *entry; === modified file 'src/eval.c' --- src/eval.c 2012-09-29 02:02:34 +0000 +++ src/eval.c 2012-10-01 06:36:54 +0000 @@ -119,13 +119,13 @@ /* Functions to set Lisp_Object slots of struct specbinding. */ -static inline void +static void set_specpdl_symbol (Lisp_Object symbol) { specpdl_ptr->symbol = symbol; } -static inline void +static void set_specpdl_old_value (Lisp_Object oldval) { specpdl_ptr->old_value = oldval; === modified file 'src/fns.c' --- src/fns.c 2012-09-30 09:18:38 +0000 +++ src/fns.c 2012-10-01 06:36:54 +0000 @@ -3695,7 +3695,7 @@ /* Resize hash table H if it's too full. If H cannot be resized because it's already too large, throw an error. */ -static inline void +static void maybe_resize_hash_table (struct Lisp_Hash_Table *h) { if (NILP (h->next_free)) === modified file 'src/frame.c' --- src/frame.c 2012-10-01 01:43:28 +0000 +++ src/frame.c 2012-10-01 06:36:54 +0000 @@ -120,12 +120,12 @@ #endif /* These setters are used only in this file, so they can be private. */ -static inline void +static void fset_buffer_predicate (struct frame *f, Lisp_Object val) { f->buffer_predicate = val; } -static inline void +static void fset_minibuffer_window (struct frame *f, Lisp_Object val) { f->minibuffer_window = val; === modified file 'src/gmalloc.c' --- src/gmalloc.c 2012-09-30 21:36:42 +0000 +++ src/gmalloc.c 2012-10-01 06:36:54 +0000 @@ -464,7 +464,7 @@ /* This is called when `_heapinfo' and `heapsize' have just been set to describe a new info table. Set up the table to describe itself and account for it in the statistics. */ -static inline void +static void register_heapinfo (void) { size_t block, blocks; === modified file 'src/intervals.c' --- src/intervals.c 2012-09-16 21:43:55 +0000 +++ src/intervals.c 2012-10-01 06:36:54 +0000 @@ -64,7 +64,7 @@ /* Use these functions to set Lisp_Object or pointer slots of struct interval. */ -static inline void +static void set_interval_object (INTERVAL i, Lisp_Object obj) { eassert (BUFFERP (obj) || STRINGP (obj)); @@ -72,13 +72,13 @@ i->up.obj = obj; } -static inline void +static void set_interval_left (INTERVAL i, INTERVAL left) { i->left = left; } -static inline void +static void set_interval_right (INTERVAL i, INTERVAL right) { i->right = right; @@ -87,7 +87,7 @@ /* Make the parent of D be whatever the parent of S is, regardless of the type. This is used when balancing an interval tree. */ -static inline void +static void copy_interval_parent (INTERVAL d, INTERVAL s) { d->up = s->up; @@ -341,7 +341,7 @@ c c */ -static inline INTERVAL +static INTERVAL rotate_right (INTERVAL interval) { INTERVAL i; @@ -388,7 +388,7 @@ c c */ -static inline INTERVAL +static INTERVAL rotate_left (INTERVAL interval) { INTERVAL i; @@ -466,7 +466,7 @@ /* Balance INTERVAL, potentially stuffing it back into its parent Lisp Object. */ -static inline INTERVAL +static INTERVAL balance_possible_root_interval (INTERVAL interval) { Lisp_Object parent; === modified file 'src/keyboard.c' --- src/keyboard.c 2012-09-23 08:44:20 +0000 +++ src/keyboard.c 2012-10-01 06:36:54 +0000 @@ -448,47 +448,47 @@ static void store_user_signal_events (void); /* These setters are used only in this file, so they can be private. */ -static inline void +static void kset_echo_string (struct kboard *kb, Lisp_Object val) { kb->INTERNAL_FIELD (echo_string) = val; } -static inline void +static void kset_kbd_queue (struct kboard *kb, Lisp_Object val) { kb->INTERNAL_FIELD (kbd_queue) = val; } -static inline void +static void kset_keyboard_translate_table (struct kboard *kb, Lisp_Object val) { kb->INTERNAL_FIELD (Vkeyboard_translate_table) = val; } -static inline void +static void kset_last_prefix_arg (struct kboard *kb, Lisp_Object val) { kb->INTERNAL_FIELD (Vlast_prefix_arg) = val; } -static inline void +static void kset_last_repeatable_command (struct kboard *kb, Lisp_Object val) { kb->INTERNAL_FIELD (Vlast_repeatable_command) = val; } -static inline void +static void kset_local_function_key_map (struct kboard *kb, Lisp_Object val) { kb->INTERNAL_FIELD (Vlocal_function_key_map) = val; } -static inline void +static void kset_overriding_terminal_local_map (struct kboard *kb, Lisp_Object val) { kb->INTERNAL_FIELD (Voverriding_terminal_local_map) = val; } -static inline void +static void kset_real_last_command (struct kboard *kb, Lisp_Object val) { kb->INTERNAL_FIELD (Vreal_last_command) = val; } -static inline void +static void kset_system_key_syms (struct kboard *kb, Lisp_Object val) { kb->INTERNAL_FIELD (system_key_syms) = val; @@ -3749,7 +3749,7 @@ /* Clear input event EVENT. */ -static inline void +static void clear_event (struct input_event *event) { event->kind = NO_EVENT; @@ -8054,7 +8054,7 @@ /* Access slot with index IDX of vector tool_bar_item_properties. */ #define PROP(IDX) AREF (tool_bar_item_properties, (IDX)) -static inline void +static void set_prop (ptrdiff_t idx, Lisp_Object val) { ASET (tool_bar_item_properties, idx, val); === modified file 'src/lread.c' --- src/lread.c 2012-09-28 07:45:18 +0000 +++ src/lread.c 2012-10-01 06:36:54 +0000 @@ -2283,7 +2283,7 @@ /* Return the digit that CHARACTER stands for in the given BASE. Return -1 if CHARACTER is out of range for BASE, and -2 if CHARACTER is not valid for any supported BASE. */ -static inline int +static int digit_to_number (int character, int base) { int digit; === modified file 'src/marker.c' --- src/marker.c 2012-09-15 07:06:56 +0000 +++ src/marker.c 2012-10-01 06:36:54 +0000 @@ -427,7 +427,7 @@ /* Change M so it points to B at CHARPOS and BYTEPOS. */ -static inline void +static void attach_marker (struct Lisp_Marker *m, struct buffer *b, ptrdiff_t charpos, ptrdiff_t bytepos) { @@ -454,7 +454,7 @@ whether BUFFER is a buffer object and return buffer pointer corresponding to BUFFER if BUFFER is live, or NULL otherwise. */ -static inline struct buffer * +static struct buffer * live_buffer (Lisp_Object buffer) { struct buffer *b; @@ -477,7 +477,7 @@ /* Internal function to set MARKER in BUFFER at POSITION. Non-zero RESTRICTED means limit the POSITION by the visible part of BUFFER. */ -static inline Lisp_Object +static Lisp_Object set_marker_internal (Lisp_Object marker, Lisp_Object position, Lisp_Object buffer, int restricted) { === modified file 'src/nsterm.m' --- src/nsterm.m 2012-09-30 12:50:09 +0000 +++ src/nsterm.m 2012-10-01 06:36:54 +0000 @@ -2171,7 +2171,7 @@ ========================================================================== */ -static inline void +static void ns_compute_glyph_string_overhangs (struct glyph_string *s) /* -------------------------------------------------------------------------- External (RIF); compute left/right overhang of whole string and set in s === modified file 'src/process.c' --- src/process.c 2012-09-23 08:44:20 +0000 +++ src/process.c 2012-10-01 06:36:54 +0000 @@ -335,82 +335,82 @@ static int pty_max_bytes; /* These setters are used only in this file, so they can be private. */ -static inline void +static void pset_buffer (struct Lisp_Process *p, Lisp_Object val) { p->buffer = val; } -static inline void +static void pset_command (struct Lisp_Process *p, Lisp_Object val) { p->command = val; } -static inline void +static void pset_decode_coding_system (struct Lisp_Process *p, Lisp_Object val) { p->decode_coding_system = val; } -static inline void +static void pset_decoding_buf (struct Lisp_Process *p, Lisp_Object val) { p->decoding_buf = val; } -static inline void +static void pset_encode_coding_system (struct Lisp_Process *p, Lisp_Object val) { p->encode_coding_system = val; } -static inline void +static void pset_encoding_buf (struct Lisp_Process *p, Lisp_Object val) { p->encoding_buf = val; } -static inline void +static void pset_filter (struct Lisp_Process *p, Lisp_Object val) { p->filter = val; } -static inline void +static void pset_log (struct Lisp_Process *p, Lisp_Object val) { p->log = val; } -static inline void +static void pset_mark (struct Lisp_Process *p, Lisp_Object val) { p->mark = val; } -static inline void +static void pset_name (struct Lisp_Process *p, Lisp_Object val) { p->name = val; } -static inline void +static void pset_plist (struct Lisp_Process *p, Lisp_Object val) { p->plist = val; } -static inline void +static void pset_sentinel (struct Lisp_Process *p, Lisp_Object val) { p->sentinel = val; } -static inline void +static void pset_status (struct Lisp_Process *p, Lisp_Object val) { p->status = val; } -static inline void +static void pset_tty_name (struct Lisp_Process *p, Lisp_Object val) { p->tty_name = val; } -static inline void +static void pset_type (struct Lisp_Process *p, Lisp_Object val) { p->type = val; } -static inline void +static void pset_write_queue (struct Lisp_Process *p, Lisp_Object val) { p->write_queue = val; === modified file 'src/syntax.c' --- src/syntax.c 2012-09-15 07:06:56 +0000 +++ src/syntax.c 2012-10-01 06:36:54 +0000 @@ -151,7 +151,7 @@ static int in_classes (int, Lisp_Object); /* This setter is used only in this file, so it can be private. */ -static inline void +static void bset_syntax_table (struct buffer *b, Lisp_Object val) { b->INTERNAL_FIELD (syntax_table) = val; @@ -372,7 +372,7 @@ /* Return the bytepos one character before BYTEPOS. We assume that BYTEPOS is not at the start of the buffer. */ -static inline ptrdiff_t +static ptrdiff_t dec_bytepos (ptrdiff_t bytepos) { if (NILP (BVAR (current_buffer, enable_multibyte_characters))) === modified file 'src/terminal.c' --- src/terminal.c 2012-09-15 07:06:56 +0000 +++ src/terminal.c 2012-10-01 06:36:54 +0000 @@ -42,7 +42,7 @@ static void delete_initial_terminal (struct terminal *); /* This setter is used only in this file, so it can be private. */ -static inline void +static void tset_param_alist (struct terminal *t, Lisp_Object val) { t->param_alist = val; === modified file 'src/textprop.c' --- src/textprop.c 2012-09-15 07:06:56 +0000 +++ src/textprop.c 2012-10-01 06:36:54 +0000 @@ -241,7 +241,7 @@ /* Return nonzero if the plist of interval I has any of the properties of PLIST, regardless of their values. */ -static inline int +static int interval_has_some_properties (Lisp_Object plist, INTERVAL i) { register Lisp_Object tail1, tail2, sym; @@ -263,7 +263,7 @@ /* Return nonzero if the plist of interval I has any of the property names in LIST, regardless of their values. */ -static inline int +static int interval_has_some_properties_list (Lisp_Object list, INTERVAL i) { register Lisp_Object tail1, tail2, sym; === modified file 'src/window.c' --- src/window.c 2012-09-30 09:10:59 +0000 +++ src/window.c 2012-10-01 06:36:54 +0000 @@ -133,102 +133,102 @@ static EMACS_INT window_scroll_preserve_vpos; /* These setters are used only in this file, so they can be private. */ -static inline void +static void wset_combination_limit (struct window *w, Lisp_Object val) { w->combination_limit = val; } -static inline void +static void wset_dedicated (struct window *w, Lisp_Object val) { w->dedicated = val; } -static inline void +static void wset_display_table (struct window *w, Lisp_Object val) { w->display_table = val; } -static inline void +static void wset_hchild (struct window *w, Lisp_Object val) { w->hchild = val; } -static inline void +static void wset_left_fringe_width (struct window *w, Lisp_Object val) { w->left_fringe_width = val; } -static inline void +static void wset_left_margin_cols (struct window *w, Lisp_Object val) { w->left_margin_cols = val; } -static inline void +static void wset_new_normal (struct window *w, Lisp_Object val) { w->new_normal = val; } -static inline void +static void wset_new_total (struct window *w, Lisp_Object val) { w->new_total = val; } -static inline void +static void wset_normal_cols (struct window *w, Lisp_Object val) { w->normal_cols = val; } -static inline void +static void wset_normal_lines (struct window *w, Lisp_Object val) { w->normal_lines = val; } -static inline void +static void wset_parent (struct window *w, Lisp_Object val) { w->parent = val; } -static inline void +static void wset_pointm (struct window *w, Lisp_Object val) { w->pointm = val; } -static inline void +static void wset_right_fringe_width (struct window *w, Lisp_Object val) { w->right_fringe_width = val; } -static inline void +static void wset_right_margin_cols (struct window *w, Lisp_Object val) { w->right_margin_cols = val; } -static inline void +static void wset_scroll_bar_width (struct window *w, Lisp_Object val) { w->scroll_bar_width = val; } -static inline void +static void wset_start (struct window *w, Lisp_Object val) { w->start = val; } -static inline void +static void wset_temslot (struct window *w, Lisp_Object val) { w->temslot = val; } -static inline void +static void wset_vchild (struct window *w, Lisp_Object val) { w->vchild = val; } -static inline void +static void wset_vertical_scroll_bar_type (struct window *w, Lisp_Object val) { w->vertical_scroll_bar_type = val; } -static inline void +static void wset_window_parameters (struct window *w, Lisp_Object val) { w->window_parameters = val; === modified file 'src/xdisp.c' --- src/xdisp.c 2012-09-30 15:49:05 +0000 +++ src/xdisp.c 2012-10-01 06:36:54 +0000 @@ -367,22 +367,22 @@ static Lisp_Object Qline_height; /* These setters are used only in this file, so they can be private. */ -static inline void +static void wset_base_line_number (struct window *w, Lisp_Object val) { w->base_line_number = val; } -static inline void +static void wset_base_line_pos (struct window *w, Lisp_Object val) { w->base_line_pos = val; } -static inline void +static void wset_column_number_displayed (struct window *w, Lisp_Object val) { w->column_number_displayed = val; } -static inline void +static void wset_region_showing (struct window *w, Lisp_Object val) { w->region_showing = val; @@ -1191,7 +1191,7 @@ *BOTTOM_RIGHT_Y the coordinates of the bottom-right corner of the box. */ -static inline void +static void window_box_edges (struct window *w, int area, int *top_left_x, int *top_left_y, int *bottom_right_x, int *bottom_right_y) { @@ -1278,7 +1278,7 @@ /* Limit insanely large values of W->hscroll on frame F to the largest value that will still prevent first_visible_x and last_visible_x of 'struct it' from overflowing an int. */ -static inline int +static int window_hscroll_limited (struct window *w, struct frame *f) { ptrdiff_t window_hscroll = w->hscroll; @@ -1625,7 +1625,7 @@ returns an invalid character. If we find one, we return a `?', but with the length of the invalid character. */ -static inline int +static int string_char_and_length (const unsigned char *str, int *len) { int c; @@ -1673,7 +1673,7 @@ /* Value is the text position, i.e. character and byte position, for character position CHARPOS in STRING. */ -static inline struct text_pos +static struct text_pos string_pos (ptrdiff_t charpos, Lisp_Object string) { struct text_pos pos; @@ -12577,7 +12577,7 @@ buffer position, END is given as a distance from Z. Used in redisplay_internal for display optimization. */ -static inline int +static int text_outside_line_unchanged_p (struct window *w, ptrdiff_t start, ptrdiff_t end) { @@ -12838,7 +12838,7 @@ /* Reconsider the setting of B->clip_changed which is displayed in window W. */ -static inline void +static void reconsider_clip_changes (struct window *w, struct buffer *b) { if (b->clip_changed @@ -14538,7 +14538,7 @@ We assume that the window's buffer is really current. */ -static inline struct text_pos +static struct text_pos run_window_scroll_functions (Lisp_Object window, struct text_pos startp) { struct window *w = XWINDOW (window); @@ -22491,7 +22491,7 @@ /* Append the list of glyph strings with head H and tail T to the list with head *HEAD and tail *TAIL. Set *HEAD and *TAIL to the result. */ -static inline void +static void append_glyph_string_lists (struct glyph_string **head, struct glyph_string **tail, struct glyph_string *h, struct glyph_string *t) { @@ -22511,7 +22511,7 @@ list with head *HEAD and tail *TAIL. Set *HEAD and *TAIL to the result. */ -static inline void +static void prepend_glyph_string_lists (struct glyph_string **head, struct glyph_string **tail, struct glyph_string *h, struct glyph_string *t) { @@ -22530,7 +22530,7 @@ /* Append glyph string S to the list with head *HEAD and tail *TAIL. Set *HEAD and *TAIL to the resulting list. */ -static inline void +static void append_glyph_string (struct glyph_string **head, struct glyph_string **tail, struct glyph_string *s) { @@ -22545,7 +22545,7 @@ Value is a pointer to a realized face that is ready for display if DISPLAY_P is non-zero. */ -static inline struct face * +static struct face * get_char_face_and_encoding (struct frame *f, int c, int face_id, XChar2b *char2b, int display_p) { @@ -22578,7 +22578,7 @@ The encoding of GLYPH->u.ch is returned in *CHAR2B. Value is a pointer to a realized face that is ready for display. */ -static inline struct face * +static struct face * get_glyph_face_and_encoding (struct frame *f, struct glyph *glyph, XChar2b *char2b, int *two_byte_p) { @@ -22615,7 +22615,7 @@ /* Get glyph code of character C in FONT in the two-byte form CHAR2B. Return 1 if FONT has a glyph for C, otherwise return 0. */ -static inline int +static int get_char_glyph_code (int c, struct font *font, XChar2b *char2b) { unsigned code; @@ -23089,7 +23089,7 @@ first glyph following S. LAST_X is the right-most x-position + 1 in the drawing area. */ -static inline void +static void set_glyph_string_background_width (struct glyph_string *s, int start, int last_x) { /* If the face of this glyph string has to be drawn to the end of @@ -23650,7 +23650,7 @@ /* Store one glyph for IT->char_to_display in IT->glyph_row. Called from x_produce_glyphs when IT->glyph_row is non-null. */ -static inline void +static void append_glyph (struct it *it) { struct glyph *glyph; @@ -23724,7 +23724,7 @@ IT->glyph_row. Called from x_produce_glyphs when IT->glyph_row is non-null. */ -static inline void +static void append_composite_glyph (struct it *it) { struct glyph *glyph; @@ -23793,7 +23793,7 @@ /* Change IT->ascent and IT->height according to the setting of IT->voffset. */ -static inline void +static void take_vertical_position_into_account (struct it *it) { if (it->voffset) === modified file 'src/xfaces.c' --- src/xfaces.c 2012-09-24 21:38:23 +0000 +++ src/xfaces.c 2012-10-01 06:36:54 +0000 @@ -601,7 +601,7 @@ /* Create and return a GC for use on frame F. GC values and mask are given by XGCV and MASK. */ -static inline GC +static GC x_create_gc (struct frame *f, long unsigned int mask, XGCValues *xgcv) { GC gc; @@ -615,7 +615,7 @@ /* Free GC which was used on frame F. */ -static inline void +static void x_free_gc (struct frame *f, GC gc) { eassert (input_blocked_p ()); @@ -628,7 +628,7 @@ #ifdef WINDOWSNT /* W32 emulation of GCs */ -static inline GC +static GC x_create_gc (struct frame *f, unsigned long mask, XGCValues *xgcv) { GC gc; @@ -642,7 +642,7 @@ /* Free GC which was used on frame F. */ -static inline void +static void x_free_gc (struct frame *f, GC gc) { IF_DEBUG (eassert (--ngcs >= 0)); @@ -654,7 +654,7 @@ #ifdef HAVE_NS /* NS emulation of GCs */ -static inline GC +static GC x_create_gc (struct frame *f, unsigned long mask, XGCValues *xgcv) @@ -664,7 +664,7 @@ return gc; } -static inline void +static void x_free_gc (struct frame *f, GC gc) { xfree (gc); @@ -677,7 +677,7 @@ CHECK_LIVE_FRAME. This is here because it's a frequent pattern in Lisp function definitions. */ -static inline struct frame * +static struct frame * frame_or_selected_frame (Lisp_Object frame, int nparam) { if (NILP (frame)) @@ -1920,7 +1920,7 @@ FACE_NAME and NAMED_MERGE_POINT_KIND, as the head of the linked list pointed to by NAMED_MERGE_POINTS, and return 1. */ -static inline int +static int push_named_merge_point (struct named_merge_point *new_named_merge_point, Lisp_Object face_name, enum named_merge_point_kind named_merge_point_kind, @@ -2004,7 +2004,7 @@ face text properties; Ediff uses that). If SIGNAL_P is non-zero, signal an error if FACE_NAME is not a valid face name. If SIGNAL_P is zero, value is nil if FACE_NAME is not a valid face name. */ -static inline Lisp_Object +static Lisp_Object lface_from_face_name_no_resolve (struct frame *f, Lisp_Object face_name, int signal_p) { @@ -2033,7 +2033,7 @@ non-zero, signal an error if FACE_NAME is not a valid face name. If SIGNAL_P is zero, value is nil if FACE_NAME is not a valid face name. */ -static inline Lisp_Object +static Lisp_Object lface_from_face_name (struct frame *f, Lisp_Object face_name, int signal_p) { face_name = resolve_face_name (face_name, signal_p); @@ -2047,7 +2047,7 @@ is non-zero, signal an error if FACE_NAME does not name a face. Otherwise, value is zero if FACE_NAME is not a face. */ -static inline int +static int get_lface_attributes_no_remap (struct frame *f, Lisp_Object face_name, Lisp_Object *attrs, int signal_p) { @@ -2069,7 +2069,7 @@ non-zero, signal an error if FACE_NAME does not name a face. Otherwise, value is zero if FACE_NAME is not a face. */ -static inline int +static int get_lface_attributes (struct frame *f, Lisp_Object face_name, Lisp_Object *attrs, int signal_p, struct named_merge_point *named_merge_points) @@ -2234,7 +2234,7 @@ loops in face inheritance/remapping; it should be 0 when called from other places. */ -static inline void +static void merge_face_vectors (struct frame *f, Lisp_Object *from, Lisp_Object *to, struct named_merge_point *named_merge_points) { @@ -3906,7 +3906,7 @@ all attributes are `equal'. Tries to be fast because this function is called quite often. */ -static inline int +static int face_attr_equal_p (Lisp_Object v1, Lisp_Object v2) { /* Type can differ, e.g. when one attribute is unspecified, i.e. nil, @@ -3939,7 +3939,7 @@ all attributes are `equal'. Tries to be fast because this function is called quite often. */ -static inline int +static int lface_equal_p (Lisp_Object *v1, Lisp_Object *v2) { int i, equal_p = 1; @@ -4024,7 +4024,7 @@ /* Return a hash code for Lisp string STRING with case ignored. Used below in computing a hash value for a Lisp face. */ -static inline unsigned +static unsigned hash_string_case_insensitive (Lisp_Object string) { const unsigned char *s; @@ -4038,7 +4038,7 @@ /* Return a hash code for face attribute vector V. */ -static inline unsigned +static unsigned lface_hash (Lisp_Object *v) { return (hash_string_case_insensitive (v[LFACE_FAMILY_INDEX]) @@ -4057,7 +4057,7 @@ family, point size, weight, width, slant, and font. Both LFACE1 and LFACE2 must be fully-specified. */ -static inline int +static int lface_same_font_attributes_p (Lisp_Object *lface1, Lisp_Object *lface2) { eassert (lface_fully_specified_p (lface1) @@ -4453,7 +4453,7 @@ Value is the ID of the face found. If no suitable face is found, realize a new one. */ -static inline int +static int lookup_face (struct frame *f, Lisp_Object *attr) { struct face_cache *cache = FRAME_FACE_CACHE (f); === modified file 'src/xml.c' --- src/xml.c 2012-09-23 09:16:57 +0000 +++ src/xml.c 2012-10-01 06:36:54 +0000 @@ -73,7 +73,7 @@ #define fn_xmlCleanupParser xmlCleanupParser #define fn_xmlCheckVersion xmlCheckVersion -static inline int +static int libxml2_loaded_p (void) { return 1; === modified file 'src/xterm.c' --- src/xterm.c 2012-09-24 21:38:23 +0000 +++ src/xterm.c 2012-10-01 06:36:54 +0000 @@ -1027,7 +1027,7 @@ Faces to use in the mode line have already been computed when the matrix was built, so there isn't much to do, here. */ -static inline void +static void x_set_mode_line_face_gc (struct glyph_string *s) { s->gc = s->face->gc; @@ -1038,7 +1038,7 @@ S->stippled_p to a non-zero value if the face of S has a stipple pattern. */ -static inline void +static void x_set_glyph_string_gc (struct glyph_string *s) { PREPARE_FACE_FOR_DISPLAY (s->f, s->face); @@ -1083,7 +1083,7 @@ /* Set clipping for output of glyph string S. S may be part of a mode line or menu if we don't have X toolkit support. */ -static inline void +static void x_set_glyph_string_clipping (struct glyph_string *s) { XRectangle *r = s->clip; @@ -1156,7 +1156,7 @@ /* Fill rectangle X, Y, W, H with background color of glyph string S. */ -static inline void +static void x_clear_glyph_string_rect (struct glyph_string *s, int x, int y, int w, int h) { XGCValues xgcv; ------------------------------------------------------------ revno: 110314 committer: Paul Eggert branch nick: trunk timestamp: Sun 2012-09-30 23:19:52 -0700 message: * bidi.c: Tune. (bidi_copy_it): Do the whole copy with a single memcpy. (bidi_char_at_pos): Merge the two STRING_CHAR calls into one. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-10-01 02:07:14 +0000 +++ src/ChangeLog 2012-10-01 06:19:52 +0000 @@ -1,5 +1,9 @@ 2012-10-01 Paul Eggert + * bidi.c: Tune. + (bidi_copy_it): Do the whole copy with a single memcpy. + (bidi_char_at_pos): Merge the two STRING_CHAR calls into one. + Revert the FOLLOW-SYMLINKS change for file-attributes. Doing it right would require several changes to Tramp, and there's not enough time to get that tested before the freeze today. === modified file 'src/bidi.c' --- src/bidi.c 2012-09-15 07:06:56 +0000 +++ src/bidi.c 2012-10-01 06:19:52 +0000 @@ -298,15 +298,11 @@ static inline void bidi_copy_it (struct bidi_it *to, struct bidi_it *from) { - int i; - - /* Copy everything except the level stack and beyond. */ - memcpy (to, from, offsetof (struct bidi_it, level_stack[0])); - - /* Copy the active part of the level stack. */ - to->level_stack[0] = from->level_stack[0]; /* level zero is always in use */ - for (i = 1; i <= from->stack_idx; i++) - to->level_stack[i] = from->level_stack[i]; + /* Copy everything from the start through the active part of + the level stack. */ + memcpy (to, from, + (offsetof (struct bidi_it, level_stack[1]) + + from->stack_idx * sizeof from->level_stack[0])); } @@ -896,7 +892,7 @@ return p - start; } -/* Fetch and returns the character at byte position BYTEPOS. If S is +/* Fetch and return the character at byte position BYTEPOS. If S is non-NULL, fetch the character from string S; otherwise fetch the character from the current buffer. UNIBYTE means S is a unibyte string. */ @@ -905,13 +901,13 @@ { if (s) { + s += bytepos; if (unibyte) - return s[bytepos]; - else - return STRING_CHAR (s + bytepos); + return *s; } else - return FETCH_MULTIBYTE_CHAR (bytepos); + s = BYTE_POS_ADDR (bytepos); + return STRING_CHAR (s); } /* Fetch and return the character at BYTEPOS/CHARPOS. If that ------------------------------------------------------------ revno: 110313 committer: Bastien Guerry branch nick: trunk timestamp: Mon 2012-10-01 07:48:54 +0200 message: Complete previous commit. diff: === modified file 'etc/refcards/orgcard.tex' --- etc/refcards/orgcard.tex 2012-09-30 15:14:59 +0000 +++ etc/refcards/orgcard.tex 2012-10-01 05:48:54 +0000 @@ -1,5 +1,5 @@ % Reference Card for Org Mode -\def\orgversionnumber{7.9} +\def\orgversionnumber{7.9.2} \def\versionyear{2012} % latest update \input emacsver.tex ------------------------------------------------------------ revno: 110312 committer: Bastien Guerry branch nick: trunk timestamp: Mon 2012-10-01 07:48:21 +0200 message: etc/refcards/orgcard.tex: Update and add a ChangeLog entry. diff: === modified file 'etc/ChangeLog' --- etc/ChangeLog 2012-10-01 05:39:33 +0000 +++ etc/ChangeLog 2012-10-01 05:48:21 +0000 @@ -11,6 +11,10 @@ Revert the FOLLOW-SYMLINKS change for file-attributes. * NEWS: Undo last change. +2012-09-30 Bastien Guerry + + * refcards/orgcard.tex: Update version number. + 2012-09-30 Jambunathan K * org/OrgOdtContentTemplate.xml: ------------------------------------------------------------ revno: 110311 committer: Bastien Guerry branch nick: trunk timestamp: Mon 2012-10-01 07:41:14 +0200 message: Remove duplicate ChangeLog entry. Thanks to Glenn Morris for pointing at this. diff: === modified file 'lisp/org/ChangeLog' --- lisp/org/ChangeLog 2012-09-30 15:14:59 +0000 +++ lisp/org/ChangeLog 2012-10-01 05:41:14 +0000 @@ -21,12 +21,6 @@ `ess-ask-for-ess-directory´ and `ess-local-process-name´. Remove second declaration for `ess-local-process-name´. - * org-id.el: Do not use (random t), we just want a new random - number, not a re-seeding of the PRNG for which (random t) doesn't - provide enough entropy anyway. Even if (random) would always - produce the same sequence, the other components going into the MD5 - hash ensure that the result will be unique. - * org-gnus.el: Add a missing require for gnus-util. * org-compat.el: Rename utils to make throughout. ------------------------------------------------------------ revno: 110310 committer: Bastien Guerry branch nick: trunk timestamp: Mon 2012-10-01 07:39:33 +0200 message: Add a ChangeLog entry for modifications in etc/org/*xml. Thanks to Glenn Morris for pointing at this. diff: === modified file 'etc/ChangeLog' --- etc/ChangeLog 2012-10-01 03:17:02 +0000 +++ etc/ChangeLog 2012-10-01 05:39:33 +0000 @@ -11,6 +11,11 @@ Revert the FOLLOW-SYMLINKS change for file-attributes. * NEWS: Undo last change. +2012-09-30 Jambunathan K + + * org/OrgOdtContentTemplate.xml: + * org/OrgOdtStyles.xml: Add Listing-related entries. + 2012-09-30 Paul Eggert file-attributes has a new optional arg FOLLOW-SYMLINKS. ------------------------------------------------------------ revno: 110309 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12508 committer: Stefan Monnier branch nick: trunk timestamp: Mon 2012-10-01 00:45:32 -0400 message: * lisp/emacs-lisp/bytecomp.el (byte-compiler-abbreviate-file): New function. (byte-compile-warning-prefix, byte-compile-file): Use it. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-10-01 03:44:59 +0000 +++ lisp/ChangeLog 2012-10-01 04:45:32 +0000 @@ -1,3 +1,8 @@ +2012-10-01 Stefan Monnier + + * emacs-lisp/bytecomp.el (byte-compiler-abbreviate-file): New function. + (byte-compile-warning-prefix, byte-compile-file): Use it (bug#12508). + 2012-10-01 Karl Fogel * bookmark.el (bookmark-version-control): Give tags in the @@ -19,8 +24,8 @@ Shell output catching a la gud-gdb. * progmodes/python.el (python-shell-fetch-lines-in-progress) - (python-shell-fetch-lines-string, python-shell-fetched-lines): New - Vars. + (python-shell-fetch-lines-string, python-shell-fetched-lines): + New Vars. (python-shell-fetch-lines-filter): New function. (python-shell-send-string-no-output): Use them. @@ -51,12 +56,12 @@ version of the original ChangeLog can be found in the commit log. * textmodes/reftex-auc.el: Move `provide' call to bottom of file. - (reftex-arg-cite): Use `reftex-cite-key-separator'. Correctly - handle new value type returned by `reftex-citation'. + (reftex-arg-cite): Use `reftex-cite-key-separator'. + Correctly handle new value type returned by `reftex-citation'. * textmodes/reftex-cite.el (reftex-create-bibtex-file): Make sure - that entries with whitespace at various places are found. Doc - fix. Include entries that are cross-referenced from cited entries. + that entries with whitespace at various places are found. + Doc fix. Include entries that are cross-referenced from cited entries. Include @String definitions in the resulting bib file. Add header and footer defined in `reftex-create-bibtex-header' and `reftex-create-bibtex-footer'. @@ -75,10 +80,10 @@ (reftex-extract-bib-entries-from-thebibliography): Match \bibitem entries with spaces or tabs in front of arguments. (reftex-pop-to-bibtex-entry, reftex-extract-bib-entries) - (reftex-parse-bibtex-entry, reftex-create-bibtex-file): Match - entries containing numbers and symbol constituents. - (reftex-do-citation, reftex-figure-out-cite-format): Use - `reftex-cite-key-separator'. + (reftex-parse-bibtex-entry, reftex-create-bibtex-file): + Match entries containing numbers and symbol constituents. + (reftex-do-citation, reftex-figure-out-cite-format): + Use `reftex-cite-key-separator'. * textmodes/reftex-dcr.el: Move provide statement to end of file. (reftex-mouse-view-crossref): Explain why point is set. @@ -98,21 +103,21 @@ prevents fontification of quoted content. (reftex-index-phrases-mode): Use it. - * textmodes/reftex-parse.el (reftex-parse-from-file): Move - backward one char if a `\' was matched after a section macro. + * textmodes/reftex-parse.el (reftex-parse-from-file): + Move backward one char if a `\' was matched after a section macro. (reftex-parse-from-file): Use beginning of match instead of end as bound. * textmodes/reftex-ref.el: Adapt creation of `reftex--' functions to new structure of `reftex-ref-style-alist'. - (reftex-reference): Use `reftex-ref-style-list' function. Adapt - to new structure of `reftex-ref-style-alist'. Prompt for a + (reftex-reference): Use `reftex-ref-style-list' function. + Adapt to new structure of `reftex-ref-style-alist'. Prompt for a reference macro if `reftex-ref-macro-prompt' is non-nil. (reftex-reference): Pass refstyle to `reftex-format-special'. Determine reference macro by looking at - `reftex-ref-style-default-list' and `reftex-ref-style-alist'. Use - only one special format function. + `reftex-ref-style-default-list' and `reftex-ref-style-alist'. + Use only one special format function. (reftex-varioref-vref, reftex-fancyref-fref) (reftex-fancyref-Fref): Remove definitions. The functions are now generated from `reftex-ref-style-alist'. @@ -132,8 +137,8 @@ through reference styles. Add `p' for switching between number and page reference types. - * textmodes/reftex-toc.el (reftex-re-enlarge): Call - `enlarge-window' only if there is something to do because in Emacs + * textmodes/reftex-toc.el (reftex-re-enlarge): + Call `enlarge-window' only if there is something to do because in Emacs the horizontal version throws an error even if the parameter is 0. * textmodes/reftex-vars.el (reftex-label-alist): Doc fix. @@ -142,21 +147,21 @@ string. Adapt to new name. (reftex-ref-style-alist): Change structure so that it is not possible to use multiple different package names within a style. - Remove the symbols for symbols for macro type distinction. Add - characters for macro selection. + Remove the symbols for symbols for macro type distinction. + Add characters for macro selection. (reftex-ref-macro-prompt, reftex-create-bibtex-header) (reftex-create-bibtex-footer): New variables. (reftex-format-ref-function): Mention third argument of special format function. - (reftex-ref-style-alist, reftex-ref-style-default-list): New - variables. + (reftex-ref-style-alist, reftex-ref-style-default-list): + New variables. (reftex-vref-is-default, reftex-fref-is-default): Adapt doc string to new implementation. Mark as obsolete. Add compatibility code for honoring the variable values in case they are set. - (reftex-cite-format-builtin, reftex-bibliography-commands): Add - support for ConTeXt. - (reftex-format-ref-function, reftex-format-cite-function): Fix - custom type. + (reftex-cite-format-builtin, reftex-bibliography-commands): + Add support for ConTeXt. + (reftex-format-ref-function, reftex-format-cite-function): + Fix custom type. (reftex-cite-key-separator): New variable. * textmodes/reftex.el (reftex-syntax-table-for-bib) @@ -166,8 +171,8 @@ work. (reftex-in-comment): Do not error out if `comment-start-skip' is not set. Deal correctly with escaped comment characters. - (reftex-tie-multifile-symbols): Add doc string. Initialize - `reftex-ref-style-list'. + (reftex-tie-multifile-symbols): Add doc string. + Initialize `reftex-ref-style-list'. (reftex-untie-multifile-symbols): Add doc string. (reftex-add-index-macros): Doc fix. (reftex-ref-style-activate, reftex-ref-style-toggle) @@ -188,8 +193,8 @@ 2012-09-30 Fabián Ezequiel Gallina Enhancements for triple-quote string syntax. - * progmodes/python.el (python-syntax-propertize-function): Match - both quote cases in one regexp. + * progmodes/python.el (python-syntax-propertize-function): + Match both quote cases in one regexp. (python-syntax-stringify): Handle matches properly. 2012-09-30 Juri Linkov @@ -223,10 +228,10 @@ In buffer display functions handle window-height/window-width alist entries. Suggested by Juri Linkov as fix for Bug#1806. - * window.el (window--display-buffer): New argument ALIST. Obey - window-height and window-width alist entries. - (window--try-to-split-window): New argument ALIST. Bind - window-combination-limit to t when the window's size shall be + * window.el (window--display-buffer): New argument ALIST. + Obey window-height and window-width alist entries. + (window--try-to-split-window): New argument ALIST. + Bind window-combination-limit to t when the window's size shall be changed and window-combination-limit equals `window-size'. (display-buffer-in-atom-window) (display-buffer-in-major-side-window) @@ -249,8 +254,8 @@ temp-buffer-resize-regexps. Use fit-frame-to-buffer instead of temp-buffer-resize-frames. - * dired.el (dired-mark-pop-up): Call - display-buffer-below-selected with a fit-window-to-buffer alist + * dired.el (dired-mark-pop-up): + Call display-buffer-below-selected with a fit-window-to-buffer alist entry. 2012-09-30 Chong Yidong @@ -348,8 +353,8 @@ 2012-09-28 Leo Liu - * pcomplete.el (pcomplete-show-completions): Use - minibuffer-message to make pcomplete usable in minibuffer. + * pcomplete.el (pcomplete-show-completions): + Use minibuffer-message to make pcomplete usable in minibuffer. * ido.el (ido-set-matches-1): Fix 2012-09-11 change. === modified file 'lisp/emacs-lisp/bytecomp.el' --- lisp/emacs-lisp/bytecomp.el 2012-09-28 23:30:52 +0000 +++ lisp/emacs-lisp/bytecomp.el 2012-10-01 04:45:32 +0000 @@ -1005,13 +1005,20 @@ (defvar byte-compile-root-dir nil "Directory relative to which file names in error messages are written.") +;; FIXME: We should maybe extend abbreviate-file-name with an optional DIR +;; argument to try and use a relative file-name. +(defun byte-compile-abbreviate-file (file &optional dir) + (let ((f1 (abbreviate-file-name file)) + (f2 (file-relative-name file dir))) + (if (< (length f2) (length f1)) f2 f1))) + ;; This is used as warning-prefix for the compiler. ;; It is always called with the warnings buffer current. (defun byte-compile-warning-prefix (level entry) (let* ((inhibit-read-only t) (dir (or byte-compile-root-dir default-directory)) (file (cond ((stringp byte-compile-current-file) - (format "%s:" (file-relative-name + (format "%s:" (byte-compile-abbreviate-file byte-compile-current-file dir))) ((bufferp byte-compile-current-file) (format "Buffer %s:" @@ -1019,7 +1026,8 @@ ;; We might be simply loading a file that ;; contains explicit calls to byte-compile functions. ((stringp load-file-name) - (format "%s:" (file-relative-name load-file-name dir))) + (format "%s:" (byte-compile-abbreviate-file + load-file-name dir))) (t ""))) (pos (if (and byte-compile-current-file (integerp byte-compile-read-position)) @@ -1746,11 +1754,11 @@ (if (with-current-buffer input-buffer no-byte-compile) (progn ;; (message "%s not compiled because of `no-byte-compile: %s'" - ;; (file-relative-name filename) + ;; (byte-compile-abbreviate-file filename) ;; (with-current-buffer input-buffer no-byte-compile)) (when (file-exists-p target-file) (message "%s deleted because of `no-byte-compile: %s'" - (file-relative-name target-file) + (byte-compile-abbreviate-file target-file) (buffer-local-value 'no-byte-compile input-buffer)) (condition-case nil (delete-file target-file) (error nil))) ;; We successfully didn't compile this file. ------------------------------------------------------------ revno: 110308 committer: Karl Fogel branch nick: trunk timestamp: Sun 2012-09-30 23:15:48 -0500 message: * lisp/bookmark.el (bookmark-version-control): Use Drew's slightly better wording from (Bug#12309). diff: === modified file 'lisp/bookmark.el' --- lisp/bookmark.el 2012-10-01 03:44:59 +0000 +++ lisp/bookmark.el 2012-10-01 04:15:48 +0000 @@ -105,8 +105,8 @@ just use the value of `version-control'." :type '(choice (const :tag "If existing" nil) (const :tag "Never" never) - (const :tag "Use the value of `version-control'" nospecial) - (const :tag "Always" t)) + (const :tag "Use value of option `version-control'" nospecial) + (other :tag "Always" t)) :group 'bookmark) ------------------------------------------------------------ revno: 110307 committer: Karl Fogel branch nick: trunk timestamp: Sun 2012-09-30 22:44:59 -0500 message: * lisp/bookmark.el (bookmark-write-file): Bind `print-circle' to `t' here to allow circular custom bookmark types. (Bug#12503) diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-10-01 03:32:06 +0000 +++ lisp/ChangeLog 2012-10-01 03:44:59 +0000 @@ -2,6 +2,8 @@ * bookmark.el (bookmark-version-control): Give tags in the :type choices (Bug#12309), and improve doc string. + (bookmark-write-file): Bind `print-circle' to `t' to allow + circular custom bookmark types. (Bug#12503) 2012-10-01 Paul Eggert === modified file 'lisp/bookmark.el' --- lisp/bookmark.el 2012-10-01 03:34:02 +0000 +++ lisp/bookmark.el 2012-10-01 03:44:59 +0000 @@ -1359,7 +1359,12 @@ (goto-char (point-min)) (delete-region (point-min) (point-max)) (let ((print-length nil) - (print-level nil)) + (print-level nil) + ;; See bug #12503 for why we bind `print-circle'. Users + ;; can define their own bookmark types, which can result in + ;; arbitrary Lisp objects being stored in bookmark records, + ;; and some users create objects containing circularities. + (print-circle t)) (bookmark-insert-file-format-version-stamp) (insert "(") ;; Rather than a single call to `pp' we make one per bookmark. ------------------------------------------------------------ revno: 110306 committer: Karl Fogel branch nick: trunk timestamp: Sun 2012-09-30 22:34:02 -0500 message: Fix indentation TAB accidentally introduced in revno 110305 (kfogel@red-bean.com-20121001033206-5eja4ztyhs1sjm7q). diff: === modified file 'lisp/bookmark.el' --- lisp/bookmark.el 2012-10-01 03:32:06 +0000 +++ lisp/bookmark.el 2012-10-01 03:34:02 +0000 @@ -106,7 +106,7 @@ :type '(choice (const :tag "If existing" nil) (const :tag "Never" never) (const :tag "Use the value of `version-control'" nospecial) - (const :tag "Always" t)) + (const :tag "Always" t)) :group 'bookmark) ------------------------------------------------------------ revno: 110305 committer: Karl Fogel branch nick: trunk timestamp: Sun 2012-09-30 22:32:06 -0500 message: * lisp/bookmark.el (bookmark-version-control): Give tags in the :type choices (Bug#12309), and improve doc string. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-10-01 02:07:14 +0000 +++ lisp/ChangeLog 2012-10-01 03:32:06 +0000 @@ -1,3 +1,8 @@ +2012-10-01 Karl Fogel + + * bookmark.el (bookmark-version-control): Give tags in the + :type choices (Bug#12309), and improve doc string. + 2012-10-01 Paul Eggert Revert the FOLLOW-SYMLINKS change for file-attributes. === modified file 'lisp/bookmark.el' --- lisp/bookmark.el 2012-09-25 04:13:02 +0000 +++ lisp/bookmark.el 2012-10-01 03:32:06 +0000 @@ -99,12 +99,14 @@ (defcustom bookmark-version-control 'nospecial "Whether or not to make numbered backups of the bookmark file. -It can have four values: t, nil, `never', and `nospecial'. +It can have four values: t, nil, `never', or `nospecial'. The first three have the same meaning that they do for the -variable `version-control', and the final value `nospecial' means just -use the value of `version-control'." - :type '(choice (const nil) (const never) (const nospecial) - (other t)) +variable `version-control'; the value `nospecial' (the default) means +just use the value of `version-control'." + :type '(choice (const :tag "If existing" nil) + (const :tag "Never" never) + (const :tag "Use the value of `version-control'" nospecial) + (const :tag "Always" t)) :group 'bookmark) ------------------------------------------------------------ revno: 110304 fixes bug: http://debbugs.gnu.org/12536 committer: Chong Yidong branch nick: trunk timestamp: Mon 2012-10-01 11:17:02 +0800 message: Remove Emacs 22 icons. * images/icons/hicolor/32x32/apps/emacs22.png: * images/icons/hicolor/16x16/apps/emacs22.png: * images/icons/hicolor/48x48/apps/emacs22.png: * images/icons/hicolor/24x24/apps/emacs22.png: Remove old icons. diff: === modified file 'etc/ChangeLog' --- etc/ChangeLog 2012-10-01 02:07:14 +0000 +++ etc/ChangeLog 2012-10-01 03:17:02 +0000 @@ -1,3 +1,11 @@ +2012-10-01 Chong Yidong + + * images/icons/hicolor/32x32/apps/emacs22.png: + * images/icons/hicolor/16x16/apps/emacs22.png: + * images/icons/hicolor/48x48/apps/emacs22.png: + * images/icons/hicolor/24x24/apps/emacs22.png: Remove old icons + (Bug#12536). + 2012-10-01 Paul Eggert Revert the FOLLOW-SYMLINKS change for file-attributes. === removed file 'etc/images/icons/hicolor/16x16/apps/emacs22.png' Binary files etc/images/icons/hicolor/16x16/apps/emacs22.png 2008-03-03 08:58:35 +0000 and etc/images/icons/hicolor/16x16/apps/emacs22.png 1970-01-01 00:00:00 +0000 differ === removed file 'etc/images/icons/hicolor/24x24/apps/emacs22.png' Binary files etc/images/icons/hicolor/24x24/apps/emacs22.png 2008-03-03 08:58:41 +0000 and etc/images/icons/hicolor/24x24/apps/emacs22.png 1970-01-01 00:00:00 +0000 differ === removed file 'etc/images/icons/hicolor/32x32/apps/emacs22.png' Binary files etc/images/icons/hicolor/32x32/apps/emacs22.png 2008-03-03 08:58:47 +0000 and etc/images/icons/hicolor/32x32/apps/emacs22.png 1970-01-01 00:00:00 +0000 differ === removed file 'etc/images/icons/hicolor/48x48/apps/emacs22.png' Binary files etc/images/icons/hicolor/48x48/apps/emacs22.png 2008-03-03 08:58:53 +0000 and etc/images/icons/hicolor/48x48/apps/emacs22.png 1970-01-01 00:00:00 +0000 differ ------------------------------------------------------------ revno: 110303 committer: Paul Eggert branch nick: trunk timestamp: Sun 2012-09-30 19:07:14 -0700 message: Revert the FOLLOW-SYMLINKS change for file-attributes. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2012-09-30 21:12:04 +0000 +++ doc/lispref/ChangeLog 2012-10-01 02:07:14 +0000 @@ -1,3 +1,8 @@ +2012-10-01 Paul Eggert + + Revert the FOLLOW-SYMLINKS change for file-attributes. + * files.texi (File Attributes, Magic File Names): Undo last change. + 2012-09-30 Paul Eggert file-attributes has a new optional arg FOLLOW-SYMLINKS. === modified file 'doc/lispref/files.texi' --- doc/lispref/files.texi 2012-09-30 21:12:04 +0000 +++ doc/lispref/files.texi 2012-10-01 02:07:14 +0000 @@ -1187,7 +1187,7 @@ @end example @end defun -@defun file-attributes filename &optional id-format follow-symlinks +@defun file-attributes filename &optional id-format @anchor{Definition of file-attributes} This function returns a list of attributes of file @var{filename}. If the specified file cannot be opened, it returns @code{nil}. @@ -1197,9 +1197,6 @@ the default, but we plan to change that, so you should specify a non-@code{nil} value for @var{id-format} if you use the returned @acronym{UID} or @acronym{GID}. -The optional parameter @var{follow-symlinks} says whether to follow -@var{filename} if it is a symbolic link; if @code{t}, symbolic links -are followed and if @code{nil} they are not. The elements of the list, in order, are: @@ -2964,7 +2961,8 @@ (let ((remote-file-name-inhibit-cache (- display-time-interval 5))) (and (file-exists-p file) - (< 0 (nth 7 (file-attributes file nil t)))))) + (< 0 (nth 7 (file-attributes + (file-chase-links file))))))) @end example @end defopt === modified file 'etc/ChangeLog' --- etc/ChangeLog 2012-09-30 21:12:04 +0000 +++ etc/ChangeLog 2012-10-01 02:07:14 +0000 @@ -1,3 +1,8 @@ +2012-10-01 Paul Eggert + + Revert the FOLLOW-SYMLINKS change for file-attributes. + * NEWS: Undo last change. + 2012-09-30 Paul Eggert file-attributes has a new optional arg FOLLOW-SYMLINKS. === modified file 'etc/NEWS' --- etc/NEWS 2012-09-30 21:12:04 +0000 +++ etc/NEWS 2012-10-01 02:07:14 +0000 @@ -807,11 +807,6 @@ accessed via the new timer--psecs accessor. +++ -** file-attributes has a new optional argument FOLLOW-SYMLINKS -that says whether to follow symbolic links. The default, as before, -is to not follow symlinks. - -+++ ** Floating point functions now always return special values like NaN, instead of signaling errors, if given invalid args, e.g. (log -1.0). Previously, they returned NaNs on some platforms but signaled errors === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-10-01 01:46:06 +0000 +++ lisp/ChangeLog 2012-10-01 02:07:14 +0000 @@ -1,5 +1,9 @@ 2012-10-01 Paul Eggert + Revert the FOLLOW-SYMLINKS change for file-attributes. + * files.el (remote-file-name-inhibit-cache, after-find-file): + * time.el (display-time-file-nonempty-p): Undo last change. + * profiler.el (profiler-sampling-interval): Change default back to 1. See Stefan Monnier in . === modified file 'lisp/files.el' --- lisp/files.el 2012-09-30 21:12:04 +0000 +++ lisp/files.el 2012-10-01 02:07:14 +0000 @@ -1014,7 +1014,7 @@ (defun display-time-file-nonempty-p (file) (let ((remote-file-name-inhibit-cache (- display-time-interval 5))) (and (file-exists-p file) - (< 0 (nth 7 (file-attributes file nil t))))))" + (< 0 (nth 7 (file-attributes (file-chase-links file)))))))" :group 'files :version "24.1" :type `(choice @@ -2082,7 +2082,8 @@ ((and error (file-attributes buffer-file-name)) (setq buffer-read-only t) (if (and (file-symlink-p buffer-file-name) - (not (file-exists-p buffer-file-name))) + (not (file-exists-p + (file-chase-links buffer-file-name)))) "Symbolic link that points to nonexistent file" "File exists, but cannot be read")) ((not buffer-read-only) === modified file 'lisp/time.el' --- lisp/time.el 2012-09-30 21:12:04 +0000 +++ lisp/time.el 2012-10-01 02:07:14 +0000 @@ -485,7 +485,7 @@ (defun display-time-file-nonempty-p (file) (let ((remote-file-name-inhibit-cache (- display-time-interval 5))) (and (file-exists-p file) - (< 0 (nth 7 (file-attributes file nil t)))))) + (< 0 (nth 7 (file-attributes (file-chase-links file))))))) ;;;###autoload (define-minor-mode display-time-mode === modified file 'src/ChangeLog' --- src/ChangeLog 2012-10-01 01:43:28 +0000 +++ src/ChangeLog 2012-10-01 02:07:14 +0000 @@ -1,5 +1,11 @@ 2012-10-01 Paul Eggert + Revert the FOLLOW-SYMLINKS change for file-attributes. + Doing it right would require several changes to Tramp, and there's + not enough time to get that tested before the freeze today. + * dired.c (directory_files_internal, Ffile_attributes): + Undo last change. + * frame.c (x_report_frame_params): Port better to wider ints. Do not assume that EMACS_UINT is the same width as uprintmax_t, or that pointers can be printed in 15 decimal digits. === modified file 'src/dired.c' --- src/dired.c 2012-09-30 21:12:04 +0000 +++ src/dired.c 2012-10-01 02:07:14 +0000 @@ -110,13 +110,12 @@ /* Function shared by Fdirectory_files and Fdirectory_files_and_attributes. If not ATTRS, return a list of directory filenames; if ATTRS, return a list of directory filenames and their attributes. - In the latter case, ID_FORMAT and FOLLOW_SYMLINKS are passed to - Ffile_attributes. */ + In the latter case, ID_FORMAT is passed to Ffile_attributes. */ Lisp_Object directory_files_internal (Lisp_Object directory, Lisp_Object full, Lisp_Object match, Lisp_Object nosort, bool attrs, - Lisp_Object id_format, Lisp_Object follow_symlinks) + Lisp_Object id_format) { DIR *d; ptrdiff_t directory_nbytes; @@ -298,8 +297,7 @@ /* Both Fexpand_file_name and Ffile_attributes can GC. */ decoded_fullname = Fexpand_file_name (name, directory); - fileattrs = Ffile_attributes (decoded_fullname, id_format, - follow_symlinks); + fileattrs = Ffile_attributes (decoded_fullname, id_format); list = Fcons (Fcons (finalname, fileattrs), list); UNGCPRO; @@ -352,8 +350,7 @@ return call5 (handler, Qdirectory_files, directory, full, match, nosort); - return directory_files_internal (directory, full, match, nosort, 0, - Qnil, Qnil); + return directory_files_internal (directory, full, match, nosort, 0, Qnil); } DEFUN ("directory-files-and-attributes", Fdirectory_files_and_attributes, @@ -381,8 +378,7 @@ return call6 (handler, Qdirectory_files_and_attributes, directory, full, match, nosort, id_format); - return directory_files_internal (directory, full, match, nosort, 1, - id_format, Qnil); + return directory_files_internal (directory, full, match, nosort, 1, id_format); } @@ -879,7 +875,7 @@ #endif } -DEFUN ("file-attributes", Ffile_attributes, Sfile_attributes, 1, 3, 0, +DEFUN ("file-attributes", Ffile_attributes, Sfile_attributes, 1, 2, 0, doc: /* Return a list of attributes of file FILENAME. Value is nil if specified file cannot be opened. @@ -888,9 +884,6 @@ default, but we plan to change that, so you should specify a non-nil value for ID-FORMAT if you use the returned uid or gid. -Optional argument FOLLOW-SYMLINKS says whether to follow symbolic -links. If t, they are followed; if nil, they are not. - Elements of the attribute list are: 0. t for directory, string (name linked to) for symbolic link, or nil. 1. Number of links to file. @@ -924,7 +917,7 @@ On some FAT-based filesystems, only the date of last access is recorded, so last access time will always be midnight of that day. */) - (Lisp_Object filename, Lisp_Object id_format, Lisp_Object follow_symlinks) + (Lisp_Object filename, Lisp_Object id_format) { Lisp_Object values[12]; Lisp_Object encoded; @@ -960,10 +953,7 @@ encoded = ENCODE_FILE (filename); UNGCPRO; - if ((!NILP (follow_symlinks) - ? stat (SSDATA (encoded), &s) - : lstat (SSDATA (encoded), &s)) - != 0) + if (lstat (SSDATA (encoded), &s) < 0) return Qnil; values[0] = (S_ISLNK (s.st_mode) ? Ffile_symlink_p (filename) === modified file 'src/lisp.h' --- src/lisp.h 2012-09-30 21:12:04 +0000 +++ src/lisp.h 2012-10-01 02:07:14 +0000 @@ -3474,7 +3474,7 @@ extern void syms_of_dired (void); extern Lisp_Object directory_files_internal (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, - bool, Lisp_Object, Lisp_Object); + bool, Lisp_Object); /* Defined in term.c. */ extern int *char_ins_del_vector; === modified file 'src/sysdep.c' --- src/sysdep.c 2012-09-30 21:36:42 +0000 +++ src/sysdep.c 2012-10-01 02:07:14 +0000 @@ -2532,8 +2532,7 @@ process. */ procdir = build_string ("/proc"); match = build_string ("[0-9]+"); - proclist = directory_files_internal (procdir, Qnil, match, Qt, 0, - Qnil, Qnil); + proclist = directory_files_internal (procdir, Qnil, match, Qt, 0, Qnil); /* `proclist' gives process IDs as strings. Destructively convert each string into a number. */ ------------------------------------------------------------ revno: 110302 committer: Paul Eggert branch nick: trunk timestamp: Sun 2012-09-30 18:46:06 -0700 message: * profiler.el (profiler-sampling-interval): Change default back to 1. See Stefan Monnier in . diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-10-01 00:53:44 +0000 +++ lisp/ChangeLog 2012-10-01 01:46:06 +0000 @@ -1,3 +1,9 @@ +2012-10-01 Paul Eggert + + * profiler.el (profiler-sampling-interval): Change default back to 1. + See Stefan Monnier in + . + 2012-10-01 Fabián Ezequiel Gallina Shell output catching a la gud-gdb. === modified file 'lisp/profiler.el' --- lisp/profiler.el 2012-09-30 22:21:25 +0000 +++ lisp/profiler.el 2012-10-01 01:46:06 +0000 @@ -33,7 +33,7 @@ (defconst profiler-version "24.3") -(defcustom profiler-sampling-interval 10 +(defcustom profiler-sampling-interval 1 "Default sampling interval in millisecond." :type 'integer :group 'profiler) ------------------------------------------------------------ revno: 110301 committer: Paul Eggert branch nick: trunk timestamp: Sun 2012-09-30 18:43:28 -0700 message: * frame.c (x_report_frame_params): Port better to wider ints. Do not assume that EMACS_UINT is the same width as uprintmax_t, or that pointers can be printed in 15 decimal digits. Avoid GCC warnings if EMACS_UINT is wider than a pointer. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-09-30 21:52:49 +0000 +++ src/ChangeLog 2012-10-01 01:43:28 +0000 @@ -1,3 +1,10 @@ +2012-10-01 Paul Eggert + + * frame.c (x_report_frame_params): Port better to wider ints. + Do not assume that EMACS_UINT is the same width as uprintmax_t, + or that pointers can be printed in 15 decimal digits. + Avoid GCC warnings if EMACS_UINT is wider than a pointer. + 2012-09-30 Fabrice Popineau Support x64 build on MS-Windows. === modified file 'src/frame.c' --- src/frame.c 2012-09-30 21:36:42 +0000 +++ src/frame.c 2012-10-01 01:43:28 +0000 @@ -3028,9 +3028,9 @@ void x_report_frame_params (struct frame *f, Lisp_Object *alistptr) { - char buf[16]; Lisp_Object tem; - EMACS_UINT w; + uprintmax_t w; + char buf[INT_BUFSIZE_BOUND (w)]; /* Represent negative positions (off the top or left screen edge) in a way that Fmodify_frame_parameters will understand correctly. */ @@ -3067,7 +3067,7 @@ MS-Windows it returns a value whose type is HANDLE, which is actually a pointer. Explicit casting avoids compiler warnings. */ - w = (EMACS_UINT) FRAME_X_WINDOW (f); + w = (uintptr_t) FRAME_X_WINDOW (f); store_in_alist (alistptr, Qwindow_id, make_formatted_string (buf, "%"pMu, w)); #ifdef HAVE_X_WINDOWS @@ -3075,7 +3075,7 @@ /* Tooltip frame may not have this widget. */ if (FRAME_X_OUTPUT (f)->widget) #endif - w = (EMACS_UINT) FRAME_OUTER_WINDOW (f); + w = (uintptr_t) FRAME_OUTER_WINDOW (f); store_in_alist (alistptr, Qouter_window_id, make_formatted_string (buf, "%"pMu, w)); #endif ------------------------------------------------------------ revno: 110300 committer: Fabián Ezequiel Gallina branch nick: trunk timestamp: Sun 2012-09-30 21:53:44 -0300 message: Shell output catching a la gud-gdb. * progmodes/python.el (python-shell-fetch-lines-in-progress) (python-shell-fetch-lines-string, python-shell-fetched-lines): New Vars. (python-shell-fetch-lines-filter): New function. (python-shell-send-string-no-output): Use them. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-30 22:21:25 +0000 +++ lisp/ChangeLog 2012-10-01 00:53:44 +0000 @@ -1,3 +1,12 @@ +2012-10-01 Fabián Ezequiel Gallina + + Shell output catching a la gud-gdb. + * progmodes/python.el (python-shell-fetch-lines-in-progress) + (python-shell-fetch-lines-string, python-shell-fetched-lines): New + Vars. + (python-shell-fetch-lines-filter): New function. + (python-shell-send-string-no-output): Use them. + 2012-09-30 Tomohiro Matsuyama * profiler.el (profiler-sampling-interval): Rename from === modified file 'lisp/progmodes/python.el' --- lisp/progmodes/python.el 2012-09-30 20:14:02 +0000 +++ lisp/progmodes/python.el 2012-10-01 00:53:44 +0000 @@ -1867,31 +1867,45 @@ (string-match "\n[ \t].*\n?$" string)) (comint-send-string process "\n"))))) +;; Shell output catching stolen from gud-gdb +(defvar python-shell-fetch-lines-in-progress nil) +(defvar python-shell-fetch-lines-string nil) +(defvar python-shell-fetched-lines nil) + +(defun python-shell-fetch-lines-filter (string) + "Filter used to read the list of lines output by a command. +STRING is the output to filter." + (setq string (concat python-shell-fetch-lines-string string)) + (while (string-match "\n" string) + (push (substring string 0 (match-beginning 0)) + python-shell-fetched-lines) + (setq string (substring string (match-end 0)))) + (if (equal (string-match comint-prompt-regexp string) 0) + (progn + (setq python-shell-fetch-lines-in-progress nil) + string) + (progn + (setq python-shell-fetch-lines-string string) + ""))) + (defun python-shell-send-string-no-output (string &optional process msg) "Send STRING to PROCESS and inhibit output. When MSG is non-nil messages the first line of STRING. Return the output." - (let* ((output-buffer "") - (process (or process (python-shell-get-or-create-process))) - (comint-preoutput-filter-functions - (append comint-preoutput-filter-functions - '(ansi-color-filter-apply - (lambda (string) - (setq output-buffer (concat output-buffer string)) - "")))) - (inhibit-quit t)) + (let ((process (or process (python-shell-get-or-create-process))) + (comint-preoutput-filter-functions + '(python-shell-fetch-lines-filter)) + (python-shell-fetch-lines-in-progress t) + (inhibit-quit t)) (or (with-local-quit (python-shell-send-string string process msg) - (accept-process-output process) - (replace-regexp-in-string - (if (> (length python-shell-prompt-output-regexp) 0) - (format "\n*%s$\\|^%s\\|\n$" - python-shell-prompt-regexp - (or python-shell-prompt-output-regexp "")) - (format "\n*$\\|^%s\\|\n$" - python-shell-prompt-regexp)) - "" output-buffer)) + (while python-shell-fetch-lines-in-progress + (accept-process-output process)) + (prog1 + (mapconcat #'identity + (reverse python-shell-fetched-lines) "\n") + (setq python-shell-fetched-lines nil))) (with-current-buffer (process-buffer process) (comint-interrupt-subjob))))) ------------------------------------------------------------ revno: 110299 committer: Glenn Morris branch nick: trunk timestamp: Sun 2012-09-30 17:05:20 -0700 message: Tweak reftex.texi's inclusion of emacsver.texi * doc/misc/Makefile.in ($(buildinfodir)/reftex$(INFO_EXT)), reftex.dvi) (reftex.pdf): Add dependency on emacsver.texi. * doc/misc/reftex.texi: Don't include directory part for emacsver.texi; the Makefile's -I handles it. diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2012-09-30 21:10:33 +0000 +++ doc/misc/ChangeLog 2012-10-01 00:05:20 +0000 @@ -1,3 +1,10 @@ +2012-10-01 Glenn Morris + + * Makefile.in ($(buildinfodir)/reftex$(INFO_EXT)), reftex.dvi) + (reftex.pdf): Add dependency on emacsver.texi. + * reftex.texi: Don't include directory part for emacsver.texi; + the Makefile's -I handles it. + 2012-09-30 Ralf Angeli Merge from standalone RefTeX repository. === modified file 'doc/misc/Makefile.in' --- doc/misc/Makefile.in 2012-06-21 07:34:27 +0000 +++ doc/misc/Makefile.in 2012-10-01 00:05:20 +0000 @@ -526,12 +526,12 @@ $(ENVADD) $(TEXI2PDF) ${srcdir}/rcirc.texi reftex : $(buildinfodir)/reftex$(INFO_EXT) -$(buildinfodir)/reftex$(INFO_EXT): ${srcdir}/reftex.texi +$(buildinfodir)/reftex$(INFO_EXT): ${srcdir}/reftex.texi $(emacsdir)/emacsver.texi $(mkinfodir) $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/reftex.texi -reftex.dvi: ${srcdir}/reftex.texi +reftex.dvi: ${srcdir}/reftex.texi $(emacsdir)/emacsver.texi $(ENVADD) $(TEXI2DVI) ${srcdir}/reftex.texi -reftex.pdf: ${srcdir}/reftex.texi +reftex.pdf: ${srcdir}/reftex.texi $(emacsdir)/emacsver.texi $(ENVADD) $(TEXI2PDF) ${srcdir}/reftex.texi remember : $(buildinfodir)/remember$(INFO_EXT) === modified file 'doc/misc/reftex.texi' --- doc/misc/reftex.texi 2012-09-30 20:30:13 +0000 +++ doc/misc/reftex.texi 2012-10-01 00:05:20 +0000 @@ -27,7 +27,7 @@ \gdef\ConTeXt{Con\TeX t} @end tex -@include ../emacs/emacsver.texi +@include emacsver.texi @set VERSION @value{EMACSVER} @set AUCTEXSITE @uref{http://www.gnu.org/software/auctex/,@AUCTeX{} web site} ------------------------------------------------------------ revno: 110298 committer: Tomohiro Matsuyama branch nick: trunk timestamp: Mon 2012-10-01 07:21:25 +0900 message: * profiler.el (profiler-sampling-interval): Rename from profiler-sample-interval. (profiler-sampling-interval): Default to 10. (profiler-find-profile): New command (was profiler-find-log). (profiler-find-profile-other-window): New command. (profiler-find-profile-other-frame): New command. (profiler-profile): Introduce API-level data structure. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-30 21:12:04 +0000 +++ lisp/ChangeLog 2012-09-30 22:21:25 +0000 @@ -1,3 +1,13 @@ +2012-09-30 Tomohiro Matsuyama + + * profiler.el (profiler-sampling-interval): Rename from + profiler-sample-interval. + (profiler-sampling-interval): Default to 10. + (profiler-find-profile): New command (was profiler-find-log). + (profiler-find-profile-other-window): New command. + (profiler-find-profile-other-frame): New command. + (profiler-profile): Introduce API-level data structure. + 2012-09-30 Paul Eggert file-attributes has a new optional arg FOLLOW-SYMLINKS. === modified file 'lisp/profiler.el' --- lisp/profiler.el 2012-09-26 15:19:10 +0000 +++ lisp/profiler.el 2012-09-30 22:21:25 +0000 @@ -24,19 +24,21 @@ ;;; Code: -(eval-when-compile - (require 'cl-lib)) +(require 'cl-lib) (defgroup profiler nil "Emacs profiler." :group 'lisp :prefix "profiler-") -(defcustom profiler-sample-interval 1 - "Default sample interval in millisecond." +(defconst profiler-version "24.3") + +(defcustom profiler-sampling-interval 10 + "Default sampling interval in millisecond." :type 'integer :group 'profiler) + ;;; Utilities (defun profiler-ensure-string (object) @@ -49,6 +51,23 @@ (t (format "%s" object)))) +(defun profiler-format-percent (number divisor) + (concat (number-to-string (/ (* number 100) divisor)) "%")) + +(defun profiler-format-number (number) + "Format NUMBER in human readable string." + (if (and (integerp number) (> number 0)) + (cl-loop with i = (% (1+ (floor (log10 number))) 3) + for c in (append (number-to-string number) nil) + if (= i 0) + collect ?, into s + and do (setq i 3) + collect c into s + do (cl-decf i) + finally return + (apply 'string (if (eq (car s) ?,) (cdr s) s))) + (profiler-ensure-string number))) + (defun profiler-format (fmt &rest args) (cl-loop for (width align subfmt) in fmt for arg in args @@ -74,27 +93,10 @@ into frags finally return (apply #'concat frags))) -(defun profiler-format-percent (number divisor) - (concat (number-to-string (/ (* number 100) divisor)) "%")) - -(defun profiler-format-nbytes (nbytes) - "Format NBYTES in humarn readable string." - (if (and (integerp nbytes) (> nbytes 0)) - (cl-loop with i = (% (1+ (floor (log10 nbytes))) 3) - for c in (append (number-to-string nbytes) nil) - if (= i 0) - collect ?, into s - and do (setq i 3) - collect c into s - do (cl-decf i) - finally return - (apply 'string (if (eq (car s) ?,) (cdr s) s))) - (profiler-ensure-string nbytes))) - ;;; Entries -(defun profiler-entry-format (entry) +(defun profiler-format-entry (entry) "Format ENTRY in human readable string. ENTRY would be a function name of a function itself." (cond ((memq (car-safe entry) '(closure lambda)) @@ -106,76 +108,117 @@ (t (format "#" (sxhash entry))))) -;;; Log data structure +(defun profiler-fixup-entry (entry) + (if (symbolp entry) + entry + (profiler-format-entry entry))) + + +;;; Backtraces + +(defun profiler-fixup-backtrace (backtrace) + (apply 'vector (mapcar 'profiler-fixup-entry backtrace))) + + +;;; Logs ;; The C code returns the log in the form of a hash-table where the keys are ;; vectors (of size profiler-max-stack-depth, holding truncated ;; backtraces, where the first element is the top of the stack) and ;; the values are integers (which count how many times this backtrace ;; has been seen, multiplied by a "weight factor" which is either the -;; sample-interval or the memory being allocated). -;; We extend it by adding a few other entries to the hash-table, most notably: -;; - Key `type' has a value indicating the kind of log (`memory' or `cpu'). -;; - Key `timestamp' has a value giving the time when the log was obtained. -;; - Key `diff-p' indicates if this log represents a diff between two logs. - -(defun profiler-log-timestamp (log) (gethash 'timestamp log)) -(defun profiler-log-type (log) (gethash 'type log)) -(defun profiler-log-diff-p (log) (gethash 'diff-p log)) - -(defun profiler-log-diff (log1 log2) - "Compare LOG1 with LOG2 and return a diff log. Both logs must -be same type." - (unless (eq (profiler-log-type log1) - (profiler-log-type log2)) - (error "Can't compare different type of logs")) +;; sampling-interval or the memory being allocated). + +(defun profiler-compare-logs (log1 log2) + "Compare LOG1 with LOG2 and return diff." (let ((newlog (make-hash-table :test 'equal))) ;; Make a copy of `log1' into `newlog'. (maphash (lambda (backtrace count) (puthash backtrace count newlog)) log1) - (puthash 'diff-p t newlog) (maphash (lambda (backtrace count) - (when (vectorp backtrace) - (puthash backtrace (- (gethash backtrace log1 0) count) - newlog))) + (puthash backtrace (- (gethash backtrace log1 0) count) + newlog)) log2) newlog)) -(defun profiler-log-fixup-entry (entry) - (if (symbolp entry) - entry - (profiler-entry-format entry))) - -(defun profiler-log-fixup-backtrace (backtrace) - (mapcar 'profiler-log-fixup-entry backtrace)) - -(defun profiler-log-fixup (log) - "Fixup LOG so that the log could be serialized into file." +(defun profiler-fixup-log (log) (let ((newlog (make-hash-table :test 'equal))) (maphash (lambda (backtrace count) - (puthash (if (not (vectorp backtrace)) - backtrace - (profiler-log-fixup-backtrace backtrace)) + (puthash (profiler-fixup-backtrace backtrace) count newlog)) log) newlog)) -(defun profiler-log-write-file (log filename &optional confirm) - "Write LOG into FILENAME." + +;;; Profiles + +(cl-defstruct (profiler-profile (:type vector) + (:constructor profiler-make-profile)) + (tag 'profiler-profile) + (version profiler-version) + ;; - `type' has a value indicating the kind of profile (`memory' or `cpu'). + ;; - `log' indicates the profile log. + ;; - `timestamp' has a value giving the time when the profile was obtained. + ;; - `diff-p' indicates if this profile represents a diff between two profiles. + type log timestamp diff-p) + +(defun profiler-compare-profiles (profile1 profile2) + "Compare PROFILE1 with PROFILE2 and return diff." + (unless (eq (profiler-profile-type profile1) + (profiler-profile-type profile2)) + (error "Can't compare different type of profiles")) + (profiler-make-profile + :type (profiler-profile-type profile1) + :timestamp (current-time) + :diff-p t + :log (profiler-compare-logs + (profiler-profile-log profile1) + (profiler-profile-log profile2)))) + +(defun profiler-fixup-profile (profile) + "Fixup PROFILE so that the profile could be serialized into file." + (profiler-make-profile + :type (profiler-profile-type profile) + :timestamp (profiler-profile-timestamp profile) + :diff-p (profiler-profile-diff-p profile) + :log (profiler-fixup-log (profiler-profile-log profile)))) + +(defun profiler-write-profile (profile filename &optional confirm) + "Write PROFILE into file FILENAME." (with-temp-buffer (let (print-level print-length) - (print (profiler-log-fixup log) (current-buffer))) + (print (profiler-fixup-profile profile) + (current-buffer))) (write-file filename confirm))) -(defun profiler-log-read-file (filename) - "Read log from FILENAME." +(defun profiler-read-profile (filename) + "Read profile from file FILENAME." + ;; FIXME: tag and version check (with-temp-buffer (insert-file-contents filename) (goto-char (point-min)) (read (current-buffer)))) +(defun profiler-cpu-profile () + "Return CPU profile." + (when (and (fboundp 'profiler-cpu-running-p) + (fboundp 'profiler-cpu-log) + (profiler-cpu-running-p)) + (profiler-make-profile + :type 'cpu + :timestamp (current-time) + :log (profiler-cpu-log)))) + +(defun profiler-memory-profile () + "Return memory profile." + (when (profiler-memory-running-p) + (profiler-make-profile + :type 'memory + :timestamp (current-time) + :log (profiler-memory-log)))) + -;;; Calltree data structure +;;; Calltrees (cl-defstruct (profiler-calltree (:constructor profiler-make-calltree)) entry @@ -202,7 +245,6 @@ (defun profiler-calltree-find (tree entry) "Return a child tree of ENTRY under TREE." - ;; OPTIMIZED (let (result (children (profiler-calltree-children tree))) ;; FIXME: Use `assoc'. (while (and children (null result)) @@ -224,19 +266,18 @@ ;; get a meaningful call-tree. (maphash (lambda (backtrace count) - (when (vectorp backtrace) - (let ((node tree) - (max (length backtrace))) - (dotimes (i max) - (let ((entry (aref backtrace (if reverse i (- max i 1))))) - (when entry - (let ((child (profiler-calltree-find node entry))) - (unless child - (setq child (profiler-make-calltree - :entry entry :parent node)) - (push child (profiler-calltree-children node))) - (cl-incf (profiler-calltree-count child) count) - (setq node child)))))))) + (let ((node tree) + (max (length backtrace))) + (dotimes (i max) + (let ((entry (aref backtrace (if reverse i (- max i 1))))) + (when entry + (let ((child (profiler-calltree-find node entry))) + (unless child + (setq child (profiler-make-calltree + :entry entry :parent node)) + (push child (profiler-calltree-children node))) + (cl-incf (profiler-calltree-count child) count) + (setq node child))))))) log)) (defun profiler-calltree-compute-percentages (tree) @@ -281,18 +322,18 @@ :type 'string :group 'profiler) -(defvar profiler-report-sample-line-format +(defvar profiler-report-cpu-line-format '((60 left) (14 right ((9 right) (5 right))))) (defvar profiler-report-memory-line-format '((55 left) - (19 right ((14 right profiler-format-nbytes) + (19 right ((14 right profiler-format-number) (5 right))))) -(defvar-local profiler-report-log nil - "The current profiler log.") +(defvar-local profiler-report-profile nil + "The current profile.") (defvar-local profiler-report-reversed nil "True if calltree is rendered in bottom-up. Do not touch this @@ -313,7 +354,7 @@ 'mouse-face 'highlight 'help-echo "mouse-2 or RET jumps to definition")) (t - (profiler-entry-format entry))))) + (profiler-format-entry entry))))) (propertize string 'profiler-entry entry))) (defun profiler-report-make-name-part (tree) @@ -332,12 +373,12 @@ (concat " " escaped))) (defun profiler-report-line-format (tree) - (let ((diff-p (profiler-log-diff-p profiler-report-log)) + (let ((diff-p (profiler-profile-diff-p profiler-report-profile)) (name-part (profiler-report-make-name-part tree)) (count (profiler-calltree-count tree)) (count-percent (profiler-calltree-count-percent tree))) - (profiler-format (cl-ecase (profiler-log-type profiler-report-log) - (cpu profiler-report-sample-line-format) + (profiler-format (cl-ecase (profiler-profile-type profiler-report-profile) + (cpu profiler-report-cpu-line-format) (memory profiler-report-memory-line-format)) name-part (if diff-p @@ -378,27 +419,35 @@ (define-key map "B" 'profiler-report-render-reversed-calltree) (define-key map "A" 'profiler-report-ascending-sort) (define-key map "D" 'profiler-report-descending-sort) - (define-key map "=" 'profiler-report-compare-log) - (define-key map (kbd "C-x C-w") 'profiler-report-write-log) + (define-key map "=" 'profiler-report-compare-profile) + (define-key map (kbd "C-x C-w") 'profiler-report-write-profile) (define-key map "q" 'quit-window) map)) -(defun profiler-report-make-buffer-name (log) +(defun profiler-report-make-buffer-name (profile) (format "*%s-Profiler-Report %s*" - (cl-ecase (profiler-log-type log) (cpu 'CPU) (memory 'Memory)) - (format-time-string "%Y-%m-%d %T" (profiler-log-timestamp log)))) + (cl-ecase (profiler-profile-type profile) (cpu 'CPU) (memory 'Memory)) + (format-time-string "%Y-%m-%d %T" (profiler-profile-timestamp profile)))) -(defun profiler-report-setup-buffer (log) - "Make a buffer for LOG and return it." - (let* ((buf-name (profiler-report-make-buffer-name log)) +(defun profiler-report-setup-buffer-1 (profile) + "Make a buffer for PROFILE and return it." + (let* ((buf-name (profiler-report-make-buffer-name profile)) (buffer (get-buffer-create buf-name))) (with-current-buffer buffer (profiler-report-mode) - (setq profiler-report-log log + (setq profiler-report-profile profile profiler-report-reversed nil profiler-report-order 'descending)) buffer)) +(defun profiler-report-setup-buffer (profile) + "Make a buffer for PROFILE with rendering the profile and +return it." + (let ((buffer (profiler-report-setup-buffer-1 profile))) + (with-current-buffer buffer + (profiler-report-render-calltree)) + buffer)) + (define-derived-mode profiler-report-mode special-mode "Profiler-Report" "Profiler Report Mode." (setq buffer-read-only t @@ -408,12 +457,12 @@ ;;; Report commands -(defun profiler-report-calltree-at-point () - (get-text-property (point) 'calltree)) +(defun profiler-report-calltree-at-point (&optional point) + (get-text-property (or point (point)) 'calltree)) (defun profiler-report-move-to-entry () - (let ((point (next-single-property-change (line-beginning-position) - 'profiler-entry))) + (let ((point (next-single-property-change + (line-beginning-position) 'profiler-entry))) (if point (goto-char point) (back-to-indentation)))) @@ -493,14 +542,15 @@ (describe-function entry))))) (cl-defun profiler-report-render-calltree-1 - (log &key reverse (order 'descending)) - (let ((calltree (profiler-calltree-build profiler-report-log - :reverse reverse))) + (profile &key reverse (order 'descending)) + (let ((calltree (profiler-calltree-build + (profiler-profile-log profile) + :reverse reverse))) (setq header-line-format - (cl-ecase (profiler-log-type log) + (cl-ecase (profiler-profile-type profile) (cpu (profiler-report-header-line-format - profiler-report-sample-line-format + profiler-report-cpu-line-format "Function" (list "Time (ms)" "%"))) (memory (profiler-report-header-line-format @@ -517,7 +567,7 @@ (profiler-report-move-to-entry)))) (defun profiler-report-rerender-calltree () - (profiler-report-render-calltree-1 profiler-report-log + (profiler-report-render-calltree-1 profiler-report-profile :reverse profiler-report-reversed :order profiler-report-order)) @@ -545,28 +595,31 @@ (setq profiler-report-order 'descending) (profiler-report-rerender-calltree)) -(defun profiler-report-log (log) - (let ((buffer (profiler-report-setup-buffer log))) - (with-current-buffer buffer - (profiler-report-render-calltree)) - (pop-to-buffer buffer))) - -(defun profiler-report-compare-log (buffer) - "Compare the current profiler log with another." +(defun profiler-report-profile (profile) + (switch-to-buffer (profiler-report-setup-buffer profile))) + +(defun profiler-report-profile-other-window (profile) + (switch-to-buffer-other-window (profiler-report-setup-buffer profile))) + +(defun profiler-report-profile-other-frame (profile) + (switch-to-buffer-other-frame (profiler-report-setup-buffer profile))) + +(defun profiler-report-compare-profile (buffer) + "Compare the current profile with another." (interactive (list (read-buffer "Compare to: "))) - (let* ((log1 (with-current-buffer buffer profiler-report-log)) - (log2 profiler-report-log) - (diff-log (profiler-log-diff log1 log2))) - (profiler-report-log diff-log))) + (let* ((profile1 (with-current-buffer buffer profiler-report-profile)) + (profile2 profiler-report-profile) + (diff-profile (profiler-compare-profiles profile1 profile2))) + (profiler-report-profile diff-profile))) -(defun profiler-report-write-log (filename &optional confirm) - "Write the current profiler log into FILENAME." +(defun profiler-report-write-profile (filename &optional confirm) + "Write the current profile into file FILENAME." (interactive - (list (read-file-name "Write log: " default-directory) + (list (read-file-name "Write profile: " default-directory) (not current-prefix-arg))) - (profiler-log-write-file profiler-report-log - filename - confirm)) + (profiler-write-profile profiler-report-profile + filename + confirm)) ;;; Profiler commands @@ -584,13 +637,13 @@ nil t nil nil "cpu"))))) (cl-ecase mode (cpu - (profiler-cpu-start profiler-sample-interval) + (profiler-cpu-start profiler-sampling-interval) (message "CPU profiler started")) (mem (profiler-memory-start) (message "Memory profiler started")) (cpu+mem - (profiler-cpu-start profiler-sample-interval) + (profiler-cpu-start profiler-sampling-interval) (profiler-memory-start) (message "CPU and memory profiler started")))) @@ -606,48 +659,58 @@ (t "No"))))) (defun profiler-reset () - "Reset profiler log." + "Reset profiler logs." (interactive) (when (fboundp 'profiler-cpu-log) (ignore (profiler-cpu-log))) (ignore (profiler-memory-log)) t) -(defun profiler--report-cpu () - (let ((log (if (fboundp 'profiler-cpu-log) (profiler-cpu-log)))) - (when log - (puthash 'type 'cpu log) - (puthash 'timestamp (current-time) log) - (profiler-report-log log)))) +(defun profiler-report-cpu () + (let ((profile (profiler-cpu-profile))) + (when profile + (profiler-report-profile-other-window profile)))) -(defun profiler--report-memory () - (let ((log (profiler-memory-log))) - (when log - (puthash 'type 'memory log) - (puthash 'timestamp (current-time) log) - (profiler-report-log log)))) +(defun profiler-report-memory () + (let ((profile (profiler-memory-profile))) + (when profile + (profiler-report-profile-other-window profile)))) (defun profiler-report () "Report profiling results." (interactive) - (profiler--report-cpu) - (profiler--report-memory)) - -;;;###autoload -(defun profiler-find-log (filename) - "Read a profiler log from FILENAME and report it." - (interactive - (list (read-file-name "Find log: " default-directory))) - (profiler-report-log (profiler-log-read-file filename))) + (profiler-report-cpu) + (profiler-report-memory)) + +;;;###autoload +(defun profiler-find-profile (filename) + "Open profile FILENAME." + (interactive + (list (read-file-name "Find profile: " default-directory))) + (profiler-report-profile (profiler-read-profile filename))) + +;;;###autoload +(defun profiler-find-profile-other-window (filename) + "Open profile FILENAME." + (interactive + (list (read-file-name "Find profile: " default-directory))) + (profiler-report-profile-other-window (profiler-read-profile filename))) + +;;;###autoload +(defun profiler-find-profile-other-frame (filename) + "Open profile FILENAME." + (interactive + (list (read-file-name "Find profile: " default-directory))) + (profiler-report-profile-other-frame(profiler-read-profile filename))) ;;; Profiling helpers -;; (cl-defmacro with-sample-profiling ((&key interval) &rest body) +;; (cl-defmacro with-cpu-profiling ((&key sampling-interval) &rest body) ;; `(unwind-protect ;; (progn ;; (ignore (profiler-cpu-log)) -;; (profiler-cpu-start ,interval) +;; (profiler-cpu-start ,sampling-interval) ;; ,@body) ;; (profiler-cpu-stop) ;; (profiler--report-cpu))) === modified file 'src/profiler.c' --- src/profiler.c 2012-09-30 15:49:05 +0000 +++ src/profiler.c 2012-09-30 22:21:25 +0000 @@ -198,7 +198,7 @@ } } -/* Sample profiler. */ +/* Sampling profiler. */ #ifdef PROFILER_CPU_SUPPORT @@ -220,10 +220,10 @@ /* Separate counter for the time spent in the GC. */ static EMACS_INT cpu_gc_count; -/* The current sample interval in milliseconds. */ -static EMACS_INT current_sample_interval; +/* The current sampling interval in milliseconds. */ +static EMACS_INT current_sampling_interval; -/* Signal handler for sample profiler. */ +/* Signal handler for sampling profiler. */ static void handle_profiler_signal (int signal) @@ -235,11 +235,11 @@ not expect the ARRAY_MARK_FLAG to be set. We could try and harden the hash-table code, but it doesn't seem worth the effort. */ - cpu_gc_count = saturated_add (cpu_gc_count, current_sample_interval); + cpu_gc_count = saturated_add (cpu_gc_count, current_sampling_interval); else { eassert (HASH_TABLE_P (cpu_log)); - record_backtrace (XHASH_TABLE (cpu_log), current_sample_interval); + record_backtrace (XHASH_TABLE (cpu_log), current_sampling_interval); } } @@ -250,21 +250,21 @@ } static enum profiler_cpu_running -setup_cpu_timer (Lisp_Object sample_interval) +setup_cpu_timer (Lisp_Object sampling_interval) { struct sigaction action; struct itimerval timer; struct timespec interval; - if (! RANGED_INTEGERP (1, sample_interval, + if (! RANGED_INTEGERP (1, sampling_interval, (TYPE_MAXIMUM (time_t) < EMACS_INT_MAX / 1000 ? (EMACS_INT) TYPE_MAXIMUM (time_t) * 1000 + 999 : EMACS_INT_MAX))) return NOT_RUNNING; - current_sample_interval = XINT (sample_interval); - interval = make_emacs_time (current_sample_interval / 1000, - current_sample_interval % 1000 * 1000000); + current_sampling_interval = XINT (sampling_interval); + interval = make_emacs_time (current_sampling_interval / 1000, + current_sampling_interval % 1000 * 1000000); emacs_sigaction_init (&action, deliver_profiler_signal); sigaction (SIGPROF, &action, 0); @@ -315,12 +315,12 @@ DEFUN ("profiler-cpu-start", Fprofiler_cpu_start, Sprofiler_cpu_start, 1, 1, 0, doc: /* Start or restart the cpu profiler. -It takes call-stack samples each SAMPLE-INTERVAL milliseconds. +It takes call-stack samples each SAMPLING-INTERVAL milliseconds. See also `profiler-log-size' and `profiler-max-stack-depth'. */) - (Lisp_Object sample_interval) + (Lisp_Object sampling_interval) { if (profiler_cpu_running) - error ("Sample profiler is already running"); + error ("CPU profiler is already running"); if (NILP (cpu_log)) { @@ -329,9 +329,9 @@ profiler_max_stack_depth); } - profiler_cpu_running = setup_cpu_timer (sample_interval); + profiler_cpu_running = setup_cpu_timer (sampling_interval); if (! profiler_cpu_running) - error ("Invalid sample interval"); + error ("Invalid sampling interval"); return Qt; } ------------------------------------------------------------ revno: 110297 author: Fabrice Popineau committer: Eli Zaretskii branch nick: trunk timestamp: Sun 2012-09-30 23:52:49 +0200 message: Fix last commit. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-09-30 21:36:42 +0000 +++ src/ChangeLog 2012-09-30 21:52:49 +0000 @@ -4,6 +4,7 @@ * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64. (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for compatibility with x64. + (x_get_focus_frame): Add prototype. * w32term.c (w32_draw_underwave): Don't use GCC extensions for defining an XRectangle structure. === modified file 'src/w32term.h' --- src/w32term.h 2012-09-30 21:36:42 +0000 +++ src/w32term.h 2012-09-30 21:52:49 +0000 @@ -201,6 +201,8 @@ extern int x_display_pixel_height (struct w32_display_info *); extern int x_display_pixel_width (struct w32_display_info *); +extern Lisp_Object x_get_focus_frame (struct frame *); + #define PIX_TYPE COLORREF ------------------------------------------------------------ revno: 110296 author: Fabrice Popineau committer: Eli Zaretskii branch nick: trunk timestamp: Sun 2012-09-30 23:36:42 +0200 message: Support x64 build on MS-Windows with MSVC. src/w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64. (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for compatibility with x64. src/w32term.c (w32_draw_underwave): Don't use GCC extensions for defining an XRectangle structure. src/w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer arithmetics for compatibility with x64. src/w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for compatibility with x64. src/w32heap.h: Adjust prototypes and declarations. src/w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap) (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of DWORD, long, and unsigned long, for compatibility with x64. (allocate_heap) [_WIN64]: Reserve 32GB of memory. (sbrk): Argument is now of type ptrdiff_t. src/w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being less than 0x0500. (w32_msg_pump): Use WPARAM type for 'result'. src/w32.c (init_environment, get_emacs_configuration): Support AMD64 architecture. (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for compatibility with x64. src/vm-limit.c (lim_data): Now size_t. (check_memory_limits): Adjust prototypes of real_morecore and __morecore to receive argument of type ptrdiff_t. Use size_t for five_percent and data_size. src/unexw32.c: Use DWORD_PTR instead of DWORD for file-scope variables, for compatibility with x64. (rva_to_section, offset_to_section, relocate_offset) (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET) (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info) (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD for compatibility with x64. src/sysdep.c (STDERR_FILENO): Define if not already defined. src/ralloc.c (real_morecore): Argument type is now ptrdiff_t. (__morecore): Argument type is now ptrdiff_t. (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'. (relinquish): Use ptrdiff_t type for 'excess'. (r_alloc_sbrk): Argument type is now ptrdiff_t. src/makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE. (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE) instead of a literal number. src/gmalloc.c [WINDOWSNT]: Include w32heap.h. (min): Define only if not already defined. src/frame.c (x_report_frame_params): Use EMACS_UINT for the return value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows hosts. src/image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since 'bitmaps' is a pointer. src/dispextern.h (x_bitmap_pixmap): Adjust prototype. src/alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__. nt/makefile.w32-in ($(TRES)): Use $(EMACS_MANIFEST). nt/inc/sys/socket.h: Don't map Winsock error codes to standard ones that are already defined. nt/inc/ms-w32.h (EMACS_INT, EMACS_UINT, EMACS_INT_MAX, PRIuMAX) (pI, _INTPTR) [_MSC_VER]: Fix definitions for MSVC. [_MSC_VER]: Add pragmas to suppress some MSVC warnings. nt/preprep.c (pfnCheckSumMappedFile, rva_to_section) (offset_to_section, relocate_offset, OFFSET_TO_RVA) (RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET, PTR_TO_RVA) (OFFSET_TO_PTR, ROUND_UP, ROUND_DOWN) (copy_executable_and_move_sections, ADJUST_IMPORT_RVA, main): Use DWORD_PTR instead of DWORD for compatibility with x64. nt/nmake.defs: Support AMD64. (EMACS_HEAPSIZE, EMACS_PURESIZE, EMACS_MANIFEST): New macros. nt/gmake.defs: (EMACS_HEAPSIZE, EMACS_PURESIZE, EMACS_MANIFEST): New macros. nt/addsection.c (pfnCheckSumMappedFile, rva_to_section) (offset_to_section, relocate_offset, OFFSET_TO_RVA) (RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET, PTR_TO_RVA) (OFFSET_TO_PTR, ROUND_UP, ROUND_DOWN) (copy_executable_and_add_section, main): Use DWORD_PTR instead of DWORD, for compatibility with x64. nt/emacs-x64.manifest: New file. nt/emacs-x86.manifest: Renamed from emacs.manifest. lib-src/ntlib.c (gettimeofday): Copy from src/w32.c. lib/gettime. needs this function. diff: === modified file 'lib-src/ChangeLog' --- lib-src/ChangeLog 2012-09-26 22:42:54 +0000 +++ lib-src/ChangeLog 2012-09-30 21:36:42 +0000 @@ -1,3 +1,8 @@ +2012-09-30 Eli Zaretskii + + * ntlib.c (gettimeofday): Copy from src/w32.c. lib/gettime.c + needs this function. + 2012-09-26 Juanma Barranquero * makefile.w32-in (obj): Add profiler.o. === modified file 'lib-src/ntlib.c' --- lib-src/ntlib.c 2012-08-09 23:59:38 +0000 +++ lib-src/ntlib.c 2012-09-30 21:36:42 +0000 @@ -29,9 +29,16 @@ #include #include #include +#include #include "ntlib.h" +struct timezone +{ + int tz_minuteswest; /* minutes west of Greenwich */ + int tz_dsttime; /* type of dst correction */ +}; + #define MAXPATHLEN _MAX_PATH /* Emulate sleep...we could have done this with a define, but that @@ -202,6 +209,29 @@ return NULL; } +/* This is needed because lib/gettime.c calls gettimeofday, which MSVC + doesn't have. Copied from w32.c. */ +void +gettimeofday (struct timeval *tv, struct timezone *tz) +{ + struct _timeb tb; + _ftime (&tb); + + tv->tv_sec = tb.time; + tv->tv_usec = tb.millitm * 1000L; + /* Implementation note: _ftime sometimes doesn't update the dstflag + according to the new timezone when the system timezone is + changed. We could fix that by using GetSystemTime and + GetTimeZoneInformation, but that doesn't seem necessary, since + Emacs always calls gettimeofday with the 2nd argument NULL (see + current_emacs_time). */ + if (tz) + { + tz->tz_minuteswest = tb.timezone; /* minutes west of Greenwich */ + tz->tz_dsttime = tb.dstflag; /* type of dst correction */ + } +} + int fchown (int fd, unsigned uid, unsigned gid) { === modified file 'nt/ChangeLog' --- nt/ChangeLog 2012-09-30 15:49:05 +0000 +++ nt/ChangeLog 2012-09-30 21:36:42 +0000 @@ -1,5 +1,42 @@ 2012-09-30 Eli Zaretskii + * makefile.w32-in ($(TRES)): Use $(EMACS_MANIFEST). + +2012-09-30 Fabrice Popineau + + * inc/sys/socket.h: Don't map Winsock error codes to standard ones + that are already defined. + + * inc/ms-w32.h (EMACS_INT, EMACS_UINT, EMACS_INT_MAX, PRIuMAX) + (pI, _INTPTR) [_MSC_VER]: Fix definitions for MSVC. + [_MSC_VER]: Add pragmas to suppress some MSVC warnings. + + * preprep.c (pfnCheckSumMappedFile, rva_to_section) + (offset_to_section, relocate_offset, OFFSET_TO_RVA) + (RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET, PTR_TO_RVA) + (OFFSET_TO_PTR, ROUND_UP, ROUND_DOWN) + (copy_executable_and_move_sections, ADJUST_IMPORT_RVA, main): Use + DWORD_PTR instead of DWORD for compatibility with x64. + + * nmake.defs: Support AMD64. + (EMACS_HEAPSIZE, EMACS_PURESIZE, EMACS_MANIFEST): New macros. + + * gmake.defs: (EMACS_HEAPSIZE, EMACS_PURESIZE, EMACS_MANIFEST): + New macros. + + * addsection.c (pfnCheckSumMappedFile, rva_to_section) + (offset_to_section, relocate_offset, OFFSET_TO_RVA) + (RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET, PTR_TO_RVA) + (OFFSET_TO_PTR, ROUND_UP, ROUND_DOWN) + (copy_executable_and_add_section, main): Use DWORD_PTR instead of + DWORD, for compatibility with x64. + + * emacs-x64.manifest: New file. + + * emacs-x86.manifest: Renamed from emacs.manifest. + +2012-09-30 Eli Zaretskii + * inc/sys/time.h (ITIMER_REAL, ITIMER_PROF): Define. (struct itimerval): Define. (getitimer, setitimer): Add prototypes. === modified file 'nt/addsection.c' --- nt/addsection.c 2012-01-19 07:21:25 +0000 +++ nt/addsection.c 2012-09-30 21:36:42 +0000 @@ -35,10 +35,10 @@ in \\win32sdk\mstools\samples\image\include\imagehlp.h. */ PIMAGE_NT_HEADERS -(__stdcall * pfnCheckSumMappedFile) (LPVOID BaseAddress, - DWORD FileLength, - LPDWORD HeaderSum, - LPDWORD CheckSum); +(__stdcall * pfnCheckSumMappedFile) (PVOID BaseAddress, + DWORD_PTR FileLength, + PDWORD_PTR HeaderSum, + PDWORD_PTR CheckSum); #undef min #undef max @@ -164,7 +164,7 @@ /* Return pointer to section header for section containing the given relative virtual address. */ IMAGE_SECTION_HEADER * -rva_to_section (DWORD rva, IMAGE_NT_HEADERS * nt_header) +rva_to_section (DWORD_PTR rva, IMAGE_NT_HEADERS * nt_header) { PIMAGE_SECTION_HEADER section; int i; @@ -179,7 +179,7 @@ some very old exes (eg. gzip dated Dec 1993). Since w32_executable_type relies on this function to work reliably, we need to cope with this. */ - DWORD real_size = max (section->SizeOfRawData, + DWORD_PTR real_size = max (section->SizeOfRawData, section->Misc.VirtualSize); if (rva >= section->VirtualAddress && rva < section->VirtualAddress + real_size) @@ -192,7 +192,7 @@ /* Return pointer to section header for section containing the given offset in its raw data area. */ IMAGE_SECTION_HEADER * -offset_to_section (DWORD offset, IMAGE_NT_HEADERS * nt_header) +offset_to_section (DWORD_PTR offset, IMAGE_NT_HEADERS * nt_header) { PIMAGE_SECTION_HEADER section; int i; @@ -212,8 +212,8 @@ /* Return offset to an object in dst, given offset in src. We assume there is at least one section in both src and dst images, and that the some sections may have been added to dst (after sections in src). */ -static DWORD -relocate_offset (DWORD offset, +static DWORD_PTR +relocate_offset (DWORD_PTR offset, IMAGE_NT_HEADERS * src_nt_header, IMAGE_NT_HEADERS * dst_nt_header) { @@ -247,32 +247,33 @@ } #define OFFSET_TO_RVA(offset, section) \ - (section->VirtualAddress + ((DWORD)(offset) - section->PointerToRawData)) + (section->VirtualAddress + ((DWORD_PTR)(offset) - section->PointerToRawData)) #define RVA_TO_OFFSET(rva, section) \ - (section->PointerToRawData + ((DWORD)(rva) - section->VirtualAddress)) + (section->PointerToRawData + ((DWORD_PTR)(rva) - section->VirtualAddress)) #define RVA_TO_SECTION_OFFSET(rva, section) \ - ((DWORD)(rva) - section->VirtualAddress) + ((DWORD_PTR)(rva) - section->VirtualAddress) /* Convert address in executing image to RVA. */ -#define PTR_TO_RVA(ptr) ((DWORD)(ptr) - (DWORD) GetModuleHandle (NULL)) +#define PTR_TO_RVA(ptr) ((DWORD_PTR)(ptr) - (DWORD_PTR) GetModuleHandle (NULL)) #define PTR_TO_OFFSET(ptr, pfile_data) \ ((unsigned const char *)(ptr) - (pfile_data)->file_base) #define OFFSET_TO_PTR(offset, pfile_data) \ - ((pfile_data)->file_base + (DWORD)(offset)) + ((pfile_data)->file_base + (DWORD_PTR)(offset)) -#define ROUND_UP(p, align) (((DWORD)(p) + (align)-1) & ~((align)-1)) -#define ROUND_DOWN(p, align) ((DWORD)(p) & ~((align)-1)) +#define ROUND_UP(p, align) \ + (((DWORD_PTR)(p) + (align)-1) & ~((DWORD_PTR)(align)-1)) +#define ROUND_DOWN(p, align) ((DWORD_PTR)(p) & ~((DWORD_PTR)(align)-1)) static void copy_executable_and_add_section (file_data *p_infile, file_data *p_outfile, const char *new_section_name, - DWORD new_section_size) + DWORD_PTR new_section_size) { unsigned char *dst; PIMAGE_DOS_HEADER dos_header; @@ -280,7 +281,7 @@ PIMAGE_NT_HEADERS dst_nt_header; PIMAGE_SECTION_HEADER section; PIMAGE_SECTION_HEADER dst_section; - DWORD offset; + DWORD_PTR offset; int i; int be_verbose = GetEnvironmentVariable ("DEBUG_DUMP", NULL, 0) > 0; @@ -317,17 +318,17 @@ Note that dst is updated implicitly by each COPY_CHUNK. */ dos_header = (PIMAGE_DOS_HEADER) p_infile->file_base; - nt_header = (PIMAGE_NT_HEADERS) (((unsigned long) dos_header) + + nt_header = (PIMAGE_NT_HEADERS) (((unsigned char *) dos_header) + dos_header->e_lfanew); section = IMAGE_FIRST_SECTION (nt_header); dst = (unsigned char *) p_outfile->file_base; COPY_CHUNK ("Copying DOS header...", dos_header, - (DWORD) nt_header - (DWORD) dos_header, be_verbose); + (DWORD_PTR) nt_header - (DWORD_PTR) dos_header, be_verbose); dst_nt_header = (PIMAGE_NT_HEADERS) dst; COPY_CHUNK ("Copying NT header...", nt_header, - (DWORD) section - (DWORD) nt_header, be_verbose); + (DWORD_PTR) section - (DWORD_PTR) nt_header, be_verbose); dst_section = (PIMAGE_SECTION_HEADER) dst; COPY_CHUNK ("Copying section table...", section, nt_header->FileHeader.NumberOfSections * sizeof (*section), @@ -509,8 +510,8 @@ /* Patch up header fields; profiler is picky about this. */ { HANDLE hImagehelp = LoadLibrary ("imagehlp.dll"); - DWORD headersum; - DWORD checksum; + DWORD_PTR headersum; + DWORD_PTR checksum; dos_header = (PIMAGE_DOS_HEADER) out_file.file_base; nt_header = (PIMAGE_NT_HEADERS) ((char *) dos_header + dos_header->e_lfanew); === added file 'nt/emacs-x64.manifest' --- nt/emacs-x64.manifest 1970-01-01 00:00:00 +0000 +++ nt/emacs-x64.manifest 2012-09-30 21:36:42 +0000 @@ -0,0 +1,21 @@ + + + + + + + + + GNU Emacs + + + + + + + + === renamed file 'nt/emacs.manifest' => 'nt/emacs-x86.manifest' === modified file 'nt/emacs.rc' --- nt/emacs.rc 2012-08-28 16:01:59 +0000 +++ nt/emacs.rc 2012-09-30 21:36:42 +0000 @@ -1,6 +1,10 @@ Emacs ICON icons\emacs.ico 32649 CURSOR icons\hand.cur -1 24 "emacs.manifest" +#ifdef WIN64 +1 24 "emacs-x64.manifest" +#else +1 24 "emacs-x86.manifest" +#endif #ifndef VS_VERSION_INFO #define VS_VERSION_INFO 1 === modified file 'nt/gmake.defs' --- nt/gmake.defs 2012-07-04 17:17:19 +0000 +++ nt/gmake.defs 2012-09-30 21:36:42 +0000 @@ -139,15 +139,27 @@ ifeq "$(PROCESSOR_ARCHITECTURE)" "x86" ARCH = i386 CPU = i386 +EMACS_HEAPSIZE = 27 +EMACS_PURESIZE = 5000000 +EMACS_MANIFEST = emacs-x86.manifest else ifeq "$(PROCESSOR_ARCHITECTURE)" "MIPS" ARCH = mips +EMACS_HEAPSIZE = 27 +EMACS_PURESIZE = 5000000 +EMACS_MANIFEST = emacs-mips.manifest else ifeq "$(PROCESSOR_ARCHITECTURE)" "ALPHA" ARCH = alpha +EMACS_HEAPSIZE = 27 +EMACS_PURESIZE = 5000000 +EMACS_MANIFEST = emacs-alpha.manifest else ifeq "$(PROCESSOR_ARCHITECTURE)" "PPC" ARCH = ppc +EMACS_HEAPSIZE = 27 +EMACS_PURESIZE = 5000000 +EMACS_MANIFEST = emacs-ppc.manifest else $(error Unknown architecture type "$(PROCESSOR_ARCHITECTURE)") endif === modified file 'nt/inc/ms-w32.h' --- nt/inc/ms-w32.h 2012-09-30 15:49:05 +0000 +++ nt/inc/ms-w32.h 2012-09-30 21:36:42 +0000 @@ -358,7 +358,7 @@ extern int getloadavg (double *, int); -#if defined (__MINGW32__) || _MSC_VER >= 1400 +#if defined (__MINGW32__) /* Define to 1 if the system has the type `long long int'. */ # define HAVE_LONG_LONG_INT 1 @@ -366,21 +366,37 @@ /* Define to 1 if the system has the type `unsigned long long int'. */ # define HAVE_UNSIGNED_LONG_LONG_INT 1 -#elif _MSC_VER >= 1200 +#endif +#ifdef _MSC_VER +# if defined(_WIN64) +typedef __int64 EMACS_INT; +typedef unsigned __int64 EMACS_UINT; +# define EMACS_INT_MAX LLONG_MAX +# define PRIuMAX "llu" +# define pI "ll" +/* Fix a bug in MSVC headers : stdint.h */ +# define _INTPTR 2 +# elif defined(_WIN32) /* Temporarily disable wider-than-pointer integers until they're tested more. Build with CFLAGS='-DWIDE_EMACS_INT' to try them out. */ -# ifdef WIDE_EMACS_INT +# ifdef WIDE_EMACS_INT /* Use pre-C99-style 64-bit integers. */ typedef __int64 EMACS_INT; typedef unsigned __int64 EMACS_UINT; -# define EMACS_INT_MAX _I64_MAX -# define pI "I64" - +# define EMACS_INT_MAX LLONG_MAX +# define PRIuMAX "llu" +# define pI "I64" +# else +typedef int EMACS_INT; +typedef unsigned int EMACS_UINT; +# define EMACS_INT_MAX LONG_MAX +# define PRIuMAX "lu" +# define pI "l" +# endif # endif - #endif /* We need a little extra space, see ../../lisp/loadup.el. */ @@ -420,6 +436,22 @@ #define DebPrint(stuff) #endif +#ifdef _MSC_VER +#if _MSC_VER >= 800 && !defined(__cplusplus) +/* Unnamed type definition in parentheses. + A structure, union, or enumerated type with no name is defined in a + parenthetical expression. The type definition is meaningless. */ +#pragma warning(disable:4116) +/* 'argument' : conversion from 'type1' to 'type2', possible loss of + data A floating point type was converted to an integer type. A + possible loss of data may have occurred. */ +#pragma warning(disable:4244) +/* Negative integral constant converted to unsigned type. + An expression converts a negative integer constant to an unsigned type. + The result of the expression is probably meaningless. */ +#pragma warning(disable:4308) +#endif +#endif #define TERM_HEADER "w32term.h" === modified file 'nt/inc/sys/socket.h' --- nt/inc/sys/socket.h 2012-01-19 07:21:25 +0000 +++ nt/inc/sys/socket.h 2012-09-30 21:36:42 +0000 @@ -126,42 +126,147 @@ extern int h_errno; /* map winsock error codes to standard names */ +#if defined(EWOULDBLOCK) +#undef EWOULDBLOCK +#endif #define EWOULDBLOCK WSAEWOULDBLOCK +#if defined(EINPROGRESS) +#undef EINPROGRESS +#endif #define EINPROGRESS WSAEINPROGRESS +#if defined(EALREADY) +#undef EALREADY +#endif #define EALREADY WSAEALREADY +#if defined(ENOTSOCK) +#undef ENOTSOCK +#endif #define ENOTSOCK WSAENOTSOCK +#if defined(EDESTADDRREQ) +#undef EDESTADDRREQ +#endif #define EDESTADDRREQ WSAEDESTADDRREQ +#if defined(EMSGSIZE) +#undef EMSGSIZE +#endif #define EMSGSIZE WSAEMSGSIZE +#if defined(EPROTOTYPE) +#undef EPROTOTYPE +#endif #define EPROTOTYPE WSAEPROTOTYPE +#if defined(ENOPROTOOPT) +#undef ENOPROTOOPT +#endif #define ENOPROTOOPT WSAENOPROTOOPT +#if defined(EPROTONOSUPPORT) +#undef EPROTONOSUPPORT +#endif #define EPROTONOSUPPORT WSAEPROTONOSUPPORT +#if defined(ESOCKTNOSUPPORT) +#undef ESOCKTNOSUPPORT +#endif #define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT +#if defined(EOPNOTSUPP) +#undef EOPNOTSUPP +#endif #define EOPNOTSUPP WSAEOPNOTSUPP +#if defined(EPFNOSUPPORT) +#undef EPFNOSUPPORT +#endif #define EPFNOSUPPORT WSAEPFNOSUPPORT +#if defined(EAFNOSUPPORT) +#undef EAFNOSUPPORT +#endif #define EAFNOSUPPORT WSAEAFNOSUPPORT +#if defined(EADDRINUSE) +#undef EADDRINUSE +#endif #define EADDRINUSE WSAEADDRINUSE +#if defined(EADDRNOTAVAIL) +#undef EADDRNOTAVAIL +#endif #define EADDRNOTAVAIL WSAEADDRNOTAVAIL +#if defined(ENETDOWN) +#undef ENETDOWN +#endif #define ENETDOWN WSAENETDOWN +#if defined(ENETUNREACH) +#undef ENETUNREACH +#endif #define ENETUNREACH WSAENETUNREACH +#if defined(ENETRESET) +#undef ENETRESET +#endif #define ENETRESET WSAENETRESET +#if defined(ECONNABORTED) +#undef ECONNABORTED +#endif #define ECONNABORTED WSAECONNABORTED +#if defined(ECONNRESET) +#undef ECONNRESET +#endif #define ECONNRESET WSAECONNRESET +#if defined(ENOBUFS) +#undef ENOBUFS +#endif #define ENOBUFS WSAENOBUFS +#if defined(EISCONN) +#undef EISCONN +#endif #define EISCONN WSAEISCONN +#if defined(ENOTCONN) +#undef ENOTCONN +#endif #define ENOTCONN WSAENOTCONN +#if defined(ESHUTDOWN) +#undef ESHUTDOWN +#endif #define ESHUTDOWN WSAESHUTDOWN +#if defined(ETOOMANYREFS) +#undef ETOOMANYREFS +#endif #define ETOOMANYREFS WSAETOOMANYREFS +#if defined(ETIMEDOUT) +#undef ETIMEDOUT +#endif #define ETIMEDOUT WSAETIMEDOUT +#if defined(ECONNREFUSED) +#undef ECONNREFUSED +#endif #define ECONNREFUSED WSAECONNREFUSED +#if defined(ELOOP) +#undef ELOOP +#endif #define ELOOP WSAELOOP /* #define ENAMETOOLONG WSAENAMETOOLONG */ +#if defined(EHOSTDOWN) +#undef EHOSTDOWN +#endif #define EHOSTDOWN WSAEHOSTDOWN +#if defined(EHOSTUNREACH) +#undef EHOSTUNREACH +#endif #define EHOSTUNREACH WSAEHOSTUNREACH /* #define ENOTEMPTY WSAENOTEMPTY */ +#if defined(EPROCLIM) +#undef EPROCLIM +#endif #define EPROCLIM WSAEPROCLIM +#if defined(EUSERS) +#undef EUSERS +#endif #define EUSERS WSAEUSERS +#if defined(EDQUOT) +#undef EDQUOT +#endif #define EDQUOT WSAEDQUOT +#if defined(ESTALE) +#undef ESTALE +#endif #define ESTALE WSAESTALE +#if defined(EREMOTE) +#undef EREMOTE +#endif #define EREMOTE WSAEREMOTE #endif /* _SOCKET_H_ */ === modified file 'nt/makefile.w32-in' --- nt/makefile.w32-in 2012-08-28 16:01:59 +0000 +++ nt/makefile.w32-in 2012-09-30 21:36:42 +0000 @@ -66,7 +66,7 @@ # The resource file. NT 3.10 requires the use of cvtres; even though # it is not necessary on later versions, it is still ok to use it. # -$(TRES): emacs.rc icons/emacs.ico emacs.manifest stamp_BLD +$(TRES): emacs.rc icons/emacs.ico $(EMACS_MANIFEST) stamp_BLD $(RC) $(RC_OUT)$(TRES) emacs.rc $(CLIENTRES): emacsclient.rc stamp_BLD === modified file 'nt/nmake.defs' --- nt/nmake.defs 2012-07-04 17:17:19 +0000 +++ nt/nmake.defs 2012-09-30 21:36:42 +0000 @@ -87,7 +87,11 @@ ! if "$(PROCESSOR_ARCHITECTURE)" == "PPC" ARCH = ppc ! else -! error Unknown architecture type "$(PROCESSOR_ARCHITECTURE)" +! if "$(PROCESSOR_ARCHITECTURE)" == "AMD64" +ARCH = AMD64 +! else +! error Unknown architecture type "$(PROCESSOR_ARCHITECTURE)" +! endif ! endif ! endif ! endif @@ -106,7 +110,7 @@ CC_OUT = -Fo LINK = link LINK_OUT = -out: -RC = rc +RC = rc $(ARCH_RCFLAGS) RC_OUT = -Fo RC_INCLUDE = -i @@ -147,21 +151,21 @@ MWINDOWS = -subsystem:windows -entry:mainCRTStartup -CFLAGS = -I. $(ARCH_CFLAGS) \ +CFLAGS = -I. $(ARCH_CFLAGS) -D_CRT_SECURE_NO_WARNINGS \ $(DEBUG_CFLAGS) $(USER_CFLAGS) $(LOCAL_FLAGS) -ESC_CFLAGS = -I. $(ARCH_CFLAGS) \ +ESC_CFLAGS = -I. $(ARCH_CFLAGS) -D_CRT_SECURE_NO_WARNINGS \ $(DEBUG_CFLAGS) $(ESC_USER_CFLAGS) $(LOCAL_FLAGS) #SYS_LDFLAGS = -nologo -release -incremental:no -version:3.10 -swaprun:cd -swaprun:net setargv.obj -!ifdef NOOPT -SYS_LDFLAGS = -nologo -manifest -dynamicbase:no -debug -incremental:no -version:3.10 -swaprun:cd -swaprun:net setargv.obj -!else -SYS_LDFLAGS = -nologo -manifest -dynamicbase:no -release -incremental:no -version:3.10 -swaprun:cd -swaprun:net setargv.obj -!endif +SYS_LDFLAGS = -nologo -manifest -dynamicbase:no -incremental:no -version:3.10 -swaprun:cd -swaprun:net setargv.obj # see comments in allocate_heap in w32heap.c before changing any of the # -stack, -heap, or -base settings. -TEMACS_EXTRA_LINK = -stack:0x00800000 -heap:0x00100000 -base:0x01000000 -pdb:$(BLD)\temacs.pdb -machine:$(ARCH) $(SUBSYSTEM_CONSOLE) -entry:_start -map:$(BLD)\temacs.map $(EXTRA_LINK) +!if "$(ARCH)" == "i386" +TEMACS_EXTRA_LINK = -stack:0x00800000 -heap:0x00100000 -base:0x01000000 -pdb:$(BLD)\temacs.pdb -machine:x86 $(SUBSYSTEM_CONSOLE) -entry:_start -map:$(BLD)\temacs.map $(EXTRA_LINK) +!elseif "$(ARCH)" == "AMD64" +TEMACS_EXTRA_LINK = -stack:0x00800000 -heap:0x00100000 -base:0x400000000 -pdb:$(BLD)\temacs.pdb -machine:x64 $(SUBSYSTEM_CONSOLE) -entry:_start -map:$(BLD)\temacs.map $(EXTRA_LINK) +!endif !ifdef NOOPT OBJDIR = obj @@ -212,11 +216,17 @@ ARCH_CFLAGS = -nologo -D_X86_=1 -c -Zl -Zp8 -W2 -Oi -Ot -Oy- -Ob2 -GF -Gy -Gd $(DEBUG_FLAG) !endif ARCH_LDFLAGS = $(SYS_LDFLAGS) +EMACS_HEAPSIZE = 27 +EMACS_PURESIZE = 5000000 +EMACS_MANIFEST = emacs-x86.manifest !else !if "$(ARCH)" == "mips" ARCH_CFLAGS = -D_MIPS_=1 -c -W2 -Zi -Od -Gt0 ARCH_LDFLAGS = $(SYS_LDFLAGS) +EMACS_HEAPSIZE = 27 +EMACS_PURESIZE = 5000000 +EMACS_MANIFEST = emacs-mips.manifest !else !if "$(ARCH)" == "alpha" @@ -226,12 +236,30 @@ ARCH_CFLAGS = -D_ALPHA_=1 -c -Ze -Zi -W2 -O1 -D__stdcall= -D__cdecl= !endif ARCH_LDFLAGS = $(SYS_LDFLAGS) +EMACS_HEAPSIZE = 27 +EMACS_PURESIZE = 5000000 +EMACS_MANIFEST = emacs-alpha.manifest !else !if "$(ARCH)" == "ppc" # These flags are a guess...if they don't work, please send me mail. -ARCH_CFLAGS = -D_PPC_=1 -c -Ze -Zi -W2 -Od ARCH_LDFLAGS = $(SYS_LDFLAGS) +EMACS_HEAPSIZE = 27 +EMACS_PURESIZE = 5000000 +EMACS_MANIFEST = emacs-ppc.manifest + +!else +!if "$(ARCH)" == "AMD64" +!ifdef NOOPT +ARCH_CFLAGS = -nologo -D_AMD64_=1 -DWIN64 -D_WIN64 -DWIN32 -D_WIN32 -c -Zl -Zp8 -W2 -Od -Gd -Wp64 $(DEBUG_FLAG) +!else +ARCH_CFLAGS = -nologo -D_AMD64_=1 -DWIN64 -D_WIN64 -DWIN32 -D_WIN32 -c -Zl -Zp8 -W2 -O2x -GF -Gy -Gd $(DEBUG_FLAG) +!endif +ARCH_LDFLAGS = $(SYS_LDFLAGS) -machine:x64 +ARCH_RCFLAGS = -DWIN64 +EMACS_HEAPSIZE = 42 +EMACS_PURESIZE = 10000000 +EMACS_MANIFEST = emacs-x64.manifest !else !ERROR Unknown architecture type "$(ARCH)". @@ -239,6 +267,7 @@ !endif !endif !endif +!endif LINK_FLAGS = $(ARCH_LDFLAGS) $(DEBUG_LINK) $(USER_LDFLAGS) @@ -262,4 +291,3 @@ .c{$(BLD)}.obj:: $(CC) $(CFLAGS) -Fo$(BLD)\ $< !ENDIF - === modified file 'nt/preprep.c' --- nt/preprep.c 2012-01-19 07:21:25 +0000 +++ nt/preprep.c 2012-09-30 21:36:42 +0000 @@ -36,9 +36,9 @@ PIMAGE_NT_HEADERS (__stdcall * pfnCheckSumMappedFile) (LPVOID BaseAddress, - DWORD FileLength, - LPDWORD HeaderSum, - LPDWORD CheckSum); + DWORD_PTR FileLength, + PDWORD_PTR HeaderSum, + PDWORD_PTR CheckSum); #undef min #undef max @@ -196,7 +196,7 @@ /* Return pointer to section header for section containing the given relative virtual address. */ IMAGE_SECTION_HEADER * -rva_to_section (DWORD rva, IMAGE_NT_HEADERS * nt_header) +rva_to_section (DWORD_PTR rva, IMAGE_NT_HEADERS * nt_header) { PIMAGE_SECTION_HEADER section; int i; @@ -211,7 +211,7 @@ some very old exes (eg. gzip dated Dec 1993). Since w32_executable_type relies on this function to work reliably, we need to cope with this. */ - DWORD real_size = max (section->SizeOfRawData, + DWORD_PTR real_size = max (section->SizeOfRawData, section->Misc.VirtualSize); if (rva >= section->VirtualAddress && rva < section->VirtualAddress + real_size) @@ -224,7 +224,7 @@ /* Return pointer to section header for section containing the given offset in its raw data area. */ IMAGE_SECTION_HEADER * -offset_to_section (DWORD offset, IMAGE_NT_HEADERS * nt_header) +offset_to_section (DWORD_PTR offset, IMAGE_NT_HEADERS * nt_header) { PIMAGE_SECTION_HEADER section; int i; @@ -244,8 +244,8 @@ /* Return offset to an object in dst, given offset in src. We assume there is at least one section in both src and dst images, and that the some sections may have been added to dst (after sections in src). */ -static DWORD -relocate_offset (DWORD offset, +static DWORD_PTR +relocate_offset (DWORD_PTR offset, IMAGE_NT_HEADERS * src_nt_header, IMAGE_NT_HEADERS * dst_nt_header) { @@ -279,28 +279,29 @@ } #define OFFSET_TO_RVA(offset, section) \ - (section->VirtualAddress + ((DWORD)(offset) - section->PointerToRawData)) + (section->VirtualAddress + ((DWORD_PTR)(offset) - section->PointerToRawData)) #define RVA_TO_OFFSET(rva, section) \ - (section->PointerToRawData + ((DWORD)(rva) - section->VirtualAddress)) + (section->PointerToRawData + ((DWORD_PTR)(rva) - section->VirtualAddress)) #define RVA_TO_SECTION_OFFSET(rva, section) \ - ((DWORD)(rva) - section->VirtualAddress) + ((DWORD_PTR)(rva) - section->VirtualAddress) #define RVA_TO_PTR(var,section,filedata) \ ((void *)(RVA_TO_OFFSET(var,section) + (filedata)->file_base)) /* Convert address in executing image to RVA. */ -#define PTR_TO_RVA(ptr) ((DWORD)(ptr) - (DWORD) GetModuleHandle (NULL)) +#define PTR_TO_RVA(ptr) ((DWORD_PTR)(ptr) - (DWORD_PTR) GetModuleHandle (NULL)) #define PTR_TO_OFFSET(ptr, pfile_data) \ ((unsigned const char *)(ptr) - (pfile_data)->file_base) #define OFFSET_TO_PTR(offset, pfile_data) \ - ((pfile_data)->file_base + (DWORD)(offset)) + ((pfile_data)->file_base + (DWORD_PTR)(offset)) -#define ROUND_UP(p, align) (((DWORD)(p) + (align)-1) & ~((align)-1)) -#define ROUND_DOWN(p, align) ((DWORD)(p) & ~((align)-1)) +#define ROUND_UP(p, align) \ + (((DWORD_PTR)(p) + (align)-1) & ~((DWORD_PTR)(align)-1)) +#define ROUND_DOWN(p, align) ((DWORD_PTR)(p) & ~((DWORD_PTR)(align)-1)) /* The MSVC prep program generates a ._xe file from .exe, where relevant @@ -353,9 +354,9 @@ PIMAGE_SECTION_HEADER reloc_section; PIMAGE_DATA_DIRECTORY import_dir; PIMAGE_DATA_DIRECTORY reloc_dir; - DWORD import_delta_rva; - DWORD reloc_delta_rva; - DWORD offset; + DWORD_PTR import_delta_rva; + DWORD_PTR reloc_delta_rva; + DWORD_PTR offset; int i; #define COPY_CHUNK(message, src, size) \ @@ -388,7 +389,7 @@ Note that dst is updated implicitly by each COPY_CHUNK. */ dos_header = (PIMAGE_DOS_HEADER) p_infile->file_base; - nt_header = (PIMAGE_NT_HEADERS) (((unsigned long) dos_header) + + nt_header = (PIMAGE_NT_HEADERS) (((unsigned char *) dos_header) + dos_header->e_lfanew); section = IMAGE_FIRST_SECTION (nt_header); @@ -406,10 +407,10 @@ dst = (unsigned char *) p_outfile->file_base; COPY_CHUNK ("Copying DOS header...", dos_header, - (DWORD) nt_header - (DWORD) dos_header); + (DWORD_PTR) nt_header - (DWORD_PTR) dos_header); dst_nt_header = (PIMAGE_NT_HEADERS) dst; COPY_CHUNK ("Copying NT header...", nt_header, - (DWORD) section - (DWORD) nt_header); + (DWORD_PTR) section - (DWORD_PTR) nt_header); dst_section = (PIMAGE_SECTION_HEADER) dst; COPY_CHUNK ("Copying section table...", section, nt_header->FileHeader.NumberOfSections * sizeof (*section)); @@ -537,7 +538,7 @@ #define ADJUST_IMPORT_RVA(var) \ do { \ if ((var) != 0) \ - *((DWORD *)&(var)) += import_delta_rva; \ + *((DWORD_PTR *)&(var)) += import_delta_rva; \ } while (0) dst_nt_header->OptionalHeader.SizeOfInitializedData = 0; @@ -627,10 +628,10 @@ { IMAGE_BASE_RELOCATION *relocs, *block, *start_block, *end_block; - DWORD import_start = import_section->VirtualAddress + dst_nt_header->OptionalHeader.ImageBase; - DWORD import_end = import_start + import_section->Misc.VirtualSize; - DWORD len_import_relocs; - DWORD len_remaining_relocs; + DWORD_PTR import_start = import_section->VirtualAddress + dst_nt_header->OptionalHeader.ImageBase; + DWORD_PTR import_end = import_start + import_section->Misc.VirtualSize; + DWORD_PTR len_import_relocs; + DWORD_PTR len_remaining_relocs; int seen_high = 0; WORD * high_word; void * holder; @@ -643,8 +644,8 @@ any; the profiler needs to be able to patch RVAs in the import section itself. */ for (block = relocs, start_block = 0; - (DWORD) block - (DWORD) relocs < reloc_dir->Size; - block = (void *)((DWORD) block + block->SizeOfBlock)) + (DWORD_PTR) block - (DWORD_PTR) relocs < reloc_dir->Size; + block = (void *)((DWORD_PTR) block + block->SizeOfBlock)) { if (block->VirtualAddress >= import_section->VirtualAddress + import_section->Misc.VirtualSize) { @@ -660,8 +661,8 @@ } if (start_block) { - len_import_relocs = (DWORD) end_block - (DWORD) start_block; - len_remaining_relocs = (DWORD) relocs + reloc_dir->Size - (DWORD) end_block; + len_import_relocs = (DWORD_PTR) end_block - (DWORD_PTR) start_block; + len_remaining_relocs = (DWORD_PTR) relocs + reloc_dir->Size - (DWORD_PTR) end_block; holder = malloc (len_import_relocs); if (holder == 0) abort (); @@ -675,14 +676,14 @@ to the old import section location, and patching them to reference the new location. */ for (block = relocs; - (DWORD) block - (DWORD) relocs < reloc_dir->Size; - block = (void *)((DWORD) block + block->SizeOfBlock)) + (DWORD_PTR) block - (DWORD_PTR) relocs < reloc_dir->Size; + block = (void *)((DWORD_PTR) block + block->SizeOfBlock)) { - DWORD page_rva = block->VirtualAddress; - DWORD page_offset; + DWORD_PTR page_rva = block->VirtualAddress; + DWORD_PTR page_offset; union { WORD word; - DWORD dword; + DWORD_PTR dword; } * ploc; WORD *fixup; @@ -692,7 +693,7 @@ continue; for (fixup = (WORD *) &block[1]; - (DWORD) fixup - (DWORD) block < block->SizeOfBlock; + (DWORD_PTR) fixup - (DWORD_PTR) block < block->SizeOfBlock; fixup++) { page_offset = (*fixup) & 0xfff; @@ -794,8 +795,8 @@ /* Patch up header fields; profiler is picky about this. */ { HANDLE hImagehelp = LoadLibrary ("imagehlp.dll"); - DWORD headersum; - DWORD checksum; + DWORD_PTR headersum; + DWORD_PTR checksum; dos_header = (PIMAGE_DOS_HEADER) out_file.file_base; nt_header = (PIMAGE_NT_HEADERS) ((char *) dos_header + dos_header->e_lfanew); === modified file 'src/ChangeLog' --- src/ChangeLog 2012-09-30 21:12:04 +0000 +++ src/ChangeLog 2012-09-30 21:36:42 +0000 @@ -1,3 +1,75 @@ +2012-09-30 Fabrice Popineau + + Support x64 build on MS-Windows. + * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64. + (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for + compatibility with x64. + + * w32term.c (w32_draw_underwave): Don't use GCC extensions for + defining an XRectangle structure. + + * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer + arithmetics for compatibility with x64. + + * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for + compatibility with x64. + + * w32heap.h: Adjust prototypes and declarations. + + * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap) + (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of + DWORD, long, and unsigned long, for compatibility with x64. + (allocate_heap) [_WIN64]: Reserve 32GB of memory. + (sbrk): Argument is now of type ptrdiff_t. + + * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being + less than 0x0500. + (w32_msg_pump): Use WPARAM type for 'result'. + + * w32.c (init_environment, get_emacs_configuration): Support AMD64 + architecture. + (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for + compatibility with x64. + + * vm-limit.c (lim_data): Now size_t. + (check_memory_limits): Adjust prototypes of real_morecore and + __morecore to receive argument of type ptrdiff_t. Use size_t for + five_percent and data_size. + + * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope + variables, for compatibility with x64. + (rva_to_section, offset_to_section, relocate_offset) + (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET) + (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info) + (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD + for compatibility with x64. + + * sysdep.c (STDERR_FILENO): Define if not already defined. + + * ralloc.c (real_morecore): Argument type is now ptrdiff_t. + (__morecore): Argument type is now ptrdiff_t. + (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'. + (relinquish): Use ptrdiff_t type for 'excess'. + (r_alloc_sbrk): Argument type is now ptrdiff_t. + + * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE. + (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE) + instead of a literal number. + + * gmalloc.c [WINDOWSNT]: Include w32heap.h. + (min): Define only if not already defined. + + * frame.c (x_report_frame_params): Use EMACS_UINT for the return + value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows + hosts. + + * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since + 'bitmaps' is a pointer. + + * dispextern.h (x_bitmap_pixmap): Adjust prototype. + + * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__. + 2012-09-30 Paul Eggert file-attributes has a new optional arg FOLLOW-SYMLINKS. === modified file 'src/alloc.c' --- src/alloc.c 2012-09-29 02:02:34 +0000 +++ src/alloc.c 2012-09-30 21:36:42 +0000 @@ -74,6 +74,7 @@ #endif #ifdef WINDOWSNT #include "w32.h" +#include "w32heap.h" /* for sbrk */ #endif #ifdef DOUG_LEA_MALLOC @@ -6607,7 +6608,8 @@ /* When compiled with GCC, GDB might say "No enum type named pvec_type" if we don't have at least one symbol with that type, and then xbacktrace could fail. Similarly for the other enums and - their values. */ + their values. Some non-GCC compilers don't like these constructs. */ +#ifdef __GNUC__ union { enum CHARTAB_SIZE_BITS CHARTAB_SIZE_BITS; @@ -6627,3 +6629,4 @@ enum lsb_bits lsb_bits; #endif } const EXTERNALLY_VISIBLE gdb_make_enums_visible = {0}; +#endif /* __GNUC__ */ === modified file 'src/dispextern.h' --- src/dispextern.h 2012-09-24 21:38:23 +0000 +++ src/dispextern.h 2012-09-30 21:36:42 +0000 @@ -3157,7 +3157,7 @@ extern int x_bitmap_height (struct frame *, ptrdiff_t); extern int x_bitmap_width (struct frame *, ptrdiff_t); -extern int x_bitmap_pixmap (struct frame *, ptrdiff_t); +extern ptrdiff_t x_bitmap_pixmap (struct frame *, ptrdiff_t); extern void x_reference_bitmap (struct frame *, ptrdiff_t); extern ptrdiff_t x_create_bitmap_from_data (struct frame *, char *, unsigned int, unsigned int); === modified file 'src/frame.c' --- src/frame.c 2012-09-23 08:44:20 +0000 +++ src/frame.c 2012-09-30 21:36:42 +0000 @@ -3030,7 +3030,7 @@ { char buf[16]; Lisp_Object tem; - unsigned long w; + EMACS_UINT w; /* Represent negative positions (off the top or left screen edge) in a way that Fmodify_frame_parameters will understand correctly. */ @@ -3067,17 +3067,17 @@ MS-Windows it returns a value whose type is HANDLE, which is actually a pointer. Explicit casting avoids compiler warnings. */ - w = (unsigned long) FRAME_X_WINDOW (f); + w = (EMACS_UINT) FRAME_X_WINDOW (f); store_in_alist (alistptr, Qwindow_id, - make_formatted_string (buf, "%lu", w)); + make_formatted_string (buf, "%"pMu, w)); #ifdef HAVE_X_WINDOWS #ifdef USE_X_TOOLKIT /* Tooltip frame may not have this widget. */ if (FRAME_X_OUTPUT (f)->widget) #endif - w = (unsigned long) FRAME_OUTER_WINDOW (f); + w = (EMACS_UINT) FRAME_OUTER_WINDOW (f); store_in_alist (alistptr, Qouter_window_id, - make_formatted_string (buf, "%lu", w)); + make_formatted_string (buf, "%"pMu, w)); #endif store_in_alist (alistptr, Qicon_name, f->icon_name); FRAME_SAMPLE_VISIBILITY (f); === modified file 'src/gmalloc.c' --- src/gmalloc.c 2012-07-14 10:03:30 +0000 +++ src/gmalloc.c 2012-09-30 21:36:42 +0000 @@ -36,6 +36,10 @@ #include #endif +#ifdef WINDOWSNT +#include /* for sbrk */ +#endif + #ifdef __cplusplus extern "C" { @@ -1289,7 +1293,9 @@ The author may be reached (Email) at the address mike@ai.mit.edu, or (US mail) as Mike Haertel c/o Free Software Foundation. */ +#ifndef min #define min(A, B) ((A) < (B) ? (A) : (B)) +#endif /* On Cygwin the dumped emacs may try to realloc storage allocated in the static heap. We just malloc space in the new heap and copy the === modified file 'src/image.c' --- src/image.c 2012-09-28 16:02:31 +0000 +++ src/image.c 2012-09-30 21:36:42 +0000 @@ -186,11 +186,11 @@ } #if defined (HAVE_X_WINDOWS) || defined (HAVE_NTGUI) -int +ptrdiff_t x_bitmap_pixmap (FRAME_PTR f, ptrdiff_t id) { /* HAVE_NTGUI needs the explicit cast here. */ - return (int) FRAME_X_DISPLAY_INFO (f)->bitmaps[id - 1].pixmap; + return (ptrdiff_t) FRAME_X_DISPLAY_INFO (f)->bitmaps[id - 1].pixmap; } #endif === modified file 'src/makefile.w32-in' --- src/makefile.w32-in 2012-09-30 12:27:58 +0000 +++ src/makefile.w32-in 2012-09-30 21:36:42 +0000 @@ -25,7 +25,7 @@ EMACSLOADPATH=$(CURDIR)/../lisp # Size in MBs of the static heap in temacs.exe. -HEAPSIZE = 27 +HEAPSIZE = $(EMACS_HEAPSIZE) LOCAL_FLAGS = -Demacs=1 -I../lib -I../nt/inc -DHAVE_NTGUI=1 $(EMACS_EXTRA_C_FLAGS) @@ -247,10 +247,10 @@ # WARNING: Do NOT split the part inside $(ARGQUOTE)s into multiple lines as # this can break with GNU Make 3.81 and later if sh.exe is used. bootstrap-temacs-CMD: - $(MAKE) $(MFLAGS) $(XMFLAGS) temacs CFLAGS=$(ARGQUOTE)$(ESC_CFLAGS) -DPURESIZE=5000000$(ARGQUOTE) + $(MAKE) $(MFLAGS) $(XMFLAGS) temacs CFLAGS=$(ARGQUOTE)$(ESC_CFLAGS) -DPURESIZE=$(EMACS_PURESIZE)$(ARGQUOTE) bootstrap-temacs-SH: - $(MAKE) $(MFLAGS) $(XMFLAGS) temacs CFLAGS=$(ARGQUOTE)$(CFLAGS) -DPURESIZE=5000000$(ARGQUOTE) + $(MAKE) $(MFLAGS) $(XMFLAGS) temacs CFLAGS=$(ARGQUOTE)$(CFLAGS) -DPURESIZE=$(EMACS_PURESIZE)$(ARGQUOTE) bootstrap-temacs: $(MAKE) $(MFLAGS) bootstrap-temacs-$(SHELLTYPE) === modified file 'src/ralloc.c' --- src/ralloc.c 2012-09-23 08:44:20 +0000 +++ src/ralloc.c 2012-09-30 21:36:42 +0000 @@ -72,7 +72,7 @@ /* Declarations for working with the malloc, ralloc, and system breaks. */ /* Function to set the real break value. */ -POINTER (*real_morecore) (long int); +POINTER (*real_morecore) (ptrdiff_t); /* The break value, as seen by malloc. */ static POINTER virtual_break_value; @@ -91,18 +91,18 @@ /* Macros for rounding. Note that rounding to any value is possible by changing the definition of PAGE. */ #define PAGE (getpagesize ()) -#define ROUNDUP(size) (((unsigned long int) (size) + page_size - 1) \ - & ~(page_size - 1)) +#define ROUNDUP(size) (((size_t) (size) + page_size - 1) \ + & ~((size_t)page_size - 1)) #define MEM_ALIGN sizeof (double) -#define MEM_ROUNDUP(addr) (((unsigned long int)(addr) + MEM_ALIGN - 1) \ - & ~(MEM_ALIGN - 1)) +#define MEM_ROUNDUP(addr) (((size_t)(addr) + MEM_ALIGN - 1) \ + & ~((size_t)MEM_ALIGN - 1)) /* The hook `malloc' uses for the function which gets more space from the system. */ #ifndef SYSTEM_MALLOC -extern POINTER (*__morecore) (long int); +extern POINTER (*__morecore) (ptrdiff_t); #endif @@ -308,7 +308,7 @@ relinquish (void) { register heap_ptr h; - long excess = 0; + ptrdiff_t excess = 0; /* Add the amount of space beyond break_value in all heaps which have extend beyond break_value at all. */ @@ -752,7 +752,7 @@ GNU malloc package. */ static POINTER -r_alloc_sbrk (long int size) +r_alloc_sbrk (ptrdiff_t size) { register bloc_ptr b; POINTER address; === modified file 'src/sysdep.c' --- src/sysdep.c 2012-09-30 21:12:04 +0000 +++ src/sysdep.c 2012-09-30 21:36:42 +0000 @@ -54,6 +54,9 @@ #ifdef WINDOWSNT #define read sys_read #define write sys_write +#ifndef STDERR_FILENO +#define STDERR_FILENO fileno(GetStdHandle(STD_ERROR_HANDLE)) +#endif #include #endif /* not WINDOWSNT */ === modified file 'src/unexw32.c' --- src/unexw32.c 2012-01-19 07:21:25 +0000 +++ src/unexw32.c 2012-09-30 21:36:42 +0000 @@ -67,18 +67,18 @@ /* Cached info about the .data section in the executable. */ PIMAGE_SECTION_HEADER data_section; PCHAR data_start = 0; -DWORD data_size = 0; +DWORD_PTR data_size = 0; /* Cached info about the .bss section in the executable. */ PIMAGE_SECTION_HEADER bss_section; PCHAR bss_start = 0; -DWORD bss_size = 0; -DWORD extra_bss_size = 0; +DWORD_PTR bss_size = 0; +DWORD_PTR extra_bss_size = 0; /* bss data that is static might be discontiguous from non-static. */ PIMAGE_SECTION_HEADER bss_section_static; PCHAR bss_start_static = 0; -DWORD bss_size_static = 0; -DWORD extra_bss_size_static = 0; +DWORD_PTR bss_size_static = 0; +DWORD_PTR extra_bss_size_static = 0; PIMAGE_SECTION_HEADER heap_section; @@ -231,7 +231,7 @@ /* Return pointer to section header for section containing the given relative virtual address. */ IMAGE_SECTION_HEADER * -rva_to_section (DWORD rva, IMAGE_NT_HEADERS * nt_header) +rva_to_section (DWORD_PTR rva, IMAGE_NT_HEADERS * nt_header) { PIMAGE_SECTION_HEADER section; int i; @@ -246,7 +246,7 @@ some very old exes (eg. gzip dated Dec 1993). Since w32_executable_type relies on this function to work reliably, we need to cope with this. */ - DWORD real_size = max (section->SizeOfRawData, + DWORD_PTR real_size = max (section->SizeOfRawData, section->Misc.VirtualSize); if (rva >= section->VirtualAddress && rva < section->VirtualAddress + real_size) @@ -259,7 +259,7 @@ /* Return pointer to section header for section containing the given offset in its raw data area. */ IMAGE_SECTION_HEADER * -offset_to_section (DWORD offset, IMAGE_NT_HEADERS * nt_header) +offset_to_section (DWORD_PTR offset, IMAGE_NT_HEADERS * nt_header) { PIMAGE_SECTION_HEADER section; int i; @@ -279,8 +279,8 @@ /* Return offset to an object in dst, given offset in src. We assume there is at least one section in both src and dst images, and that the some sections may have been added to dst (after sections in src). */ -DWORD -relocate_offset (DWORD offset, +DWORD_PTR +relocate_offset (DWORD_PTR offset, IMAGE_NT_HEADERS * src_nt_header, IMAGE_NT_HEADERS * dst_nt_header) { @@ -314,25 +314,25 @@ } #define OFFSET_TO_RVA(offset, section) \ - (section->VirtualAddress + ((DWORD)(offset) - section->PointerToRawData)) + (section->VirtualAddress + ((DWORD_PTR)(offset) - section->PointerToRawData)) #define RVA_TO_OFFSET(rva, section) \ - (section->PointerToRawData + ((DWORD)(rva) - section->VirtualAddress)) + (section->PointerToRawData + ((DWORD_PTR)(rva) - section->VirtualAddress)) #define RVA_TO_SECTION_OFFSET(rva, section) \ - ((DWORD)(rva) - section->VirtualAddress) + ((DWORD_PTR)(rva) - section->VirtualAddress) /* Convert address in executing image to RVA. */ -#define PTR_TO_RVA(ptr) ((DWORD)(ptr) - (DWORD) GetModuleHandle (NULL)) +#define PTR_TO_RVA(ptr) ((DWORD_PTR)(ptr) - (DWORD_PTR) GetModuleHandle (NULL)) #define RVA_TO_PTR(var,section,filedata) \ - ((void *)(RVA_TO_OFFSET (var,section) + (filedata).file_base)) + ((DWORD_PTR)(RVA_TO_OFFSET (var,section) + (filedata).file_base)) #define PTR_TO_OFFSET(ptr, pfile_data) \ ((unsigned char *)(ptr) - (pfile_data)->file_base) #define OFFSET_TO_PTR(offset, pfile_data) \ - ((pfile_data)->file_base + (DWORD)(offset)) + ((pfile_data)->file_base + (DWORD_PTR)(offset)) /* Flip through the executable and cache the info necessary for dumping. */ @@ -349,7 +349,7 @@ printf ("Unknown EXE header in %s...bailing.\n", p_infile->name); exit (1); } - nt_header = (PIMAGE_NT_HEADERS) (((unsigned long) dos_header) + + nt_header = (PIMAGE_NT_HEADERS) (((DWORD_PTR) dos_header) + dos_header->e_lfanew); if (nt_header == NULL) { @@ -488,7 +488,7 @@ PIMAGE_NT_HEADERS dst_nt_header; PIMAGE_SECTION_HEADER section; PIMAGE_SECTION_HEADER dst_section; - DWORD offset; + DWORD_PTR offset; int i; int be_verbose = GetEnvironmentVariable ("DEBUG_DUMP", NULL, 0) > 0; @@ -541,17 +541,17 @@ Note that dst is updated implicitly by each COPY_CHUNK. */ dos_header = (PIMAGE_DOS_HEADER) p_infile->file_base; - nt_header = (PIMAGE_NT_HEADERS) (((unsigned long) dos_header) + + nt_header = (PIMAGE_NT_HEADERS) (((DWORD_PTR) dos_header) + dos_header->e_lfanew); section = IMAGE_FIRST_SECTION (nt_header); dst = (unsigned char *) p_outfile->file_base; COPY_CHUNK ("Copying DOS header...", dos_header, - (DWORD) nt_header - (DWORD) dos_header, be_verbose); + (DWORD_PTR) nt_header - (DWORD_PTR) dos_header, be_verbose); dst_nt_header = (PIMAGE_NT_HEADERS) dst; COPY_CHUNK ("Copying NT header...", nt_header, - (DWORD) section - (DWORD) nt_header, be_verbose); + (DWORD_PTR) section - (DWORD_PTR) nt_header, be_verbose); dst_section = (PIMAGE_SECTION_HEADER) dst; COPY_CHUNK ("Copying section table...", section, nt_header->FileHeader.NumberOfSections * sizeof (*section), @@ -627,8 +627,8 @@ } if (section == heap_section) { - DWORD heap_start = (DWORD) get_heap_start (); - DWORD heap_size = get_committed_heap_size (); + DWORD_PTR heap_start = (DWORD_PTR) get_heap_start (); + DWORD_PTR heap_size = get_committed_heap_size (); /* Dump the used portion of the predump heap, adjusting the section's size to the appropriate size. */ === modified file 'src/vm-limit.c' --- src/vm-limit.c 2012-09-15 07:06:56 +0000 +++ src/vm-limit.c 2012-09-30 21:36:42 +0000 @@ -41,7 +41,7 @@ static POINTER data_space_start; /* Number of bytes of writable memory we can expect to be able to get. */ -static unsigned long lim_data; +static size_t lim_data; #if defined (HAVE_GETRLIMIT) && defined (RLIMIT_AS) @@ -88,7 +88,7 @@ static void get_lim_data (void) { - extern unsigned long reserved_heap_size; + extern size_t reserved_heap_size; lim_data = reserved_heap_size; } @@ -166,13 +166,13 @@ check_memory_limits (void) { #ifdef REL_ALLOC - extern POINTER (*real_morecore) (long); + extern POINTER (*real_morecore) (ptrdiff_t); #endif - extern POINTER (*__morecore) (long); + extern POINTER (*__morecore) (ptrdiff_t); register POINTER cp; - unsigned long five_percent; - unsigned long data_size; + size_t five_percent; + size_t data_size; enum warnlevel new_warnlevel; if (lim_data == 0) === modified file 'src/w32.c' --- src/w32.c 2012-09-30 15:49:05 +0000 +++ src/w32.c 2012-09-30 21:36:42 +0000 @@ -1738,7 +1738,8 @@ /* FIXME: should use substring of get_emacs_configuration (). But I don't think the Windows build supports alpha, mips etc anymore, so have taken the easy option for now. */ - else if (p && xstrcasecmp (p, "\\i386") == 0) + else if (p && (xstrcasecmp (p, "\\i386") == 0 + || xstrcasecmp (p, "\\AMD64") == 0)) { *p = 0; p = strrchr (modname, '\\'); @@ -1886,7 +1887,16 @@ case PROCESSOR_INTEL_386: case PROCESSOR_INTEL_486: case PROCESSOR_INTEL_PENTIUM: +#ifdef _WIN64 + arch = "amd64"; +#else arch = "i386"; +#endif + break; +#endif +#ifdef PROCESSOR_AMD_X8664 + case PROCESSOR_AMD_X8664: + arch = "amd64"; break; #endif @@ -6646,19 +6656,19 @@ fclose (stderr); if (stdin_save != INVALID_HANDLE_VALUE) - _open_osfhandle ((long) stdin_save, O_TEXT); + _open_osfhandle ((intptr_t) stdin_save, O_TEXT); else _open ("nul", O_TEXT | O_NOINHERIT | O_RDONLY); _fdopen (0, "r"); if (stdout_save != INVALID_HANDLE_VALUE) - _open_osfhandle ((long) stdout_save, O_TEXT); + _open_osfhandle ((intptr_t) stdout_save, O_TEXT); else _open ("nul", O_TEXT | O_NOINHERIT | O_WRONLY); _fdopen (1, "w"); if (stderr_save != INVALID_HANDLE_VALUE) - _open_osfhandle ((long) stderr_save, O_TEXT); + _open_osfhandle ((intptr_t) stderr_save, O_TEXT); else _open ("nul", O_TEXT | O_NOINHERIT | O_WRONLY); _fdopen (2, "w"); @@ -6779,7 +6789,7 @@ OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hnd == INVALID_HANDLE_VALUE) error ("Could not open %s", port); - fd = (int) _open_osfhandle ((int) hnd, 0); + fd = (int) _open_osfhandle ((intptr_t) hnd, 0); if (fd == -1) error ("Could not open %s", port); === modified file 'src/w32fns.c' --- src/w32fns.c 2012-09-30 15:49:05 +0000 +++ src/w32fns.c 2012-09-30 21:36:42 +0000 @@ -137,7 +137,7 @@ }; /* Reportedly, MSVC does not have this in its headers. */ -#ifdef _MSC_VER +#if defined (_MSC_VER) && _WIN32_WINNT < 0x0500 DECLARE_HANDLE(HMONITOR); #endif @@ -2252,7 +2252,7 @@ w32_msg_pump (deferred_msg * msg_buf) { MSG msg; - int result; + WPARAM result; HWND focus_window; msh_mousewheel = RegisterWindowMessage (MSH_MOUSEWHEEL); @@ -2283,7 +2283,7 @@ /* Reply is not expected. */ break; case WM_EMACS_SETKEYBOARDLAYOUT: - result = (int) ActivateKeyboardLayout ((HKL) msg.wParam, 0); + result = (WPARAM) ActivateKeyboardLayout ((HKL) msg.wParam, 0); if (!PostThreadMessage (dwMainThreadId, WM_EMACS_DONE, result, 0)) emacs_abort (); === modified file 'src/w32heap.c' --- src/w32heap.c 2012-09-15 08:03:11 +0000 +++ src/w32heap.c 2012-09-30 21:36:42 +0000 @@ -26,7 +26,7 @@ #include "w32heap.h" #include "lisp.h" /* for VALMASK */ -#define RVA_TO_PTR(rva) ((unsigned char *)((DWORD)(rva) + (DWORD)GetModuleHandle (NULL))) +#define RVA_TO_PTR(rva) ((unsigned char *)((DWORD_PTR)(rva) + (DWORD_PTR)GetModuleHandle (NULL))) /* This gives us the page size and the size of the allocation unit on NT. */ SYSTEM_INFO sysinfo_cache; @@ -34,7 +34,7 @@ /* This gives us version, build, and platform identification. */ OSVERSIONINFO osinfo_cache; -unsigned long syspage_mask = 0; +size_t syspage_mask = 0; /* The major and minor versions of NT. */ int w32_major_version; @@ -97,7 +97,7 @@ unsigned char *data_region_base = NULL; unsigned char *data_region_end = NULL; unsigned char *real_data_region_end = NULL; -unsigned long reserved_heap_size = 0; +size_t reserved_heap_size = 0; /* The start of the data segment. */ unsigned char * @@ -121,16 +121,20 @@ the preload heap section up to the usable address limit. Since GNU malloc can handle gaps in the memory it gets from sbrk, we can simply set the sbrk pointer to the base of the new heap region. */ - unsigned long base = + DWORD_PTR base = ROUND_UP ((RVA_TO_PTR (preload_heap_section->VirtualAddress) + preload_heap_section->Misc.VirtualSize), get_allocation_unit ()); - unsigned long end = 1 << VALBITS; /* 256MB */ + DWORD_PTR end = ((unsigned __int64)1) << VALBITS; /* 256MB */ void *ptr = NULL; while (!ptr && (base < end)) { +#ifdef _WIN64 + reserved_heap_size = min(end - base, 0x4000000000i64); /* Limit to 256Gb */ +#else reserved_heap_size = end - base; +#endif ptr = VirtualAlloc ((void *) base, get_reserved_heap_size (), MEM_RESERVE, @@ -144,7 +148,11 @@ static char * allocate_heap (void) { - unsigned long size = 0x80000000; /* start by asking for 2GB */ +#ifdef _WIN64 + size_t size = 0x4000000000i64; /* start by asking for 32GB */ +#else + size_t size = 0x80000000; /* start by asking for 2GB */ +#endif void *ptr = NULL; while (!ptr && size > 0x00100000) @@ -166,17 +174,17 @@ be the address of the _start_ (not end) of the new block in case of success, and zero (not -1) in case of failure. */ void * -sbrk (unsigned long increment) +sbrk (ptrdiff_t increment) { void *result; - long size = (long) increment; + ptrdiff_t size = increment; result = data_region_end; /* If size is negative, shrink the heap by decommitting pages. */ if (size < 0) { - int new_size; + ptrdiff_t new_size; unsigned char *new_data_region_end; size = -size; @@ -189,7 +197,7 @@ partial deallocation [cga]. */ new_data_region_end = (data_region_end - size); new_data_region_end = (unsigned char *) - ((long) (new_data_region_end + syspage_mask) & ~syspage_mask); + ((DWORD_PTR) (new_data_region_end + syspage_mask) & ~syspage_mask); new_size = real_data_region_end - new_data_region_end; real_data_region_end = new_data_region_end; if (new_size > 0) @@ -220,7 +228,7 @@ /* We really only commit full pages, so record where the real end of committed memory is [cga]. */ real_data_region_end = (unsigned char *) - ((long) (data_region_end + syspage_mask) & ~syspage_mask); + ((DWORD_PTR) (data_region_end + syspage_mask) & ~syspage_mask); } return result; @@ -245,7 +253,7 @@ PIMAGE_NT_HEADERS nt_header; dos_header = (PIMAGE_DOS_HEADER) RVA_TO_PTR (0); - nt_header = (PIMAGE_NT_HEADERS) (((unsigned long) dos_header) + + nt_header = (PIMAGE_NT_HEADERS) (((DWORD_PTR) dos_header) + dos_header->e_lfanew); preload_heap_section = find_section ("EMHEAP", nt_header); @@ -261,7 +269,7 @@ #if !USE_LSB_TAG /* Ensure that the addresses don't use the upper tag bits since the Lisp type goes there. */ - if (((unsigned long) data_region_base & ~VALMASK) != 0) + if (((DWORD_PTR) data_region_base & ~VALMASK) != 0) { printf ("Error: The heap was allocated in upper memory.\n"); exit (1); @@ -284,13 +292,13 @@ /* Round the heap up to the given alignment. */ void -round_heap (unsigned long align) +round_heap (size_t align) { - unsigned long needs_to_be; - unsigned long need_to_alloc; + DWORD_PTR needs_to_be; + DWORD_PTR need_to_alloc; - needs_to_be = (unsigned long) ROUND_UP (get_heap_end (), align); - need_to_alloc = needs_to_be - (unsigned long) get_heap_end (); + needs_to_be = (DWORD_PTR) ROUND_UP (get_heap_end (), align); + need_to_alloc = needs_to_be - (DWORD_PTR) get_heap_end (); if (need_to_alloc) sbrk (need_to_alloc); === modified file 'src/w32heap.h' --- src/w32heap.h 2012-07-29 16:22:27 +0000 +++ src/w32heap.h 2012-09-30 21:36:42 +0000 @@ -24,8 +24,8 @@ #include -#define ROUND_UP(p, align) (((DWORD)(p) + (align)-1) & ~((align)-1)) -#define ROUND_DOWN(p, align) ((DWORD)(p) & ~((align)-1)) +#define ROUND_UP(p, align) (((DWORD_PTR)(p) + (align)-1) & ~((DWORD_PTR)(align)-1)) +#define ROUND_DOWN(p, align) ((DWORD_PTR)(p) & ~((DWORD_PTR)(align)-1)) /* * Heap related stuff. @@ -42,7 +42,7 @@ extern unsigned char *get_data_start (void); extern unsigned char *get_data_end (void); -extern unsigned long reserved_heap_size; +extern size_t reserved_heap_size; extern SYSTEM_INFO sysinfo_cache; extern OSVERSIONINFO osinfo_cache; extern BOOL using_dynamic_heap; @@ -58,13 +58,13 @@ extern int os_subtype; /* Emulation of Unix sbrk(). */ -extern void *sbrk (unsigned long size); +extern void *sbrk (ptrdiff_t size); /* Initialize heap structures for sbrk on startup. */ extern void init_heap (void); /* Round the heap to this size. */ -extern void round_heap (unsigned long size); +extern void round_heap (size_t size); /* Cache system info, e.g., the NT page size. */ extern void cache_system_info (void); @@ -89,6 +89,6 @@ /* Return pointer to section header for section containing the given relative virtual address. */ -IMAGE_SECTION_HEADER * rva_to_section (DWORD rva, IMAGE_NT_HEADERS * nt_header); +IMAGE_SECTION_HEADER * rva_to_section (DWORD_PTR rva, IMAGE_NT_HEADERS * nt_header); #endif /* NTHEAP_H_ */ === modified file 'src/w32menu.c' --- src/w32menu.c 2012-09-23 19:36:31 +0000 +++ src/w32menu.c 2012-09-30 21:36:42 +0000 @@ -1483,8 +1483,8 @@ utf8to16 (out_string, utf8_len, utf16_string); return_value = unicode_append_menu (menu, fuFlags, - item != NULL ? (UINT) item - : (UINT) wv->call_data, + item != NULL ? (UINT_PTR) item + : (UINT_PTR) wv->call_data, utf16_string); if (!return_value) { @@ -1496,7 +1496,7 @@ of minor importance compared with menus not working at all. */ return_value = AppendMenu (menu, fuFlags, - item != NULL ? (UINT) item: (UINT) wv->call_data, + item != NULL ? (UINT_PTR) item: (UINT_PTR) wv->call_data, out_string); /* Don't use Unicode menus in future, unless this is Windows NT or later, where a failure of AppendMenuW does NOT mean @@ -1513,7 +1513,7 @@ return_value = AppendMenu (menu, fuFlags, - item != NULL ? (UINT) item : (UINT) wv->call_data, + item != NULL ? (UINT_PTR) item : (UINT_PTR) wv->call_data, out_string ); } @@ -1550,7 +1550,7 @@ } set_menu_item_info (menu, - item != NULL ? (UINT) item : (UINT) wv->call_data, + item != NULL ? (UINT_PTR) item : (UINT_PTR) wv->call_data, FALSE, &info); } } === modified file 'src/w32proc.c' --- src/w32proc.c 2012-09-30 15:49:05 +0000 +++ src/w32proc.c 2012-09-30 21:36:42 +0000 @@ -62,7 +62,7 @@ #define RVA_TO_PTR(var,section,filedata) \ ((void *)((section)->PointerToRawData \ - + ((DWORD)(var) - (section)->VirtualAddress) \ + + ((DWORD_PTR)(var) - (section)->VirtualAddress) \ + (filedata).file_base)) Lisp_Object Qhigh, Qlow; @@ -1190,7 +1190,7 @@ if (dos_header->e_magic != IMAGE_DOS_SIGNATURE) goto unwind; - nt_header = (PIMAGE_NT_HEADERS) ((char *) dos_header + dos_header->e_lfanew); + nt_header = (PIMAGE_NT_HEADERS) ((unsigned char *) dos_header + dos_header->e_lfanew); if ((char *) nt_header > (char *) dos_header + executable.size) { === modified file 'src/w32term.c' --- src/w32term.c 2012-09-23 19:36:31 +0000 +++ src/w32term.c 2012-09-30 21:36:42 +0000 @@ -102,7 +102,7 @@ Lisp_Object w32_display_name_list; -#ifndef GLYPHSET +#if _WIN32_WINNT < 0x0500 /* Pre Windows 2000, this was not available, but define it here so that Emacs compiled on such a platform will run on newer versions. */ @@ -360,7 +360,11 @@ /* Find and set clipping rectangle */ - wave_clip = (XRectangle){ x0, y0, width, wave_height }; + wave_clip.x = x0; + wave_clip.y = y0; + wave_clip.width = width; + wave_clip.height = wave_height; + get_glyph_string_clip_rect (s, &w32_string_clip); CONVERT_TO_XRECT (string_clip, w32_string_clip); === modified file 'src/w32term.h' --- src/w32term.h 2012-09-01 06:38:52 +0000 +++ src/w32term.h 2012-09-30 21:36:42 +0000 @@ -431,7 +431,15 @@ /* Turning a lisp vector value into a pointer to a struct scroll_bar. */ #define XSCROLL_BAR(vec) ((struct scroll_bar *) XVECTOR (vec)) +#ifdef _WIN64 +/* Building a 64-bit C integer from two 32-bit lisp integers. */ +#define SCROLL_BAR_PACK(low, high) (XINT (high) << 32 | XINT (low)) +/* Setting two lisp integers to the low and high words of a 64-bit C int. */ +#define SCROLL_BAR_UNPACK(low, high, int64) \ + (XSETINT ((low), ((DWORDLONG)(int64)) & 0xffffffff), \ + XSETINT ((high), ((DWORDLONG)(int64) >> 32) & 0xffffffff)) +#else /* not _WIN64 */ /* Building a 32-bit C integer from two 16-bit lisp integers. */ #define SCROLL_BAR_PACK(low, high) (XINT (high) << 16 | XINT (low)) @@ -439,7 +447,7 @@ #define SCROLL_BAR_UNPACK(low, high, int32) \ (XSETINT ((low), (int32) & 0xffff), \ XSETINT ((high), ((int32) >> 16) & 0xffff)) - +#endif /* not _WIN64 */ /* Extract the window id of the scroll bar from a struct scroll_bar. */ #define SCROLL_BAR_W32_WINDOW(ptr) \ @@ -447,7 +455,7 @@ /* Store a window id in a struct scroll_bar. */ #define SET_SCROLL_BAR_W32_WINDOW(ptr, id) \ - (SCROLL_BAR_UNPACK ((ptr)->w32_window_low, (ptr)->w32_window_high, (int) id)) + (SCROLL_BAR_UNPACK ((ptr)->w32_window_low, (ptr)->w32_window_high, (intptr_t) id)) /* Extract the X widget of the scroll bar from a struct scroll_bar. */ #define SCROLL_BAR_X_WIDGET(ptr) \ ------------------------------------------------------------ revno: 110295 committer: Paul Eggert branch nick: trunk timestamp: Sun 2012-09-30 14:12:04 -0700 message: file-attributes has a new optional arg FOLLOW-SYMLINKS. * doc/lispref/files.texi (File Attributes): Describe it. (Magic File Names): Use it. * etc/NEWS: Document the change. * lisp/files.el (remote-file-name-inhibit-cache): * lisp/time.el (display-time-file-nonempty-p): Use it. * lisp/files.el (after-find-file): Don't chase links before calling file-exists-p, as file-exists-p already does the right thing. * src/dired.c (directory_files_internal, Ffile_attributes): New arg follow_symlinks. All uses changed. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2012-09-30 09:18:38 +0000 +++ doc/lispref/ChangeLog 2012-09-30 21:12:04 +0000 @@ -1,3 +1,9 @@ +2012-09-30 Paul Eggert + + file-attributes has a new optional arg FOLLOW-SYMLINKS. + * files.texi (File Attributes): Describe it. + (Magic File Names): Use it. + 2012-09-30 Chong Yidong * commands.texi (Click Events): Define "mouse position list". === modified file 'doc/lispref/files.texi' --- doc/lispref/files.texi 2012-09-28 16:02:31 +0000 +++ doc/lispref/files.texi 2012-09-30 21:12:04 +0000 @@ -1187,7 +1187,7 @@ @end example @end defun -@defun file-attributes filename &optional id-format +@defun file-attributes filename &optional id-format follow-symlinks @anchor{Definition of file-attributes} This function returns a list of attributes of file @var{filename}. If the specified file cannot be opened, it returns @code{nil}. @@ -1197,6 +1197,9 @@ the default, but we plan to change that, so you should specify a non-@code{nil} value for @var{id-format} if you use the returned @acronym{UID} or @acronym{GID}. +The optional parameter @var{follow-symlinks} says whether to follow +@var{filename} if it is a symbolic link; if @code{t}, symbolic links +are followed and if @code{nil} they are not. The elements of the list, in order, are: @@ -2961,8 +2964,7 @@ (let ((remote-file-name-inhibit-cache (- display-time-interval 5))) (and (file-exists-p file) - (< 0 (nth 7 (file-attributes - (file-chase-links file))))))) + (< 0 (nth 7 (file-attributes file nil t)))))) @end example @end defopt === modified file 'etc/ChangeLog' --- etc/ChangeLog 2012-09-30 13:43:47 +0000 +++ etc/ChangeLog 2012-09-30 21:12:04 +0000 @@ -1,3 +1,8 @@ +2012-09-30 Paul Eggert + + file-attributes has a new optional arg FOLLOW-SYMLINKS. + * NEWS: Document the change. + 2012-09-30 Jan Djärv * NEWS: The NS port supports fullscreen. === modified file 'etc/NEWS' --- etc/NEWS 2012-09-30 13:43:47 +0000 +++ etc/NEWS 2012-09-30 21:12:04 +0000 @@ -807,6 +807,11 @@ accessed via the new timer--psecs accessor. +++ +** file-attributes has a new optional argument FOLLOW-SYMLINKS +that says whether to follow symbolic links. The default, as before, +is to not follow symlinks. + ++++ ** Floating point functions now always return special values like NaN, instead of signaling errors, if given invalid args, e.g. (log -1.0). Previously, they returned NaNs on some platforms but signaled errors === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-30 20:30:13 +0000 +++ lisp/ChangeLog 2012-09-30 21:12:04 +0000 @@ -1,3 +1,11 @@ +2012-09-30 Paul Eggert + + file-attributes has a new optional arg FOLLOW-SYMLINKS. + * files.el (remote-file-name-inhibit-cache): + * time.el (display-time-file-nonempty-p): Use it. + * files.el (after-find-file): Don't chase links before calling + file-exists-p, as file-exists-p already does the right thing. + 2012-09-30 Ralf Angeli Merge from standalone RefTeX repository. === modified file 'lisp/files.el' --- lisp/files.el 2012-09-25 04:13:02 +0000 +++ lisp/files.el 2012-09-30 21:12:04 +0000 @@ -1014,7 +1014,7 @@ (defun display-time-file-nonempty-p (file) (let ((remote-file-name-inhibit-cache (- display-time-interval 5))) (and (file-exists-p file) - (< 0 (nth 7 (file-attributes (file-chase-links file)))))))" + (< 0 (nth 7 (file-attributes file nil t))))))" :group 'files :version "24.1" :type `(choice @@ -2082,8 +2082,7 @@ ((and error (file-attributes buffer-file-name)) (setq buffer-read-only t) (if (and (file-symlink-p buffer-file-name) - (not (file-exists-p - (file-chase-links buffer-file-name)))) + (not (file-exists-p buffer-file-name))) "Symbolic link that points to nonexistent file" "File exists, but cannot be read")) ((not buffer-read-only) === modified file 'lisp/time.el' --- lisp/time.el 2012-09-13 06:09:45 +0000 +++ lisp/time.el 2012-09-30 21:12:04 +0000 @@ -485,7 +485,7 @@ (defun display-time-file-nonempty-p (file) (let ((remote-file-name-inhibit-cache (- display-time-interval 5))) (and (file-exists-p file) - (< 0 (nth 7 (file-attributes (file-chase-links file))))))) + (< 0 (nth 7 (file-attributes file nil t)))))) ;;;###autoload (define-minor-mode display-time-mode === modified file 'src/ChangeLog' --- src/ChangeLog 2012-09-30 20:06:20 +0000 +++ src/ChangeLog 2012-09-30 21:12:04 +0000 @@ -1,3 +1,9 @@ +2012-09-30 Paul Eggert + + file-attributes has a new optional arg FOLLOW-SYMLINKS. + * dired.c (directory_files_internal, Ffile_attributes): + New arg follow_symlinks. All uses changed. + 2012-09-30 Stefan Monnier * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change. === modified file 'src/dired.c' --- src/dired.c 2012-09-23 08:44:20 +0000 +++ src/dired.c 2012-09-30 21:12:04 +0000 @@ -110,12 +110,13 @@ /* Function shared by Fdirectory_files and Fdirectory_files_and_attributes. If not ATTRS, return a list of directory filenames; if ATTRS, return a list of directory filenames and their attributes. - In the latter case, ID_FORMAT is passed to Ffile_attributes. */ + In the latter case, ID_FORMAT and FOLLOW_SYMLINKS are passed to + Ffile_attributes. */ Lisp_Object directory_files_internal (Lisp_Object directory, Lisp_Object full, Lisp_Object match, Lisp_Object nosort, bool attrs, - Lisp_Object id_format) + Lisp_Object id_format, Lisp_Object follow_symlinks) { DIR *d; ptrdiff_t directory_nbytes; @@ -297,7 +298,8 @@ /* Both Fexpand_file_name and Ffile_attributes can GC. */ decoded_fullname = Fexpand_file_name (name, directory); - fileattrs = Ffile_attributes (decoded_fullname, id_format); + fileattrs = Ffile_attributes (decoded_fullname, id_format, + follow_symlinks); list = Fcons (Fcons (finalname, fileattrs), list); UNGCPRO; @@ -350,7 +352,8 @@ return call5 (handler, Qdirectory_files, directory, full, match, nosort); - return directory_files_internal (directory, full, match, nosort, 0, Qnil); + return directory_files_internal (directory, full, match, nosort, 0, + Qnil, Qnil); } DEFUN ("directory-files-and-attributes", Fdirectory_files_and_attributes, @@ -378,7 +381,8 @@ return call6 (handler, Qdirectory_files_and_attributes, directory, full, match, nosort, id_format); - return directory_files_internal (directory, full, match, nosort, 1, id_format); + return directory_files_internal (directory, full, match, nosort, 1, + id_format, Qnil); } @@ -875,7 +879,7 @@ #endif } -DEFUN ("file-attributes", Ffile_attributes, Sfile_attributes, 1, 2, 0, +DEFUN ("file-attributes", Ffile_attributes, Sfile_attributes, 1, 3, 0, doc: /* Return a list of attributes of file FILENAME. Value is nil if specified file cannot be opened. @@ -884,6 +888,9 @@ default, but we plan to change that, so you should specify a non-nil value for ID-FORMAT if you use the returned uid or gid. +Optional argument FOLLOW-SYMLINKS says whether to follow symbolic +links. If t, they are followed; if nil, they are not. + Elements of the attribute list are: 0. t for directory, string (name linked to) for symbolic link, or nil. 1. Number of links to file. @@ -917,7 +924,7 @@ On some FAT-based filesystems, only the date of last access is recorded, so last access time will always be midnight of that day. */) - (Lisp_Object filename, Lisp_Object id_format) + (Lisp_Object filename, Lisp_Object id_format, Lisp_Object follow_symlinks) { Lisp_Object values[12]; Lisp_Object encoded; @@ -953,7 +960,10 @@ encoded = ENCODE_FILE (filename); UNGCPRO; - if (lstat (SSDATA (encoded), &s) < 0) + if ((!NILP (follow_symlinks) + ? stat (SSDATA (encoded), &s) + : lstat (SSDATA (encoded), &s)) + != 0) return Qnil; values[0] = (S_ISLNK (s.st_mode) ? Ffile_symlink_p (filename) === modified file 'src/lisp.h' --- src/lisp.h 2012-09-29 02:02:34 +0000 +++ src/lisp.h 2012-09-30 21:12:04 +0000 @@ -3474,7 +3474,7 @@ extern void syms_of_dired (void); extern Lisp_Object directory_files_internal (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, - bool, Lisp_Object); + bool, Lisp_Object, Lisp_Object); /* Defined in term.c. */ extern int *char_ins_del_vector; === modified file 'src/sysdep.c' --- src/sysdep.c 2012-09-30 06:19:33 +0000 +++ src/sysdep.c 2012-09-30 21:12:04 +0000 @@ -2529,7 +2529,8 @@ process. */ procdir = build_string ("/proc"); match = build_string ("[0-9]+"); - proclist = directory_files_internal (procdir, Qnil, match, Qt, 0, Qnil); + proclist = directory_files_internal (procdir, Qnil, match, Qt, 0, + Qnil, Qnil); /* `proclist' gives process IDs as strings. Destructively convert each string into a number. */ ------------------------------------------------------------ revno: 110294 committer: Bastien Guerry branch nick: trunk timestamp: Sun 2012-09-30 23:10:33 +0200 message: Remove useless references to git-describe.texi. diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2012-09-30 20:30:13 +0000 +++ doc/misc/ChangeLog 2012-09-30 21:10:33 +0000 @@ -46,12 +46,6 @@ system. Mention GNU ELPA (since it needs to be handled like Emacs built-in Org). - * org.texi: Include "org-version.inc" instead of - "git-describe.texi". - - * org.texi: Remove @set for VERSION and DATE and do an @include - git-describe.texi instead. - 2012-09-30 Adam Spiers (tiny change) * org.texi: Fix typo in description of the 'Hooks' section. ------------------------------------------------------------ revno: 110293 committer: Ralf Angeli branch nick: trunk timestamp: Sun 2012-09-30 22:30:13 +0200 message: Merge from standalone RefTeX repository. Here is the ChangeLog of the standalone version of RefTeX without information about Makefiles and other auxiliary files. The differences to the Emacs repository are documented in the respective ChangeLog files. 2010-11-06 Ralf Angeli * lisp/reftex-cite.el (reftex-create-bibtex-file): Make sure that entries with whitespace at various places are found. (reftex-extract-bib-entries-from-thebibliography): Remove superfluous backslash. 2010-10-16 Ralf Angeli * lisp/reftex-cite.el (reftex-extract-bib-entries-from-thebibliography): Use `with-current-buffer'. 2010-09-14 Ralf Angeli * lisp/reftex-cite.el (reftex-do-citation): Make it possible again to insert non-existent entries. 2010-01-30 Ralf Angeli * lisp/reftex-base.el (reftex-syntax-table-for-bib, reftex-mode): Do not derive `reftex-syntax-table-for-bib' from `reftex-syntax-table' because parens have to retain their paren syntax in order for parsing of BibTeX entries like @book(...) to work. 2009-09-12 Ralf Angeli * lisp/reftex-vars.el (reftex-label-alist): Doc fix. * lisp/reftex-toc.el (reftex-re-enlarge): Call `enlarge-window' only if there is something to do because in Emacs the horizontal version throws an error even if the parameter is 0. 2009-08-08 Ralf Angeli * lisp/reftex-index.el: Suppress byte-compiler warnings. Move provide statement to end of file. * lisp/reftex-dcr.el: Suppress byte-compiler warnings. Move provide statement to end of file. * lisp/reftex-auc.el: Suppress byte-compiler warnings. * doc/reftex.texi (Imprint): Mention Wolfgang in list of contributors. * lisp/reftex-vars.el (reftex-plug-into-AUCTeX): Doc fix. 2009-07-05 Ralf Angeli * doc/reftex.texi (Creating Citations): Give a hint about how to auto-revert the BibTeX database file when using external editors. * lisp/reftex-cite.el (reftex-do-citation): Save match data when asking for optional arguments. 2009-04-29 Ralf Angeli * lisp/reftex-base.el (reftex-in-comment): Do not error out if `comment-start-skip' is not set. 2009-03-01 Wolfgang Mayer * lisp/reftex-cite.el (reftex-all-used-citation-keys): Fix regexp to correctly extract all citations in the same line. 2008-12-29 Ralf Angeli * lisp/reftex-vars.el (reftex-vref-is-default) (reftex-fref-is-default): Adapt doc string. (reftex-ref-style-default-list): New name for `reftex-ref-style-active-list'. Use :set instead of :repeat. (reftex-vref-is-default, reftex-fref-is-default): Adapt to new name. * lisp/reftex-base.el (reftex-tie-multifile-symbols): Add doc string. (reftex-tie-multifile-symbols): Initialize `reftex-ref-style-list'. (reftex-untie-multifile-symbols): Add doc string. (reftex-add-index-macros): Doc fix. (reftex-ref-style-activate, reftex-ref-style-toggle) (reftex-ref-style-list): New functions. (reftex-mode-menu): Use them. * lisp/reftex-sel.el (reftex-select-cycle-ref-style-internal): Use `reftex-ref-style-list' function. * lisp/reftex-ref.el (reftex-reference): Use `reftex-ref-style-list' function. * doc/reftex.texi (Referencing Labels): Simplify section about reference macro cycling. (Reference Styles, Options (Referencing Labels)): Adapt to changed implementation. 2008-12-18 Ralf Angeli * lisp/reftex-base.el (reftex-in-comment): Deal correctly with escaped comment characters. 2008-11-30 Ralf Angeli * lisp/reftex-vars.el (reftex-ref-style-alist): Change structure so that it is not possible to use multiple different package names within a style. (reftex-ref-style-active-list): Adapt to new structure of `reftex-ref-style-alist'. * lisp/reftex-sel.el (reftex-select-cycle-active-ref-styles): Remove. (reftex-select-cycle-ref-style-internal): Adapt to new structure of `reftex-ref-style-alist'. * lisp/reftex-ref.el: Adapt creation of `reftex--' functions to new structure of `reftex-ref-style-alist'. (reftex-reference): Adapt to new structure of `reftex-ref-style-alist'. * lisp/reftex-base.el (reftex-mode-menu): Adapt to new structure of `reftex-ref-style-alist'. * doc/reftex.texi (Options (Referencing Labels)): Adapt to new structure of `reftex-ref-style-alist'. 2008-10-16 Ralf Angeli * doc/reftex.texi (Referencing Labels, Reference Styles): Document changes in the referencing functionality. 2008-10-15 Ralf Angeli * lisp/reftex-vars.el (reftex-ref-style-alist): Remove the symbols for symbols for macro type distinction. Add characters for macro selection. (reftex-ref-macro-prompt): New variable. * lisp/reftex-sel.el (reftex-select-cycle-ref-style-internal): Remove code for testing macro type. (reftex-select-toggle-numref-pageref): Remove. (reftex-select-label-map): Remove binding for `reftex-select-toggle-numref-pageref'. * lisp/reftex-ref.el (reftex-reference): Prompt for a reference macro if `reftex-ref-macro-prompt' is non-nil. * lisp/reftex-base.el (reftex-select-with-char): Kill the RefTeX Select buffer when done. 2008-06-07 David Kastrup * lisp/reftex-base.el (reftex-remove-if): Improve performance. 2008-06-07 Ralf Angeli * lisp/reftex-cite.el (reftex-get-string-refs): Use a regexp alternative for better performance. * doc/reftex.texi (Commands): Mention options for definition of header and footer in BibTeX files. (Options (Creating Citations)): Document `reftex-create-bibtex-header' and `reftex-create-bibtex-footer'. * lisp/reftex-cite.el (reftex-stringref-p): Remove. (reftex-get-string-refs): Do without `reftex-stringref-p' and use `reftex-remove-if' instead of the cl-based `remove-if'. (reftex-create-bibtex-file): Doc fix. * lisp/reftex-base.el (reftex-remove-if): New function. 2008-06-07 Wolfgang Mayer * lisp/reftex-vars.el (reftex-create-bibtex-header) (reftex-create-bibtex-footer): New variables. * lisp/reftex-cite.el (reftex-parse-bibtex-entry): Accept additional optional argument `raw' and keep quotes or braces if it is non-nil. (reftex-stringref-p, reftex-get-string-refs): New functions. (reftex-create-bibtex-file): Include entries that are cross-referenced from cited entries. Include @String definitions in the resulting bib file. Add header and footer defined in `reftex-create-bibtex-header' and `reftex-create-bibtex-footer'. 2008-05-03 Ralf Angeli * lisp/reftex-parse.el (reftex-parse-from-file): Move backward one char if a `\' was matched after a section macro. * lisp/reftex-global.el (reftex-isearch-switch-to-next-file): Use `reverse' instead of `nreverse' and `copy-list' in order to make the byte compiler happy. Get rid of unused `orig-flist' variable. * lisp/reftex-base.el (reftex-compile-variables): Revert last change. Match `\' after a section macro. (reftex-mapconcat-with-predicate): Remove. 2008-04-13 Ralf Angeli * lisp/reftex-base.el (reftex-mapconcat-with-predicate): New function. (reftex-compile-variables): Use it. Treat environments and macros differently in the regexp for section matching. * lisp/reftex-parse.el (reftex-parse-from-file): Use beginning of match instead of end as bound. * lisp/reftex-sel.el (reftex-select-label-map): Changing binding of reference style toggling to "s" which is not already taken. * doc/reftex.texi (Reference Styles): Reflect change in key binding for toggling reference styles. Some minor changes. 2008-03-27 Ralf Angeli * lisp/reftex-vars.el: Some whitespace, doc and checkdoc fixes. 2008-03-16 Ralf Angeli * lisp/reftex-index.el (reftex-index-selection-or-word): Use `reftex-region-active-p'. (reftex-index-show-entry) (reftex-index-initialize-phrases-buffer) (reftex-index-phrases-apply-to-region): Sync with Emacs trunk. * lisp/reftex-dcr.el (reftex-start-itimer-once): Silence the byte compiler. * lisp/reftex-auc.el: Move `provide' call to bottom of file. * lisp/reftex-base.el: Require easymenu and define autoloads earlier to avoid compiler warnings. (reftex-region-active-p, reftex-select-with-char) (reftex-show-commentary): Sync with version in Emacs trunk. (reftex-make-overlay, reftex-overlay-put, reftex-move-overlay) (reftex-delete-overlay): Define in a way which hides the XEmacs symbols from the byte compiler. (reftex-info): Silence the byte compiler. Use `reftex.info' instead of `reftex' in order to get the correct file. 2008-03-07 Ralf Angeli * lisp/reftex-cite.el (reftex-extract-bib-entries): Check if BibTeX file changed on disk and ask if it should be reread in case it did. 2008-03-02 Ralf Angeli * doc/reftex.texi: Lots of small fixes. (Reference Styles): New section. (varioref (LaTeX package), fancyref (LaTeX package)): Remove. (Options (Referencing Labels)): Remove descriptions of deprecated variables `reftex-vref-is-default' and `reftex-fref-is-default'. Add descriptions for `reftex-ref-style-alist' and `reftex-ref-style-active-list'. (Referencing Labels): Update regarding reference styles. 2008-02-17 Ralf Angeli * lisp/reftex-ref.el (reftex-format-special): Add third argument for refstyle possible to be passed, making the byte compiler happy. (reftex-reference): Pass refstyle to `reftex-format-special'. * lisp/reftex-vars.el (reftex-ref-style-active-list): Make creation of type compatible with Emacs 21. (reftex-format-ref-function): Mention third argument of special format function. * lisp/reftex-base.el (reftex-mode-menu): Make creation of Reference Style menu compatible with Emacs 21. * doc/reftex.texi: Fix some typos. 2008-01-27 Ralf Angeli * lisp/reftex-vars.el (reftex-ref-style-active-list): Doc fix. * lisp/reftex-base.el (reftex-erase-all-selection-and-index-buffers) (reftex-access-parse-file): Use `mapc' instead of `mapcar' where return value is not used. * lisp/reftex-ref.el (reftex-offer-label-menu): Use `mapc' instead of `mapcar' where return value is not used. * lisp/reftex-sel.el (reftex-select-item, reftex-select-unmark): Use `mapc' instead of `mapcar' where return value is not used. * lisp/reftex-vars.el (reftex-ref-style-alist) (reftex-ref-style-active-list): New variables. (reftex-vref-is-default, reftex-fref-is-default): Adapt doc string to new implementation. Mark as obsolete. Add compatibility code for honoring the variable values in case they are set. * lisp/reftex-base.el (reftex-mode-menu): Reference styles are now computed from `reftex-ref-style-alist'. Fix typo. * lisp/reftex-ref.el (reftex-reference): Determine reference macro by looking at `reftex-ref-style-active-list' and `reftex-ref-style-alist'. Use only one special format function. (reftex-varioref-vref, reftex-fancyref-fref) (reftex-fancyref-Fref): Remove definitions. The functions are now generated from `reftex-ref-style-alist'. (reftex-format-vref, reftex-format-Fref, reftex-format-fref): Remove. (reftex-format-special): New function. * lisp/reftex-sel.el (reftex-select-toggle-varioref) (reftex-select-toggle-fancyref): Remove. (reftex-select-cycle-active-ref-styles) (reftex-select-cycle-ref-style-internal) (reftex-select-cycle-ref-style-forward) (reftex-select-cycle-ref-style-backward) (reftex-select-toggle-numref-pageref): New functions. (reftex-select-label-map): Use `v' and `V' for general cycling through reference styles. Add `p' for switching between number and page reference types. 2008-01-06 Ralf Angeli * lisp/reftex-cite.el (reftex-pop-to-bibtex-entry) (reftex-extract-bib-entries-from-thebibliography): Match \bibitem entries with spaces or tabs in front of arguments. (reftex-insert-bib-matches): Use `mapc' instead of `mapcar' because return value is not used. 2008-01-05 Ralf Angeli * lisp/reftex-toc.el (reftex-make-separate-toc-frame): Hide non-operational call to `focus-frame' in Emacs for the compilers's sake. 2008-01-03 Ralf Angeli * lisp/reftex-dcr.el (reftex-mouse-view-crossref): Explain why point is set. * lisp/reftex-toc.el (reftex-toc-do-promote): Use `mapc' instead of `mapcar' because return value is not used. (reftex-toggle-auto-toc-recenter): Fix typo. * lisp/reftex-cite.el (reftex-do-citation): Use `mapc' instead of `mapcar' because return value is not used. 2007-10-10 Ralf Angeli * lisp/reftex-vars.el (reftex-cite-format-builtin) (reftex-bibliography-commands): Add support for ConTeXt. * doc/reftex.texi (Citation Styles): Mention support for ConTeXt. 2007-08-23 Ralf Angeli * doc/reftex.texi (Options (Defining Label Environments)): Fix typo. 2007-07-22 Ralf Angeli * lisp/reftex-base.el (reftex-set-cite-format): Autoload. (reftex-access-parse-file): Create parse file in a way that does not interfere with recentf mode. (reftex-access-parse-file): Do not risk destroying an existing buffer. 2007-07-07 Ralf Angeli * lisp/reftex-parse.el (reftex-nth-arg): Use `forward-comment' instead of `comment-forward'. The latter is not always available and the former is sufficient for LaTeX. (reftex-nth-arg): Revert last change since moving over whitespace and comments is done by `reftex-move-to-next-arg'. 2007-05-20 Ralf Angeli * doc/reftex.texi (Citation Styles): Correct some mistakes. 2007-04-03 Ralf Angeli * lisp/reftex-cite.el: Delete trailing whitespace. (reftex-pop-to-bibtex-entry, reftex-extract-bib-entries) (reftex-parse-bibtex-entry, reftex-create-bibtex-file): Match entries containing numbers and symbol constituents. 2007-03-28 Ralf Angeli * doc/reftex.texi: Replace BibTeX by @BibTeX{} throughout the file. 2007-03-12 John Paul Wallington * lisp/reftex-vars.el (reftex-format-ref-function) (reftex-format-cite-function): Fix custom type. 2007-03-10 Ralf Angeli * lisp/reftex-base.el: Remove information in comment already in imprint or cluttering output of `finder-commentary'. Require reftex.el. * lisp/reftex.el: Remove. Now generated from reftex.el.in. * lisp/reftex-dcr.el: Remove version info in header. Add maintainer info. * lisp/reftex-global.el Remove version info in header. Add maintainer info. * lisp/reftex-index.el Remove version info in header. Add maintainer info. * lisp/reftex-parse.el Remove version info in header. Add maintainer info. * lisp/reftex-ref.el Remove version info in header. Add maintainer info. * lisp/reftex-sel.el Remove version info in header. Add maintainer info. * lisp/reftex-toc.el Remove version info in header. Add maintainer info. * lisp/reftex-vars.el Remove version info in header. Add maintainer info. 2007-03-08 Ralf Angeli * doc/reftex.texi: Include macros.texi and version.texi. Change maintainer and version information. Express TeX, LaTeX, AUCTeX and RefTeX with macros. (Imprint): Change maintainer information. 2007-03-04 Ralf Angeli * lisp/reftex.el: Update. * lisp/reftex-base.el (reftex-show-commentary): Look in reftex-base.el. (reftex-report-bug): New function. * lisp/reftex.el: Move original content to reftex-base.el. Add new header and automatically generated autoloads. * lisp/reftex-base.el: New file. Insert original content of reftex.el. Remove autoload for `reftex-index-phrases-mode'. Delete trailing whitespace. 2007-02-26 Ralf Angeli * lisp/reftex-index.el (reftex-index-visit-phrases-buffer): Set marker when visiting buffer. This allows for returning from the phrases file to the file one was just editing instead of the file where the last phrases was added from. 2007-02-25 Ralf Angeli * lisp/reftex-index.el (reftex-index-phrases-syntax-table): New variable. Give ?\" punctuation syntax as it usually is not used as string quote in TeX-related modes and may occur unmatched. The change also prevents fontification of quoted content. (reftex-index-phrases-mode): Use it. * lisp/reftex-cite.el (reftex-parse-bibtex-entry): Match fields containing hyphens (besides word constituents). 2007-02-25 David Kastrup * lisp/reftex.el (reftex-uniquify, reftex-uniquify-by-car): Replace O(n^2) algorithms with O(n log n). Introduce optional argument SORT (not yet used). TODO: figure out callers that can specify SORT, in order to further speed this up. 2007-02-25 Ralf Angeli * lisp/reftex-vars.el (reftex-cite-key-separator): New variable. * lisp/reftex-auc.el (reftex-arg-cite): Use `reftex-cite-key-separator'. * lisp/reftex-cite.el (reftex-do-citation) (reftex-figure-out-cite-format): Use `reftex-cite-key-separator'. * doc/reftex.texi (Options (Creating Citations)): Document `reftex-cite-key-separator'. * lisp/reftex-cite.el (reftex-do-citation): Return all keys, not just the first one. * lisp/reftex-auc.el (reftex-arg-cite): Correctly handle new value type returned by `reftex-citation'. 2007-02-24 Ralf Angeli * doc/reftex.texi: Set correct filename for standalone distribution. 2007-02-07 Ralf Angeli Create `reftex' module. diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2012-09-30 15:14:59 +0000 +++ doc/misc/ChangeLog 2012-09-30 20:30:13 +0000 @@ -1,3 +1,34 @@ +2012-09-30 Ralf Angeli + + Merge from standalone RefTeX repository. + + * reftex.texi: Express TeX, LaTeX, AUCTeX, BibTeX and RefTeX + with macros. + (Imprint): Mention Wolfgang in list of contributors. + (Creating Citations): Give a hint about how to + auto-revert the BibTeX database file when using external editors. + (Referencing Labels): Simplify section about reference macro + cycling. + (Options (Referencing Labels)): Adapt to new structure of + `reftex-ref-style-alist'. + (Referencing Labels, Reference Styles): Document changes in the + referencing functionality. + (Commands): Mention options for definition of header and footer in + BibTeX files. + (Options (Creating Citations)): Document + `reftex-create-bibtex-header' and `reftex-create-bibtex-footer'. + (Reference Styles): New section. + (varioref (LaTeX package), fancyref (LaTeX package)): Remove. + (Options (Referencing Labels)): Remove descriptions of deprecated + variables `reftex-vref-is-default' and `reftex-fref-is-default'. + Add descriptions for `reftex-ref-style-alist' and + `reftex-ref-style-default-list'. + (Referencing Labels): Update regarding reference styles. + (Citation Styles): Mention support for ConTeXt. + (Options (Defining Label Environments)): Fix typo. + (Options (Creating Citations)): Document + `reftex-cite-key-separator'. + 2012-09-30 Achim Gratz * org.texi: Add description of ORG_ADD_CONTRIB to info === modified file 'doc/misc/reftex.texi' --- doc/misc/reftex.texi 2012-01-19 07:21:25 +0000 +++ doc/misc/reftex.texi 2012-09-30 20:30:13 +0000 @@ -6,26 +6,44 @@ @syncodeindex vr cp @syncodeindex fn cp -@c Version and Contact Info -@set VERSION 4.31 -@set EDITION 4.31 -@set DATE February 2006 -@set AUCTEXSITE @uref{http://www.gnu.org/software/auctex/,AUCTeX distribution site} -@set MAINTAINERSITE @uref{http://www.gnu.org/software/auctex/reftex.html,Ref@TeX{} web page} +@ifnottex +@macro RefTeX {} +Ref@TeX{} +@end macro +@macro AUCTeX {} +AUC@TeX{} +@end macro +@macro BibTeX {} +Bib@TeX{} +@end macro +@macro ConTeXt {} +Con@TeX{}t +@end macro +@end ifnottex +@tex +\gdef\RefTeX{Ref\TeX} +\gdef\AUCTeX{AUC\TeX} +\gdef\BibTeX{Bib\TeX} +\gdef\ConTeXt{Con\TeX t} +@end tex + +@include ../emacs/emacsver.texi + +@set VERSION @value{EMACSVER} +@set AUCTEXSITE @uref{http://www.gnu.org/software/auctex/,@AUCTeX{} web site} +@set MAINTAINERSITE @uref{http://www.gnu.org/software/auctex/reftex.html,@RefTeX{} web page} @set MAINTAINERCONTACT @uref{mailto:auctex-devel@@gnu.org,contact the maintainers} -@set MAINTAINER the AUC@TeX{} project -@set SUPPORTADDRESS AUC@TeX{} user mailing list (@email{auctex@@gnu.org}) -@set DEVELADDRESS AUC@TeX{} developer mailing list (@email{auctex-devel@@gnu.org}) -@set BUGADDRESS AUC@TeX{} bug mailing list (@email{bug-auctex@@gnu.org}) -@set XEMACSFTP @uref{ftp://ftp.xemacs.org/pub/xemacs/packages/,XEmacs ftp site} +@set MAINTAINER the @AUCTeX{} project +@set SUPPORTADDRESS @AUCTeX{} user mailing list (@email{auctex@@gnu.org}) +@set DEVELADDRESS @AUCTeX{} developer mailing list (@email{auctex-devel@@gnu.org}) +@set BUGADDRESS @AUCTeX{} bug mailing list (@email{bug-auctex@@gnu.org}) +@set XEMACSFTP @uref{ftp://ftp.xemacs.org/pub/xemacs/packages/,XEmacs FTP site} @c %**end of header @copying -This file documents @b{Ref@TeX{}}, a package to do labels, references, -citations and indices for LaTeX documents with Emacs. - -This is edition @value{EDITION} of the @b{Ref@TeX{}} User Manual for -@b{Ref@TeX{}} @value{VERSION} +This manual documents @RefTeX{} (version @value{VERSION}), a package +to do labels, references, citations and indices for LaTeX documents +with Emacs. Copyright @copyright{} 1997-2012 Free Software Foundation, Inc. @@ -64,9 +82,9 @@ @end macro @titlepage -@title Ref@TeX{} User Manual -@subtitle Support for LaTeX labels, references, citations and index entries with GNU Emacs -@subtitle Edition @value{EDITION}, @value{DATE} +@title @RefTeX{} User Manual +@subtitle Support for @LaTeX{} labels, references, citations and index entries with GNU Emacs +@subtitle Version @value{VERSION} @author by Carsten Dominik @page @@ -79,18 +97,17 @@ @ifnottex @node Top,,,(dir) -@top RefTeX - -@b{Ref@TeX{}} is a package for managing Labels, References, -Citations and index entries with GNU Emacs. - -Don't be discouraged by the size of this manual, which covers -@b{Ref@TeX{}} in great depth. All you need to know to use -@b{Ref@TeX{}} can be summarized on two pages (@pxref{RefTeX in a -Nutshell}). You can go back later to other parts of this document when -needed. - -@insertcopying +@top @RefTeX{} + +@RefTeX{} is a package for managing Labels, References, Citations and +index entries with GNU Emacs. + +This manual documents @RefTeX{} version @value{VERSION}. + +Don't be discouraged by the size of this manual, which covers @RefTeX{} +in great depth. All you need to know to use @RefTeX{} can be summarized +on two pages (@pxref{RefTeX in a Nutshell}). You can go back later to +other parts of this document when needed. @menu * Introduction:: Quick-Start information. @@ -106,8 +123,8 @@ * Faces:: Fontification of RefTeX's buffers. * Multifile Documents:: Document spread over many files. * Language Support:: How to support other languages. -* Finding Files:: Included TeX files and BibTeX .bib files. -* AUCTeX:: Cooperation with AUCTeX. +* Finding Files:: Included @TeX{} files and @BibTeX{} .bib files. +* AUCTeX:: Cooperation with @AUCTeX{}. * Optimizations:: When RefTeX is too slow. * Problems and Work-Arounds:: First Aid. * Imprint:: Author, Web-site, Thanks @@ -123,6 +140,7 @@ * Index:: The full index. @detailmenu + --- The Detailed Node Listing --- Introduction @@ -136,9 +154,8 @@ * Builtin Label Environments:: The environments RefTeX knows about. * Defining Label Environments:: ... and environments it doesn't. * Reference Info:: View the label corresponding to a \ref. +* Reference Styles:: Macros to be used instead of \ref. * xr (LaTeX package):: References to external documents. -* varioref (LaTeX package):: How to create \vref instead of \ref. -* fancyref (LaTeX package):: How to create \fref instead of \ref. Defining Label Environments @@ -176,7 +193,7 @@ AUCTeX * AUCTeX-RefTeX Interface:: How both packages work together -* Style Files:: AUCTeX's style files can support RefTeX +* Style Files:: @AUCTeX{}'s style files can support RefTeX * Bib-Cite:: Hypertext reading of a document Options, Keymaps, Hooks @@ -202,18 +219,18 @@ @chapter Introduction @cindex Introduction -@b{Ref@TeX{}} is a specialized package for support of labels, -references, citations, and the index in LaTeX. @b{Ref@TeX{}} wraps -itself round 4 LaTeX macros: @code{\label}, @code{\ref}, @code{\cite}, -and @code{\index}. Using these macros usually requires looking up -different parts of the document and searching through BibTeX database -files. @b{Ref@TeX{}} automates these time--consuming tasks almost -entirely. It also provides functions to display the structure of a -document and to move around in this structure quickly. +@RefTeX{} is a specialized package for support of labels, references, +citations, and the index in @LaTeX{}. @RefTeX{} wraps itself round four +@LaTeX{} macros: @code{\label}, @code{\ref}, @code{\cite}, and +@code{\index}. Using these macros usually requires looking up different +parts of the document and searching through @BibTeX{} database files. +@RefTeX{} automates these time-consuming tasks almost entirely. It also +provides functions to display the structure of a document and to move +around in this structure quickly. @iftex -Don't be discouraged by the size of this manual, which covers @b{Ref@TeX{}} -in great depth. All you need to know to use @b{Ref@TeX{}} can be +Don't be discouraged by the size of this manual, which covers @RefTeX{} +in great depth. All you need to know to use @RefTeX{} can be summarized on two pages (@pxref{RefTeX in a Nutshell}). You can go back later to other parts of this document when needed. @end iftex @@ -230,51 +247,122 @@ @section Installation @cindex Installation -@b{Ref@TeX{}} is bundled and pre--installed with Emacs since version -20.2. It was also bundled and pre--installed with XEmacs 19.16--20.x. -XEmacs 21.x users want to install the corresponding plug-in package -which is available from the @value{XEMACSFTP}. See the XEmacs 21.x -documentation on package installation for details. - -Users of earlier Emacs distributions (including Emacs 19) can get a copy -of the @b{Ref@TeX{}} distribution from the maintainers web-page. -@xref{Imprint}, for more information. - -@section Environment +@RefTeX{} has been bundled and pre-installed with Emacs since +version 20.2. It has also been bundled and pre-installed with XEmacs +19.16--20.x. XEmacs 21.x users want to install the corresponding +plug-in package which is available from the @value{XEMACSFTP}. See the +XEmacs 21.x documentation on package installation for details. + +Users of earlier Emacs distributions (including Emacs 19) or people +craving for new features and bugs can get a copy of the @RefTeX{} +distribution from the maintainer's web page. @xref{Imprint}, for more +information. The following instructions will guide you through the +process of installing such a distribution. + +@subsection Building and Installing + +Note: Currently installation is supported for Emacs only. XEmacs users +might want to refer to the @RefTeX{} package available through the +package system of XEmacs. + +@subsubheading Installation with make + +In order to install RefTeX, unpack the distribution and edit the header +of the Makefile. Basically, you need to change the path specifications +for Emacs Lisp files and info files. Also, enter the name of your Emacs +executable (usually either @samp{emacs} or @samp{xemacs}). + +Then, type + +@example +make +make install +@end example + +to compile and install the code and documentation. + +Per default @RefTeX{} is installed in its own subdirectory which might +not be on your load path. In this case, add it to load path with a +command like the following, replacing the sample directory with the one +where @RefTeX{} is installed in your case. + +@example +(add-to-list 'load-path "/path/to/reftex") +@end example + +Put this command into your init file before other @RefTeX{}-related +settings. + +@subsubheading Installation by Hand + +If you want to get your hands dirty, there is also the possibility to +install by manually copying files. + +@enumerate a +@item +Copy the reftex*.el lisp files to a directory on your load path. Make +sure that no old copy of @RefTeX{} shadows these files. +@item +Byte compile the files. The sequence of compiling should be: +reftex-var.el, reftex.el, and then all the others. +@item +Copy the info file reftex.info to the info directory. +@end enumerate + +@subsection Loading @RefTeX{} + +In order to make the most important functions for entering @RefTeX{} +mode available add the following line to your init file. + +@example +(require 'reftex) +@end example + +@subsection Entering @RefTeX{} Mode + +@findex turn-on-reftex +@findex reftex-mode +@vindex LaTeX-mode-hook +@vindex latex-mode-hook +To turn @RefTeX{} Mode on and off in a particular buffer, use +@kbd{M-x reftex-mode @key{RET}}. To turn on @RefTeX{} Mode for all +LaTeX files, add the following lines to your @file{.emacs} file: + +@example +(add-hook 'LaTeX-mode-hook 'turn-on-reftex) ; with AUCTeX LaTeX mode +(add-hook 'latex-mode-hook 'turn-on-reftex) ; with Emacs latex mode +@end example + +That's all! + +To get started, read the documentation, in particular the +summary. (@pxref{RefTeX in a Nutshell}) + +In order to produce a printed version of the documentation, use +@code{make pdf} to produce a reftex.pdf file. Analogously you can use +the @code{dvi}, @code{ps}, or @code{html} targets to create DVI, +PostScript or HTML files. + +@subsection Environment @cindex Finding files @cindex BibTeX database files, not found @cindex TeX files, not found @cindex @code{TEXINPUTS}, environment variable @cindex @code{BIBINPUTS}, environment variable -@b{Ref@TeX{}} needs to access all files which are part of a multifile +@RefTeX{} needs to access all files which are part of a multifile document, and the BibTeX database files requested by the -@code{\bibliography} command. To find these files, @b{Ref@TeX{}} will +@code{\bibliography} command. To find these files, @RefTeX{} will require a search path, i.e. a list of directories to check. Normally this list is stored in the environment variables @code{TEXINPUTS} and -@code{BIBINPUTS} which are also used by @b{Ref@TeX{}}. However, on some +@code{BIBINPUTS} which are also used by @RefTeX{}. However, on some systems these variables do not contain the full search path. If -@b{Ref@TeX{}} does not work for you because it cannot find some files, -read @ref{Finding Files}. - -@section Entering @b{Ref@TeX{}} Mode - -@findex turn-on-reftex -@findex reftex-mode -@vindex LaTeX-mode-hook -@vindex latex-mode-hook -To turn @b{Ref@TeX{}} Mode on and off in a particular buffer, use -@kbd{M-x reftex-mode}. To turn on @b{Ref@TeX{}} Mode for all LaTeX -files, add the following lines to your @file{.emacs} file: - -@example -(add-hook 'LaTeX-mode-hook 'turn-on-reftex) ; with AUCTeX LaTeX mode -(add-hook 'latex-mode-hook 'turn-on-reftex) ; with Emacs latex mode -@end example +@RefTeX{} does not work for you because it cannot find some files, +@xref{Finding Files}. @page @node RefTeX in a Nutshell, , Installation, Introduction -@section @b{Ref@TeX{}} in a Nutshell +@section @RefTeX{} in a Nutshell @cindex Quick-Start @cindex Getting Started @cindex RefTeX in a Nutshell @@ -289,7 +377,7 @@ help. @item -@b{Labels and References}@* @b{Ref@TeX{}} helps to create unique labels +@b{Labels and References}@* @RefTeX{} helps to create unique labels and to find the correct key for references quickly. It distinguishes labels for different environments, knows about all standard environments (and many others), and can be configured to recognize any @@ -300,7 +388,7 @@ @item @b{Creating Labels}@* Type @kbd{C-c (} (@code{reftex-label}) to insert a label at point. -@b{Ref@TeX{}} will either +@RefTeX{} will either @itemize @minus @item derive a label from context (default for section labels) @@ -325,7 +413,7 @@ @item @b{Citations}@* Typing @kbd{C-c [} (@code{reftex-citation}) will let you specify a -regular expression to search in current BibTeX database files (as +regular expression to search in current @BibTeX{} database files (as specified in the @code{\bibliography} command) and pull out a list of matches for you to choose from. The list is @emph{formatted} and sorted. The selected article is referenced as @samp{\cite@{@var{key}@}} @@ -334,9 +422,9 @@ @item @b{Index Support}@* -@b{Ref@TeX{}} helps to enter index entries. It also compiles all +@RefTeX{} helps to enter index entries. It also compiles all entries into an alphabetically sorted @file{*Index*} buffer which you -can use to check and edit the entries. @b{Ref@TeX{}} knows about the +can use to check and edit the entries. @RefTeX{} knows about the standard index macros and can be configured to recognize any additional macros you have defined (@code{reftex-index-macros}). Multiple indices are supported. @@ -354,7 +442,7 @@ @b{The Index Phrases File (Delayed Indexing)}@* Type @kbd{C-c \} (@code{reftex-index-phrase-selection-or-word}) to add the current word or selection to a special @emph{index phrase file}. -@b{Ref@TeX{}} can later search the document for occurrences of these +@RefTeX{} can later search the document for occurrences of these phrases and let you interactively index the matches. @item @@ -366,11 +454,11 @@ @page @item @b{Viewing Cross-References}@* -When point is on the @var{key} argument of a cross--referencing macro +When point is on the @var{key} argument of a cross-referencing macro (@code{\label}, @code{\ref}, @code{\cite}, @code{\bibitem}, -@code{\index}, and variations) or inside a BibTeX database entry, you +@code{\index}, and variations) or inside a @BibTeX{} database entry, you can press @kbd{C-c &} (@code{reftex-view-crossref}) to display -corresponding locations in the document and associated BibTeX database +corresponding locations in the document and associated @BibTeX{} database files. @* When the enclosing macro is @code{\cite} or @code{\ref} and no other message occupies the echo area, information about the citation or label @@ -380,12 +468,12 @@ @b{Multifile Documents}@* Multifile Documents are fully supported. The included files must have a file variable @code{TeX-master} or @code{tex-main-file} pointing to the -master file. @b{Ref@TeX{}} provides cross-referencing information from +master file. @RefTeX{} provides cross-referencing information from all parts of the document, and across document borders (@file{xr.sty}). @item -@b{Document Parsing}@* @b{Ref@TeX{}} needs to parse the document in +@b{Document Parsing}@* @RefTeX{} needs to parse the document in order to find labels and other information. It does it automatically once and updates its list internally when @code{reftex-label} and @code{reftex-index} are used. To enforce reparsing, call any of the @@ -394,20 +482,20 @@ buffer, or the index buffer. @item -@b{AUCTeX} @* If your major LaTeX mode is AUCTeX, @b{Ref@TeX{}} can -cooperate with it (see variable @code{reftex-plug-into-AUCTeX}). AUCTeX +@b{@AUCTeX{}} @* If your major @LaTeX{} mode is @AUCTeX{}, @RefTeX{} can +cooperate with it (see variable @code{reftex-plug-into-AUCTeX}). @AUCTeX{} contains style files which trigger appropriate settings in -@b{Ref@TeX{}}, so that for many of the popular LaTeX packages no +@RefTeX{}, so that for many of the popular @LaTeX{} packages no additional customizations will be necessary. @item @b{Useful Settings}@* -To integrate RefTeX with AUCTeX, use +To integrate RefTeX with @AUCTeX{}, use @lisp (setq reftex-plug-into-AUCTeX t) @end lisp -To make your own LaTeX macro definitions known to @b{Ref@TeX{}}, +To make your own @LaTeX{} macro definitions known to @RefTeX{}, customize the variables @example @code{reftex-label-alist} @r{(for label macros/environments)} @@ -417,15 +505,15 @@ @code{reftex-index-default-macro} @r{(to set the default macro)} @end example If you have a large number of macros defined, you may want to write -an AUCTeX style file to support them with both AUCTeX and -@b{Ref@TeX{}}. +an @AUCTeX{} style file to support them with both @AUCTeX{} and +@RefTeX{}. -@item @b{Where Next?}@* Go ahead and use @b{Ref@TeX{}}. Use its menus +@item @b{Where Next?}@* Go ahead and use @RefTeX{}. Use its menus until you have picked up the key bindings. For an overview of what you can do in each of the different special buffers, press @kbd{?}. Read -the manual if you get stuck, of if you are curious what else might be +the manual if you get stuck, or if you are curious what else might be available. The first part of the manual explains in -a tutorial way how to use and customize @b{Ref@TeX{}}. The second +a tutorial way how to use and customize @RefTeX{}. The second part is a command and variable reference. @end enumerate @@ -463,10 +551,10 @@ @tablesubheading{Moving around} @item n -Goto next entry in the table of context. +Goto next entry in the table of contents. @item p -Goto previous entry in the table of context. +Goto previous entry in the table of contents. @item C-c C-n Goto next section heading. Useful when many labels and index entries @@ -506,7 +594,7 @@ @file{*toc*} buffer. This is similar to pressing @key{SPC} after each cursor motion. The default for this flag can be set with the variable @code{reftex-toc-follow-mode}. Note that only context in files already -visited is shown. @b{Ref@TeX{}} will not visit a file just for follow +visited is shown. @RefTeX{} will not visit a file just for follow mode. See, however, the variable @code{reftex-revisit-to-follow}. @@ -521,8 +609,8 @@ Promote the current section. This will convert @code{\section} to @code{\chapter}, @code{\subsection} to @code{\section} etc. If there is an active region, all sections in the region will be promoted, including -the one at point. To avoid mistakes, @b{Ref@TeX{}} requires a fresh -document scan before executing this command - if necessary, it will +the one at point. To avoid mistakes, @RefTeX{} requires a fresh +document scan before executing this command -- if necessary, it will automatically do this scan and ask the user to repeat the promotion command. @@ -578,7 +666,7 @@ Toggle the display of labels in the @file{*toc*} buffer. The default for this flag can be set with the variable @code{reftex-toc-include-labels}. When called with a prefix argument, -@b{Ref@TeX{}} will prompt for a label type and include only labels of +@RefTeX{} will prompt for a label type and include only labels of the selected type in the @file{*toc*} buffer. The mode line @samp{L<>} indicator shows which labels are included. @@ -587,7 +675,7 @@ Toggle the display of index entries in the @file{*toc*} buffer. The default for this flag can be set with the variable @code{reftex-toc-include-index-entries}. When called with a prefix -argument, @b{Ref@TeX{}} will prompt for a specific index and include +argument, @RefTeX{} will prompt for a specific index and include only entries in the selected index in the @file{*toc*} buffer. The mode line @samp{I<>} indicator shows which index is used. @@ -605,18 +693,18 @@ @item r @vindex reftex-enable-partial-scans -Reparse the LaTeX document and rebuild the @file{*toc*} buffer. When +Reparse the @LaTeX{} document and rebuild the @file{*toc*} buffer. When @code{reftex-enable-partial-scans} is non-@code{nil}, rescan only the file this location is defined in, not the entire document. @item C-u r -Reparse the @emph{entire} LaTeX document and rebuild the @file{*toc*} +Reparse the @emph{entire} @LaTeX{} document and rebuild the @file{*toc*} buffer. @item x Switch to the @file{*toc*} buffer of an external document. When the current document is using the @code{xr} package (@pxref{xr (LaTeX -package)}), @b{Ref@TeX{}} will switch to one of the external +package)}), @RefTeX{} will switch to one of the external documents. @@ -669,11 +757,11 @@ @cindex LaTeX classes, KOMA-Script @cindex TOC entries for environments @vindex reftex-section-levels -The section macros recognized by @b{Ref@TeX{}} are all LaTeX section +The section macros recognized by @RefTeX{} are all @LaTeX{} section macros (from @code{\part} to @code{\subsubparagraph}) and the commands @code{\addchap} and @code{\addsec} from the KOMA-Script classes. Additional macros can be configured with the variable -@code{reftex-section-levels}. It is also possible to add certain LaTeX +@code{reftex-section-levels}. It is also possible to add certain @LaTeX{} environments to the table of contents. This is probably only useful for theorem-like environments. @xref{Defining Label Environments}, for an example. @@ -686,21 +774,21 @@ @cindex Label environment @cindex @code{\label} -LaTeX provides a powerful mechanism to deal with cross--references in a +@LaTeX{} provides a powerful mechanism to deal with cross-references in a document. When writing a document, any part of it can be marked with a -label, like @samp{\label@{mark@}}. LaTeX records the current value of a +label, like @samp{\label@{mark@}}. @LaTeX{} records the current value of a certain counter when a label is defined. Later references to this label (like @samp{\ref@{mark@}}) will produce the recorded value of the counter. Labels can be used to mark sections, figures, tables, equations, -footnotes, items in enumerate lists etc. LaTeX is context sensitive in +footnotes, items in enumerate lists etc. @LaTeX{} is context sensitive in doing this: A label defined in a figure environment automatically records the figure counter, not the section counter. Several different environments can share a common counter and therefore -a common label category. E.g. labels in both @code{equation} and -@code{eqnarray} environments record the value of the same counter - the +a common label category. For example labels in both @code{equation} and +@code{eqnarray} environments record the value of the same counter -- the equation counter. @menu @@ -709,9 +797,8 @@ * Builtin Label Environments:: The environments RefTeX knows about. * Defining Label Environments:: ... and environments it doesn't. * Reference Info:: View the label corresponding to a \ref. +* Reference Styles:: Macros to be used instead of \ref. * xr (LaTeX package):: References to external documents. -* varioref (LaTeX package):: How to create \vref instead of \ref. -* fancyref (LaTeX package):: How to create \fref instead of \ref. @end menu @node Creating Labels, Referencing Labels, , Labels and References @@ -722,12 +809,12 @@ @kindex C-c ( @findex reftex-label -In order to create a label in a LaTeX document, press @kbd{C-c (} -(@code{reftex-label}). Just like LaTeX, @b{Ref@TeX{}} is context sensitive +In order to create a label in a @LaTeX{} document, press @kbd{C-c (} +(@code{reftex-label}). Just like @LaTeX{}, @RefTeX{} is context sensitive and will figure out the environment it currently is in and adapt the label to that environment. A label usually consists of a short prefix -indicating the type of the label and a unique mark. @b{Ref@TeX{}} has -3 different modes to create this mark. +indicating the type of the label and a unique mark. @RefTeX{} has +three different modes to create this mark. @enumerate @item @@ -735,10 +822,10 @@ @vindex reftex-derive-label-parameters @vindex reftex-label-illegal-re @vindex reftex-abbrev-parameters -A label can be derived from context. This means, @b{Ref@TeX{}} takes +A label can be derived from context. This means, @RefTeX{} takes the context of the label definition and constructs a label from that@footnote{Note that the context may contain constructs which are -invalid in labels. @b{Ref@TeX{}} will therefore strip the accent from +invalid in labels. @RefTeX{} will therefore strip the accent from accented Latin-1 characters and remove everything else which is not valid in labels. This mechanism is safe, but may not be satisfactory for non-western languages. Check the following variables if you need to @@ -746,28 +833,28 @@ @code{reftex-derive-label-parameters}, @code{reftex-label-illegal-re}, @code{reftex-abbrev-parameters}.}. This works best for section labels, where the section heading is used to construct a label. In fact, -@b{Ref@TeX{}}'s default settings use this method only for section +@RefTeX{}'s default settings use this method only for section labels. You will be asked to confirm the derived label, or edit it. @item We may also use a simple unique number to identify a label. This is mostly useful for labels where it is difficult to come up with a very -good descriptive name. @b{Ref@TeX{}}'s default settings use this method -for equations, enumerate items and footnotes. The author of @b{Ref@TeX{}} +good descriptive name. @RefTeX{}'s default settings use this method +for equations, enumerate items and footnotes. The author of @RefTeX{} tends to write documents with many equations and finds it impossible to come up with good names for each of them. These simple labels are inserted without query, and are therefore very fast. Good descriptive -names are not really necessary as @b{Ref@TeX{}} will provide context to +names are not really necessary as @RefTeX{} will provide context to reference a label (@pxref{Referencing Labels}). @item The third method is to ask the user for a label. This is most useful for things which are easy to describe briefly and do not turn up -too frequently in a document. @b{Ref@TeX{}} uses this for figures and +too frequently in a document. @RefTeX{} uses this for figures and tables. Of course, one can enter the label directly by typing the full @samp{\label@{mark@}}. The advantage of using @code{reftex-label} -anyway is that @b{Ref@TeX{}} will know that a new label has been defined. +anyway is that @RefTeX{} will know that a new label has been defined. It will then not be necessary to rescan the document in order to access this label later. @end enumerate @@ -777,9 +864,9 @@ variable @code{reftex-insert-label-flags} (@pxref{Options (Creating Labels)}). -If you are using AUCTeX to write your LaTeX documents, you can +If you are using @AUCTeX{} to write your @LaTeX{} documents, you can set it up to delegate the creation of labels to -@b{Ref@TeX{}}. @xref{AUCTeX}, for more information. +@RefTeX{}. @xref{AUCTeX}, for more information. @node Referencing Labels, Builtin Label Environments, Creating Labels, Labels and References @section Referencing Labels @@ -792,24 +879,31 @@ @findex reftex-reference @vindex reftex-trust-label-prefix -@b{Ref@TeX{}} scans the document in order to find all labels. To make +@RefTeX{} scans the document in order to find all labels. To make referencing labels easier, it assigns to each label a category, the @emph{label type} (for example section, table, figure, equation, etc.). -In order to determine the label type, RefTeX parses around each label +In order to determine the label type, @RefTeX{} parses around each label to see in what kind of environments it is located. You can speed up the parsing by using type-specific prefixes for labels and configuring the variable @code{reftex-trust-label-prefix}. -Referencing Labels is really at the heart of @b{Ref@TeX{}}. Press @kbd{C-c -)} in order to reference a label (reftex-reference). This will start a -selection process and finally insert the complete @samp{\ref@{label@}} -into the buffer. - -First, @b{Ref@TeX{}} will determine the label category which is required. -Often that can be figured out from context. For example, if you -write @samp{As shown in eq.} and the press @kbd{C-c )}, @b{Ref@TeX{}} knows -that an equation label is going to be referenced. If it cannot figure -out what label category is needed, it will query for one. +Referencing Labels is really at the heart of @RefTeX{}. Press @kbd{C-c +)} in order to reference a label (@code{reftex-reference}). This will +start a selection process and finally insert the complete +@samp{\ref@{label@}} into the buffer. + +@vindex reftex-ref-macro-prompt +First, you can select which reference macro you want to use, +e.g. @samp{\ref} or @samp{\pageref}. Later in the process you have +another chance to make this selection and you can therefore disable this +step by customizing @code{reftex-ref-macro-prompt} if you find it too +intrusive. @xref{Reference Styles}. + +Then, @RefTeX{} will determine the label category which is required. +Often that can be figured out from context. For example, if you write +@samp{As shown in eq.} and then press @kbd{C-c )}, @RefTeX{} knows that +an equation label is going to be referenced. If it cannot figure out +what label category is needed, it will query for one. You will then be presented with a label selection menu. This is a special buffer which contains an outline of the document along with all @@ -820,7 +914,7 @@ label, pressing @key{SPC} will show the label definition point in another window. -In order to reference a label, move to cursor to the correct label and +In order to reference a label, move the cursor to the correct label and press @key{RET}. You can also reference several labels with a single call to @code{reftex-reference} by marking entries with the @kbd{m} key (see below). @@ -871,7 +965,7 @@ Toggle follow mode. When follow mode is active, the other window will always display the full context of the current label. This is similar to pressing @key{SPC} after each cursor motion. Note that only context -in files already visited is shown. @b{RefTeX} will not visit a file +in files already visited is shown. @RefTeX{} will not visit a file just for follow mode. See, however, the variable @code{reftex-revisit-to-follow}. @@ -888,8 +982,8 @@ @item mouse-2 @vindex reftex-highlight-selection Clicking with mouse button 2 on a label will accept it like @key{RET} -would. See also variable @code{reftex-highlight-selection}, @ref{Options -(Misc)}. +would. See also variable @code{reftex-highlight-selection}, +@ref{Options (Misc)}. @vindex reftex-multiref-punctuation @item m - + , @@ -923,26 +1017,15 @@ yet exist in the document. @item v -@cindex @code{varioref}, LaTeX package -@cindex @code{\vref} -@cindex LaTeX packages, @code{varioref} -Toggle between @code{\ref} and @code{\vref} macro for references. The -@code{\vref} macro is defined in the @code{varioref} LaTeX package. -With this key you can force @b{Ref@TeX{}} to insert a @code{\vref} -macro. The current state of this flag is displayed by the @samp{S<>} -indicator in the mode line of the selection buffer. +Cycle forward through active reference macros. The selected macro is +displayed by the @samp{S<...>} indicator in the mode line of the +selection buffer. This mechanism comes in handy if you are using +@LaTeX{} packages like @code{varioref} or @code{fancyref} and want to +use the special referencing macros they provide (e.g. @code{\vref} or +@code{\fref}) instead of @code{\ref}. @item V -@cindex @code{fancyref}, LaTeX package -@cindex @code{\fref} -@cindex @code{\Fref} -@cindex LaTeX packages, @code{fancyref} -Cycle between @code{\ref}, @code{\fref} and @code{\Fref}. The -@code{\fref} and @code{\Fref} macros are defined in the @code{fancyref} -LaTeX package. With this key you can force @b{Ref@TeX{}} to insert a -@code{\fref} or @code{\Fref} macro. The current state of this flag is -displayed by the @samp{S<>} indicator in the mode line of the -selection buffer. +Cycle backward through active reference macros. @tablesubheading{Exiting} @@ -966,7 +1049,7 @@ @item t Toggle the display of the table of contents in the selection buffer. With prefix @var{arg}, change the maximum level of toc entries displayed -to @var{arg}. Chapters are level 1, section are level 2. +to @var{arg}. Chapters are level 1, sections are level 2. @item # Toggle the display of a label counter in the selection buffer. @@ -974,7 +1057,7 @@ @item % Toggle the display of labels hidden in comments in the selection buffers. Sometimes, you may have commented out parts of your document. -If these parts contain label definitions, @b{Ref@TeX{}} can still display +If these parts contain label definitions, @RefTeX{} can still display and reference these labels. @tablesubheading{Updating the buffer} @@ -998,7 +1081,7 @@ a menu for that category will be shown. @item x -Reference a label from an external document. With the LaTeX package +Reference a label from an external document. With the @LaTeX{} package @code{xr} it is possible to reference labels defined in another document. This key will switch to the label menu of an external document and let you select a label from there (@pxref{xr (LaTeX @@ -1018,10 +1101,10 @@ @vindex reftex-label-alist @vindex reftex-label-alist-builtin -@b{Ref@TeX{}} needs to be aware of the environments which can be referenced -with a label (i.e. which carry their own counters). By default, @b{Ref@TeX{}} +@RefTeX{} needs to be aware of the environments which can be referenced +with a label (i.e. which carry their own counters). By default, @RefTeX{} recognizes all labeled environments and macros discussed in @cite{The -LaTeX Companion by Goossens, Mittelbach & Samarin, Addison-Wesley +@LaTeX{} Companion by Goossens, Mittelbach & Samarin, Addison-Wesley 1994.}. These are: @itemize @minus @@ -1038,7 +1121,7 @@ @cindex LaTeX core @code{figure}, @code{figure*}, @code{table}, @code{table*}, @code{equation}, @code{eqnarray}, @code{enumerate}, the @code{\footnote} macro (this is -the LaTeX core stuff) +the @LaTeX{} core stuff) @item @cindex AMS-LaTeX @cindex @code{amsmath}, LaTeX package @@ -1053,7 +1136,7 @@ @cindex @code{subequations}, AMS-LaTeX environment @code{align}, @code{gather}, @code{multline}, @code{flalign}, @code{alignat}, @code{xalignat}, @code{xxalignat}, @code{subequations} -(from AMS-LaTeX's @file{amsmath.sty} package) +(from AMS-@LaTeX{}'s @file{amsmath.sty} package) @item @cindex @code{endnote}, LaTeX package @cindex LaTeX packages, @code{endnote} @@ -1112,7 +1195,7 @@ @end itemize If you want to use other labeled environments, defined with -@code{\newtheorem}, @b{Ref@TeX{}} needs to be configured to recognize +@code{\newtheorem}, @RefTeX{} needs to be configured to recognize them (@pxref{Defining Label Environments}). @node Defining Label Environments, Reference Info, Builtin Label Environments, Labels and References @@ -1120,7 +1203,7 @@ @cindex Label environments, defining @vindex reftex-label-alist -@b{Ref@TeX{}} can be configured to recognize additional labeled +@RefTeX{} can be configured to recognize additional labeled environments and macros. This is done with the variable @code{reftex-label-alist} (@pxref{Options (Defining Label Environments)}). If you are not familiar with Lisp, you can use the @@ -1143,7 +1226,7 @@ * Quick Equation:: When a macro sets the label type. * Figure Wrapper:: When a macro argument is a label. * Adding Magic Words:: Other words for other languages. -* Using \eqref:: How to switch to this AMS-LaTeX macro. +* Using \eqref:: How to switch to this AMS-@LaTeX{} macro. * Non-Standard Environments:: Environments without \begin and \end * Putting it Together:: How to combine many entries. @end menu @@ -1154,7 +1237,7 @@ @cindex @code{axiom}, newtheorem @cindex @code{\newtheorem} -Suppose you are using @code{\newtheorem} in LaTeX in order to define two +Suppose you are using @code{\newtheorem} in @LaTeX{} in order to define two new environments, @code{theorem} and @code{axiom} @example @@ -1172,7 +1255,7 @@ \end@{axiom@} @end example -So we need to tell @b{Ref@TeX{}} that @code{theorem} and @code{axiom} are new +So we need to tell @RefTeX{} that @code{theorem} and @code{axiom} are new labeled environments which define their own label categories. We can either use Lisp to do this (e.g. in @file{.emacs}) or use the custom library. With Lisp it would look like this @@ -1184,7 +1267,7 @@ @end lisp The type indicator characters @code{?a} and @code{?h} are used for -prompts when @b{Ref@TeX{}} queries for a label type. @code{?h} +prompts when @RefTeX{} queries for a label type. @code{?h} was chosen for @code{theorem} since @code{?t} is already taken by @code{table}. Note that also @code{?s}, @code{?f}, @code{?e}, @code{?i}, @code{?n} are already used for standard environments. @@ -1192,10 +1275,10 @@ @noindent The labels for Axioms and Theorems will have the prefixes @samp{ax:} and @samp{thr:}, respectively. @xref{AUCTeX}, for information on how -AUCTeX can use RefTeX to automatically create labels when a new environment -is inserted into a buffer. Additionally, the following needs to be -added to one's .emacs file before AUCTeX will automatically create -labels for the new environments. +@AUCTeX{} can use @RefTeX{} to automatically create labels when a new +environment is inserted into a buffer. Additionally, the following +needs to be added to one's .emacs file before @AUCTeX{} will +automatically create labels for the new environments. @lisp (add-hook 'LaTeX-mode-hook @@ -1226,9 +1309,9 @@ @end itemize The following list of strings is used to guess the correct label type -from the word before point when creating a reference. E.g. if you +from the word before point when creating a reference. For example if you write: @samp{As we have shown in Theorem} and then press @kbd{C-c )}, -@b{Ref@TeX{}} will know that you are looking for a theorem label and +@RefTeX{} will know that you are looking for a theorem label and restrict the menu to only these labels without even asking. The final item in each entry is the level at which the environment @@ -1299,7 +1382,7 @@ Einstein's equation is \quickeq@{E=mc^2 \label@{eq:einstein@}@}. @end example -We need to tell @b{Ref@TeX{}} that any label defined in the argument of the +We need to tell @RefTeX{} that any label defined in the argument of the @code{\quickeq} is an equation label. Here is how to do this with lisp: @lisp @@ -1310,7 +1393,7 @@ @emph{image} of the macro arguments. @code{?e} indicates that this is an equation label, the different @code{nil} elements indicate to use the default values for equations. The @samp{1} as the fifth element -indicates that the context of the label definition should be the 1st +indicates that the context of the label definition should be the first argument of the macro. Here is again how this would look in the customization buffer: @@ -1352,7 +1435,7 @@ \myfig[htp]@{filename@}@{caption text@}@{label@}@{1@} @end example -Now we need to tell @b{Ref@TeX{}} that the 4th argument of the +Now we need to tell @RefTeX{} that the fourth argument of the @code{\myfig} macro @emph{is itself} a figure label, and where to find the context. @@ -1366,8 +1449,8 @@ indicates that this is a figure label which will be listed together with labels from normal figure environments. The @code{nil} entries for prefix and reference format mean to use the defaults for figure labels. -The @samp{3} for the context method means to grab the 3rd macro argument -- the caption. +The @samp{3} for the context method means to grab the third macro argument +-- the caption. As a side effect of this configuration, @code{reftex-label} will now insert the required naked label (without the @code{\label} macro) when @@ -1420,7 +1503,7 @@ Another case where one only wants to change the information associated with the label category is to change the macro which is used for -referencing the label. When working with the AMS-LaTeX stuff, you might +referencing the label. When working with the AMS-@LaTeX{}, you might prefer @code{\eqref} for doing equation references. Here is how to do this: @@ -1428,7 +1511,7 @@ (setq reftex-label-alist '((nil ?e nil "~\\eqref@{%s@}" nil nil))) @end lisp -@b{Ref@TeX{}} has also a predefined symbol for this special purpose. The +@RefTeX{} has also a predefined symbol for this special purpose. The following is equivalent to the line above. @lisp @@ -1436,7 +1519,7 @@ @end lisp Note that this is automatically done by the @file{amsmath.el} style file -of AUCTeX (@pxref{Style Files}) - so if you use AUCTeX, +of @AUCTeX{} (@pxref{Style Files}) -- so if you use @AUCTeX{}, this configuration will not be necessary. @node Non-Standard Environments, Putting it Together, Using \eqref, Defining Label Environments @@ -1446,8 +1529,8 @@ @cindex Special parser functions @cindex Parser functions, for special environments -Some LaTeX packages define environment-like structures without using the -standard @samp{\begin..\end} structure. @b{Ref@TeX{}} cannot parse +Some @LaTeX{} packages define environment-like structures without using the +standard @samp{\begin..\end} structure. @RefTeX{} cannot parse these directly, but you can write your own special-purpose parser and use it instead of the name of an environment in an entry for @code{reftex-label-alist}. The function should check if point is @@ -1506,7 +1589,7 @@ The difficulty is that the @samp{\a.} lists can nest and that an empty line terminates all list levels in one go. So we have to count nesting levels between @samp{\a.} and @samp{\z.}. Here is the implementation -for @b{Ref@TeX{}}. +for @RefTeX{}. @lisp (setq reftex-label-alist @@ -1558,7 +1641,7 @@ (detect-linguex ?x "ex:" "~\\ref@{%s@}" nil ("Example" "Ex.")))) @end lisp -@node Reference Info, xr (LaTeX package), Defining Label Environments, Labels and References +@node Reference Info, Reference Styles, Defining Label Environments, Labels and References @section Reference Info @findex reftex-view-crossref @findex reftex-mouse-view-crossref @@ -1575,12 +1658,100 @@ is only displayed if the echo area is not occupied by a different message. -@b{Ref@TeX{}} can also display the label definition corresponding to a +@RefTeX{} can also display the label definition corresponding to a @code{\ref} macro, or all reference locations corresponding to a @code{\label} macro. @xref{Viewing Cross-References}, for more information. -@node xr (LaTeX package), varioref (LaTeX package), Reference Info, Labels and References +@node Reference Styles, xr (LaTeX package), Reference Info, Labels and References +@section Reference Styles + +In case you defined your own macros for referencing or you are using +@LaTeX{} packages providing specialized macros to be used instead of +@code{\ref}, @RefTeX{} provides ways to select and insert them in a +convenient way. + +@RefTeX{} comes equipped with a set of so-called reference styles where +each relates to one or more reference macros. The standard macros +@samp{\ref} and @samp{\pageref} or provided by the ``Default'' style. +The ``Varioref'' style offers macros for the @samp{varioref} @LaTeX{} +package (@samp{\vref}, @samp{\Vref}, @samp{\Ref}, @samp{\vpageref}), +``Fancyref'' for the @samp{fancyref} package (@samp{\fref}, +@samp{\Fref}) and ``Hyperref'' for the @samp{hyperref} package +(@samp{\autoref}, @samp{\autopageref}). + +@vindex reftex-ref-style-default-list +A style can be toggled by selecting the respective entry in the +@samp{Reference Style} menu. Changes made through the menu will only +last for the Emacs session. In order to configure a preference +permanently, the variable @code{reftex-ref-style-default-list} should be +customized. This variable specifies the list of styles to be activated. +It can also be set as a file variable if the preference should be set +for a specific file. + +@vindex reftex-ref-style-alist +In case the built-in styles do not suffice, you can add additional +macros and styles to the variable @code{reftex-ref-style-alist}. Those +do not necessarily have to be related to a certain @LaTeX{} package but +can follow an arbitrary grouping rule. For example you could define a +style called ``Personal'' for your personal referencing macros. (When +changing the variable you should be aware that other Emacs packages, +like @AUCTeX{}, might rely on the entries from the default value to be +present.) + +Once a style is active the macros it relates to are available for +selection when you are about to insert a reference. In general this +process involves three steps: the selection of a reference macro, a +label type and a label. Reference macros can be chosen in the first and +last step. + +@vindex reftex-ref-macro-prompt +In the first step you will be presented with a list of macros from which +you can select one by typing a single key. If you dislike having an +extra step for reference macro selection, you can disable it by +customizing @code{reftex-ref-macro-prompt} and relying only on the +selection facilities provided in the last step. + +In the last step, i.e. the label selection, two key bindings are +provided to set the reference macro. Type @key{v} in order to cycle +forward through the list of available macros or @key{V} to cycle +backward. The mode line of the selection buffer shows the macro +currently selected. + +In case you are not satisfied with the order of macros when cycling +through them you should adapt the order of entries in the variable +@code{reftex-ref-style-alist} to fit your liking. + +For each entry in @code{reftex-ref-style-alist} a function with the name +@code{reftex--} (e.g. @code{reftex-varioref-vref}) will +be created automatically by @RefTeX{}. These functions can be used +instead of @kbd{C-c )} and provide an alternative way of having your +favorite referencing macro preselected and if cycling through the macros +seems inconvenient to you.@footnote{You could e.g. bind +@code{reftex-varioref-vref} to @kbd{C-c v} and +@code{reftex-fancyref-fref} to @kbd{C-c f}.} + +@cindex @code{varioref}, LaTeX package +@cindex LaTeX packages, @code{varioref} +@cindex @code{fancyref}, LaTeX package +@cindex LaTeX packages, @code{fancyref} +@vindex reftex-vref-is-default (deprecated) +@vindex reftex-fref-is-default (deprecated) +In former versions of @RefTeX{} only support for @code{varioref} and +@code{fancyref} was included. @code{varioref} is a @LaTeX{} package to +create cross-references with page information. @code{fancyref} is a +package where a macro call like @code{\fref@{@var{fig:map-of-germany}@}} +creates not only the number of the referenced counter but also the +complete text around it, like @samp{Figure 3 on the preceding page}. In +order to make it work you need to use label prefixes like @samp{fig:} +consistently -- something @RefTeX{} does automatically. For each of +these packages a variable could be configured to make its macros to take +precedence over @code{\ref}. Those were @code{reftex-vref-is-default} +and @code{reftex-fref-is-default} respectively. While still working, +these variables are deprecated now. Instead of setting them, the +variable @code{reftex-ref-style-default-list} should be adapted now. + +@node xr (LaTeX package), , Reference Styles, Labels and References @section @code{xr}: Cross-Document References @cindex @code{xr}, LaTeX package @cindex LaTeX packages, @code{xr} @@ -1589,7 +1760,7 @@ @cindex References to external documents @cindex Cross-document references -The LaTeX package @code{xr} makes it possible to create references to +The @LaTeX{} package @code{xr} makes it possible to create references to labels defined in external documents. The preamble of a document using @code{xr} will contain something like this: @@ -1604,66 +1775,26 @@ external documents by using the prefixes @samp{V1-} and @samp{V3-}, respectively. -@b{Ref@TeX{}} can be used to create such references as well. Start the +@RefTeX{} can be used to create such references as well. Start the referencing process normally, by pressing @kbd{C-c )}. Select a label type if necessary. When you see the label selection buffer, pressing @kbd{x} will switch to the label selection buffer of one of the external -documents. You may then select a label as before and @b{Ref@TeX{}} will +documents. You may then select a label as before and @RefTeX{} will insert it along with the required prefix. For this kind of inter-document cross-references, saving of parsing information and the use of multiple selection buffers can mean a large speed-up (@pxref{Optimizations}). -@node varioref (LaTeX package), fancyref (LaTeX package), xr (LaTeX package), Labels and References -@section @code{varioref}: Variable Page References -@cindex @code{varioref}, LaTeX package -@cindex @code{\vref} -@cindex LaTeX packages, @code{varioref} -@vindex reftex-vref-is-default -@code{varioref} is a frequently used LaTeX package to create -cross--references with page information. When you want to make a -reference with the @code{\vref} macro, just press the @kbd{v} key in the -selection buffer to toggle between @code{\ref} and @code{\vref} -(@pxref{Referencing Labels}). The mode line of the selection buffer -shows the current status of this switch. If you find that you almost -always use @code{\vref}, you may want to make it the default by -customizing the variable @code{reftex-vref-is-default}. If this -toggling seems too inconvenient, you can also use the command -@code{reftex-varioref-vref}@footnote{bind it to @kbd{C-c v}.}. -Or use AUCTeX to create your macros (@pxref{AUCTeX}). - -@node fancyref (LaTeX package), , varioref (LaTeX package), Labels and References -@section @code{fancyref}: Fancy Cross References -@cindex @code{fancyref}, LaTeX package -@cindex @code{\fref} -@cindex @code{\Fref} -@cindex LaTeX packages, @code{fancyref} -@vindex reftex-fref-is-default -@code{fancyref} is a LaTeX package where a macro call like -@code{\fref@{@var{fig:map-of-germany}@}} creates not only the number of -the referenced counter but also the complete text around it, like -@samp{Figure 3 on the preceding page}. In order to make it work you -need to use label prefixes like @samp{fig:} consistently - something -@b{Ref@TeX{}} does automatically. When you want to make a reference -with the @code{\fref} macro, just press the @kbd{V} key in the selection -buffer to cycle between @code{\ref}, @code{\fref} and @code{\Fref} -(@pxref{Referencing Labels}). The mode line of the selection buffer -shows the current status of this switch. If this cycling seems -inconvenient, you can also use the commands @code{reftex-fancyref-fref} -and @code{reftex-fancyref-Fref}@footnote{bind them to @kbd{C-c -f} and @kbd{C-c F}.}. Or use AUCTeX to create your macros -(@pxref{AUCTeX}). - @node Citations, Index Support, Labels and References, Top @chapter Citations @cindex Citations @cindex @code{\cite} -Citations in LaTeX are done with the @code{\cite} macro or variations of +Citations in @LaTeX{} are done with the @code{\cite} macro or variations of it. The argument of the macro is a citation key which identifies an -article or book in either a BibTeX database file or in an explicit -@code{thebibliography} environment in the document. @b{Ref@TeX{}}'s +article or book in either a @BibTeX{} database file or in an explicit +@code{thebibliography} environment in the document. @RefTeX{}'s support for citations helps to select the correct key quickly. @menu @@ -1684,7 +1815,7 @@ @cindex Selection buffer, citations @cindex Selection process -In order to create a citation, press @kbd{C-c [}. @b{Ref@TeX{}} then +In order to create a citation, press @kbd{C-c [}. @RefTeX{} then prompts for a regular expression which will be used to search through the database and present the list of matches to choose from in a selection process similar to that for selecting labels @@ -1695,8 +1826,8 @@ @samp{Einstein&&Bose} will match all articles which mention Bose-Einstein condensation, or which are co-authored by Bose and Einstein. When entering the regular expression, you can complete on -known citation keys. RefTeX also offers a default when prompting for a -regular expression. This default is the word before the cursor or the +known citation keys. @RefTeX{} also offers a default when prompting for +a regular expression. This default is the word before the cursor or the word before the current @samp{\cite} command. Sometimes this may be a good search key. @@ -1704,16 +1835,16 @@ @cindex @code{thebibliography}, LaTeX environment @cindex @code{BIBINPUTS}, environment variable @cindex @code{TEXBIB}, environment variable -@b{Ref@TeX{}} prefers to use BibTeX database files specified with a +@RefTeX{} prefers to use @BibTeX{} database files specified with a @code{\bibliography} macro to collect its information. Just like -BibTeX, it will search for the specified files in the current directory +@BibTeX{}, it will search for the specified files in the current directory and along the path given in the environment variable @code{BIBINPUTS}. -If you do not use BibTeX, but the document contains an explicit -@code{thebibliography} environment, @b{Ref@TeX{}} will collect its +If you do not use @BibTeX{}, but the document contains an explicit +@code{thebibliography} environment, @RefTeX{} will collect its information from there. Note that in this case the information presented in the selection buffer will just be a copy of relevant @code{\bibitem} entries, not the structured listing available with -BibTeX database files. +@BibTeX{} database files. @kindex ? In the selection buffer, the following keys provide special commands. A @@ -1743,7 +1874,7 @@ @item f Toggle follow mode. When follow mode is active, the other window will always display the full database entry of the current article. This is -equivalent to pressing @key{SPC} after each cursor motion. With BibTeX +equivalent to pressing @key{SPC} after each cursor motion. With @BibTeX{} entries, follow mode can be rather slow. @tablesubheading{Selecting entries and creating the citation} @@ -1774,12 +1905,12 @@ separate @code{\cite} macro for each of it. @item e -Create a new BibTeX database file which contains all @i{marked} entries +Create a new @BibTeX{} database file which contains all @i{marked} entries in the selection buffer. If no entries are marked, all entries are selected. @item E -Create a new BibTeX database file which contains all @i{unmarked} +Create a new @BibTeX{} database file which contains all @i{unmarked} entries in the selection buffer. If no entries are marked, all entries are selected. @@ -1814,6 +1945,17 @@ In order to define additional commands for this selection process, the keymap @code{reftex-select-bib-map} may be used. +Note that if you do not use Emacs to edit the @BibTeX{} database files, +@RefTeX{} will ask if the related buffers should be updated once it +detects that the files were changed externally. If you do not want to +be bothered by such queries, you can activate Auto Revert mode for these +buffers by adding the following expression to your init file: + +@lisp +(add-hook 'bibtex-mode-hook 'turn-on-auto-revert-mode) +@end lisp + + @node Citation Styles, Citation Info, Creating Citations, Citations @section Citation Styles @cindex Citation styles @@ -1821,20 +1963,22 @@ @cindex Citation styles, @code{harvard} @cindex Citation styles, @code{chicago} @cindex Citation styles, @code{jurabib} +@cindex Citation styles, @ConTeXt{} @cindex @code{natbib}, citation style @cindex @code{harvard}, citation style @cindex @code{chicago}, citation style @cindex @code{jurabib}, citation style +@cindex @ConTeXt{}, citation style @vindex reftex-cite-format -The standard LaTeX macro @code{\cite} works well with numeric or simple -key citations. To deal with the more complex task of author-year +The standard @LaTeX{} macro @code{\cite} works well with numeric or +simple key citations. To deal with the more complex task of author-year citations as used in many natural sciences, a variety of packages has been developed which define derived forms of the @code{\cite} macro. -@b{Ref@TeX{}} can be configured to produce these citation macros as well -by setting the variable @code{reftex-cite-format}. For the most -commonly used packages (@code{natbib}, @code{harvard}, @code{chicago}, -@code{jurabib}) this may be done from the menu, under +@RefTeX{} can be configured to produce these citation macros as well by +setting the variable @code{reftex-cite-format}. For the most commonly +used @LaTeX{} packages (@code{natbib}, @code{harvard}, @code{chicago}, +@code{jurabib}) and for @ConTeXt{} this may be done from the menu, under @code{Ref->Citation Styles}. Since there are usually several macros to create the citations, executing @code{reftex-citation} (@kbd{C-c [}) starts by prompting for the correct macro. For the Natbib style, this @@ -1856,7 +2000,7 @@ @end example @vindex reftex-cite-prompt-optional-args -If cite formats contain empty paris of square brackets, RefTeX can +If citation formats contain empty pairs of square brackets, @RefTeX{} will prompt for values of these optional arguments if you call the @code{reftex-citation} command with a @kbd{C-u} prefix. Following the most generic of these packages, @code{natbib}, the builtin @@ -1872,12 +2016,12 @@ (setq reftex-cite-format 'natbib) @end lisp -You can also use AUCTeX style files to automatically set the +You can also use @AUCTeX{} style files to automatically set the citation style based on the @code{usepackage} commands in a given document. @xref{Style Files}, for information on how to set up the style files correctly. -@node Citation Info, Chapterbib and Bibunits, Citation Styles, Citations, Top +@node Citation Info, Chapterbib and Bibunits, Citation Styles, Citations @section Citation Info @cindex Displaying citations @cindex Citations, displaying @@ -1893,9 +2037,9 @@ information about the article cited there. Note that the information is only displayed if the echo area is not occupied by a different message. -@b{Ref@TeX{}} can also display the @code{\bibitem} or BibTeX database +@RefTeX{} can also display the @code{\bibitem} or @BibTeX{} database entry corresponding to a @code{\cite} macro, or all citation locations -corresponding to a @code{\bibitem} or BibTeX database entry. +corresponding to a @code{\bibitem} or @BibTeX{} database entry. @xref{Viewing Cross-References}. @node Chapterbib and Bibunits, Citations Outside LaTeX, Citation Info, Citations @@ -1904,24 +2048,24 @@ @cindex @code{bibunits}, LaTeX package @cindex Bibliographies, multiple -@code{chapterbib} and @code{bibunits} are two LaTeX packages which +@code{chapterbib} and @code{bibunits} are two @LaTeX{} packages which produce multiple bibliographies in a document. This is no problem for -@b{Ref@TeX{}} as long as all bibliographies use the same BibTeX database +@RefTeX{} as long as all bibliographies use the same @BibTeX{} database files. If they do not, it is best to have each document part in a separate file (as it is required for @code{chapterbib} anyway). Then -@b{Ref@TeX{}} will still scan the locally relevant databases correctly. If +@RefTeX{} will still scan the locally relevant databases correctly. If you have multiple bibliographies within a @emph{single file}, this may or may not be the case. @node Citations Outside LaTeX, BibTeX Database Subsets, Chapterbib and Bibunits, Citations -@section Citations outside LaTeX +@section Citations outside @LaTeX{} @cindex Citations outside LaTeX @vindex reftex-default-bibliography -The command @code{reftex-citation} can also be executed outside a LaTeX +The command @code{reftex-citation} can also be executed outside a @LaTeX{} buffer. This can be useful to reference articles in the mail buffer and other documents. You should @emph{not} enter @code{reftex-mode} for -this, just execute the command. The list of BibTeX files will in this +this, just execute the command. The list of @BibTeX{} files will in this case be taken from the variable @code{reftex-default-bibliography}. Setting the variable @code{reftex-cite-format} to the symbol @code{locally} does a decent job of putting all relevant information @@ -1943,24 +2087,24 @@ @cindex BibTeX database subsets @findex reftex-create-bibtex-file -@b{Ref@TeX{}} offers two ways to create a new BibTeX database file. +@RefTeX{} offers two ways to create a new @BibTeX{} database file. The first option produces a file which contains only the entries actually referenced in the current document. This can be useful if -the database in only meant for a single document and you want to clean +the database is only meant for a single document and you want to clean it of old and unused ballast. It can also be useful while writing a document together with collaborators, in order to avoid sending around the entire (possibly very large) database. To create the file, use @kbd{M-x reftex-create-bibtex-file}, also available from the menu under @code{Ref->Global Actions->Create Bibtex File}. The command will -prompt for a BibTeX file name and write the extracted entries to that +prompt for a @BibTeX{} file name and write the extracted entries to that file. The second option makes use of the selection process started by the command @kbd{C-c [} (@pxref{Creating Citations}). This command uses a regular expression to select entries, and lists them in a formatted selection buffer. After pressing the @kbd{e} key (mnemonics: Export), -the command will prompt for the name of a new BibTeX file and write +the command will prompt for the name of a new @BibTeX{} file and write the selected entries to that file. You can also first mark some entries in the selection buffer with the @kbd{m} key and then export either the @i{marked} entries (with the @kbd{e} key) or the @@ -1971,15 +2115,15 @@ @cindex Index Support @cindex @code{\index} -LaTeX has builtin support for creating an Index. The LaTeX core +@LaTeX{} has builtin support for creating an Index. The @LaTeX{} core supports two different indices, the standard index and a glossary. With -the help of special LaTeX packages (@file{multind.sty} or +the help of special @LaTeX{} packages (@file{multind.sty} or @file{index.sty}), any number of indices can be supported. Index entries are created with the @code{\index@{@var{entry}@}} macro. All entries defined in a document are written out to the @file{.aux} file. A separate tool must be used to convert this information into a -nicely formatted index. Tools used with LaTeX include @code{MakeIndex} +nicely formatted index. Tools used with @LaTeX{} include @code{MakeIndex} and @code{xindy}. Indexing is a very difficult task. It must follow strict conventions to @@ -1996,27 +2140,27 @@ very well be developed along with the document. Often it is worthwhile to define special purpose macros which define an item and at the same time make an index entry, possibly with special formatting to make the -reference page in the index bold or underlined. To make @b{Ref@TeX{}} +reference page in the index bold or underlined. To make @RefTeX{} support for indexing possible, these special macros must be added to -@b{Ref@TeX{}}'s configuration (@pxref{Defining Index Macros}). +@RefTeX{}'s configuration (@pxref{Defining Index Macros}). @item The rest of the index is often just a collection of where in the document certain words or phrases are being used. This part is difficult to develop along with the document, because consistent entries for each occurrence are needed and are best selected when the document -is ready. @b{Ref@TeX{}} supports this with an @emph{index phrases file} +is ready. @RefTeX{} supports this with an @emph{index phrases file} which collects phrases and helps indexing the phrases globally. @end enumerate -Before you start, you need to make sure that @b{Ref@TeX{}} knows about -the index style being used in the current document. @b{Ref@TeX{}} has +Before you start, you need to make sure that @RefTeX{} knows about +the index style being used in the current document. @RefTeX{} has builtin support for the default @code{\index} and @code{\glossary} -macros. Other LaTeX packages, like the @file{multind} or @file{index} +macros. Other @LaTeX{} packages, like the @file{multind} or @file{index} package, redefine the @code{\index} macro to have an additional -argument, and @b{Ref@TeX{}} needs to be configured for those. A -sufficiently new version of AUCTeX (9.10c or later) will do this -automatically. If you really don't use AUCTeX (you should!), this +argument, and @RefTeX{} needs to be configured for those. A +sufficiently new version of @AUCTeX{} (9.10c or later) will do this +automatically. If you really don't use @AUCTeX{} (you should!), this configuration needs to be done by hand with the menu (@code{Ref->Index Style}), or globally for all your documents with @@ -2057,7 +2201,7 @@ just call @code{reftex-index}, described below. In order to create a general index entry, press @kbd{C-c <} -(@code{reftex-index}). @b{Ref@TeX{}} will prompt for one of the +(@code{reftex-index}). @RefTeX{} will prompt for one of the available index macros and for its arguments. Completion will be available for the index entry and, if applicable, the index tag. The index tag is a string identifying one of multiple indices. With the @@ -2072,7 +2216,7 @@ @findex reftex-index-visit-phrases-buffer @cindex Macro definition lines, in phrase buffer -@b{Ref@TeX{}} maintains a file in which phrases can be collected for +@RefTeX{} maintains a file in which phrases can be collected for later indexing. The file is located in the same directory as the master file of the document and has the extension @file{.rip} (@b{R}eftex @b{I}ndex @b{P}hrases). You can create or visit the file with @kbd{C-c @@ -2080,7 +2224,7 @@ is initialized by inserting a file header which contains the definition of the available index macros. This list is initialized from @code{reftex-index-macros} (@pxref{Defining Index Macros}). You can -edit the header as needed, but if you define new LaTeX indexing macros, +edit the header as needed, but if you define new @LaTeX{} indexing macros, don't forget to add them to @code{reftex-index-macros} as well. Here is a phrase file header example: @@ -2122,7 +2266,7 @@ command @kbd{C-c \} (@code{reftex-index-phrase-selection-or-word}) copies the current selection (if active) or the word near point into the phrases buffer. It then selects this buffer, so that the phrase line -can be edited. To return to the LaTeX document, press @kbd{C-c C-c} +can be edited. To return to the @LaTeX{} document, press @kbd{C-c C-c} (@code{reftex-index-phrases-save-and-return}). You can also prepare the list of index phrases in a different way and @@ -2131,7 +2275,7 @@ indexed. The phrase lines in the phrase buffer must have a specific format. -@b{Ref@TeX{}} will use font-lock to indicate if a line has the proper +@RefTeX{} will use font-lock to indicate if a line has the proper format. A phrase line looks like this: @example @@ -2226,7 +2370,7 @@ probably good to do indexing in small chunks since your concentration may not last long enough to do everything in one go. -@b{Ref@TeX{}} will start at the first phrase line and search the phrase +@RefTeX{} will start at the first phrase line and search the phrase globally in the whole document. At each match it will stop, compute the replacement string and offer you the following choices@footnote{Windows users: Restrict yourself to the described keys during indexing. Pressing @@ -2275,9 +2419,9 @@ do not like. @item Wrap Long Lines Inserting index macros increases the line length. Turn this option on -to allow @b{Ref@TeX{}} to wrap long lines. +to allow @RefTeX{} to wrap long lines. @item Skip Indexed Matches -When this is on, @b{Ref@TeX{}} will at each match try to figure out if +When this is on, @RefTeX{} will at each match try to figure out if this match is already indexed. A match is considered indexed if it is either the argument of an index macro, or if an index macro is directly (without whitespace separation) before or after the match. Index macros @@ -2289,7 +2433,7 @@ are bound to make changes afterwards. Indexing then has to be applied to the changed regions. The command @code{reftex-index-phrases-apply-to-region} is designed for this -purpose. When called from a LaTeX document with active region, it will +purpose. When called from a @LaTeX{} document with active region, it will apply @code{reftex-index-all-phrases} to the current region. @node Displaying and Editing the Index, Builtin Index Macros, The Index Phrases File, Index Support @@ -2303,7 +2447,7 @@ @findex reftex-display-index In order to compile and display the index, press @kbd{C-c >}. If the -document uses multiple indices, @b{Ref@TeX{}} will ask you to select +document uses multiple indices, @RefTeX{} will ask you to select one. Then, all index entries will be sorted alphabetically and displayed in a special buffer, the @file{*Index*} buffer. From that buffer you can check and edit each entry. @@ -2317,7 +2461,7 @@ restriction can be moved from one section to the next by pressing the @kbd{<} and @kbd{>} keys. -One caveat: @b{Ref@TeX{}} finds the definition point of an index entry +One caveat: @RefTeX{} finds the definition point of an index entry by searching near the buffer position where it had found to macro during scanning. If you have several identical index entries in the same buffer and significant changes have shifted the entries around, you must @@ -2371,7 +2515,7 @@ buffer at point. This is similar to pressing @key{SPC} after each cursor motion. The default for this flag can be set with the variable @code{reftex-index-follow-mode}. Note that only context in files -already visited is shown. @b{Ref@TeX{}} will not visit a file just for +already visited is shown. @RefTeX{} will not visit a file just for follow mode. See, however, the variable @code{reftex-revisit-to-follow}. @@ -2459,12 +2603,12 @@ @item r @vindex reftex-enable-partial-scans -Reparse the LaTeX document and rebuild the @file{*Index*} buffer. When +Reparse the @LaTeX{} document and rebuild the @file{*Index*} buffer. When @code{reftex-enable-partial-scans} is non-@code{nil}, rescan only the file this location is defined in, not the entire document. @item C-u r -Reparse the @emph{entire} LaTeX document and rebuild the @file{*Index*} +Reparse the @emph{entire} @LaTeX{} document and rebuild the @file{*Index*} buffer. @item s @@ -2483,8 +2627,8 @@ @cindex LaTeX packages, @code{multind} @cindex LaTeX packages, @code{index} -@b{Ref@TeX{}} by default recognizes the @code{\index} and -@code{\glossary} macros which are defined in the LaTeX core. It has +@RefTeX{} by default recognizes the @code{\index} and +@code{\glossary} macros which are defined in the @LaTeX{} core. It has also builtin support for the re-implementations of @code{\index} in the @file{multind} and @file{index} packages. However, since the different definitions of the @code{\index} macro are incompatible, @@ -2513,7 +2657,7 @@ @samp{name}@footnote{We are using the syntax of the @file{index} package here.}. The last macro also places its argument into the index, but as subitems under the main index entry @samp{Astronomical Objects}. Here -is how to make @b{Ref@TeX{}} recognize and correctly interpret these +is how to make @RefTeX{} recognize and correctly interpret these macros, first with Emacs Lisp. @lisp @@ -2528,7 +2672,7 @@ for the default index and for the glossary. The character arguments @code{?x}, @code{?n}, and @code{?o} are for -quick identification of these macros when @b{Ref@TeX{}} inserts new +quick identification of these macros when @RefTeX{} inserts new index entries with @code{reftex-index}. These codes need to be unique. @code{?i}, @code{?I}, and @code{?g} are reserved for the @code{\index}, @code{\index*}, and @code{\glossary} macros, @@ -2589,22 +2733,22 @@ The index tag is "idx". @node Viewing Cross-References, RefTeXs Menu, Index Support, Top -@chapter Viewing Cross--References +@chapter Viewing Cross-References @findex reftex-view-crossref @findex reftex-mouse-view-crossref @kindex C-c & @kindex S-mouse-2 -@b{Ref@TeX{}} can display cross--referencing information. This means, -if two document locations are linked, @b{Ref@TeX{}} can display the +@RefTeX{} can display cross-referencing information. This means, +if two document locations are linked, @RefTeX{} can display the matching location(s) in another window. The @code{\label} and @code{\ref} macros are one way of establishing such a link. Also, a @code{\cite} -macro is linked to the corresponding @code{\bibitem} macro or a BibTeX +macro is linked to the corresponding @code{\bibitem} macro or a @BibTeX{} database entry. The feature is invoked by pressing @kbd{C-c &} (@code{reftex-view-crossref}) while point is on the @var{key} argument -of a macro involved in cross--referencing. You can also click with +of a macro involved in cross-referencing. You can also click with @kbd{S-mouse-2} on the macro argument. Here is what will happen for individual classes of macros: @@ -2615,7 +2759,7 @@ Display the corresponding label definition. All usual variants@footnote{all macros that start with @samp{ref} or end with @samp{ref} or @samp{refrange}} of the @code{\ref} macro are active for -cross--reference display. This works also for labels defined in an +cross-reference display. This works also for labels defined in an external document when the current document refers to them through the @code{xr} interface (@pxref{xr (LaTeX package)}). @@ -2626,13 +2770,13 @@ @kbd{C-c &} several times moves through the entire document and finds all locations. Not only the @code{\label} macro but also other macros with label arguments (as configured with @code{reftex-label-alist}) are -active for cross--reference display. +active for cross-reference display. @item @code{\cite} @cindex @code{\cite} -Display the corresponding BibTeX database entry or @code{\bibitem}. +Display the corresponding @BibTeX{} database entry or @code{\bibitem}. All usual variants@footnote{all macros that either start or end with -@samp{cite}} of the @code{\cite} macro are active for cross--reference +@samp{cite}} of the @code{\cite} macro are active for cross-reference display. @item @code{\bibitem} @@ -2641,12 +2785,12 @@ @kbd{C-c &} several times moves through the entire document and finds all locations. -@item BibTeX +@item @BibTeX{} @cindex BibTeX buffer, viewing cite locations from @cindex Viewing cite locations from BibTeX buffer -@kbd{C-c &} is also active in BibTeX buffers. All locations in a +@kbd{C-c &} is also active in @BibTeX{} buffers. All locations in a document where the database entry at point is cited will be displayed. -On first use, @b{Ref@TeX{}} will prompt for a buffer which belongs to +On first use, @RefTeX{} will prompt for a buffer which belongs to the document you want to search. Subsequent calls will use the same document, until you break this link with a prefix argument to @kbd{C-c &}. @@ -2661,7 +2805,7 @@ @vindex reftex-view-crossref-extra While the display of cross referencing information for the above -mentioned macros is hard--coded, you can configure additional relations +mentioned macros is hard-coded, you can configure additional relations in the variable @code{reftex-view-crossref-extra}. @iftex @@ -2669,14 +2813,14 @@ @end iftex @node RefTeXs Menu, Key Bindings, Viewing Cross-References, Top -@section @b{Ref@TeX{}}'s Menu +@section @RefTeX{}'s Menu @cindex RefTeXs Menu @cindex Menu, in the menu bar -@b{Ref@TeX{}} installs a @code{Ref} menu in the menu bar on systems +@RefTeX{} installs a @code{Ref} menu in the menu bar on systems which support this. From this menu you can access all of -@b{Ref@TeX{}}'s commands and a few of its options. There is also a -@code{Customize} submenu which can be used to access @b{Ref@TeX{}}'s +@RefTeX{}'s commands and a few of its options. There is also a +@code{Customize} submenu which can be used to access @RefTeX{}'s entire set of options. @node Key Bindings, Faces, RefTeXs Menu, Top @@ -2713,7 +2857,7 @@ @end example Note that the @kbd{S-mouse-2} binding is only provided if this key is -not already used by some other package. @b{Ref@TeX{}} will not override an +not already used by some other package. @RefTeX{} will not override an existing binding to @kbd{S-mouse-2}. Personally, I also bind some functions in the users @kbd{C-c} map for @@ -2749,7 +2893,7 @@ @end lisp @vindex reftex-load-hook -Changing and adding to @b{Ref@TeX{}}'s key bindings is best done in the hook +Changing and adding to @RefTeX{}'s key bindings is best done in the hook @code{reftex-load-hook}. For information on the keymaps which should be used to add keys, see @ref{Keymaps and Hooks}. @@ -2757,9 +2901,9 @@ @section Faces @cindex Faces -@b{Ref@TeX{}} uses faces when available to structure the selection and +@RefTeX{} uses faces when available to structure the selection and table of contents buffers. It does not create its own faces, but uses -the ones defined in @file{font-lock.el}. Therefore, @b{Ref@TeX{}} will +the ones defined in @file{font-lock.el}. Therefore, @RefTeX{} will use faces only when @code{font-lock} is loaded. This seems to be reasonable because people who like faces will very likely have it loaded. If you wish to turn off fontification or change the involved @@ -2775,9 +2919,9 @@ @itemize @bullet @item -@b{Ref@TeX{}} has full support for multifile documents. You can edit parts of +@RefTeX{} has full support for multifile documents. You can edit parts of several (multifile) documents at the same time without conflicts. -@b{Ref@TeX{}} provides functions to run @code{grep}, @code{search} and +@RefTeX{} provides functions to run @code{grep}, @code{search} and @code{query-replace} on all files which are part of a multifile document. @@ -2785,10 +2929,10 @@ @vindex tex-main-file @vindex TeX-master All files belonging to a multifile document should define a File -Variable (@code{TeX-master} for AUCTeX or @code{tex-main-file} for the -standard Emacs LaTeX mode) containing the name of the master file. For +Variable (@code{TeX-master} for @AUCTeX{} or @code{tex-main-file} for the +standard Emacs @LaTeX{} mode) containing the name of the master file. For example, to set the file variable @code{TeX-master}, include something -like the following at the end of each TeX file: +like the following at the end of each @TeX{} file: @example %%% Local Variables: *** @@ -2797,7 +2941,7 @@ %%% End: *** @end example -AUCTeX with the setting +@AUCTeX{} with the setting @lisp (setq-default TeX-master nil) @@ -2805,14 +2949,14 @@ will actually ask you for each new file about the master file and insert this comment automatically. For more details see the documentation of -the AUCTeX (@pxref{Multifile,,,auctex, The AUC TeX User Manual}), the +the @AUCTeX{} (@pxref{Multifile,,,auctex, The AUCTeX User Manual}), the documentation about the Emacs (La)TeX mode (@pxref{TeX Print,,,emacs, The GNU Emacs Manual}) and the Emacs documentation on File Variables (@pxref{File Variables,,,emacs, The GNU Emacs Manual}). @item The context of a label definition must be found in the same file as the -label itself in order to be processed correctly by @b{Ref@TeX{}}. The only +label itself in order to be processed correctly by @RefTeX{}. The only exception is that section labels referring to a section statement outside the current file can still use that section title as context. @@ -2822,7 +2966,7 @@ @section Language Support @cindex Language support -Some parts of @b{Ref@TeX{}} are language dependent. The default +Some parts of @RefTeX{} are language dependent. The default settings work well for English. If you are writing in a different language, the following hints may be useful: @@ -2838,7 +2982,7 @@ @item @vindex reftex-translate-to-ascii-function @vindex reftex-label-illegal-re -Also, when a label is derived from context, @b{Ref@TeX{}} clears the +Also, when a label is derived from context, @RefTeX{} clears the context string from non-ASCII characters in order to make a valid label. If there should ever be a version of @TeX{} which allows extended characters @emph{in labels}, then we will have to look at the @@ -2846,7 +2990,7 @@ @code{reftex-label-illegal-re}. @item -When a label is referenced, @b{Ref@TeX{}} looks at the word before point +When a label is referenced, @RefTeX{} looks at the word before point to guess which label type is required. These @emph{magic words} are different in every language. For an example of how to add magic words, see @ref{Adding Magic Words}. @@ -2854,7 +2998,7 @@ @vindex reftex-multiref-punctuation @vindex reftex-cite-punctuation @item -@b{Ref@TeX{}} inserts ``punctuation'' for multiple references and +@RefTeX{} inserts ``punctuation'' for multiple references and for the author list in citations. Some of this may be language dependent. See the variables @code{reftex-multiref-punctuation} and @code{reftex-cite-punctuation}. @@ -2865,25 +3009,25 @@ @cindex Finding files In order to find files included in a document via @code{\input} or -@code{\include}, @b{Ref@TeX{}} searches all directories specified in the +@code{\include}, @RefTeX{} searches all directories specified in the environment variable @code{TEXINPUTS}. Similarly, it will search the path specified in the variables @code{BIBINPUTS} and @code{TEXBIB} for -BibTeX database files. +@BibTeX{} database files. -When searching, @b{Ref@TeX{}} will also expand recursive path +When searching, @RefTeX{} will also expand recursive path definitions (directories ending in @samp{//} or @samp{!!}). But it will only search and expand directories @emph{explicitly} given in these variables. This may cause problems under the following circumstances: @itemize @bullet @item -Most TeX system have a default search path for both TeX files and BibTeX +Most @TeX{} system have a default search path for both @TeX{} files and @BibTeX{} files which is defined in some setup file. Usually this default path is -for system files which @b{Ref@TeX{}} does not need to see. But if your -document needs TeX files or BibTeX database files in a directory only -given in the default search path, @b{Ref@TeX{}} will fail to find them. +for system files which @RefTeX{} does not need to see. But if your +document needs @TeX{} files or @BibTeX{} database files in a directory only +given in the default search path, @RefTeX{} will fail to find them. @item -Some TeX systems do not use environment variables at all in order to +Some @TeX{} systems do not use environment variables at all in order to specify the search path. Both default and user search path are then defined in setup files. @end itemize @@ -2896,7 +3040,7 @@ Specify all relevant directories explicitly in the environment variables. If for some reason you don't want to mess with the default variables @code{TEXINPUTS} and @code{BIBINPUTS}, define your own -variables and configure @b{Ref@TeX{}} to use them instead: +variables and configure @RefTeX{} to use them instead: @lisp (setq reftex-texpath-environment-variables '("MYTEXINPUTS")) @@ -2904,7 +3048,7 @@ @end lisp @item -Specify the full search path directly in @b{Ref@TeX{}}'s variables. +Specify the full search path directly in @RefTeX{}'s variables. @lisp (setq reftex-texpath-environment-variables @@ -2914,10 +3058,10 @@ @end lisp @item -Some TeX systems provide stand--alone programs to do the file search just -like TeX and BibTeX. E.g. Thomas Esser's @code{teTeX} uses the +Some @TeX{} systems provide stand-alone programs to do the file search just +like @TeX{} and @BibTeX{}. E.g. Thomas Esser's @code{teTeX} uses the @code{kpathsearch} library which provides the command @code{kpsewhich} -to search for files. @b{Ref@TeX{}} can be configured to use this +to search for files. @RefTeX{} can be configured to use this program. Note that the exact syntax of the @code{kpsewhich} command depends upon the version of that program. @@ -2935,8 +3079,8 @@ Some people like to use RefTeX with noweb files, which usually have the extension @file{.nw}. In order to deal with such files, the new extension must be added to the list of valid extensions in the variable -@code{reftex-file-extensions}. When working with AUCTeX as major mode, -the new extension must also be known to AUCTeX via the variable +@code{reftex-file-extensions}. When working with @AUCTeX{} as major mode, +the new extension must also be known to @AUCTeX{} via the variable @code{TeX-file-extension}. For example: @lisp @@ -2956,15 +3100,15 @@ books, where some of it still might be useful.} Implementing the principle of least surprises, the default settings of -@b{Ref@TeX{}} ensure a safe ride for beginners and casual users. However, -when using @b{Ref@TeX{}} for a large project and/or on a small computer, +@RefTeX{} ensure a safe ride for beginners and casual users. However, +when using @RefTeX{} for a large project and/or on a small computer, there are ways to improve speed or memory usage. @itemize @bullet @item @b{Removing Lookup Buffers}@* @cindex Removing lookup buffers -@b{Ref@TeX{}} will load other parts of a multifile document as well as BibTeX +@RefTeX{} will load other parts of a multifile document as well as @BibTeX{} database files for lookup purposes. These buffers are kept, so that subsequent use of the same files is fast. If you can't afford keeping these buffers around, and if you can live with a speed penalty, try @@ -2978,13 +3122,13 @@ @b{Partial Document Scans}@* @cindex Partial documents scans @cindex Document scanning, partial -A @kbd{C-u} prefix on the major @b{Ref@TeX{}} commands @code{reftex-label} +A @kbd{C-u} prefix on the major @RefTeX{} commands @code{reftex-label} (@kbd{C-u C-c (}), @code{reftex-reference} (@kbd{C-u C-c )}), @code{reftex-citation} (@kbd{C-u C-c [}), @code{reftex-toc} (@kbd{C-u C-c =}), and @code{reftex-view-crossref} (@kbd{C-u C-c &}) initiates re-parsing of the entire document in order to update the parsing information. For a large document this can be unnecessary, in -particular if only one file has changed. @b{Ref@TeX{}} can be configured +particular if only one file has changed. @RefTeX{} can be configured to do partial scans instead of full ones. @kbd{C-u} re-parsing then does apply only to the current buffer and files included from it. Likewise, the @kbd{r} key in both the label selection buffer and the @@ -3004,7 +3148,7 @@ @cindex Saving parser information @cindex Parse information, saving to a file @vindex reftex-parse-file-extension -Even with partial scans enabled, @b{Ref@TeX{}} still has to make one full +Even with partial scans enabled, @RefTeX{} still has to make one full scan, when you start working with a document. To avoid this, parsing information can be stored in a file. The file @file{MASTER.rel} is used for storing information about a document with master file @@ -3022,11 +3166,11 @@ @b{Identifying label types by prefix}@* @cindex Parse information, saving to a file @vindex reftex-trust-label-prefix -@b{Ref@TeX{}} normally parses around each label to check in which +@RefTeX{} normally parses around each label to check in which environment this label is located, in order to assign a label type to the label. If your document contains thousands of labels, document parsing will take considerable time. If you have been using label prefixes -like tab: and fn: consistently, you can tell @b{Ref@TeX{}} to get the +like tab: and fn: consistently, you can tell @RefTeX{} to get the label type directly from the prefix, without additional parsing. This will be faster and also allow labels to end up in the correct category if for some reason it is not possible to derive the correct type from @@ -3041,7 +3185,7 @@ @b{Automatic Document Scans}@* @cindex Automatic document scans @cindex Document scanning, automatic -At rare occasions, @b{Ref@TeX{}} will automatically rescan a part of the +At rare occasions, @RefTeX{} will automatically rescan a part of the document. If this gets into your way, it can be turned off with @vindex reftex-allow-automatic-rescan @@ -3049,7 +3193,7 @@ (setq reftex-allow-automatic-rescan nil) @end lisp -@b{Ref@TeX{}} will then occasionally annotate new labels in the selection +@RefTeX{} will then occasionally annotate new labels in the selection buffer, saying that their position in the label list in uncertain. A manual document scan will fix this. @@ -3059,7 +3203,7 @@ @cindex Selection buffers, multiple Normally, the selection buffer @file{*RefTeX Select*} is re-created for every selection process. In documents with very many labels this can -take several seconds. @b{Ref@TeX{}} provides an option to create a +take several seconds. @RefTeX{} provides an option to create a separate selection buffer for each label type and to keep this buffer from one selection to the next. These buffers are updated automatically only when a new label has been added in the buffers category with @@ -3089,7 +3233,7 @@ @need 2000 @noindent @b{As a summary}, here are the settings I recommend for heavy use of -@b{Ref@TeX{}} with large documents: +@RefTeX{} with large documents: @lisp @group @@ -3100,30 +3244,30 @@ @end lisp @node AUCTeX, Multifile Documents, Faces, Top -@section AUC@TeX{} +@section @AUCTeX{} @cindex @code{AUCTeX}, Emacs package @cindex Emacs packages, @code{AUCTeX} -AUCTeX is without doubt the best major mode for editing TeX and LaTeX +@AUCTeX{} is without doubt the best major mode for editing @TeX{} and @LaTeX{} files with Emacs (@pxref{Top,AUCTeX,,auctex, The AUCTeX User Manual}). -If AUCTeX is not part of your Emacs distribution, you can get +If @AUCTeX{} is not part of your Emacs distribution, you can get it@footnote{XEmacs 21.x users may want to install the corresponding -XEmacs package.} by ftp from the @value{AUCTEXSITE}. +XEmacs package.} by FTP from the @value{AUCTEXSITE}. @menu * AUCTeX-RefTeX Interface:: How both packages work together -* Style Files:: AUCTeX's style files can support RefTeX +* Style Files:: @AUCTeX{}'s style files can support RefTeX * Bib-Cite:: Hypertext reading of a document @end menu @node AUCTeX-RefTeX Interface, Style Files, , AUCTeX -@subsection The AUC@TeX{}-@b{Ref@TeX{}} Interface +@subsection The @AUCTeX{}-@RefTeX{} Interface -@b{Ref@TeX{}} contains code to interface with AUCTeX. When this +@RefTeX{} contains code to interface with @AUCTeX{}. When this interface is turned on, both packages will interact closely. Instead of -using @b{Ref@TeX{}}'s commands directly, you can then also use them -indirectly as part of the AUCTeX -environment@footnote{@b{Ref@TeX{}} 4.0 and AUCTeX 9.10c will be +using @RefTeX{}'s commands directly, you can then also use them +indirectly as part of the @AUCTeX{} +environment@footnote{@RefTeX{} 4.0 and @AUCTeX{} 9.10c will be needed for all of this to work. Parts of it work also with earlier versions.}. The interface is turned on with @@ -3146,12 +3290,12 @@ @kindex C-c C-s @findex LaTeX-section, @r{AUCTeX} @findex TeX-insert-macro, @r{AUCTeX} -@b{AUCTeX calls @code{reftex-label} to insert labels}@* +@b{@AUCTeX{} calls @code{reftex-label} to insert labels}@* When a new section is created with @kbd{C-c C-s}, or a new environment -is inserted with @kbd{C-c C-e}, AUCTeX normally prompts for a label to +is inserted with @kbd{C-c C-e}, @AUCTeX{} normally prompts for a label to go with it. With the interface, @code{reftex-label} is called instead. -For example, if you type @kbd{C-c C-e equation @key{RET}}, AUCTeX and -@b{Ref@TeX{}} will insert +For example, if you type @kbd{C-c C-e equation @key{RET}}, @AUCTeX{} and +@RefTeX{} will insert @example \begin@{equation@} @@ -3163,12 +3307,12 @@ @noindent without further prompts. -Similarly, when you type @kbd{C-c C-s section @key{RET}}, @b{Ref@TeX{}} +Similarly, when you type @kbd{C-c C-s section @key{RET}}, @RefTeX{} will offer its default label which is derived from the section title. @item -@b{AUCTeX tells @b{Ref@TeX{}} about new sections}@* -When creating a new section with @kbd{C-c C-s}, @b{Ref@TeX{}} will not +@b{@AUCTeX{} tells @RefTeX{} about new sections}@* +When creating a new section with @kbd{C-c C-s}, @RefTeX{} will not have to rescan the buffer in order to see it. @item @@ -3182,44 +3326,44 @@ @findex TeX-arg-index, @r{AUCTeX function} @findex TeX-insert-macro, @r{AUCTeX function} @kindex C-c @key{RET} -@b{@b{Ref@TeX{}} supplies macro arguments}@* When you insert a macro -interactively with @kbd{C-c @key{RET}}, AUCTeX normally prompts for +@b{@RefTeX{} supplies macro arguments}@* When you insert a macro +interactively with @kbd{C-c @key{RET}}, @AUCTeX{} normally prompts for macro arguments. Internally, it uses the functions @code{TeX-arg-label}, @code{TeX-arg-cite}, and @code{TeX-arg-index} to prompt for arguments which are labels, citation keys and index entries. The interface takes over these functions@footnote{@code{fset} is used to -do this, which is not reversible. However, @b{Ref@TeX{}} implements the +do this, which is not reversible. However, @RefTeX{} implements the old functionality when you later decide to turn off the interface.} and -supplies the macro arguments with @b{Ref@TeX{}'s} mechanisms. For -example, when you type @kbd{C-c @key{RET} ref @key{RET}}, @b{Ref@TeX{}} +supplies the macro arguments with @b{@RefTeX{}'s} mechanisms. For +example, when you type @kbd{C-c @key{RET} ref @key{RET}}, @RefTeX{} will supply its label selection process (@pxref{Referencing Labels}). @item -@b{@b{Ref@TeX{}} tells AUCTeX about new labels, citation-- and index keys}@* -@b{Ref@TeX{}} will add all newly created labels to AUCTeX's completion list. +@b{@RefTeX{} tells @AUCTeX{} about new labels, citation and index keys}@* +@RefTeX{} will add all newly created labels to @AUCTeX{}'s completion list. @end itemize @node Style Files, Bib-Cite, AUCTeX-RefTeX Interface, AUCTeX @subsection Style Files @cindex Style files, AUCTeX @findex TeX-add-style-hook, @r{AUCTeX} -Style files are Emacs Lisp files which are evaluated by AUCTeX in +Style files are Emacs Lisp files which are evaluated by @AUCTeX{} in association with the @code{\documentclass} and @code{\usepackage} commands of a document (@pxref{Style Files,,,auctex}). Support for -@b{Ref@TeX{}} in such a style file is useful when the LaTeX style +@RefTeX{} in such a style file is useful when the @LaTeX{} style defines macros or environments connected with labels, citations, or the index. Many style files (e.g. @file{amsmath.el} or @file{natbib.el}) -distributed with AUCTeX already support @b{Ref@TeX{}} in this +distributed with @AUCTeX{} already support @RefTeX{} in this way. -Before calling a @b{Ref@TeX{}} function, the style hook should always +Before calling a @RefTeX{} function, the style hook should always test for the availability of the function, so that the style file will -also work for people who do not use @b{Ref@TeX{}}. +also work for people who do not use @RefTeX{}. Additions made with style files in the way described below remain local to the current document. For example, if one package uses AMSTeX, the -style file will make @b{Ref@TeX{}} switch over to @code{\eqref}, but +style file will make @RefTeX{} switch over to @code{\eqref}, but this will not affect other documents. @findex reftex-add-label-environments @@ -3230,7 +3374,7 @@ alias for compatibility.} which defines additions to @code{reftex-label-alist}. The argument taken by this function must have the same format as @code{reftex-label-alist}. The @file{amsmath.el} -style file of AUCTeX for example contains the following: +style file of @AUCTeX{} for example contains the following: @lisp @group @@ -3262,7 +3406,7 @@ Similarly, a style hook may contain a call to @code{reftex-set-cite-format} to set the citation format. The style file @file{natbib.el} for the Natbib citation style does switch -@b{Ref@TeX{}}'s citation format like this: +@RefTeX{}'s citation format like this: @lisp (TeX-add-style-hook "natbib" @@ -3286,7 +3430,7 @@ @end lisp If you have your own package @file{myindex} which defines the -following macros to be used with the LaTeX @file{index.sty} file +following macros to be used with the @LaTeX{} @file{index.sty} file @example \newcommand@{\molec@}[1]@{#1\index@{Molecules!#1@}@} \newcommand@{\aindex@}[1]@{#1\index[author]@{#1@} @@ -3310,7 +3454,7 @@ Finally the hook may contain a call to @code{reftex-add-section-levels} to define additional section statements. For example, the FoilTeX class has just two headers, @code{\foilhead} and @code{\rotatefoilhead}. Here -is a style file @file{foils.el} that will inform @b{Ref@TeX{}} about these: +is a style file @file{foils.el} that will inform @RefTeX{} about these: @lisp (TeX-add-style-hook "foils" @@ -3326,20 +3470,20 @@ @cindex Emacs packages, @code{bib-cite} Once you have written a document with labels, references and citations, -it can be nice to read it like a hypertext document. @b{Ref@TeX{}} has +it can be nice to read it like a hypertext document. @RefTeX{} has support for that: @code{reftex-view-crossref} (bound to @kbd{C-c &}), @code{reftex-mouse-view-crossref} (bound to @kbd{S-mouse-2}), and @code{reftex-search-document}. A somewhat fancier interface with mouse highlighting is provided (among other things) by Peter S. Galbraith's @file{bib-cite.el}. There is some overlap in the functionalities of -Bib-cite and @b{Ref@TeX{}}. Bib-cite.el comes bundled with -AUCTeX. +Bib-cite and @RefTeX{}. Bib-cite.el comes bundled with +@AUCTeX{}. Bib-cite version 3.06 and later can be configured so that bib-cite's -mouse functions use @b{Ref@TeX{}} for displaying references and citations. -This can be useful in particular when working with the LaTeX @code{xr} +mouse functions use @RefTeX{} for displaying references and citations. +This can be useful in particular when working with the @LaTeX{} @code{xr} package or with an explicit @code{thebibliography} environment (rather -than BibTeX). Bib-cite cannot handle those, but @b{Ref@TeX{}} does. To +than @BibTeX{}). Bib-cite cannot handle those, but @RefTeX{} does. To make use of this feature, try @vindex bib-cite-use-reftex-view-crossref @@ -3354,7 +3498,7 @@ @itemize @bullet @item -@b{LaTeX commands}@* +@b{@LaTeX{} commands}@* @cindex LaTeX commands, not found @code{\input}, @code{\include}, and @code{\section} (etc.) statements have to be first on a line (except for white space). @@ -3362,7 +3506,7 @@ @item @b{Commented regions}@* @cindex Labels, commented out -@b{Ref@TeX{}} sees also labels in regions commented out and will refuse to +@RefTeX{} sees also labels in regions commented out and will refuse to make duplicates of such labels. This is considered to be a feature. @item @@ -3382,7 +3526,7 @@ The label environment definitions in @code{reftex-label-alist} are global and apply to all documents. If you need to make definitions local to a document, because they would interfere with settings in other -documents, you should use AUCTeX and set up style files with calls to +documents, you should use @AUCTeX{} and set up style files with calls to @code{reftex-add-label-environments}, @code{reftex-set-cite-format}, @code{reftex-add-index-macros}, and @code{reftex-add-section-levels}. Settings made with these functions remain local to the current @@ -3398,9 +3542,9 @@ @cindex Emacs packages, @code{iso-cvt} When using packages which make the buffer representation of a file different from its disk representation (e.g. x-symbol, isotex, -iso-cvt) you may find that @b{Ref@TeX{}}'s parsing information sometimes +iso-cvt) you may find that @RefTeX{}'s parsing information sometimes reflects the disk state of a file. This happens only in @emph{unvisited} -parts of a multifile document, because @b{Ref@TeX{}} visits these files +parts of a multifile document, because @RefTeX{} visits these files literally for speed reasons. Then both short context and section headings may look different from what you usually see on your screen. In rare cases @code{reftex-toc} may have problems to jump to an affected @@ -3410,7 +3554,7 @@ @item @vindex reftex-keep-temporary-buffers @code{(setq reftex-keep-temporary-buffers t)}@* -This implies that @b{Ref@TeX{}} will load all parts of a multifile +This implies that @RefTeX{} will load all parts of a multifile document into Emacs (i.e. there won't be any temporary buffers). @item @vindex reftex-initialize-temporary-buffers @@ -3437,7 +3581,7 @@ @end example @noindent -We need to trick @b{Ref@TeX{}} into swallowing this: +We need to trick @RefTeX{} into swallowing this: @lisp @group @@ -3450,7 +3594,7 @@ @noindent The first line is just a normal configuration for a macro. For the -@code{step+} environment we actually tell @b{Ref@TeX{}} to look for the +@code{step+} environment we actually tell @RefTeX{} to look for the @emph{macro} @samp{\begin@{step+@}} and interpret the @emph{first} argument (which really is a second argument to the macro @code{\begin}) as a label of type @code{?p}. Argument count for this macro starts only @@ -3462,7 +3606,7 @@ @cindex Idle timer restart @vindex reftex-use-itimer-in-xemacs In XEmacs, idle timer restart does not work reliably after fast -keystrokes. Therefore @b{Ref@TeX{}} currently uses the post command +keystrokes. Therefore @RefTeX{} currently uses the post command hook to start the timer used for automatic crossref information. When this bug gets fixed, a real idle timer can be requested with @lisp @@ -3475,7 +3619,7 @@ @cindex Key bindings, problems with Viper mode @findex viper-harness-minor-mode With @i{Viper} mode prior to Vipers version 3.01, you need to protect -@b{Ref@TeX{}}'s keymaps with +@RefTeX{}'s keymaps with @lisp (viper-harness-minor-mode "reftex") @@ -3491,15 +3635,15 @@ @cindex Acknowledgments @cindex Thanks @cindex Bug reports -@cindex @code{http}, @b{Ref@TeX{}} home page -@cindex @code{ftp}, @b{Ref@TeX{}} site +@cindex @code{http}, @RefTeX{} home page +@cindex @code{ftp}, @RefTeX{} site -Ref@TeX{} was written by @i{Carsten Dominik} +@RefTeX{} was written by @i{Carsten Dominik} @email{dominik@@science.uva.nl}, with contributions by @i{Stephen -Eglen}. Ref@TeX{} is currently maintained by @value{MAINTAINER}, see +Eglen}. @RefTeX{} is currently maintained by @value{MAINTAINER}, see the @value{MAINTAINERSITE} for detailed information. -If you have questions about Ref@TeX{}, you can send email to the +If you have questions about @RefTeX{}, you can send email to the @value{SUPPORTADDRESS}. If you want to contribute code or ideas, write to the @value{DEVELADDRESS}. And in the rare case of finding a bug, please use @kbd{M-x reftex-report-bug @key{RET}} which will prepare a @@ -3512,42 +3656,31 @@ might be able to help: @code{comp.emacs}, @code{gnu.emacs.help}, @code{comp.emacs.xemacs}, and @code{comp.text.tex}. -@b{Ref@TeX{}} is bundled and pre-installed with Emacs since version 20.2. -It was also bundled and pre-installed with XEmacs 19.16--20.x. XEmacs -21.x users want to install the corresponding plugin package which is -available from the @value{XEMACSFTP}. See the XEmacs 21.x -documentation on package installation for details. - -Users of earlier Emacs distributions (including Emacs 19) can get a -@b{Ref@TeX{}} distribution from the @value{MAINTAINERSITE}. Note that -the Emacs 19 version supports many but not all features described in -this manual. - -Thanks to the people on the Net who have used @b{Ref@TeX{}} and helped +Thanks to the people on the Net who have used @RefTeX{} and helped developing it with their reports. In particular thanks to @i{Ralf Angeli, Fran Burstall, Alastair Burt, Lars Clausen, Soren Dayton, Stephen Eglen, Karl Eichwalder, Erik Frisk, Peter Galbraith, Kai Grossjohann, Frank Harrell, Till A. Heilmann, Peter Heslin, Stephan Heuel, Alan Ho, Lute Kamstra, Dieter Kraft, David Kastrup, Adrian Lanz, -Juri Linkov, Rory Molinari, Stefan Monnier, Laurent Mugnier, Dan -Nicolaescu, Sudeep Kumar Palat, Daniel Polani, Alan Shutko, Robin Socha, -Richard Stanton, Allan Strand, Jan Vroonhof, Christoph Wedler, Alan -Williams, Roland Winkler, Hans-Christoph Wirth, Eli Zaretskii}. - +Juri Linkov, Wolfgang Mayer, Rory Molinari, Stefan Monnier, Laurent +Mugnier, Dan Nicolaescu, Sudeep Kumar Palat, Daniel Polani, Alan Shutko, +Robin Socha, Richard Stanton, Allan Strand, Jan Vroonhof, Christoph +Wedler, Alan Williams, Roland Winkler, Hans-Christoph Wirth, Eli +Zaretskii}. The @code{view-crossref} feature was inspired by @i{Peter Galbraith's} @file{bib-cite.el}. Finally thanks to @i{Uwe Bolick} who first got me interested in -supporting LaTeX labels and references with an editor (which was +supporting @LaTeX{} labels and references with an editor (which was MicroEmacs at the time). @node Commands, Options, Imprint, Top @chapter Commands @cindex Commands, list of -Here is a summary of @b{Ref@TeX{}}'s commands which can be executed from -LaTeX files. Command which are executed from the special buffers are +Here is a summary of @RefTeX{}'s commands which can be executed from +@LaTeX{} files. Command which are executed from the special buffers are not described here. All commands are available from the @code{Ref} menu. See @xref{Key Bindings}. @@ -3567,8 +3700,8 @@ @end deffn @deffn Command reftex-citation -Make a citation using BibTeX database files. After prompting for a regular -expression, scans the buffers with BibTeX entries (taken from the +Make a citation using @BibTeX{} database files. After prompting for a regular +expression, scans the buffers with @BibTeX{} entries (taken from the @code{\bibliography} command or a @code{thebibliography} environment) and offers the matching entries for selection. The selected entry is formatted according to @code{reftex-cite-format} and inserted into the @@ -3588,8 +3721,8 @@ @deffn Command reftex-index Query for an index macro and insert it along with its arguments. The index macros available are those defined in @code{reftex-index-macro} or -by a call to @code{reftex-add-index-macros}, typically from an AUCTeX -style file. @b{Ref@TeX{}} provides completion for the index tag and the +by a call to @code{reftex-add-index-macros}, typically from an @AUCTeX{} +style file. @RefTeX{} provides completion for the index tag and the index key, and will prompt for other arguments. @end deffn @@ -3600,8 +3733,8 @@ the word near point. When called with one @kbd{C-u} prefix, let the user have a chance to edit the index entry. When called with 2 @kbd{C-u} as prefix, also ask for the index macro and other stuff. When -called inside TeX math mode as determined by the @file{texmathp.el} -library which is part of AUCTeX, the string is first processed with the +called inside @TeX{} math mode as determined by the @file{texmathp.el} +library which is part of @AUCTeX{}, the string is first processed with the @code{reftex-index-math-format}, which see. @end deffn @@ -3610,7 +3743,7 @@ When you are in transient-mark-mode and the region is active, the selection will be used - otherwise the word at point. You get a chance to edit the entry in the phrases buffer - to save the -buffer and return to the LaTeX document, finish with @kbd{C-c C-c}. +buffer and return to the @LaTeX{} document, finish with @kbd{C-c C-c}. @end deffn @deffn Command reftex-index-visit-phrases-buffer @@ -3644,9 +3777,9 @@ @end deffn @deffn Command reftex-view-crossref-from-bibtex -View location in a LaTeX document which cites the BibTeX entry at point. -Since BibTeX files can be used by many LaTeX documents, this function -prompts upon first use for a buffer in @b{Ref@TeX{}} mode. To reset this +View location in a @LaTeX{} document which cites the @BibTeX{} entry at point. +Since @BibTeX{} files can be used by many @LaTeX{} documents, this function +prompts upon first use for a buffer in @RefTeX{} mode. To reset this link to a document, call the function with a prefix arg. Calling this function several times find successive citation locations. @end deffn @@ -3677,7 +3810,7 @@ @deffn Command reftex-isearch-minor-mode Toggle a minor mode which enables incremental search to work globally -on the entire multifile document. Files will be searched in th +on the entire multifile document. Files will be searched in the sequence they appear in the document. @end deffn @@ -3699,7 +3832,7 @@ Simple labels are the ones created by RefTeX, consisting only of the prefix and a number. After the command completes, all these labels will have sequential numbers throughout the document. Any references to the -labels will be changed as well. For this, @b{Ref@TeX{}} looks at the +labels will be changed as well. For this, @RefTeX{} looks at the arguments of any macros which either start or end with the string @samp{ref}. This command should be used with care, in particular in multifile documents. You should not use it if another document refers @@ -3711,21 +3844,30 @@ @end deffn @deffn Command reftex-create-bibtex-file -Create a new BibTeX database file with all entries referenced in document. -The command prompts for a filename and writes the collected entries to -that file. Only entries referenced in the current document with -any @code{\cite}-like macros are used. -The sequence in the new file is the same as it was in the old database. +@vindex reftex-create-bibtex-header +@vindex reftex-create-bibtex-footer +Create a new @BibTeX{} database file with all entries referenced in +document. The command prompts for a filename and writes the collected +entries to that file. Only entries referenced in the current document +with any @code{\cite}-like macros are used. The sequence in the new +file is the same as it was in the old database. + +Entries referenced from other entries must appear after all referencing +entries. + +You can define strings to be used as header or footer for the created +files in the variables @code{reftex-create-bibtex-header} or +@code{reftex-create-bibtex-footer} respectively. @end deffn @deffn Command reftex-customize -Run the customize browser on the @b{Ref@TeX{}} group. +Run the customize browser on the @RefTeX{} group. @end deffn @deffn Command reftex-show-commentary Show the commentary section from @file{reftex.el}. @end deffn @deffn Command reftex-info -Run info on the top @b{Ref@TeX{}} node. +Run info on the top @RefTeX{} node. @end deffn @deffn Command reftex-parse-document Parse the entire document in order to update the parsing information. @@ -3739,7 +3881,7 @@ @chapter Options, Keymaps, Hooks @cindex Options, list of -Here is a complete list of @b{Ref@TeX{}}'s configuration variables. All +Here is a complete list of @RefTeX{}'s configuration variables. All variables have customize support - so if you are not familiar with Emacs Lisp (and even if you are) you might find it more comfortable to use @code{customize} to look at and change these variables. @kbd{M-x @@ -3765,14 +3907,14 @@ @cindex Table of contents, options @defopt reftex-include-file-commands -List of LaTeX commands which input another file. +List of @LaTeX{} commands which input another file. The file name is expected after the command, either in braces or separated by whitespace. @end defopt @defopt reftex-max-section-depth Maximum depth of section levels in document structure. -Standard LaTeX needs 7, default is 12. +Standard @LaTeX{} needs 7, default is 12. @end defopt @defopt reftex-section-levels @@ -3910,7 +4052,7 @@ @end example Each list entry describes either an environment carrying a counter for -use with @code{\label} and @code{\ref}, or a LaTeX macro defining a +use with @code{\label} and @code{\ref}, or a @LaTeX{} macro defining a label as (or inside) one of its arguments. The elements of each list entry are: @@ -3947,7 +4089,7 @@ label type (like @code{equation} and @code{eqnarray}). If the type indicator is @code{nil} and the macro has a label argument @samp{@{*@}}, the macro defines neutral labels just like @code{\label}. In this case -the reminder of this entry is ignored. +the remainder of this entry is ignored. @item @var{label-prefix} Label prefix string, like @samp{tab:}. The prefix is a short string @@ -3968,7 +4110,7 @@ @samp{eq:intro:}. @item @var{reference-format} -Format string for reference insert in buffer. @samp{%s} will be +Format string for reference insertion in buffer. @samp{%s} will be replaced by the label. When the format starts with @samp{~}, this @samp{~} will only be inserted when the character before point is @emph{not} a whitespace. @@ -3996,7 +4138,7 @@ 1000 means to get text after the last macro argument. @item If a string, use as regexp to search @emph{backward} from the label. -Context is then the text following the end of the match. E.g. putting +Context is then the text following the end of the match. E.g. setting this to @samp{\\caption[[@{]} will use the caption in a figure or table environment. @samp{\\begin@{eqnarray@}\|\\\\} works for eqnarrays. @@ -4021,7 +4163,7 @@ @end example @end itemize -Label context is used in two ways by @b{Ref@TeX{}}: For display in the label +Label context is used in two ways by @RefTeX{}: For display in the label menu, and to derive a label string. If you want to use a different method for each of these, specify them as a dotted pair. E.g. @code{(nil . t)} uses the text after the label (@code{nil}) for @@ -4033,7 +4175,7 @@ the word before point is equal to one of these words when calling @code{reftex-reference}, the label list offered will be automatically restricted to labels of the correct type. If the first element of this -word--list is the symbol `regexp', the strings are interpreted as regular +word list is the symbol `regexp', the strings are interpreted as regular expressions. @item @var{toc-level} @@ -4047,7 +4189,7 @@ @end table If the type indicator characters of two or more entries are the same, -@b{Ref@TeX{}} will use +@RefTeX{} will use @itemize @minus @item the first non-@code{nil} format and prefix @@ -4081,7 +4223,7 @@ @defopt reftex-trust-label-prefix Non-@code{nil} means, trust the label prefix when determining label type. It is customary to use special label prefixes to distinguish different label -types. The label prefixes have no syntactic meaning in LaTeX (unless +types. The label prefixes have no syntactic meaning in @LaTeX{} (unless special packages like fancyref) are being used. RefTeX can and by default does parse around each label to detect the correct label type, but this process can be slow when a document contains thousands of @@ -4122,7 +4264,7 @@ (@var{derive} @var{prompt}) @end example -If @var{derive} is @code{t}, @b{Ref@TeX{}} will try to derive a sensible +If @var{derive} is @code{t}, @RefTeX{} will try to derive a sensible label from context. A section label for example will be derived from the section heading. The conversion of the context to a valid label is governed by the specifications given in @@ -4171,7 +4313,7 @@ @deffn Hook reftex-string-to-label-function Function to turn an arbitrary string into a valid label. -@b{Ref@TeX{}}'s default function uses the variable +@RefTeX{}'s default function uses the variable @code{reftex-derive-label-parameters}. @end deffn @@ -4278,35 +4420,38 @@ @code{reftex-reference}. @end defopt -@defopt reftex-vref-is-default -Non-@code{nil} means, the varioref macro @code{\vref} is used as -default. In the selection buffer, the @kbd{v} key toggles the reference -macro between @code{\ref} and @code{\vref}. The value of this variable -determines the default which is active when entering the selection -process. Instead of @code{nil} or @code{t}, this may also be a string -of type letters indicating the label types for which it should be -true. -@end defopt - -@defopt reftex-fref-is-default -Non-@code{nil} means, the fancyref macro @code{\fref} is used as -default. In the selection buffer, the @kbd{V} key toggles the reference -macro between @code{\ref}, @code{\fref} and @code{\Fref}. The value of -this variable determines the default which is active when entering the -selection process. Instead of @code{nil} or @code{t}, this may also be -a string of type letters indicating the label types for which it should -be true. +@defopt reftex-ref-style-alist +Alist of reference styles. Each element is a list of the style name, +the name of the @LaTeX{} package associated with the style or @code{t} +for any package, and an alist of macros where the first entry of each +item is the reference macro and the second a key for selecting the macro +when the macro type is being prompted for. (See also +@code{reftex-ref-macro-prompt}.) The keys, represented as characters, +have to be unique. +@end defopt + +@defopt reftex-ref-style-default-list +List of reference styles to be activated by default. The order is +significant and controls the order in which macros can be cycled in the +buffer for selecting a label. The entries in the list have to match the +respective reference style names used in the variable +@code{reftex-ref-style-alist}. +@end defopt + +@defopt reftex-ref-macro-prompt +Controls if @code{reftex-reference} prompts for the reference macro. @end defopt @deffn Hook reftex-format-ref-function If non-@code{nil}, should be a function which produces the string to insert as a reference. Note that the insertion format can also be changed with @code{reftex-label-alist}. This hook also is used by the -special commands to insert @code{\vref} and @code{\fref} references, so -even if you set this, your setting will be ignored by the special -commands. The function will be called with two arguments, the -@var{label} and the @var{default-format} (usually @samp{~\ref@{%s@}}). -It should return the string to insert into the buffer. +special commands to insert e.g. @code{\vref} and @code{\fref} +references, so even if you set this, your setting will be ignored by the +special commands. The function will be called with three arguments, the +@var{label}, the @var{default format} which normally is +@samp{~\ref@{%s@}} and the @var{reference style}. The function should +return the string to insert into the buffer. @end deffn @defopt reftex-level-indent @@ -4315,11 +4460,11 @@ @defopt reftex-guess-label-type Non-@code{nil} means, @code{reftex-reference} will try to guess the -label type. To do that, @b{Ref@TeX{}} will look at the word before the +label type. To do that, @RefTeX{} will look at the word before the cursor and compare it with the magic words given in -@code{reftex-label-alist}. When it finds a match, @b{Ref@TeX{}} will +@code{reftex-label-alist}. When it finds a match, @RefTeX{} will immediately offer the correct label menu - otherwise it will prompt you -for a label type. If you set this variable to @code{nil}, @b{Ref@TeX{}} +for a label type. If you set this variable to @code{nil}, @RefTeX{} will always prompt for a label type. @end defopt @@ -4351,7 +4496,7 @@ @cindex Creating citations, options @defopt reftex-bibliography-commands -LaTeX commands which specify the BibTeX databases to use with the document. +@LaTeX{} commands which specify the @BibTeX{} databases to use with the document. @end defopt @defopt reftex-bibfile-ignore-regexps @@ -4359,20 +4504,20 @@ @code{\\bibliography@{..@}}. File names matched by any of these regexps will not be parsed. Intended for files which contain only @code{@@string} macro definitions and the like, which are ignored by -@b{Ref@TeX{}} anyway. +@RefTeX{} anyway. @end defopt @defopt reftex-default-bibliography -List of BibTeX database files which should be used if none are specified. +List of @BibTeX{} database files which should be used if none are specified. When @code{reftex-citation} is called from a document with neither a @samp{\bibliography@{...@}} statement nor a @code{thebibliography} -environment, @b{Ref@TeX{}} will scan these files instead. Intended for -using @code{reftex-citation} in non-LaTeX files. The files will be +environment, @RefTeX{} will scan these files instead. Intended for +using @code{reftex-citation} in non-@LaTeX{} files. The files will be searched along the BIBINPUTS or TEXBIB path. @end defopt @defopt reftex-sort-bibtex-matches -Sorting of the entries found in BibTeX databases by reftex-citation. +Sorting of the entries found in @BibTeX{} databases by reftex-citation. Possible values: @example nil @r{Do not sort entries.} @@ -4393,7 +4538,7 @@ @table @code @item %l -The BibTeX label of the citation. +The @BibTeX{} label of the citation. @item %a List of author names, see also @code{reftex-cite-punctuation}. @item %2a @@ -4405,7 +4550,7 @@ @samp{%E} work a well). @end table -It is also possible to access all other BibTeX database fields: +It is also possible to access all other @BibTeX{} database fields: @example %b booktitle %c chapter %d edition %h howpublished @@ -4426,7 +4571,7 @@ A pair of square brackets indicates an optional argument, and RefTeX will prompt for the values of these arguments. -Beware that all this only works with BibTeX database files. When +Beware that all this only works with @BibTeX{} database files. When citations are made from the @code{\bibitems} in an explicit @code{thebibliography} environment, only @samp{%l} is available. @@ -4505,6 +4650,24 @@ (@pxref{Creating Citations}). @end deffn +@defopt reftex-cite-key-separator +String used to separate several keys in a single @samp{\\cite} macro. +Per default this is @samp{","} but if you often have to deal with a lot +of entries and need to break the macro across several lines you might +want to change it to @samp{", "}. +@end defopt + +@defopt reftex-create-bibtex-header +Header to insert in BibTeX files generated by +@code{reftex-create-bibtex-file}. +@end defopt + +@defopt reftex-create-bibtex-footer +Footer to insert in BibTeX files generated by +@code{reftex-create-bibtex-file}. +@end defopt + + @node Options (Index Support), Options (Viewing Cross-References), Options (Creating Citations), Options @section Index Support @cindex Options, Index support @@ -4553,7 +4716,7 @@ @var{exclude} can be a function. If this function exists and returns a non-@code{nil} value, the index entry at point is ignored. This was implemented to support the (deprecated) @samp{^} and @samp{_} shortcuts -in the LaTeX2e @code{index} package. +in the @LaTeX{}2e @code{index} package. @var{repeat}, if non-@code{nil}, means the index macro does not typeset the entry in the text, so that the text has to be repeated outside the @@ -4564,14 +4727,14 @@ the variable @code{reftex-index-macros-builtin} to specify the main indexing package you are using. Valid values are currently @example -default @r{The LaTeX default - unnecessary to specify this one} +default @r{The @LaTeX{} default - unnecessary to specify this one} multind @r{The multind.sty package} index @r{The index.sty package} index-shortcut @r{The index.sty packages with the ^ and _ shortcuts.} @r{Should not be used - only for old documents} @end example -Note that AUCTeX sets these things internally for @b{Ref@TeX{}} as well, -so with a sufficiently new version of AUCTeX, you should not set the +Note that @AUCTeX{} sets these things internally for @RefTeX{} as well, +so with a sufficiently new version of @AUCTeX{}, you should not set the package here. @end defopt @@ -4584,7 +4747,7 @@ @var{default-tag} is the tag to be used if the macro requires a @var{tag} argument. When this is @code{nil} and a @var{tag} is needed, -@b{Ref@TeX{}} will ask for it. When this is the empty string and the +@RefTeX{} will ask for it. When this is the empty string and the TAG argument of the index macro is optional, the TAG argument will be omitted. @end defopt @@ -4604,11 +4767,11 @@ @defopt reftex-index-math-format Format of index entries when copied from inside math mode. When -@code{reftex-index-selection-or-word} is executed inside TeX math mode, +@code{reftex-index-selection-or-word} is executed inside @TeX{} math mode, the index key copied from the buffer is processed with this format string through the @code{format} function. This can be used to add the math delimiters (e.g. @samp{$}) to the string. Requires the -@file{texmathp.el} library which is part of AUCTeX. +@file{texmathp.el} library which is part of @AUCTeX{}. @end defopt @defopt reftex-index-phrase-file-extension @@ -4660,7 +4823,7 @@ phrases may match at places where that phrase was already indexed. In particular when indexing an already processed document again, this will even be the norm. When this variable is non-@code{nil}, -@b{Ref@TeX{}} checks if the match is an index macro argument, or if an +@RefTeX{} checks if the match is an index macro argument, or if an index macro is directly before or after the phrase. If that is the case, that match will be ignored. @end defopt @@ -4701,7 +4864,7 @@ The letters which denote sections in the index. Usually these are all capital letters. Don't use any downcase letters. Order is not significant, the index will be sorted by whatever the sort function -thinks is correct. In addition to these letters, @b{Ref@TeX{}} will +thinks is correct. In addition to these letters, @RefTeX{} will create a group @samp{!} which contains all entries sorted below the lowest specified letter. In the @file{*Index*} buffer, pressing any of these capital letters or @kbd{!} will jump to that section. @@ -4773,7 +4936,7 @@ Non-@code{nil} means, automatic citation display will revisit files if necessary. When nil, citation display in echo area will only be active for cached echo strings (see @code{reftex-cache-cite-echo}), or for -BibTeX database files which are already visited by a live associated +@BibTeX{} database files which are already visited by a live associated buffers. @end defopt @@ -4790,7 +4953,7 @@ @cindex Finding files, options @defopt reftex-texpath-environment-variables -List of specifications how to retrieve the search path for TeX files. +List of specifications how to retrieve the search path for @TeX{} files. Several entries are possible. @itemize @minus @item @@ -4809,7 +4972,7 @@ @end defopt @defopt reftex-bibpath-environment-variables -List of specifications how to retrieve the search path for BibTeX +List of specifications how to retrieve the search path for @BibTeX{} files. Several entries are possible. @itemize @minus @item @@ -4847,14 +5010,14 @@ option is @code{nil}, the subdirectories of @samp{./} are searched before @samp{/tex/}. This is mainly for speed - most of the time the recursive path is for the system files and not for the user files. Set -this to @code{nil} if the default makes @b{Ref@TeX{}} finding files with +this to @code{nil} if the default makes @RefTeX{} finding files with equal names in wrong sequence. @end defopt @defopt reftex-use-external-file-finders Non-@code{nil} means, use external programs to find files. Normally, -@b{Ref@TeX{}} searches the paths given in the environment variables -@code{TEXINPUTS} and @code{BIBINPUTS} to find TeX files and BibTeX +@RefTeX{} searches the paths given in the environment variables +@code{TEXINPUTS} and @code{BIBINPUTS} to find @TeX{} files and @BibTeX{} database files. With this option turned on, it calls an external program specified in the option @code{reftex-external-file-finders} instead. As a side effect, the variables @@ -4881,14 +5044,14 @@ @defopt reftex-keep-temporary-buffers Non-@code{nil} means, keep buffers created for parsing and lookup. -@b{Ref@TeX{}} sometimes needs to visit files related to the current +@RefTeX{} sometimes needs to visit files related to the current document. We distinguish files visited for @table @asis @item PARSING Parts of a multifile document loaded when (re)-parsing the document. @item LOOKUP -BibTeX database files and TeX files loaded to find a reference, to +@BibTeX{} database files and @TeX{} files loaded to find a reference, to display label context, etc. @end table The created buffers can be kept for later use, or be thrown away @@ -4912,7 +5075,7 @@ @defopt reftex-initialize-temporary-buffers Non-@code{nil} means do initializations even when visiting file -temporarily. When @code{nil}, @b{Ref@TeX{}} may turn off find-file hooks and +temporarily. When @code{nil}, @RefTeX{} may turn off find-file hooks and other stuff to briefly visit a file. When @code{t}, the full default initializations are done (@code{find-file-hook} etc.). Instead of @code{t} or @code{nil}, this variable may also be a list of hook @@ -4923,12 +5086,12 @@ List of regular expressions to exclude certain input files from parsing. If the name of a file included via @code{\include} or @code{\input} is matched by any of the regular expressions in this list, that file is not -parsed by @b{Ref@TeX{}}. +parsed by @RefTeX{}. @end defopt @defopt reftex-enable-partial-scans Non-@code{nil} means, re-parse only 1 file when asked to re-parse. -Re-parsing is normally requested with a @kbd{C-u} prefix to many @b{Ref@TeX{}} +Re-parsing is normally requested with a @kbd{C-u} prefix to many @RefTeX{} commands, or with the @kbd{r} key in menus. When this option is @code{t} in a multifile document, we will only parse the current buffer, or the file associated with the label or section heading near point in a @@ -4958,7 +5121,7 @@ @end defopt @defopt reftex-allow-automatic-rescan -Non-@code{nil} means, @b{Ref@TeX{}} may rescan the document when this seems +Non-@code{nil} means, @RefTeX{} may rescan the document when this seems necessary. Applies (currently) only in rare cases, when a new label cannot be placed with certainty into the internal label list. @end defopt @@ -5092,8 +5255,8 @@ @end defopt @defopt reftex-plug-into-AUCTeX -Plug-in flags for AUCTeX interface. This variable is a list of -5 boolean flags. When a flag is non-@code{nil}, @b{Ref@TeX{}} +Plug-in flags for @AUCTeX{} interface. This variable is a list of +5 boolean flags. When a flag is non-@code{nil}, @RefTeX{} will @example @@ -5110,7 +5273,7 @@ sections with @kbd{C-c C-s} and environments with @kbd{C-c C-e}.@* Supplying macro arguments applies when you insert such a macro interactively with @kbd{C-c @key{RET}}.@* -See the AUCTeX documentation for more information. +See the @AUCTeX{} documentation for more information. @end defopt @defopt reftex-revisit-to-follow @@ -5130,10 +5293,10 @@ @section Keymaps and Hooks @cindex Keymaps -@b{Ref@TeX{}} has the usual general keymap and load-- and mode-hook. +@RefTeX{} has the usual general keymap, load hook and mode hook. @deffn Keymap reftex-mode-map -The keymap for @b{Ref@TeX{}} mode. +The keymap for @RefTeX{} mode. @end deffn @deffn {Normal Hook} reftex-load-hook @@ -5141,20 +5304,54 @@ @end deffn @deffn {Normal Hook} reftex-mode-hook -Normal hook which is being run when turning on @b{Ref@TeX{}} mode. +Normal hook which is being run when turning on @RefTeX{} mode. @end deffn -Furthermore, the 4 modes used for referencing labels, creating +Furthermore, the four modes used for referencing labels, creating citations, the table of contents buffer and the phrases buffer have their own keymaps and mode hooks. See the respective sections. There are many more hooks which are described in the relevant sections about -options for a specific part of @b{Ref@TeX{}}. +options for a specific part of @RefTeX{}. @node Changes, GNU Free Documentation License, Keymaps and Hooks, Top @chapter Changes @cindex Changes -Here is a list of recent changes to @b{Ref@TeX{}}. +Here is a list of recent changes to @RefTeX{}. + +@noindent @b{Version 4.33} + +@itemize @bullet +@item +Update to GPLv3. +@item +Parse files are created in a way that does not interfere with recentf +mode. +@end itemize + +@noindent @b{Version 4.32} + +@itemize @bullet +@item +First release by @AUCTeX{} project. +@item +Installation routine rewritten after structure of source package +changed. +@item +Activation of @RefTeX{} changed, so make sure you read the installation +instructions and remove obsolete cruft related to @RefTeX{} from your +init file. +@item +Fixed bug where point would end up in the wrong buffer when jumping +between several @LaTeX{} and phrases buffers. +@item +Fixed bug where @BibTeX{} keys with hyphens were parsed incorrectly. +@item +Some performance improvements. +@item +The separator used between multiple citations in a \cite macro can now +be changed by customizing the variable @code{reftex-cite-key-separator}. +@end itemize @noindent @b{Version 4.28} @itemize @bullet @@ -5504,7 +5701,7 @@ @item Expansion of recursive tex and bib path rewritten. @item -Fixed problem where @b{Ref@TeX{}} did not scan unsaved buffers. +Fixed problem where @RefTeX{} did not scan unsaved buffers. @item Fixed bug with section numbering after *-red sections. @end itemize @@ -5571,15 +5768,15 @@ AUCTeX interface updates: @itemize @minus @item -AUCTeX 9.9c and later notifies @b{Ref@TeX{}} about new sections. +AUCTeX 9.9c and later notifies @RefTeX{} about new sections. @item -@b{Ref@TeX{}} notifies AUCTeX about new labels. +@RefTeX{} notifies AUCTeX about new labels. @item @code{TeX-arg-ref} no longer used (introduction was unnecessary). @item @code{reftex-arg-label} and @code{reftex-arg-cite} fixed up. @item -Settings added to @b{Ref@TeX{}} via style files remain local. +Settings added to @RefTeX{} via style files remain local. @end itemize @item Fixed bug with @code{reftex-citation} in non-latex buffers. @@ -5601,7 +5798,7 @@ @noindent @b{Version 3.21} @itemize @bullet @item -New options for all faces used by @b{Ref@TeX{}}. They're in the +New options for all faces used by @RefTeX{}. They're in the customization group @code{reftex-fontification-configurations}. @end itemize @@ -5627,7 +5824,7 @@ @item Follow-mode is now only used after point motion. @item -@b{Ref@TeX{}} now finally does not fontify temporary files anymore. +@RefTeX{} now finally does not fontify temporary files anymore. @end itemize @noindent @b{Version 3.17} @@ -5740,7 +5937,7 @@ @noindent @b{Version 3.00} @itemize @bullet @item -@b{Ref@TeX{}} should work better for very large projects: +@RefTeX{} should work better for very large projects: @item The new parser works without creating a master buffer. @item @@ -5748,19 +5945,19 @@ @item Information from the parser can be stored in a file. @item -@b{Ref@TeX{}} can deal with macros having a naked label as an argument. +@RefTeX{} can deal with macros having a naked label as an argument. @item Macros may have white space and newlines between arguments. @item Multiple identical section headings no longer confuse @code{reftex-toc}. @item -@b{Ref@TeX{}} should work correctly in combination with buffer-altering +@RefTeX{} should work correctly in combination with buffer-altering packages like outline, folding, x-symbol, iso-cvt, isotex, etc. @item All labeled environments discussed in @emph{The LaTeX Companion} by Goossens, Mittelbach & Samarin, Addison-Wesley 1994) are part of -@b{Ref@TeX{}}'s defaults. +@RefTeX{}'s defaults. @end itemize @noindent @b{Version 2.17} @@ -5858,7 +6055,7 @@ @noindent @b{Version 1.07} @itemize @bullet @item -@b{Ref@TeX{}} gets its own menu. +@RefTeX{} gets its own menu. @end itemize @noindent @b{Version 1.05} === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-30 20:16:12 +0000 +++ lisp/ChangeLog 2012-09-30 20:30:13 +0000 @@ -1,3 +1,146 @@ +2012-09-30 Ralf Angeli + + Merge from standalone RefTeX repository. + + The following ChangeLog entries are shortened versions of the + original ones with file paths adapted. A not so strongly edited + version of the original ChangeLog can be found in the commit log. + + * textmodes/reftex-auc.el: Move `provide' call to bottom of file. + (reftex-arg-cite): Use `reftex-cite-key-separator'. Correctly + handle new value type returned by `reftex-citation'. + + * textmodes/reftex-cite.el (reftex-create-bibtex-file): Make sure + that entries with whitespace at various places are found. Doc + fix. Include entries that are cross-referenced from cited entries. + Include @String definitions in the resulting bib file. Add header + and footer defined in `reftex-create-bibtex-header' and + `reftex-create-bibtex-footer'. + (reftex-do-citation): Make it possible again to insert + non-existent entries. Save match data when asking for optional + arguments. Return all keys, not just the first one. + (reftex-all-used-citation-keys): Fix regexp to correctly extract + all citations in the same line. + (reftex-parse-bibtex-entry): Accept additional optional argument + `raw' and keep quotes or braces if it is non-nil. Match fields + containing hyphens besides word constituents. + (reftex-get-string-refs): New function. + (reftex-extract-bib-entries): Check if BibTeX file changed on disk + and ask if it should be reread in case it did. + (reftex-pop-to-bibtex-entry) + (reftex-extract-bib-entries-from-thebibliography): Match \bibitem + entries with spaces or tabs in front of arguments. + (reftex-pop-to-bibtex-entry, reftex-extract-bib-entries) + (reftex-parse-bibtex-entry, reftex-create-bibtex-file): Match + entries containing numbers and symbol constituents. + (reftex-do-citation, reftex-figure-out-cite-format): Use + `reftex-cite-key-separator'. + + * textmodes/reftex-dcr.el: Move provide statement to end of file. + (reftex-mouse-view-crossref): Explain why point is set. + + * textmodes/reftex-global.el: Whitespace changes. + + * textmodes/reftex-index.el: Move provide statement to end of + file. + (reftex-index-selection-or-word): Use `reftex-region-active-p'. + (reftex-index-visit-phrases-buffer): Set marker when visiting + buffer. This allows for returning from the phrases file to the + file one was just editing instead of the file where the last + phrases was added from. + (reftex-index-phrases-syntax-table): New variable. Give ?\" + punctuation syntax as it usually is not used as string quote in + TeX-related modes and may occur unmatched. The change also + prevents fontification of quoted content. + (reftex-index-phrases-mode): Use it. + + * textmodes/reftex-parse.el (reftex-parse-from-file): Move + backward one char if a `\' was matched after a section macro. + (reftex-parse-from-file): Use beginning of match instead of end as + bound. + + * textmodes/reftex-ref.el: Adapt creation of + `reftex--' functions to new structure of + `reftex-ref-style-alist'. + (reftex-reference): Use `reftex-ref-style-list' function. Adapt + to new structure of `reftex-ref-style-alist'. Prompt for a + reference macro if `reftex-ref-macro-prompt' is non-nil. + (reftex-reference): Pass refstyle to `reftex-format-special'. + Determine reference macro by looking at + `reftex-ref-style-default-list' and `reftex-ref-style-alist'. Use + only one special format function. + (reftex-varioref-vref, reftex-fancyref-fref) + (reftex-fancyref-Fref): Remove definitions. The functions are now + generated from `reftex-ref-style-alist'. + (reftex-format-vref, reftex-format-Fref, reftex-format-fref): + Remove. + (reftex-format-special): New function. + + * textmodes/reftex-sel.el + (reftex-select-cycle-ref-style-internal): Adapt to new structure + of `reftex-ref-style-alist'. Remove code for testing macro type. + (reftex-select-toggle-varioref) + (reftex-select-toggle-fancyref): Remove. + (reftex-select-cycle-ref-style-internal) + (reftex-select-cycle-ref-style-forward) + (reftex-select-cycle-ref-style-backward): New functions. + (reftex-select-label-map): Use `v' and `V' for general cycling + through reference styles. Add `p' for switching between number + and page reference types. + + * textmodes/reftex-toc.el (reftex-re-enlarge): Call + `enlarge-window' only if there is something to do because in Emacs + the horizontal version throws an error even if the parameter is 0. + + * textmodes/reftex-vars.el (reftex-label-alist): Doc fix. + (reftex-plug-into-AUCTeX): Doc fix. + (reftex-vref-is-default, reftex-fref-is-default): Adapt doc + string. Adapt to new name. + (reftex-ref-style-alist): Change structure so that it is not + possible to use multiple different package names within a style. + Remove the symbols for symbols for macro type distinction. Add + characters for macro selection. + (reftex-ref-macro-prompt, reftex-create-bibtex-header) + (reftex-create-bibtex-footer): New variables. + (reftex-format-ref-function): Mention third argument of special + format function. + (reftex-ref-style-alist, reftex-ref-style-default-list): New + variables. + (reftex-vref-is-default, reftex-fref-is-default): Adapt doc string + to new implementation. Mark as obsolete. Add compatibility code + for honoring the variable values in case they are set. + (reftex-cite-format-builtin, reftex-bibliography-commands): Add + support for ConTeXt. + (reftex-format-ref-function, reftex-format-cite-function): Fix + custom type. + (reftex-cite-key-separator): New variable. + + * textmodes/reftex.el (reftex-syntax-table-for-bib) + (reftex-mode): Do not derive `reftex-syntax-table-for-bib' from + `reftex-syntax-table' because parens have to retain their paren + syntax in order for parsing of BibTeX entries like @book(...) to + work. + (reftex-in-comment): Do not error out if `comment-start-skip' is + not set. Deal correctly with escaped comment characters. + (reftex-tie-multifile-symbols): Add doc string. Initialize + `reftex-ref-style-list'. + (reftex-untie-multifile-symbols): Add doc string. + (reftex-add-index-macros): Doc fix. + (reftex-ref-style-activate, reftex-ref-style-toggle) + (reftex-ref-style-list): New functions. + (reftex-mode-menu): Use them. Adapt to new structure of + `reftex-ref-style-alist'. + (reftex-select-with-char): Kill the RefTeX Select buffer when + done. + (reftex-remove-if): New function. + (reftex-erase-all-selection-and-index-buffers) + (reftex-mode-menu): Reference styles are now computed from + `reftex-ref-style-alist'. Fix typo. + (reftex-report-bug): New function. + (reftex-uniquify, reftex-uniquify-by-car): Replace O(n^2) + algorithms with O(n log n). Introduce optional argument SORT (not + yet used). + 2012-09-30 Fabián Ezequiel Gallina Enhancements for triple-quote string syntax. === modified file 'lisp/textmodes/reftex-auc.el' --- lisp/textmodes/reftex-auc.el 2012-01-19 07:21:25 +0000 +++ lisp/textmodes/reftex-auc.el 2012-09-30 20:30:13 +0000 @@ -4,8 +4,6 @@ ;; Author: Carsten Dominik ;; Maintainer: auctex-devel@gnu.org -;; Version: 4.31 -;; Package: reftex ;; This file is part of GNU Emacs. @@ -27,21 +25,21 @@ ;;; Code: (eval-when-compile (require 'cl)) -(provide 'reftex-auc) + (require 'reftex) -;;; -(declare-function TeX-argument-insert "ext:tex" (name optional &optional prefix)) -(declare-function TeX-argument-prompt "ext:tex" (optional prompt default &optional complete)) -(declare-function multi-prompt "ext:multi-prompt" - (separator - unique prompt table - &optional mp-predicate require-match initial history)) +(declare-function TeX-argument-prompt "ext:tex" + (optional prompt default &optional complete)) +(declare-function TeX-argument-insert "ext:tex" + (name optional &optional prefix)) +(declare-function LaTeX-add-labels "ext:tex" (&rest entries) t) (declare-function LaTeX-add-index-entries "ext:tex" (&rest entries) t) -(declare-function LaTeX-add-labels "ext:tex" (&rest entries) t) (declare-function LaTeX-bibitem-list "ext:tex" () t) (declare-function LaTeX-index-entry-list "ext:tex" () t) (declare-function LaTeX-label-list "ext:tex" () t) +(declare-function multi-prompt "ext:multi-prompt" + (separator unique prompt table &optional + mp-predicate require-match initial history)) (defun reftex-plug-flag (which) ;; Tell if a certain flag is set in reftex-plug-into-AUCTeX @@ -76,14 +74,15 @@ (let (items) (cond ((and (not definition) (reftex-plug-flag 3)) - (setq items (list (or (reftex-citation t) "")))) + (setq items (or (reftex-citation t) (list "")))) (t (setq prompt (concat (if optional "(Optional) " "") (if prompt prompt "Add key") " (default none): ")) (setq items (multi-prompt "," t prompt (LaTeX-bibitem-list))))) (apply 'LaTeX-add-bibitems items) - (TeX-argument-insert (mapconcat 'identity items ",") optional))) + (TeX-argument-insert (mapconcat 'identity items reftex-cite-key-separator) + optional))) (defun reftex-arg-index-tag (optional &optional prompt &rest args) @@ -223,4 +222,6 @@ (defun reftex-notice-new-section () (reftex-notice-new 1 'force)) +(provide 'reftex-auc) + ;;; reftex-auc.el ends here === modified file 'lisp/textmodes/reftex-cite.el' --- lisp/textmodes/reftex-cite.el 2012-09-24 11:39:33 +0000 +++ lisp/textmodes/reftex-cite.el 2012-09-30 20:30:13 +0000 @@ -4,8 +4,6 @@ ;; Author: Carsten Dominik ;; Maintainer: auctex-devel@gnu.org -;; Version: 4.31 -;; Package: reftex ;; This file is part of GNU Emacs. @@ -129,9 +127,10 @@ (let* ((re (if item - (concat "\\\\bibitem\\(\\[[^]]*\\]\\)?{" (regexp-quote key) "}") - (concat "@[a-zA-Z]+[ \t\n\r]*[{(][ \t\n\r]*" (regexp-quote key) - "[, \t\r\n}]"))) + (concat "\\\\bibitem[ \t]*\\(\\[[^]]*\\]\\)?[ \t]*{" + (regexp-quote key) "}") + (concat "@\\(?:\\w\\|\\s_\\)+[ \t\n\r]*[{(][ \t\n\r]*" + (regexp-quote key) "[, \t\r\n}]"))) (buffer-conf (current-buffer)) file buf pos oldpos) @@ -229,7 +228,13 @@ buffer (not reftex-keep-temporary-buffers)))) (if (not buffer1) (message "No such BibTeX file %s (ignored)" buffer) - (message "Scanning bibliography database %s" buffer1)) + (message "Scanning bibliography database %s" buffer1) + (unless (verify-visited-file-modtime buffer1) + (when (y-or-n-p + (format "File %s changed on disk. Reread from disk? " + (file-name-nondirectory + (buffer-file-name buffer1)))) + (with-current-buffer buffer1 (revert-buffer t t))))) (set-buffer buffer1) (reftex-with-special-syntax-for-bib @@ -238,8 +243,8 @@ (while (re-search-forward first-re nil t) (catch 'search-again (setq key-point (point)) - (unless (re-search-backward - "\\(\\`\\|[\n\r]\\)[ \t]*@\\([a-zA-Z]+\\)[ \t\n\r]*[{(]" nil t) + (unless (re-search-backward "\\(\\`\\|[\n\r]\\)[ \t]*\ +@\\(\\(?:\\w\\|\\s_\\)+\\)[ \t\n\r]*[{(]" nil t) (throw 'search-again nil)) (setq start-point (point)) (goto-char (match-end 0)) @@ -451,7 +456,8 @@ (setq names (replace-match " " nil t names))) (split-string names "\n"))) -(defun reftex-parse-bibtex-entry (entry &optional from to) +(defun reftex-parse-bibtex-entry (entry &optional from to raw) + ; if RAW is non-nil, keep double quotes/curly braces delimiting fields (let (alist key start field) (save-excursion (save-restriction @@ -463,41 +469,56 @@ (erase-buffer) (insert entry)) (widen) - (narrow-to-region from to)) + (if (and from to) (narrow-to-region from to))) (goto-char (point-min)) - (if (re-search-forward - "@\\(\\w+\\)[ \t\n\r]*[{(][ \t\n\r]*\\([^ \t\n\r,]+\\)" nil t) + (if (re-search-forward "@\\(\\(?:\\w\\|\\s_\\)+\\)[ \t\n\r]*\ +\[{(][ \t\n\r]*\\([^ \t\n\r,]+\\)" nil t) (setq alist (list (cons "&type" (downcase (reftex-match-string 1))) (cons "&key" (reftex-match-string 2))))) - (while (re-search-forward "\\(\\w+\\)[ \t\n\r]*=[ \t\n\r]*" nil t) + (while (re-search-forward "\\(\\(?:\\w\\|-\\)+\\)[ \t\n\r]*=[ \t\n\r]*" + nil t) (setq key (downcase (reftex-match-string 1))) (cond ((= (following-char) ?{) - (forward-char 1) - (setq start (point)) - (condition-case nil - (up-list 1) - (error nil))) + (cond + (raw + (setq start (point)) + (forward-char 1)) + (t + (forward-char 1) + (setq start (point)) + (condition-case nil + (up-list 1) + (error nil))))) ((= (following-char) ?\") - (forward-char 1) - (setq start (point)) + (cond + (raw + (setq start (point)) + (forward-char 1)) + (t + (forward-char 1) + (setq start (point)))) (while (and (search-forward "\"" nil t) (= ?\\ (char-after (- (point) 2)))))) (t (setq start (point)) (re-search-forward "[ \t]*[\n\r,}]" nil 1))) - (setq field (buffer-substring-no-properties start (1- (point)))) + ;; extract field value, ignore trailing comma if in RAW mode + (let ((stop (if (and raw (not (= (char-after (1- (point))) ?,))) + (point) + (1- (point))) )) + (setq field (buffer-substring-no-properties start stop))) ;; remove extra whitespace (while (string-match "[\n\t\r]\\|[ \t][ \t]+" field) (setq field (replace-match " " nil t field))) ;; remove leading garbage - (if (string-match "^[ \t{]+" field) + (if (string-match (if raw "^[ \t]+" "^[ \t{]+") field) (setq field (replace-match "" nil t field))) ;; remove trailing garbage - (if (string-match "[ \t}]+$" field) + (if (string-match (if raw "[ \t]+$" "[ \t}]+$") field) (setq field (replace-match "" nil t field))) (push (cons key field) alist)))) alist)) @@ -638,15 +659,13 @@ (insert-entries selected-entries) entry string cite-view) - (when (stringp selected-entries) - (error selected-entries)) (unless selected-entries (error "Quit")) (if (stringp selected-entries) ;; Nonexistent entry - (setq selected-entries nil - insert-entries (list (list selected-entries - (cons "&key" selected-entries)))) + (setq insert-entries (list (list selected-entries + (cons "&key" selected-entries))) + selected-entries nil) ;; It makes sense to compute the cite-view strings. (setq cite-view t)) @@ -654,7 +673,8 @@ ;; All keys go into a single command - we need to trick a little ;; FIXME: Unfortunately, this means that commenting does not work right. (pop selected-entries) - (let ((concat-keys (mapconcat 'car selected-entries ","))) + (let ((concat-keys (mapconcat 'car selected-entries + reftex-cite-key-separator))) (setq insert-entries (list (list concat-keys (cons "&key" concat-keys)))))) @@ -675,8 +695,9 @@ (equal arg '(4)))) (let ((start 0) (nth 0) value) (while (setq start (string-match "\\[\\]" string start)) - (setq value (read-string (format "Optional argument %d: " - (setq nth (1+ nth))))) + (setq value (save-match-data + (read-string (format "Optional argument %d: " + (setq nth (1+ nth)))))) (setq string (replace-match (concat "[" value "]") t t string)) (setq start (1+ start))))) ;; Should we cleanup empty optional arguments? @@ -725,7 +746,7 @@ (forward-char 1))) ;; Return the citation key - (car (car selected-entries)))) + (mapcar 'car selected-entries))) (defun reftex-figure-out-cite-format (arg &optional no-insert format-key) ;; Check if there is already a cite command at point and change cite format @@ -744,9 +765,13 @@ (if (or (not arg) (not (listp arg))) (setq format (concat - (if (member (preceding-char) '(?\{ ?,)) "" ",") + (if (member (preceding-char) '(?\{ ?,)) + "" + reftex-cite-key-separator) "%l" - (if (member (following-char) '(?\} ?,)) "" ","))) + (if (member (following-char) '(?\} ?,)) + "" + reftex-cite-key-separator))) (setq format "%l"))) (t ;; Figure out the correct format @@ -1114,7 +1139,7 @@ (save-restriction (widen) (goto-char (point-min)) - (while (re-search-forward "^[^%\n\r]*\\\\\\(bibentry\\|[a-zA-Z]*cite[a-zA-Z]*\\)\\(\\[[^\\]]*\\]\\)?{\\([^}]+\\)}" nil t) + (while (re-search-forward "\\(?:^\\|\\=\\)[^%\n\r]*?\\\\\\(bibentry\\|[a-zA-Z]*cite[a-zA-Z]*\\)\\(\\[[^\\]]*\\]\\)?{\\([^}]+\\)}" nil t) (setq kk (match-string-no-properties 3)) (while (string-match "%.*\n?" kk) (setq kk (replace-match "" t t kk))) @@ -1125,18 +1150,35 @@ (reftex-kill-temporary-buffers) keys)) +(defun reftex-get-string-refs (alist) + "Return a list of BibTeX @string references that appear as values in ALIST." + (reftex-remove-if (lambda (x) (string-match "^\\([\"{]\\|[0-9]+$\\)" x)) + ;; get list of values, discard keys + (mapcar 'cdr + ;; remove &key and &type entries + (reftex-remove-if (lambda (pair) + (string-match "^&" (car pair))) + alist)))) + (defun reftex-create-bibtex-file (bibfile) "Create a new BibTeX database file with all entries referenced in document. -The command prompts for a filename and writes the collected entries to -that file. Only entries referenced in the current document with -any \\cite-like macros are used. -The sequence in the new file is the same as it was in the old database." +The command prompts for a filename and writes the collected +entries to that file. Only entries referenced in the current +document with any \\cite-like macros are used. The sequence in +the new file is the same as it was in the old database. + +Entries referenced from other entries must appear after all +referencing entries. + +You can define strings to be used as header or footer for the +created files in the variables `reftex-create-bibtex-header' or +`reftex-create-bibtex-footer' respectively." (interactive "FNew BibTeX file: ") (let ((keys (reftex-all-used-citation-keys)) (files (reftex-get-bibfile-list)) - file key entries beg end entry) + file key entries beg end entry string-keys string-entries) (save-current-buffer - (while (setq file (pop files)) + (dolist (file files) (set-buffer (reftex-get-file-buffer-force file 'mark)) (reftex-with-special-syntax-for-bib (save-excursion @@ -1156,14 +1198,54 @@ (when (member key keys) (setq entry (buffer-substring beg end) entries (cons entry entries) - keys (delete key keys))))))))) + keys (delete key keys)) + + ;; check for crossref entries + (let* ((attr-list (reftex-parse-bibtex-entry nil beg end)) + (xref-key (cdr (assoc "crossref" attr-list)))) + (if xref-key (pushnew xref-key keys))) + ;; check for string references + (let* ((raw-fields (reftex-parse-bibtex-entry nil beg end t)) + (string-fields (reftex-get-string-refs raw-fields))) + (dolist (skey string-fields) + (unless (member skey string-keys) + (push skey string-keys))))))))))) + ;; second pass: grab @string references + (if string-keys + (save-current-buffer + (dolist (file files) + (set-buffer (reftex-get-file-buffer-force file 'mark)) + (reftex-with-special-syntax-for-bib + (save-excursion + (save-restriction + (widen) + (goto-char (point-min)) + (while (re-search-forward + "^[ \t]*@[Ss][Tt][Rr][Ii][Nn][Gg][ \t]*{[ \t]*\\([^ \t\r\n]+\\)" + nil t) + (setq key (match-string 1) + beg (match-beginning 0) + end (progn + (goto-char (match-beginning 1)) + (condition-case nil + (up-list 1) + (error (goto-char (match-end 0)))) + (point))) + (when (member key string-keys) + (setq entry (buffer-substring beg end) + string-entries (cons entry string-entries) + string-keys (delete key string-keys)))))))))) (find-file-other-window bibfile) (if (> (buffer-size) 0) (unless (yes-or-no-p (format "Overwrite non-empty file %s? " bibfile)) (error "Abort"))) (erase-buffer) + (if reftex-create-bibtex-header (insert reftex-create-bibtex-header "\n\n")) + (insert (mapconcat 'identity (reverse string-entries) "\n\n")) + (if string-entries (insert "\n\n\n")) (insert (mapconcat 'identity (reverse entries) "\n\n")) + (if reftex-create-bibtex-footer (insert "\n\n" reftex-create-bibtex-footer)) (goto-char (point-min)) (save-buffer) (message "%d entries extracted and copied to new database" === modified file 'lisp/textmodes/reftex-dcr.el' --- lisp/textmodes/reftex-dcr.el 2012-04-09 13:05:48 +0000 +++ lisp/textmodes/reftex-dcr.el 2012-09-30 20:30:13 +0000 @@ -4,8 +4,6 @@ ;; Author: Carsten Dominik ;; Maintainer: auctex-devel@gnu.org -;; Version: 4.31 -;; Package: reftex ;; This file is part of GNU Emacs. @@ -27,10 +25,10 @@ ;;; Code: (eval-when-compile (require 'cl)) -(provide 'reftex-dcr) -(provide 'reftex-vcr) + +(declare-function bibtex-beginning-of-entry "bibtex" ()) + (require 'reftex) -;;; (defun reftex-view-crossref (&optional arg auto-how fail-quietly) "View cross reference of macro at point. Point must be on the KEY @@ -229,6 +227,7 @@ If there is no such macro at point, search forward to find one. With argument, actually select the window showing the cross reference." (interactive "e") + ;; Make sure the referencing macro stays visible in the original window. (mouse-set-point ev) (reftex-view-crossref current-prefix-arg)) @@ -348,15 +347,14 @@ (message "Automatic display of crossref information was turned on"))) (defun reftex-start-itimer-once () - (and (featurep 'xemacs) reftex-mode + (and (featurep 'xemacs) + reftex-mode (not (itimer-live-p reftex-auto-view-crossref-timer)) (setq reftex-auto-view-crossref-timer (start-itimer "RefTeX Idle Timer" 'reftex-view-crossref-when-idle reftex-idle-time nil t)))) -(declare-function bibtex-beginning-of-entry "bibtex" ()) - (defun reftex-view-crossref-from-bibtex (&optional arg) "View location in a LaTeX document which cites the BibTeX entry at point. Since BibTeX files can be used by many LaTeX documents, this function @@ -481,4 +479,6 @@ (move-marker reftex-global-search-marker nil) (error "All files processed")))) +(provide 'reftex-dcr) + ;;; reftex-dcr.el ends here === modified file 'lisp/textmodes/reftex-global.el' --- lisp/textmodes/reftex-global.el 2012-06-02 10:56:09 +0000 +++ lisp/textmodes/reftex-global.el 2012-09-30 20:30:13 +0000 @@ -4,8 +4,6 @@ ;; Author: Carsten Dominik ;; Maintainer: auctex-devel@gnu.org -;; Version: 4.31 -;; Package: reftex ;; This file is part of GNU Emacs. @@ -407,7 +405,7 @@ (when flist (if wrapp (unless isearch-forward - (setq flist (last flist))) + (setq flist (last flist))) (unless isearch-forward (setq flist (reverse flist))) (while (not (string= (car flist) cb)) @@ -437,7 +435,8 @@ (with-current-buffer crt-buf (when reftex-mode (if (boundp 'multi-isearch-next-buffer-function) - (set (make-local-variable 'multi-isearch-next-buffer-function) + (set (make-local-variable + 'multi-isearch-next-buffer-function) 'reftex-isearch-switch-to-next-file) (set (make-local-variable 'isearch-wrap-function) 'reftex-isearch-wrap-function) === modified file 'lisp/textmodes/reftex-index.el' --- lisp/textmodes/reftex-index.el 2012-09-24 11:39:33 +0000 +++ lisp/textmodes/reftex-index.el 2012-09-30 20:30:13 +0000 @@ -4,8 +4,6 @@ ;; Author: Carsten Dominik ;; Maintainer: auctex-devel@gnu.org -;; Version: 4.31 -;; Package: reftex ;; This file is part of GNU Emacs. @@ -27,9 +25,9 @@ ;;; Code: (eval-when-compile (require 'cl)) -(provide 'reftex-index) +(declare-function texmathp "ext:texmathp" ()) + (require 'reftex) -;;; ;; START remove for XEmacs release (defvar mark-active) @@ -37,8 +35,6 @@ (defvar TeX-master) ;; END remove for XEmacs release -(declare-function texmathp "ext:texmathp" ()) - (defun reftex-index-selection-or-word (&optional arg phrase) "Put selection or the word near point into the default index macro. This uses the information in `reftex-index-default-macro' to make an index @@ -52,9 +48,7 @@ (interactive "P") (let* ((use-default (not (equal arg '(16)))) ; check for double prefix ;; check if we have an active selection - (active (if (featurep 'xemacs) - (and zmacs-regions (region-exists-p)) ; XEmacs - (and transient-mark-mode mark-active))) ; Emacs + (active (reftex-region-active-p)) (beg (if active (region-beginning) (save-excursion @@ -1244,7 +1238,11 @@ map) "Keymap used for *toc* buffer.") - +(defvar reftex-index-phrases-syntax-table + (let ((table (make-syntax-table))) + (modify-syntax-entry ?\" "." table) + table) + "Syntax table for RefTeX Index Phrases mode.") (defun reftex-index-phrase-selection-or-word (arg) "Add current selection or word at point to the phrases buffer. @@ -1264,6 +1262,7 @@ "Switch to the phrases buffer, initialize if empty." (interactive) (reftex-access-scan-info) + (set-marker reftex-index-return-marker (point)) (let* ((master (reftex-TeX-master-file)) (name (concat (file-name-sans-extension master) reftex-index-phrase-file-extension))) @@ -1371,6 +1370,7 @@ Here are all local bindings. \\{reftex-index-phrases-mode-map}" + :syntax-table reftex-index-phrases-syntax-table (set (make-local-variable 'font-lock-defaults) reftex-index-phrases-font-lock-defaults) (easy-menu-add reftex-index-phrases-menu reftex-index-phrases-mode-map) @@ -2093,5 +2093,6 @@ reftex-index-phrases-macro-data "\n")))) (reftex-select-with-char prompt help delay))) +(provide 'reftex-index) ;;; reftex-index.el ends here === modified file 'lisp/textmodes/reftex-parse.el' --- lisp/textmodes/reftex-parse.el 2012-01-19 07:21:25 +0000 +++ lisp/textmodes/reftex-parse.el 2012-09-30 20:30:13 +0000 @@ -4,8 +4,6 @@ ;; Author: Carsten Dominik ;; Maintainer: auctex-devel@gnu.org -;; Version: 4.31 -;; Package: reftex ;; This file is part of GNU Emacs. @@ -27,7 +25,7 @@ ;;; Code: (eval-when-compile (require 'cl)) -(provide 'reftex-parse) + (require 'reftex) (defmacro reftex-with-special-syntax (&rest body) @@ -241,8 +239,17 @@ ((match-end 3) ;; It is a section - (setq bound (point)) + ;; Use the beginning as bound and not the end + ;; (i.e. (point)) because the section command might + ;; be the start of the current environment to be + ;; found by `reftex-label-info'. + (setq bound (match-beginning 0)) + ;; The section regexp matches a character at the end + ;; we are not interested in. Especially if it is the + ;; backslash of a following macro we want to find in + ;; the next parsing iteration. + (when (eq (char-before) ?\\) (backward-char)) ;; Insert in List (setq toc-entry (reftex-section-info file)) (when toc-entry @@ -1072,4 +1079,6 @@ nrest (- nrest i)))) string)) +(provide 'reftex-parse) + ;;; reftex-parse.el ends here === modified file 'lisp/textmodes/reftex-ref.el' --- lisp/textmodes/reftex-ref.el 2012-06-26 16:23:01 +0000 +++ lisp/textmodes/reftex-ref.el 2012-09-30 20:30:13 +0000 @@ -4,8 +4,6 @@ ;; Author: Carsten Dominik ;; Maintainer: auctex-devel@gnu.org -;; Version: 4.31 -;; Package: reftex ;; This file is part of GNU Emacs. @@ -27,10 +25,9 @@ ;;; Code: (eval-when-compile (require 'cl)) -(provide 'reftex-ref) + (require 'reftex) (require 'reftex-parse) -;;; (defun reftex-label-location (&optional bound) "Return the environment or macro which determines the label type at point. @@ -413,27 +410,54 @@ (interactive) - ;; check for active recursive edits + ;; Check for active recursive edits (reftex-check-recursive-edit) - ;; Ensure access to scanning info and rescan buffer if prefix are is '(4) + ;; Ensure access to scanning info and rescan buffer if prefix is '(4) (reftex-access-scan-info current-prefix-arg) - (unless type - ;; guess type from context - (if (and reftex-guess-label-type - (setq type (reftex-guess-label-type))) - (setq cut (cdr type) - type (car type)) - (setq type (reftex-query-label-type)))) - - (let* ((reftex-refstyle - (cond ((reftex-typekey-check type reftex-vref-is-default) "\\vref") - ((reftex-typekey-check type reftex-fref-is-default) "\\fref") - (t "\\ref"))) - (reftex-format-ref-function reftex-format-ref-function) - (form "\\ref{%s}") - label labels sep sep1) + (let ((reftex-refstyle (when (and (boundp 'reftex-refstyle) reftex-refstyle) + reftex-refstyle)) + (reftex-format-ref-function reftex-format-ref-function) + (form "\\ref{%s}") + label labels sep sep1 style-alist) + + (unless reftex-refstyle + (if reftex-ref-macro-prompt + (progn + ;; Build a temporary list which handles more easily. + (dolist (elt reftex-ref-style-alist) + (when (member (car elt) (reftex-ref-style-list)) + (mapc (lambda (x) + (add-to-list 'style-alist (cons (cadr x) (car x)) t)) + (nth 2 elt)))) + ;; Prompt the user for the macro. + (let ((key (reftex-select-with-char + "" (concat "SELECT A REFERENCE FORMAT\n\n" + (mapconcat + (lambda (x) + (format "[%c] %s %s" (car x) + (if (> (car x) 31) " " "") + (cdr x))) + style-alist "\n"))))) + (setq reftex-refstyle (cdr (assoc key style-alist))) + (unless reftex-refstyle + (error "No reference macro associated with key `%c'" key)))) + ;; Get the first macro from `reftex-ref-style-alist' which + ;; matches the first entry in the list of active styles. + (setq reftex-refstyle + (or (caar (nth 2 (assoc (car (reftex-ref-style-list)) + reftex-ref-style-alist))) + ;; Use the first entry in r-r-s-a as a last resort. + (caar (nth 2 (car reftex-ref-style-alist))))))) + + (unless type + ;; Guess type from context + (if (and reftex-guess-label-type + (setq type (reftex-guess-label-type))) + (setq cut (cdr type) + type (car type)) + (setq type (reftex-query-label-type)))) ;; Have the user select a label (set-marker reftex-select-return-marker (point)) @@ -472,17 +496,13 @@ (member (preceding-char) '(?\ ?\t ?\n ?~))) (setq form (substring form 1))) ;; do we have a special format? - (setq reftex-format-ref-function - (cond - ((string= reftex-refstyle "\\vref") 'reftex-format-vref) - ((string= reftex-refstyle "\\fref") 'reftex-format-fref) - ((string= reftex-refstyle "\\Fref") 'reftex-format-Fref) - (t reftex-format-ref-function))) + (unless (string= reftex-refstyle "\\ref") + (setq reftex-format-ref-function 'reftex-format-special)) ;; ok, insert the reference (if sep1 (insert sep1)) (insert (if reftex-format-ref-function - (funcall reftex-format-ref-function label form) + (funcall reftex-format-ref-function label form reftex-refstyle) (format form label label))) ;; take out the initial ~ for good (and (= ?~ (string-to-char form)) @@ -791,34 +811,31 @@ (run-hooks 'reftex-display-copied-context-hook) (setq buffer-read-only t)))))) -(defun reftex-varioref-vref () - "Insert a reference using the `\\vref' macro from the varioref package." - (interactive) - (let ((reftex-format-ref-function 'reftex-format-vref)) - (reftex-reference))) -(defun reftex-fancyref-fref () - "Insert a reference using the `\\fref' macro from the fancyref package." - (interactive) - (let ((reftex-format-ref-function 'reftex-format-fref) - ;;(reftex-guess-label-type nil) ;FIXME do we want this???? - ) - (reftex-reference))) -(defun reftex-fancyref-Fref () - "Insert a reference using the `\\Fref' macro from the fancyref package." - (interactive) - (let ((reftex-format-ref-function 'reftex-format-Fref) - ;;(reftex-guess-label-type nil) ;FIXME do we want this???? - ) - (reftex-reference))) +;; Generate functions for direct insertion of specific referencing +;; macros. The functions are named `reftex--', +;; e.g. `reftex-varioref-vref'. +(dolist (elt reftex-ref-style-alist) + (when (stringp (nth 1 elt)) + (dolist (item (nth 2 elt)) + (let ((macro (car item)) + (package (nth 1 elt))) + (eval `(defun ,(intern (format "reftex-%s-%s" package + (substring macro 1 (length macro)))) () + ,(format "Insert a reference using the `%s' macro from the %s \ +package.\n\nThis is a generated function." + macro package) + (interactive) + (let ((reftex-refstyle ,macro)) + (reftex-reference)))))))) -(defun reftex-format-vref (label fmt) - (while (string-match "\\\\ref{" fmt) - (setq fmt (replace-match "\\vref{" t t fmt))) - (format fmt label label)) -(defun reftex-format-Fref (label def-fmt) - (format "\\Fref{%s}" label)) -(defun reftex-format-fref (label def-fmt) - (format "\\fref{%s}" label)) +(defun reftex-format-special (label fmt refstyle) + "Apply selected reference style to format FMT and add LABEL. +Replace any occurrences of \"\\ref\" with REFSTYLE." + ;; Replace instances of \ref in `fmt' with the special reference + ;; style selected by the user. + (while (string-match "\\(\\\\ref\\)[ \t]*{" fmt) + (setq fmt (replace-match refstyle t t fmt 1))) + (format fmt label)) (defun reftex-goto-label (&optional other-window) "Prompt for a label (with completion) and jump to the location of this label. @@ -847,5 +864,6 @@ (goto-char where)) (reftex-unhighlight 0))) +(provide 'reftex-ref) ;;; reftex-ref.el ends here === modified file 'lisp/textmodes/reftex-sel.el' --- lisp/textmodes/reftex-sel.el 2012-09-24 11:39:33 +0000 +++ lisp/textmodes/reftex-sel.el 2012-09-30 20:30:13 +0000 @@ -4,8 +4,6 @@ ;; Author: Carsten Dominik ;; Maintainer: auctex-devel@gnu.org -;; Version: 4.31 -;; Package: reftex ;; This file is part of GNU Emacs. @@ -27,9 +25,8 @@ ;;; Code: (eval-when-compile (require 'cl)) -(provide 'reftex-sel) + (require 'reftex) -;;; ;; Common bindings in reftex-select-label-mode-map ;; and reftex-select-bib-mode-map. @@ -86,8 +83,8 @@ (loop for x in '(("b" . reftex-select-jump-to-previous) ("z" . reftex-select-jump) - ("v" . reftex-select-toggle-varioref) - ("V" . reftex-select-toggle-fancyref) + ("v" . reftex-select-cycle-ref-style-forward) + ("V" . reftex-select-cycle-ref-style-backward) ("m" . reftex-select-mark) ("u" . reftex-select-unmark) ("," . reftex-select-mark-comma) @@ -511,6 +508,7 @@ (defvar last-data) (defvar call-back) (defvar help-string) +(defvar reftex-refstyle) ;; The selection commands @@ -604,23 +602,28 @@ (setq reftex-last-follow-point -1) (setq cb-flag (not cb-flag))) -(defvar reftex-refstyle) ; from reftex-reference - -(defun reftex-select-toggle-varioref () - "Toggle the macro used for referencing the label between \\ref and \\vref." - (interactive) - (if (string= reftex-refstyle "\\ref") - (setq reftex-refstyle "\\vref") - (setq reftex-refstyle "\\ref")) - (force-mode-line-update)) -(defun reftex-select-toggle-fancyref () - "Toggle the macro used for referencing the label between \\ref and \\vref." - (interactive) - (setq reftex-refstyle - (cond ((string= reftex-refstyle "\\ref") "\\fref") - ((string= reftex-refstyle "\\fref") "\\Fref") - (t "\\ref"))) - (force-mode-line-update)) +(defun reftex-select-cycle-ref-style-internal (&optional reverse) + "Cycle through macros used for referencing. +Cycle in reverse order if optional argument REVERSE is non-nil." + (let (list) + (dolist (style (reftex-ref-style-list)) + (mapc (lambda (x) (add-to-list 'list (car x) t)) + (nth 2 (assoc style reftex-ref-style-alist)))) + (when reverse + (setq list (reverse list))) + (setq reftex-refstyle (or (cadr (member reftex-refstyle list)) (car list)))) + (force-mode-line-update)) + +(defun reftex-select-cycle-ref-style-forward () + "Cycle forward through macros used for referencing." + (interactive) + (reftex-select-cycle-ref-style-internal)) + +(defun reftex-select-cycle-ref-style-backward () + "Cycle backward through macros used for referencing." + (interactive) + (reftex-select-cycle-ref-style-internal t)) + (defun reftex-select-show-insertion-point () "Show the point from where selection was started in another window." (interactive) @@ -721,7 +724,7 @@ (if sep (format "*%c%d* " sep (decf cnt)) (format "*%d* " (decf cnt))))) - reftex-select-marked) + reftex-select-marked) (message "Entry no longer marked"))) (defun reftex-select-help () @@ -731,4 +734,6 @@ (princ help-string)) (reftex-enlarge-to-fit "*RefTeX Help*" t)) +(provide 'reftex-sel) + ;;; reftex-sel.el ends here === modified file 'lisp/textmodes/reftex-toc.el' --- lisp/textmodes/reftex-toc.el 2012-05-13 03:05:06 +0000 +++ lisp/textmodes/reftex-toc.el 2012-09-30 20:30:13 +0000 @@ -4,8 +4,6 @@ ;; Author: Carsten Dominik ;; Maintainer: auctex-devel@gnu.org -;; Version: 4.31 -;; Package: reftex ;; This file is part of GNU Emacs. @@ -372,14 +370,14 @@ (error t))))) (defun reftex-re-enlarge () - ;; Enlarge window to a remembered size. - (if reftex-toc-split-windows-horizontally - (enlarge-window-horizontally - (max 0 (- (or reftex-last-window-width (window-width)) - (window-width)))) - (enlarge-window - (max 0 (- (or reftex-last-window-height (window-height)) - (window-height)))))) + "Enlarge window to a remembered size." + (let ((count (if reftex-toc-split-windows-horizontally + (- (or reftex-last-window-width (window-width)) + (window-width)) + (- (or reftex-last-window-height (window-height)) + (window-height))))) + (when (> count 0) + (enlarge-window count reftex-toc-split-windows-horizontally)))) (defun reftex-toc-dframe-p (&optional frame error) ;; Check if FRAME is the dedicated TOC frame. === modified file 'lisp/textmodes/reftex-vars.el' --- lisp/textmodes/reftex-vars.el 2012-08-02 18:54:36 +0000 +++ lisp/textmodes/reftex-vars.el 2012-09-30 20:30:13 +0000 @@ -4,8 +4,6 @@ ;; Author: Carsten Dominik ;; Maintainer: auctex-devel@gnu.org -;; Version: 4.31 -;; Package: reftex ;; This file is part of GNU Emacs. @@ -207,6 +205,11 @@ (?p . "(%2a %y\\nocite{%l})"))) (locally "Full info in parenthesis" "(%2a %y, %j %v, %P, %e: %b, %u, %s %<)") + (context + "ConTeXt bib module" + ((?\C-m . "\\cite[%l]") + (?s . "\\cite[][%l]") + (?n . "\\nocite[%l]"))) ) "Builtin versions of the citation format. The following conventions are valid for all alist entries: @@ -239,7 +242,7 @@ "LaTeX label and citation support." :tag "RefTeX" :link '(url-link :tag "Home Page" - "http://staff.science.uva.nl/~dominik/Tools/reftex/") + "http://www.gnu.org/software/auctex/reftex.html") :link '(emacs-commentary-link :tag "Commentary in reftex.el" "reftex.el") :link '(custom-manual "(reftex)Top") :prefix "reftex-" @@ -261,8 +264,8 @@ (defcustom reftex-max-section-depth 12 "Maximum depth of section levels in document structure. -Standard LaTeX needs default is 7, but there are packages for which this -needs to be larger." +The default in standard LaTeX is 7, but there are packages for +which this needs to be larger." :group 'reftex-table-of-contents-browser :type 'integer) @@ -329,7 +332,7 @@ Value 'frame (the default) means, turn automatic recentering on only while the dedicated TOC frame does exist, and do the recentering only in that frame. So -when creating that frame (with \"d\" key in an ordinary TOC window), the +when creating that frame (with `d' key in an ordinary TOC window), the automatic recentering is turned on. When the frame gets destroyed, automatic recentering is turned off again. @@ -383,8 +386,8 @@ (defcustom reftex-toc-confirm-promotion 2 "Non-nil means, promotion/demotion commands first prompt for confirmation. -When nil, the command is executed immediately. When this is an integer -N, ask for confirmation only if N or more section commands are going to be +If nil, the command is executed immediately. If this is an integer N, +ask for confirmation only if N or more section commands are going to be changed." :group 'reftex-table-of-contents-browser :type '(choice @@ -408,7 +411,7 @@ (defcustom reftex-revisit-to-follow nil "Non-nil means, follow-mode will revisit files if necessary. -When nil, follow-mode will be suspended for stuff in unvisited files." +If nil, follow-mode will be suspended for stuff in unvisited files." :group 'reftex-table-of-contents-browser :group 'reftex-referencing-labels :type 'boolean) @@ -452,8 +455,8 @@ (defcustom reftex-label-alist nil "Alist with information on environments for \\label-\\ref use. -This docstring is easier to understand after reading the configuration -examples in `reftex.el'. Looking at the builtin defaults in the constant +This doc string is easier to understand after reading the configuration +examples in the manual. Looking at the builtin defaults in the constant `reftex-label-alist-builtin' may also be instructive. Set this variable to define additions and changes to the default. The only @@ -481,12 +484,11 @@ Special names: `section' for section labels, `any' to define a group which contains all labels. - This may also be a function to do local parsing and identify point - to be in a non-standard label environment. The function must take - an argument BOUND and limit backward searches to this value. It - should return either nil or a cons cell (FUNCTION . POSITION) with - the function symbol and the position where the special environment - starts. See the Info documentation for an example. + This may also be a function to do local parsing and identify point to + be in a non-standard label environment. The function must take an + argument BOUND and limit backward searches to this value. It should + return either nil or the position where the special environment starts. + See the Info documentation for an example. Finally this may also be nil if the entry is only meant to change some settings associated with the type indicator character (see below). @@ -500,7 +502,7 @@ `equation' and `eqnarray'). If the type indicator is nil and the macro has a label argument {*}, the macro defines neutral labels just like \\label. In this case - the reminder of this entry is ignored. + the remainder of this entry is ignored. LABEL-PREFIX Label prefix string, like \"tab:\". @@ -516,8 +518,8 @@ Example: In a file `intro.tex', \"eq:%f:\" will become \"eq:intro:\"). REFERENCE-FORMAT - Format string for reference insert in buffer. `%s' will be replaced by - the label. + Format string for reference insertion in buffer. `%s' will be replaced + by the label. When the format starts with `~', the `~' will only be inserted if there is not already a whitespace before point. @@ -533,7 +535,7 @@ - If an integer, use the nth argument of the macro. As a special case, 1000 means to get text after the last macro argument. - If a string, use as regexp to search *backward* from the label. Context - is then the text following the end of the match. E.g. putting this to + is then the text following the end of the match. E.g. setting this to \"\\\\\\\\caption[[{]\" will use the caption in a figure or table environment. \"\\\\\\\\begin{eqnarray}\\\\|\\\\\\\\\\\\\\\\\" works for eqnarrays. @@ -755,8 +757,7 @@ 3. Tell RefTeX to use this function - (setq reftex-special-environment-functions '(my-detect-linguex-list)) -" + (setq reftex-special-environment-functions '(my-detect-linguex-list))" :group 'reftex-defining-label-environments :type 'hook) @@ -820,11 +821,13 @@ :type 'symbol) (defcustom reftex-translate-to-ascii-function 'reftex-latin1-to-ascii - "Filter function which will process a context string before it is used -to derive a label from it. The intended application is to convert ISO or -Mule characters into something valid in labels. The default function -removes the accents from Latin-1 characters. X-Symbol (>=2.6) sets this -variable to the much more general `x-symbol-translate-to-ascii'." + "Filter function to convert a string to ASCII. +The function is used to process a context string before it is +used to derive a label from it. The intended application is to +convert ISO or Mule characters into something valid in labels. +The default function removes the accents from Latin-1 characters. +X-Symbol (>=2.6) sets this variable to the much more general +`x-symbol-translate-to-ascii'." :group 'reftex-making-and-inserting-labels :type 'symbol) @@ -947,28 +950,79 @@ :group 'reftex-referencing-labels :type '(repeat (cons (character) (string)))) +(defcustom reftex-ref-style-alist + '(("Default" t + (("\\ref" ?\C-m) ("\\pageref" ?p))) + ("Varioref" "varioref" + (("\\vref" ?v) ("\\vpageref" ?g) ("\\Vref" ?V) ("\\Ref" ?R))) + ("Fancyref" "fancyref" + (("\\fref" ?f) ("\\Fref" ?F))) + ("Hyperref" "hyperref" + (("\\autoref" ?a) ("\\autopageref" ?u)))) + "Alist of reference styles. +Each element is a list of the style name, the name of the LaTeX +package associated with the style or t for any package, and an +alist of macros where the first entry of each item is the +reference macro and the second a key for selecting the macro when +the macro type is being prompted for. (See also +`reftex-ref-macro-prompt'.) The keys, represented as characters, +have to be unique." + :group 'reftex-referencing-labels + :type '(alist :key-type (string :tag "Style name") + :value-type (group (choice :tag "Package" + (const :tag "Any package" t) + (string :tag "Name")) + (repeat :tag "Macros" + (group (string :tag "Macro") + (character :tag "Key")))))) + +(defcustom reftex-ref-macro-prompt t + "If non-nil, `reftex-reference' prompts for the reference macro." + :group 'reftex-referencing-labels + :type 'boolean) + (defcustom reftex-vref-is-default nil - "Non-nil means, the varioref macro \\vref is used as default. -In the selection buffer, the `v' key toggles the reference macro between -`\\ref' and `\\vref'. The value of this variable determines the default -which is active when entering the selection process. -Instead of nil or t, this may also be a string of type letters indicating -the label types for which it should be true." + "Non-nil means, the varioref reference style is used as default. +The value of this variable determines the default which is active +when entering the selection process. Instead of nil or t, this +may also be a string of type letters indicating the label types +for which it should be true. + +This variable is obsolete, use `reftex-ref-style-default-list' +instead." :group 'reftex-referencing-labels :type `(choice :tag "\\vref is default macro" ,@reftex-tmp)) ;;;###autoload(put 'reftex-vref-is-default 'safe-local-variable (lambda (x) (or (stringp x) (symbolp x)))) (defcustom reftex-fref-is-default nil - "Non-nil means, the fancyref macro \\fref is used as default. -In the selection buffer, the `V' key toggles the reference macro between -`\\ref', `\\fref' and `\\Fref'. The value of this variable determines -the default which is active when entering the selection process. -Instead of nil or t, this may also be a string of type letters indicating -the label types for which it should be true." + "Non-nil means, the fancyref reference style is used as default. +The value of this variable determines the default which is active +when entering the selection process. Instead of nil or t, this +may also be a string of type letters indicating the label types +for which it should be true. + +This variable is obsolete, use `reftex-ref-style-default-list' +instead." :group 'reftex-referencing-labels :type `(choice :tag "\\fref is default macro" ,@reftex-tmp)) ;;;###autoload(put 'reftex-fref-is-default 'safe-local-variable (lambda (x) (or (stringp x) (symbolp x)))) +(defcustom reftex-ref-style-default-list '("Default") + "List of reference styles to be activated by default. +The order is significant and controls the order in which macros +can be cycled in the buffer for selecting a label. The entries +in the list have to match the respective reference style names +used in the variable `reftex-ref-style-alist'." + :group 'reftex-referencing-labels + :type `(set ,@(mapcar (lambda (x) (list 'const (car x))) + reftex-ref-style-alist))) + +;; Compatibility with obsolete variables. +(when reftex-vref-is-default + (add-to-list 'reftex-ref-style-default-list "Varioref")) +(when reftex-fref-is-default + (add-to-list 'reftex-ref-style-default-list "Fancyref")) + (defcustom reftex-level-indent 2 "Number of spaces to be used for indentation per section level." :group 'reftex-referencing-labels @@ -987,19 +1041,22 @@ (defcustom reftex-format-ref-function nil "Function which produces the string to insert as a reference. -Normally should be nil, because the format to insert a reference can -already be specified in `reftex-label-alist'. -This hook also is used by the special commands to insert `\\vref' and `\\fref' -references, so even if you set this, your setting will be ignored by -the special commands. -The function will be called with two arguments, the LABEL and the DEFAULT -FORMAT, which normally is `~\\ref{%s}'. The function should return the -string to insert into the buffer." +Normally should be nil, because the format to insert a reference +can already be specified in `reftex-label-alist'. + +This hook also is used by the special commands to insert +e.g. `\\vref' and `\\fref' references, so even if you set this, +your setting will be ignored by the special commands. + +The function will be called with three arguments, the LABEL, the +DEFAULT FORMAT, which normally is `~\\ref{%s}' and the REFERENCE +STYLE. The function should return the string to insert into the +buffer." :group 'reftex-referencing-labels - :type 'function) + :type '(choice (const nil) function)) (defcustom reftex-select-label-mode-hook nil - "Mode hook for reftex-select-label-mode." + "Mode hook for `reftex-select-label-mode'." :group 'reftex-referencing-labels :type 'hook) @@ -1009,7 +1066,8 @@ "Support for referencing bibliographic data with BibTeX." :group 'reftex) -(defcustom reftex-bibliography-commands '("bibliography" "nobibliography") +(defcustom reftex-bibliography-commands + '("bibliography" "nobibliography" "setupbibtex\\[.*?database=") "LaTeX commands which specify the BibTeX databases to use with the document." :group 'reftex-citation-support :type '(repeat string)) @@ -1114,7 +1172,7 @@ (defcustom reftex-cite-prompt-optional-args 'maybe "Non-nil means, prompt for empty optional arguments in cite macros. -When an entry in `reftex-cite-format' ist given with square brackets to +When an entry in `reftex-cite-format' is given with square brackets to indicate optional arguments (for example \\cite[][]{%l}), RefTeX can prompt for values. Possible values are: @@ -1189,13 +1247,28 @@ DEFAULT FORMAT, which is taken from `reftex-cite-format'. The function should return the string to insert into the buffer." :group 'reftex-citation-support - :type 'function) + :type '(choice (const nil) function)) (defcustom reftex-select-bib-mode-hook nil "Mode hook for reftex-select-bib-mode." :group 'reftex-citation-support :type 'hook) +(defcustom reftex-cite-key-separator "," + "String to be used for separating several keys in a \\cite macro." + :group 'reftex-citation-support + :type 'string) + +(defcustom reftex-create-bibtex-header nil + "Header to insert in BibTeX files generated by RefTeX." + :group 'reftex-citation-support + :type 'string) + +(defcustom reftex-create-bibtex-footer nil + "Footer to insert in BibTeX files generated by RefTeX." + :group 'reftex-citation-support + :type 'string) + ;; Index Support Configuration (defgroup reftex-index-support nil @@ -1223,7 +1296,9 @@ (string :tag "ESCAPE char "))) (defcustom reftex-index-macros nil - "Macros which define index entries. The structure is + "Macros which define index entries. + +The structure is \(MACRO INDEX-TAG KEY PREFIX EXCLUDE REPEAT) @@ -1456,7 +1531,7 @@ This is used when `reftex-view-crossref' is called with point in an argument of a macro. Note that crossref viewing for citations, references (both ways) and index entries is hard-coded. This variable -is only to configure additional structures for which crossreference +is only to configure additional structures for which cross-reference viewing can be useful. Each entry has the structure \(MACRO-RE SEARCH-RE HIGHLIGHT). @@ -1499,15 +1574,17 @@ :type 'boolean) (defcustom reftex-cache-cite-echo t - "Non-nil means, the information displayed in the echo area for cite macros -is cached and even saved along with the parsing information. The cache -survives document scans. In order to clear it, use M-x reftex-reset-mode." + "Non-nil means, echoed information for cite macros is cached. +The information displayed in the echo area for cite macros is +cached and even saved along with the parsing information. The +cache survives document scans. In order to clear it, use M-x +reftex-reset-mode ." :group 'reftex-viewing-cross-references :type 'boolean) (defcustom reftex-display-copied-context-hook nil - "Normal Hook which is run before context is displayed anywhere. Designed -for X-Symbol, but may have other uses as well." + "Normal hook which is run before context is displayed anywhere. +Designed for X-Symbol, but may have other uses as well." :group 'reftex-viewing-cross-references :group 'reftex-referencing-labels :type 'hook) @@ -1690,7 +1767,7 @@ information. When this variable is t, - accessing the parsing information for the first time in an editing session will read that file (if available) instead of parsing the document. -- exiting Emacs or killing a buffer in reftex-mode will cause a new version +- exiting Emacs or killing a buffer in `reftex-mode' will cause a new version of the file to be written." :group 'reftex-optimizations-for-large-documents :type 'boolean) @@ -1855,22 +1932,13 @@ (defcustom reftex-extra-bindings nil "Non-nil means, make additional key bindings on startup. -These extra bindings are located in the -`reftex-extra-bindings-map' map, bound to -`reftex-extra-bindings-prefix'." - :group 'reftex-miscellaneous-configurations - :type 'boolean) - -;; below, default is C-c C-y because it is free in LaTeX mode. -(defcustom reftex-extra-bindings-prefix "\C-c\C-y" - "When `reftex-extra-bindings' is set to non-nil, use extra -bindings with this prefix bound to `reftex-extra-bindings-map'." +These extra bindings are located in the users `C-c letter' map." :group 'reftex-miscellaneous-configurations :type 'boolean) (defcustom reftex-plug-into-AUCTeX nil "Plug-in flags for AUCTeX interface. -This variable is a list of 4 boolean flags. When a flag is non-nil, +This variable is a list of 5 boolean flags. When a flag is non-nil, RefTeX will - supply labels in new sections and environments (flag 1) @@ -1900,8 +1968,7 @@ (boolean :tag "supply argument for macros like `\\label' ") (boolean :tag "supply argument for macros like `\\ref' ") (boolean :tag "supply argument for macros like `\\cite' ") - (boolean :tag "supply argument for macros like `\\index' ") - ))) + (boolean :tag "supply argument for macros like `\\index' ")))) (defcustom reftex-allow-detached-macro-args nil "Non-nil means, allow arguments of macros to be detached by whitespace. === modified file 'lisp/textmodes/reftex.el' --- lisp/textmodes/reftex.el 2012-09-24 11:39:33 +0000 +++ lisp/textmodes/reftex.el 2012-09-30 20:30:13 +0000 @@ -3,7 +3,6 @@ ;; Author: Carsten Dominik ;; Maintainer: auctex-devel@gnu.org -;; Version: 4.31 ;; Keywords: tex ;; This file is part of GNU Emacs. @@ -21,10 +20,8 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . -;;--------------------------------------------------------------------------- -;; ;;; Commentary: -;; + ;; RefTeX is a minor mode with distinct support for \ref, \label, \cite, ;; and \index commands in (multi-file) LaTeX documents. ;; - A table of contents provides easy access to any part of a document. @@ -34,243 +31,23 @@ ;; - Text phrases can be collected in a file, for later global indexing. ;; - The index preview buffer helps to check and edit index entries. ;; -;; -;; INSTALLATION -;; ------------ -;; -;; - If this file is part of an X/Emacs distribution, it is installed. -;; - For XEmacs 21.x, you need to install the RefTeX plug-in package -;; available from the XEmacs distribution sites. -;; - If you have downloaded this file from the maintainers webpage, follow -;; the instructions in the INSTALL file of the distribution. -;; -;; To turn RefTeX Mode on and off in a buffer, use `M-x reftex-mode'. -;; -;; To turn on RefTeX Mode for all LaTeX files, add the following lines -;; to your init file: -;; -;; (add-hook 'LaTeX-mode-hook 'turn-on-reftex) ; AUCTeX LaTeX mode -;; (add-hook 'latex-mode-hook 'turn-on-reftex) ; Emacs latex mode -;; -;; -;; DOCUMENTATION -;; ------------- -;; -;; See below for a short summary of how to use RefTeX. -;; -;; There is an extensive texinfo document describing RefTeX in detail. +;; There is an extensive Texinfo document describing RefTeX in detail. ;; One way to view this documentation is `M-x reftex-info RET'. ;; ;; The documentation in various formats is also available at ;; -;; http://zon.astro.uva.nl/~dominik/Tools/ -;; -;;--------------------------------------------------------------------------- -;; -;; Introduction -;; ************ -;; -;; RefTeX is a specialized package for support of labels, references, -;; citations, and the index in LaTeX. RefTeX wraps itself round 4 LaTeX -;; macros: `\label', `\ref', `\cite', and `\index'. Using these macros -;; usually requires looking up different parts of the document and -;; searching through BibTeX database files. RefTeX automates these -;; time-consuming tasks almost entirely. It also provides functions to -;; display the structure of a document and to move around in this -;; structure quickly. -;; -;; *Note Imprint::, for information about who to contact for help, bug -;; reports or suggestions. -;; -;; Environment -;; =========== -;; -;; RefTeX needs to access all files which are part of a multifile -;; document, and the BibTeX database files requested by the -;; `\bibliography' command. To find these files, RefTeX will require a -;; search path, i.e. a list of directories to check. Normally this list -;; is stored in the environment variables `TEXINPUTS' and `BIBINPUTS' -;; which are also used by RefTeX. However, on some systems these -;; variables do not contain the full search path. If RefTeX does not work -;; for you because it cannot find some files, read *Note Finding Files::. -;; -;; Entering RefTeX Mode -;; ==================== -;; -;; To turn RefTeX Mode on and off in a particular buffer, use `M-x -;; reftex-mode'. To turn on RefTeX Mode for all LaTeX files, add the -;; following lines to your init file: -;; -;; (add-hook 'LaTeX-mode-hook 'turn-on-reftex) ; with AUCTeX LaTeX mode -;; (add-hook 'latex-mode-hook 'turn-on-reftex) ; with Emacs latex mode -;; -;; RefTeX in a Nutshell -;; ==================== -;; -;; 1. Table of Contents -;; Typing `C-c =' (`reftex-toc') will show a table of contents of the -;; document. This buffer can display sections, labels and index -;; entries defined in the document. From the buffer, you can jump -;; quickly to every part of your document. Press `?' to get help. -;; -;; 2. Labels and References -;; RefTeX helps to create unique labels and to find the correct key -;; for references quickly. It distinguishes labels for different -;; environments, knows about all standard environments (and many -;; others), and can be configured to recognize any additional labeled -;; environments you have defined yourself (variable -;; `reftex-label-alist'). -;; -;; * Creating Labels -;; Type `C-c (' (`reftex-label') to insert a label at point. -;; RefTeX will either -;; - derive a label from context (default for section labels) -;; - prompt for a label string (default for figures and -;; tables) or -;; - insert a simple label made of a prefix and a number (all -;; other environments) -;; -;; Which labels are created how is configurable with the variable -;; `reftex-insert-label-flags'. -;; -;; * Referencing Labels -;; To make a reference, type `C-c )' (`reftex-reference'). This -;; shows an outline of the document with all labels of a certain -;; type (figure, equation,...) and some label context. -;; Selecting a label inserts a `\ref{LABEL}' macro into the -;; original buffer. -;; -;; 3. Citations -;; Typing `C-c [' (`reftex-citation') will let you specify a regular -;; expression to search in current BibTeX database files (as -;; specified in the `\bibliography' command) and pull out a list of -;; matches for you to choose from. The list is _formatted_ and -;; sorted. The selected article is referenced as `\cite{KEY}' (see -;; the variable `reftex-cite-format' if you want to insert different -;; macros). -;; -;; 4. Index Support -;; RefTeX helps to enter index entries. It also compiles all entries -;; into an alphabetically sorted `*Index*' buffer which you can use -;; to check and edit the entries. RefTeX knows about the standard -;; index macros and can be configured to recognize any additional -;; macros you have defined (`reftex-index-macros'). Multiple indices -;; are supported. -;; -;; * Creating Index Entries -;; To index the current selection or the word at point, type -;; `C-c /' (`reftex-index-selection-or-word'). The default macro -;; `reftex-index-default-macro' will be used. For a more -;; complex entry type `C-c <' (`reftex-index'), select any of -;; the index macros and enter the arguments with completion. -;; -;; * The Index Phrases File (Delayed Indexing) -;; Type `C-c \' (`reftex-index-phrase-selection-or-word') to add -;; the current word or selection to a special _index phrase -;; file_. RefTeX can later search the document for occurrences -;; of these phrases and let you interactively index the matches. -;; -;; * Displaying and Editing the Index -;; To display the compiled index in a special buffer, type `C-c -;; >' (`reftex-display-index'). From that buffer you can check -;; and edit all entries. -;; -;; 5. Viewing Cross-References -;; When point is on the KEY argument of a cross-referencing macro -;; (`\label', `\ref', `\cite', `\bibitem', `\index', and variations) -;; or inside a BibTeX database entry, you can press `C-c &' -;; (`reftex-view-crossref') to display corresponding locations in the -;; document and associated BibTeX database files. -;; When the enclosing macro is `\cite' or `\ref' and no other message -;; occupies the echo area, information about the citation or label -;; will automatically be displayed in the echo area. -;; -;; 6. Multifile Documents -;; Multifile Documents are fully supported. The included files must -;; have a file variable `TeX-master' or `tex-main-file' pointing to -;; the master file. RefTeX provides cross-referencing information -;; from all parts of the document, and across document borders -;; (`xr.sty'). -;; -;; 7. Document Parsing -;; RefTeX needs to parse the document in order to find labels and -;; other information. It does it automatically once and updates its -;; list internally when `reftex-label' and `reftex-index' are used. -;; To enforce reparsing, call any of the commands described above -;; with a raw `C-u' prefix, or press the `r' key in the label -;; selection buffer, the table of contents buffer, or the index -;; buffer. -;; -;; 8. AUCTeX -;; If your major LaTeX mode is AUCTeX, RefTeX can cooperate with it -;; (see variable `reftex-plug-into-AUCTeX'). AUCTeX contains style -;; files which trigger appropriate settings in RefTeX, so that for -;; many of the popular LaTeX packages no additional customizations -;; will be necessary. -;; -;; 9. Useful Settings -;; To make RefTeX faster for large documents, try these: -;; (setq reftex-enable-partial-scans t) -;; (setq reftex-save-parse-info t) -;; (setq reftex-use-multiple-selection-buffers t) -;; -;; To integrate with AUCTeX, use -;; (setq reftex-plug-into-AUCTeX t) -;; -;; To make your own LaTeX macro definitions known to RefTeX, -;; customize the variables -;; `reftex-label-alist' (for label macros/environments) -;; `reftex-section-levels' (for sectioning commands) -;; `reftex-cite-format' (for `\cite'-like macros) -;; `reftex-index-macros' (for `\index'-like macros) -;; `reftex-index-default-macro' (to set the default macro) -;; If you have a large number of macros defined, you may want to write -;; an AUCTeX style file to support them with both AUCTeX and RefTeX. -;; -;; 10. Where Next? -;; Go ahead and use RefTeX. Use its menus until you have picked up -;; the key bindings. For an overview of what you can do in each of -;; the different special buffers, press `?'. Read the manual if you -;; get stuck, of if you are curious what else might be available. -;; The first part of the manual explains in a tutorial way how to use -;; and customize RefTeX. The second part is a command and variable -;; reference. -;; -;;--------------------------------------------------------------------------- -;; -;; AUTHOR -;; ====== -;; -;; Carsten Dominik -;; -;; with contributions from Stephen Eglen +;; http://www.gnu.org/software/auctex/manual/reftex.index.html ;; ;; RefTeX is bundled with Emacs and available as a plug-in package for ;; XEmacs 21.x. If you need to install it yourself, you can find a ;; distribution at ;; -;; http://zon.astro.uva.nl/~dominik/Tools/ -;; -;; THANKS TO: -;; --------- -;; Thanks to the people on the Net who have used RefTeX and helped -;; developing it with their reports. In particular thanks to -;; -;; Fran Burstall, Alastair Burt, Soren Dayton, Stephen Eglen, -;; Karl Eichwalder, Peter Galbraith, Dieter Kraft, Kai Grossjohann, -;; Frank Harrell, Adrian Lanz, Rory Molinari, Stefan Monnier, -;; Laurent Mugnier, Sudeep Kumar Palat, Daniel Polani, Robin Socha, -;; Richard Stanton, Allan Strand, Jan Vroonhof, Christoph Wedler, -;; Alan Williams. -;; -;; Finally thanks to Uwe Bolick who first got me (some years ago) into -;; supporting LaTeX labels and references with an editor (which was -;; MicroEmacs at the time). -;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;;;;;; - +;; http://www.gnu.org/software/auctex/reftex.html +;; +;; RefTeX was written by Carsten Dominik with +;; contributions from Stephen Eglen. It is currently maintained by +;; the AUCTeX project. + ;;; Code: (eval-when-compile (require 'cl)) @@ -289,52 +66,13 @@ (set symbol value))) -;;; ========================================================================= -;;; -;;; Configuration variables - +;; Configuration variables (require 'reftex-vars) -;;; ========================================================================= -;;; -;;; Define the formal stuff for a minor mode named RefTeX. -;;; - -(defconst reftex-version "RefTeX version 4.31" - "Version string for RefTeX.") - -(defvar reftex-mode-map (make-sparse-keymap) - "Keymap for RefTeX mode.") - -(defvar reftex-mode-menu nil) -(defvar reftex-syntax-table nil) -(defvar reftex-syntax-table-for-bib nil) - -(unless reftex-syntax-table - (setq reftex-syntax-table (copy-syntax-table)) - (modify-syntax-entry ?\( "." reftex-syntax-table) - (modify-syntax-entry ?\) "." reftex-syntax-table)) - -(unless reftex-syntax-table-for-bib - (setq reftex-syntax-table-for-bib - (copy-syntax-table reftex-syntax-table)) - (modify-syntax-entry ?\' "." reftex-syntax-table-for-bib) - (modify-syntax-entry ?\" "." reftex-syntax-table-for-bib) - (modify-syntax-entry ?\[ "." reftex-syntax-table-for-bib) - (modify-syntax-entry ?\] "." reftex-syntax-table-for-bib)) - -;; The following definitions are out of place, but I need them here -;; to make the compilation of reftex-mode not complain. -(defvar reftex-auto-view-crossref-timer nil - "The timer used for auto-view-crossref.") -(defvar reftex-toc-auto-recenter-timer nil - "The idle timer used to recenter the toc window.") - -;;; ========================================================================= -;;; -;;; Parser functions - +;;; Autoloads + +;; Parser functions (autoload 'reftex-parse-one "reftex-parse" "Re-parse this file." t) (autoload 'reftex-parse-all "reftex-parse" @@ -358,11 +96,7 @@ (autoload 'reftex-ensure-index-support "reftex-parse") (autoload 'reftex-everything-regexp "reftex-parse") - -;;; ========================================================================= -;;; -;;; Labels and References - +;; Labels and References (autoload 'reftex-label-location "reftex-ref") (autoload 'reftex-label-info-update "reftex-ref") (autoload 'reftex-label-info "reftex-ref") @@ -381,10 +115,7 @@ (autoload 'reftex-goto-label "reftex-ref" "Prompt for label name and go to that location." t) -;;; ========================================================================= -;;; -;;; Table of contents - +;; Table of contents (autoload 'reftex-toc "reftex-toc" "Show the table of contents for the current document." t) (autoload 'reftex-toc-recenter "reftex-toc" @@ -392,10 +123,7 @@ (autoload 'reftex-toggle-auto-toc-recenter "reftex-toc" "Toggle automatic recentering of TOC window." t) -;;; ========================================================================= -;;; -;;; BibTeX citations. - +;; BibTeX citations. (autoload 'reftex-citep "reftex-cite") (autoload 'reftex-citet "reftex-cite") (autoload 'reftex-make-cite-echo-string "reftex-cite") @@ -409,10 +137,7 @@ (autoload 'reftex-bib-or-thebib "reftex-cite") (autoload 'reftex-create-bibtex-file "reftex-cite") -;;; ========================================================================= -;;; -;;; Selection - +;; Selection (autoload 'reftex-select-label-mode "reftex-sel") (autoload 'reftex-select-bib-mode "reftex-sel") (autoload 'reftex-find-start-point "reftex-sel") @@ -420,11 +145,7 @@ (autoload 'reftex-get-offset "reftex-sel") (autoload 'reftex-select-item "reftex-sel") - -;;; ========================================================================= -;;; -;;; Index support - +;; Index support (autoload 'reftex-index "reftex-index" "Query for an index macro and insert it along with its arguments." t) (autoload 'reftex-index-selection-or-word "reftex-index" @@ -442,11 +163,7 @@ (autoload 'reftex-index-show-entry "reftex-index") (autoload 'reftex-index-select-tag "reftex-index") - -;;; ========================================================================= -;;; -;;; View cross references - +;; View cross references (autoload 'reftex-view-crossref "reftex-dcr" "View cross reference of \\ref or \\cite macro at point." t) (autoload 'reftex-mouse-view-crossref "reftex-dcr" @@ -455,11 +172,7 @@ (autoload 'reftex-view-crossref-from-bibtex "reftex-dcr" "View location in a LaTeX document which cites the BibTeX entry at point." t) - -;;; ========================================================================= -;;; -;;; Operations on entire Multifile documents - +;; Operations on entire Multifile documents (autoload 'reftex-create-tags-file "reftex-global" "Create TAGS file by running `etags' on the current document." t) (autoload 'reftex-grep-document "reftex-global" @@ -477,11 +190,7 @@ (autoload 'reftex-save-all-document-buffers "reftex-global" "Save all documents associated with the current document." t) - -;;; ========================================================================= -;;; -;;; AUCTeX Interface - +;; AUCTeX Interface (autoload 'reftex-arg-label "reftex-auc") (autoload 'reftex-arg-cite "reftex-auc") (autoload 'reftex-arg-index-tag "reftex-auc") @@ -494,6 +203,41 @@ (autoload 'reftex-add-section-levels "reftex-auc") (autoload 'reftex-notice-new-section "reftex-auc") + +;;; ========================================================================= +;;; +;;; Define the formal stuff for a minor mode named RefTeX. +;;; + +(defconst reftex-version emacs-version + "Version string for RefTeX.") + +(defvar reftex-mode-map (make-sparse-keymap) + "Keymap for RefTeX mode.") + +(defvar reftex-mode-menu nil) +(defvar reftex-syntax-table nil) +(defvar reftex-syntax-table-for-bib nil) + +(unless reftex-syntax-table + (setq reftex-syntax-table (copy-syntax-table)) + (modify-syntax-entry ?\( "." reftex-syntax-table) + (modify-syntax-entry ?\) "." reftex-syntax-table)) + +(unless reftex-syntax-table-for-bib + (setq reftex-syntax-table-for-bib (copy-syntax-table)) + (modify-syntax-entry ?\' "." reftex-syntax-table-for-bib) + (modify-syntax-entry ?\" "." reftex-syntax-table-for-bib) + (modify-syntax-entry ?\[ "." reftex-syntax-table-for-bib) + (modify-syntax-entry ?\] "." reftex-syntax-table-for-bib)) + +;; The following definitions are out of place, but I need them here +;; to make the compilation of reftex-mode not complain. +(defvar reftex-auto-view-crossref-timer nil + "The timer used for auto-view-crossref.") +(defvar reftex-toc-auto-recenter-timer nil + "The idle timer used to recenter the toc window.") + ;;;###autoload (defun turn-on-reftex () "Turn on RefTeX mode." @@ -503,13 +247,7 @@ (put 'reftex-mode :menu-tag "RefTeX Mode") ;;;###autoload (define-minor-mode reftex-mode - "Toggle RefTeX mode. -With a prefix argument ARG, enable RefTeX mode if ARG is -positive, and disable it otherwise. If called from Lisp, enable -the mode if ARG is omitted or nil. - -RefTeX mode is a buffer-local minor mode with distinct support -for \\label, \\ref and \\cite in LaTeX. + "Minor mode with distinct support for \\label, \\ref and \\cite in LaTeX. \\A Table of Contents of the entire (multifile) document with browsing capabilities is available with `\\[reftex-toc]'. @@ -559,8 +297,7 @@ (modify-syntax-entry ?\( "." reftex-syntax-table) (modify-syntax-entry ?\) "." reftex-syntax-table) - (setq reftex-syntax-table-for-bib - (copy-syntax-table reftex-syntax-table)) + (setq reftex-syntax-table-for-bib (copy-syntax-table)) (modify-syntax-entry ?\' "." reftex-syntax-table-for-bib) (modify-syntax-entry ?\" "." reftex-syntax-table-for-bib) (modify-syntax-entry ?\[ "." reftex-syntax-table-for-bib) @@ -635,16 +372,15 @@ (incf reftex-multifile-index)) (defun reftex-tie-multifile-symbols () - ;; Tie the buffer-local symbols to globals connected with the master file. - ;; If the symbols for the current master file do not exist, they are created. - + "Tie the buffer-local symbols to globals connected with the master file. +If the symbols for the current master file do not exist, they are created." (let* ((master (file-truename (reftex-TeX-master-file))) (index (assoc master reftex-master-index-list)) (symlist reftex-multifile-symbols) symbol symname newflag) ;; Find the correct index. (if index - ;; symbols do exist + ;; Symbols do exist (setq index (cdr index)) ;; Get a new index and add info to the alist. (setq index (reftex-next-multifile-index) @@ -661,13 +397,15 @@ ;; Initialize if new symbols. (when newflag (set (symbol-value symbol) nil) - (put (symbol-value symbol) 'reftex-index-macros-style '(default)))) + (put (symbol-value symbol) 'reftex-index-macros-style '(default)) + (put (symbol-value symbol) 'reftex-ref-style-list + reftex-ref-style-default-list))) ;; Return t if the symbols did already exist, nil when we've made them. (not newflag))) (defun reftex-untie-multifile-symbols () - ;; Remove ties from multifile symbols, so that next use makes new ones. + "Remove ties from multifile symbols, so that next use makes new ones." (let ((symlist reftex-multifile-symbols) (symbol nil)) (while symlist @@ -761,7 +499,7 @@ This function makes it possible to support RefTeX from AUCTeX style files. The entries in ENTRY-LIST will be processed after the user settings in `reftex-index-entries', and before the defaults. Any changes made to -`reftex-label-alist-style' will raise a flag to the effect that +`reftex-index-macros-style' will raise a flag to the effect that the label information is recompiled on next use." (unless reftex-docstruct-symbol (reftex-tie-multifile-symbols)) @@ -783,6 +521,52 @@ (when changed (put reftex-docstruct-symbol 'reftex-index-macros-style list))))) +(defun reftex-ref-style-activate (style) + "Activate the referencing style STYLE." + (reftex-ref-style-toggle style 'activate)) + +(defun reftex-ref-style-toggle (style &optional action) + "Activate or deactivate the referencing style STYLE. +With the optional argument ACTION a certain action can be forced. +The symbol `activate' will activate the style and `deactivate' +will deactivate it." + (unless reftex-docstruct-symbol + (reftex-tie-multifile-symbols)) + (when (and reftex-docstruct-symbol + (symbolp reftex-docstruct-symbol)) + (let ((list (get reftex-docstruct-symbol 'reftex-ref-style-list)) + changed) + (cond ((eq action 'activate) + (unless (member style list) + (setq reftex-tables-dirty t + changed t) + (add-to-list 'list style t))) + ((eq action 'deactivate) + (when (member style list) + (setq reftex-tables-dirty t + changed t) + (delete style list))) + (t + (if (member style list) + (delete style list) + (add-to-list 'list style t)) + (setq reftex-tables-dirty t + changed t))) + (when changed + (put reftex-docstruct-symbol 'reftex-ref-style-list list))))) + +(defun reftex-ref-style-list () + "Return the list of referencing styles to be active at the moment." + ;; Initialize the value of `reftex-ref-style-list' and tie it to the + ;; docstruct symbol if necessary. + (unless reftex-docstruct-symbol + (reftex-tie-multifile-symbols)) + (if (and reftex-docstruct-symbol + (symbolp reftex-docstruct-symbol) + (get reftex-docstruct-symbol 'reftex-ref-style-list)) + (get reftex-docstruct-symbol 'reftex-ref-style-list) + reftex-ref-style-default-list)) + ;;; ========================================================================= ;;; ;;; Functions to compile the tables, reset the mode etc. @@ -1282,8 +1066,8 @@ ;; Calculate the regular expressions (let* ( ; (wbol "\\(\\`\\|[\n\r]\\)[ \t]*") - (wbol "\\(^\\)[ \t]*") ; Need to keep the empty group because - ;;; because match number are hard coded + (wbol "\\(^\\)[ \t]*") ; Need to keep the empty group because + ; match numbers are hard coded (label-re (concat "\\(?:" ;; Normal \label{...} "\\\\label{\\([^}]*\\)}" @@ -1299,10 +1083,16 @@ reftex-include-file-commands "\\|") "\\)[{ \t]+\\([^} \t\n\r]+\\)")) (section-re + ;; Including `\' as a character to be matched at the end + ;; of the regexp will allow stuff like + ;; \begin{foo}\label{bar} to be matched. This will make + ;; the parser to advance one char too much. Therefore + ;; `reftex-parse-from-file' will step one char back if a + ;; section is found. (concat wbol "\\\\\\(" (mapconcat (lambda (x) (regexp-quote (car x))) reftex-section-levels-all "\\|") - "\\)\\*?\\(\\[[^]]*\\]\\)?[[{ \t\r\n]")) + "\\)\\*?\\(\\[[^]]*\\]\\)?[[{ \t\r\n\\]")) (appendix-re (concat wbol "\\(\\\\appendix\\)")) (macro-re (if macros-with-labels @@ -1780,9 +1570,18 @@ "In unfinished selection process. Finish, or abort with \\[abort-recursive-edit]")))) (defun reftex-in-comment () + "Return non-nil if point is in a comment." (save-excursion - (skip-chars-backward "^%\n\r") - (eq (preceding-char) ?%))) + (save-match-data + (let ((pos (point))) + (beginning-of-line) + (re-search-forward + (or comment-start-skip + ;; The parser may open files in fundamental mode if + ;; `reftex-initialize-temporary-buffers' is nil, so here + ;; is a default suitable for plain TeX and LaTeX. + "\\(\\(^\\|[^\\\n]\\)\\(\\\\\\\\\\)*\\)\\(%+[ \t]*\\)") + pos t))))) (defun reftex-no-props (string) ;; Return STRING with all text properties removed @@ -1996,6 +1795,7 @@ (condition-case nil (scroll-down) (error nil)) (message "%s" prompt)) (t (message "") + (reftex-kill-buffer "*RefTeX Select*") (throw 'exit char))) (setq char (read-char-exclusive))))))) @@ -2123,25 +1923,95 @@ (setq list (cdr list))) (nreverse rtn))) -(defun reftex-uniquify (list) - ;; Return a list of all elements in LIST, but each only once, keeping order - (let (new elm) - (while list - (setq elm (pop list)) - (unless (member elm new) - (push elm new))) - (nreverse new))) +(defun reftex-uniquify (list &optional sort) + ;; Return a list of all strings in LIST, but each only once, keeping order + ;; unless SORT is set (faster!). + (setq list (copy-sequence list)) + (if sort + (progn + (setq list (sort list 'string<)) + (let ((p list)) + (while (cdr p) + (if (string= (car p) (car (cdr p))) + (setcdr p (cdr (cdr p))) + (setq p (cdr p))))) + list) + (let ((p list) lst elt) + ;; push all sublists into lst in reverse(!) order + (while p + (push p lst) + (setq p (cdr p))) + ;; sort all sublists + (setq lst (sort lst (lambda (x1 x2) (string< (car x1) (car x2))))) + (while (cdr lst) + (setq elt (car (car lst))) + ;; for equal elements in the sorted sublist, replace the + ;; last(!) original list member with nil + (when (string= elt (car (cadr lst))) + (setcar (pop lst) nil) + (while (and (cdr lst) (string= elt (car (cadr lst)))) + (setcar (pop lst) nil))) + (pop lst))) + ;; weed out all nils and return. + (delq nil list))) -(defun reftex-uniquify-by-car (alist &optional keep-list) +(defun reftex-uniquify-by-car (alist &optional keep-list sort) ;; Return a list of all elements in ALIST, but each car only once. ;; Elements of KEEP-LIST are not removed even if duplicate. - (let (new elm) - (while alist - (setq elm (pop alist)) - (if (or (member (car elm) keep-list) - (not (assoc (car elm) new))) - (push elm new))) - (nreverse new))) + ;; The order is kept unless SORT is set (faster!). + (setq keep-list (sort (copy-sequence keep-list) #'string<) + alist (copy-sequence alist)) + (if sort + (let (lst elt) + (setq alist (sort alist (lambda(a b) (string< (car a) (car b))))) + (setq lst alist) + (while (cdr lst) + (setq elt (car (car lst))) + (when (string= elt (car (cadr lst))) + (while (and keep-list (string< (car keep-list) elt)) + (pop keep-list)) + (if (and keep-list (string= elt (car keep-list))) + (progn + (pop lst) + (while (and (cdr lst) + (string= elt (car (cadr lst)))) + (pop lst))) + (setcdr lst (cdr (cdr lst))) + (while (and (cdr lst) + (string= elt (car (cadr lst)))) + (setcdr lst (cdr (cdr lst)))))) + (pop lst)) + alist) + (let ((p alist) lst elt) + (while p + (push p lst) + (setq p (cdr p))) + (setq lst (sort lst (lambda(a b) (string< (car (car a)) + (car (car b)))))) + (while (cdr lst) + (setq elt (car (car (car lst)))) + (when (string= elt (car (car (cadr lst)))) + (while (and keep-list (string< (car keep-list) elt)) + (pop keep-list)) + (if (and keep-list (string= elt (car keep-list))) + (progn + (pop lst) + (while (and (cdr lst) + (string= elt (car (car (cadr lst))))) + (pop lst))) + (setcar (pop lst) nil) + (while (and (cdr lst) + (string= elt (car (car (cadr lst))))) + (setcar (pop lst) nil)))) + (pop lst))) + (delq nil alist))) + +(defun reftex-remove-if (predicate list) + "Nondestructively remove all items from LIST which satisfy PREDICATE." + (let (result) + (dolist (elt list (nreverse result)) + (unless (funcall predicate elt) + (push elt result))))) (defun reftex-abbreviate-title (string) (reftex-convert-string string "[-~ \t\n\r,;]" nil t t @@ -2243,6 +2113,7 @@ ((= (length text) 0) (make-string 1 ?\ )) (t text))) + ;;; ========================================================================= ;;; ;;; Fontification and Highlighting @@ -2390,28 +2261,20 @@ "bibtex" '(define-key bibtex-mode-map "\C-c&" 'reftex-view-crossref-from-bibtex)) -;; If the user requests so, she can have a few more bindings: ;; For most of these commands there are already bindings in place. ;; Setting `reftex-extra-bindings' really is only there to spare users ;; the hassle of defining bindings in the user space themselves. This ;; is why they violate the key binding recommendations. -(defvar reftex-extra-bindings-map - (let ((map (make-sparse-keymap))) - (define-key map "t" 'reftex-toc) - (define-key map "l" 'reftex-label) - (define-key map "r" 'reftex-reference) - (define-key map "c" 'reftex-citation) - (define-key map "v" 'reftex-view-crossref) - (define-key map "g" 'reftex-grep-document) - (define-key map "s" 'reftex-search-document) - map) - "Reftex extra bindings map") - (when reftex-extra-bindings - (define-key reftex-mode-map - reftex-extra-bindings-prefix - reftex-extra-bindings-map)) - + (loop for x in + '(("\C-ct" . reftex-toc) + ("\C-cl" . reftex-label) + ("\C-cr" . reftex-reference) + ("\C-cc" . reftex-citation) + ("\C-cv" . reftex-view-crossref) + ("\C-cg" . reftex-grep-document) + ("\C-cs" . reftex-search-document)) + do (define-key reftex-mode-map (car x) (cdr x)))) ;;; ========================================================================= ;;; @@ -2488,21 +2351,22 @@ :style radio :selected (eq reftex-auto-view-crossref 'window)] "--" "MISC" - ["AUC TeX Interface" reftex-toggle-plug-into-AUCTeX + ["AUCTeX Interface" reftex-toggle-plug-into-AUCTeX :style toggle :selected reftex-plug-into-AUCTeX] ["isearch whole document" reftex-isearch-minor-mode :style toggle :selected reftex-isearch-minor-mode]) ("Reference Style" - ["Default" (setq reftex-vref-is-default nil - reftex-fref-is-default nil) - :style radio :selected (not (or reftex-vref-is-default - reftex-fref-is-default))] - ["Varioref" (setq reftex-vref-is-default t - reftex-fref-is-default nil) - :style radio :selected reftex-vref-is-default] - ["Fancyref" (setq reftex-fref-is-default t - reftex-vref-is-default nil) - :style radio :selected reftex-fref-is-default]) + ,@(let (list item) + (dolist (elt reftex-ref-style-alist) + (setq elt (car elt) + item (vector + elt + `(reftex-ref-style-toggle ,elt) + :style 'toggle + :selected `(member ,elt (reftex-ref-style-list)))) + (unless (member item list) + (add-to-list 'list item t))) + list)) ("Citation Style" ,@(mapcar (lambda (x) @@ -2568,6 +2432,9 @@ (message "\"Ref\"-menu now contains full customization menu")) (error "Cannot expand menu (outdated version of cus-edit.el)"))) + +;;; Misc + (defun reftex-show-commentary () "Use the finder to view the file documentation from `reftex.el'." (interactive) @@ -2579,6 +2446,36 @@ (interactive) (info (format "(reftex)%s" (or node "")))) +(defun reftex-report-bug () + "Report a bug in RefTeX. + +Don't hesitate to report any problems or inaccurate documentation. + +If you don't have setup sending mail from (X)Emacs, please copy the +output buffer into your mail program, as it gives us important +information about your RefTeX version and configuration." + (interactive) + (require 'reporter) + (let ((reporter-prompt-for-summary-p "Bug report subject: ")) + (reporter-submit-bug-report + "bug-auctex@gnu.org" + reftex-version + (list 'window-system + 'reftex-plug-into-AUCTeX) + nil nil + "Remember to cover the basics, that is, what you expected to happen and +what in fact did happen. + +Check if the bug is reproducable with an up-to-date version of +RefTeX available from http://www.gnu.org/software/auctex/. + +If the bug is triggered by a specific \(La\)TeX file, you should try +to produce a minimal sample file showing the problem and include it +in your report. + +Your bug report will be posted to the AUCTeX bug reporting list. +------------------------------------------------------------------------"))) + ;;; Install the kill-buffer and kill-emacs hooks ------------------------------ (add-hook 'kill-buffer-hook 'reftex-kill-buffer-hook) @@ -2594,6 +2491,4 @@ (setq reftex-tables-dirty t) ; in case this file is evaluated by hand (provide 'reftex) -;;;============================================================================ - ;;; reftex.el ends here ------------------------------------------------------------ revno: 110292 committer: Fabián Ezequiel Gallina branch nick: trunk timestamp: Sun 2012-09-30 17:16:12 -0300 message: Added missing ChangeLog entry for previous commit. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-30 16:54:43 +0000 +++ lisp/ChangeLog 2012-09-30 20:16:12 +0000 @@ -1,3 +1,10 @@ +2012-09-30 Fabián Ezequiel Gallina + + Enhancements for triple-quote string syntax. + * progmodes/python.el (python-syntax-propertize-function): Match + both quote cases in one regexp. + (python-syntax-stringify): Handle matches properly. + 2012-09-30 Juri Linkov * arc-mode.el (archive-summarize): Let-bind `buffer-file-truename' ------------------------------------------------------------ revno: 110291 committer: Fabián Ezequiel Gallina branch nick: trunk timestamp: Sun 2012-09-30 17:14:02 -0300 message: Enhancements for triple-quote string syntax. * progmodes/python.el (python-syntax-propertize-function): Match both quote cases in one regexp. (python-syntax-stringify): Handle matches properly. diff: === modified file 'lisp/progmodes/python.el' --- lisp/progmodes/python.el 2012-09-24 23:15:40 +0000 +++ lisp/progmodes/python.el 2012-09-30 20:14:02 +0000 @@ -499,17 +499,17 @@ (defconst python-syntax-propertize-function (syntax-propertize-rules ((rx - ;; Match even number of backslashes. - (or (not (any ?\\ ?\' ?\")) point) (* ?\\ ?\\) - ;; Match single or triple quotes of any kind. - (group (or "\"" "\"\"\"" "'" "'''"))) - (1 (ignore (python-syntax-stringify)))) - ((rx - ;; Match odd number of backslashes. - (or (not (any ?\\)) point) ?\\ (* ?\\ ?\\) - ;; Followed by even number of equal quotes. - (group (or "\"\"" "\"\"\"\"" "''" "''''"))) - (1 (ignore (python-syntax-stringify)))))) + (or (and + ;; Match even number of backslashes. + (or (not (any ?\\ ?\' ?\")) point) (* ?\\ ?\\) + ;; Match single or triple quotes of any kind. + (group (or "\"" "\"\"\"" "'" "'''"))) + (and + ;; Match odd number of backslashes. + (or (not (any ?\\)) point) ?\\ (* ?\\ ?\\) + ;; Followed by even number of equal quotes. + (group (or "\"\"" "\"\"\"\"" "''" "''''"))))) + (0 (ignore (python-syntax-stringify)))))) (defsubst python-syntax-count-quotes (quote-char &optional point limit) "Count number of quotes around point (max is 3). @@ -526,7 +526,8 @@ (defun python-syntax-stringify () "Put `syntax-table' property correctly on single/triple quotes." (let* ((num-quotes - (let ((n (length (match-string-no-properties 1)))) + (let ((n (length (or (match-string-no-properties 1) + (match-string-no-properties 2))))) ;; This corrects the quote count when matching odd number ;; of backslashes followed by even number of quotes. (or (and (= 1 (logand n 1)) n) (1- n)))) ------------------------------------------------------------ revno: 110290 committer: Stefan Monnier branch nick: trunk timestamp: Sun 2012-09-30 16:06:20 -0400 message: * src/.gdbinit (xbacktrace): Adjust to recent "struct backtrace" change. diff: === modified file 'src/.gdbinit' --- src/.gdbinit 2012-09-23 17:34:30 +0000 +++ src/.gdbinit 2012-09-30 20:06:20 +0000 @@ -1121,15 +1121,15 @@ define xbacktrace set $bt = backtrace_list while $bt - xgettype (*$bt->function) + xgettype ($bt->function) if $type == Lisp_Symbol - xprintsym (*$bt->function) + xprintsym ($bt->function) printf " (0x%x)\n", $bt->args else - xgetptr *$bt->function + xgetptr $bt->function printf "0x%x ", $ptr if $type == Lisp_Vectorlike - xgetptr (*$bt->function) + xgetptr ($bt->function) set $size = ((struct Lisp_Vector *) $ptr)->header.size if ($size & PSEUDOVECTOR_FLAG) output (enum pvec_type) (($size & PVEC_TYPE_MASK) >> PSEUDOVECTOR_SIZE_BITS) === modified file 'src/ChangeLog' --- src/ChangeLog 2012-09-30 15:49:05 +0000 +++ src/ChangeLog 2012-09-30 20:06:20 +0000 @@ -1,10 +1,14 @@ +2012-09-30 Stefan Monnier + + * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change. + 2012-09-30 Eli Zaretskii Support atimers and CPU profiler via profile.c on MS-Windows. * w32proc.c (sig_mask, crit_sig): New static variables. (sys_signal): Support SIGALRM and SIGPROF. (sigemptyset, sigaddset, sigfillset, sigprocmask) - (pthread_sigmask, setpgrp): Moved here from w32.c. sigaddset, + (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset, sigfillset, and sigprocmask are no longer no-ops. (sigismember): New function. (struct itimer_data): New definition. @@ -26,8 +30,8 @@ to hourglass timer expiration. (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY): Remove, no longer used. - (w32_note_current_window, show_hourglass, hide_hourglass): New - functions, in support of hourglass cursor display similar to other + (w32_note_current_window, show_hourglass, hide_hourglass): + New functions, in support of hourglass cursor display similar to other window systems. (syms_of_w32fns): Don't initialize hourglass_timer. ------------------------------------------------------------ revno: 110289 fixes bug: http://debbugs.gnu.org/2295 committer: Juri Linkov branch nick: trunk timestamp: Sun 2012-09-30 19:54:43 +0300 message: * lisp/arc-mode.el (archive-summarize): Let-bind `buffer-file-truename' to nil around the call to `add-text-properties' to prevent directory time modification by lock_file. * lisp/tar-mode.el (tar-summarize-buffer): Idem. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-30 16:36:42 +0000 +++ lisp/ChangeLog 2012-09-30 16:54:43 +0000 @@ -1,5 +1,12 @@ 2012-09-30 Juri Linkov + * arc-mode.el (archive-summarize): Let-bind `buffer-file-truename' + to nil around the call to `add-text-properties' to prevent + directory time modification by lock_file. (Bug#2295) + * tar-mode.el (tar-summarize-buffer): Idem. + +2012-09-30 Juri Linkov + * facemenu.el (list-colors-sort): Add option "Luminance". (list-colors-sort-key): Implement it. @@ -2686,8 +2693,9 @@ * register.el (copy-to-register, copy-rectangle-to-register): Deactivate the mark, and use indicate-copied-region (Bug#10056). - (append-to-register, prepend-to-register): - Call 2012-07-29 Juri Linkov + (append-to-register, prepend-to-register): Call indicate-copied-region. + +2012-07-29 Juri Linkov * simple.el (async-shell-command-buffer): New defcustom. (shell-command): Use it. (Bug#4719) === modified file 'lisp/arc-mode.el' --- lisp/arc-mode.el 2012-09-28 16:38:07 +0000 +++ lisp/arc-mode.el 2012-09-30 16:54:43 +0000 @@ -787,7 +787,8 @@ Optional argument SHUT-UP, if non-nil, means don't print messages when parsing the archive." (widen) - (let ((inhibit-read-only t)) + (let ((buffer-file-truename nil) ; avoid changing dir mtime by lock_file + (inhibit-read-only t)) (setq archive-proper-file-start (copy-marker (point-min) t)) (set (make-local-variable 'change-major-mode-hook) 'archive-desummarize) (or shut-up === modified file 'lisp/tar-mode.el' --- lisp/tar-mode.el 2012-08-13 10:34:25 +0000 +++ lisp/tar-mode.el 2012-09-30 16:54:43 +0000 @@ -518,12 +518,13 @@ (progress-reporter-done progress-reporter) (message "Warning: premature EOF parsing tar file")) (goto-char (point-min)) - (let ((inhibit-read-only t) + (let ((buffer-file-truename nil) ; avoid changing dir mtime by lock_file + (inhibit-read-only t) (total-summaries (mapconcat 'tar-header-block-summarize tar-parse-info "\n"))) - (insert total-summaries "\n")) - (goto-char (point-min)) - (restore-buffer-modified-p modified))) + (insert total-summaries "\n") + (goto-char (point-min)) + (restore-buffer-modified-p modified)))) (defvar tar-mode-map (let ((map (make-keymap))) ------------------------------------------------------------ revno: 110288 fixes bug: http://debbugs.gnu.org/10181 committer: Juri Linkov branch nick: trunk timestamp: Sun 2012-09-30 19:36:42 +0300 message: * lisp/facemenu.el (list-colors-sort): Add option "Luminance". (list-colors-sort-key): Implement it. * lisp/vc/diff-mode.el (diff-refine-removed): * lisp/vc/ediff-init.el (ediff-fine-diff-A): * lisp/vc/smerge-mode.el (smerge-refined-removed): Change background color "#ffaaaa" to "#ffbbbb". diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-30 13:43:47 +0000 +++ lisp/ChangeLog 2012-09-30 16:36:42 +0000 @@ -1,3 +1,13 @@ +2012-09-30 Juri Linkov + + * facemenu.el (list-colors-sort): Add option "Luminance". + (list-colors-sort-key): Implement it. + + * vc/diff-mode.el (diff-refine-removed): + * vc/ediff-init.el (ediff-fine-diff-A): + * vc/smerge-mode.el (smerge-refined-removed): + Change background color "#ffaaaa" to "#ffbbbb". (Bug#10181) + 2012-09-30 Jan Djärv * term/ns-win.el (x-file-dialog): New function. === modified file 'lisp/facemenu.el' --- lisp/facemenu.el 2012-05-04 05:14:14 +0000 +++ lisp/facemenu.el 2012-09-30 16:36:42 +0000 @@ -464,7 +464,8 @@ `(rgb-dist . COLOR)' sorts by the RGB distance to the specified color. `hsv' sorts by hue, saturation, value. `(hsv-dist . COLOR)' sorts by the HSV distance to the specified color -and excludes grayscale colors." +and excludes grayscale colors. +`luminance' sorts by relative luminance in the CIE XYZ color space." :type '(choice (const :tag "Unsorted" nil) (const :tag "Color Name" name) (const :tag "Red-Green-Blue" rgb) @@ -474,7 +475,8 @@ (const :tag "Hue-Saturation-Value" hsv) (cons :tag "Distance on HSV cylinder" (const :tag "Distance from Color" hsv-dist) - (color :tag "Source Color Name"))) + (color :tag "Source Color Name")) + (const :tag "Luminance" luminance)) :group 'facemenu :version "24.1") @@ -504,7 +506,12 @@ (+ (expt (- 180 (abs (- 180 (abs (- (nth 0 c-hsv) ; wrap hue (nth 0 o-hsv)))))) 2) (expt (- (nth 1 c-hsv) (nth 1 o-hsv)) 2) - (expt (- (nth 2 c-hsv) (nth 2 o-hsv)) 2))))))) + (expt (- (nth 2 c-hsv) (nth 2 o-hsv)) 2))))) + ((eq list-colors-sort 'luminance) + (let ((c-rgb (color-name-to-rgb color))) + (+ (* (nth 0 c-rgb) 0.21266729) + (* (nth 1 c-rgb) 0.7151522) + (* (nth 2 c-rgb) 0.0721750)))))) (defun list-colors-display (&optional list buffer-name callback) "Display names of defined colors, and show what they look like. === modified file 'lisp/vc/diff-mode.el' --- lisp/vc/diff-mode.el 2012-09-10 14:40:13 +0000 +++ lisp/vc/diff-mode.el 2012-09-30 16:36:42 +0000 @@ -1899,7 +1899,7 @@ '((default :inherit diff-refine-change) (((class color) (min-colors 88) (background light)) - :background "#ffaaaa") + :background "#ffbbbb") (((class color) (min-colors 88) (background dark)) :background "#aa2222")) "Face used for removed characters shown by `diff-refine-hunk'." === modified file 'lisp/vc/ediff-init.el' --- lisp/vc/ediff-init.el 2012-09-25 04:13:02 +0000 +++ lisp/vc/ediff-init.el 2012-09-30 16:36:42 +0000 @@ -979,7 +979,7 @@ (defface ediff-fine-diff-A (if (featurep 'emacs) '((((class color) (min-colors 88) (background light)) - :background "#ffaaaa") + :background "#ffbbbb") (((class color) (min-colors 88) (background dark)) :background "#aa2222") (((class color) (min-colors 16)) === modified file 'lisp/vc/smerge-mode.el' --- lisp/vc/smerge-mode.el 2012-08-15 16:29:11 +0000 +++ lisp/vc/smerge-mode.el 2012-09-30 16:36:42 +0000 @@ -132,7 +132,7 @@ '((default :inherit smerge-refined-change) (((class color) (min-colors 88) (background light)) - :background "#ffaaaa") + :background "#ffbbbb") (((class color) (min-colors 88) (background dark)) :background "#aa2222") (t :inverse-video t)) ------------------------------------------------------------ revno: 110287 committer: Eli Zaretskii branch nick: trunk timestamp: Sun 2012-09-30 17:49:05 +0200 message: Support atimers and CPU profiler via profile.c on MS-Windows. src/w32proc.c (sig_mask, crit_sig): New static variables. (sys_signal): Support SIGALRM and SIGPROF. (sigemptyset, sigaddset, sigfillset, sigprocmask) (pthread_sigmask, setpgrp): Moved here from w32.c. sigaddset, sigfillset, and sigprocmask are no longer no-ops. (sigismember): New function. (struct itimer_data): New definition. (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real) (crit_prof): New static variables. (MAX_SINGLE_SLEEP): New definition. (timer_loop, stop_timer_thread, term_timers, init_timers) (start_timer_thread, getitimer, setitimer): New functions. (alarm): No longer a no-op, calls setitimer. src/w32.c (term_ntproc): Call term_timers. (init_ntproc): Make sure all signals are unblocked at startup, to erase any traces of dumping. Call init_timers. src/w32fns.c (hourglass_timer, HOURGLASS_ID): Remove. Windows-specific code to display the hourglass mouse pointer is no longer used. (w32_wnd_proc): Remove code that handled the WM_TIMER message due to hourglass timer expiration. (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY): Remove, no longer used. (w32_note_current_window, show_hourglass, hide_hourglass): New functions, in support of hourglass cursor display similar to other window systems. (syms_of_w32fns): Don't initialize hourglass_timer. src/xdisp.c (start_hourglass, cancel_hourglass): Now used on WINDOWSNT as well. (start_hourglass) [WINDOWSNT]: Call w32_note_current_window. src/w32.h (init_timers, term_timers): Add prototypes. nt/inc/sys/time.h (ITIMER_REAL, ITIMER_PROF): Define. (struct itimerval): Define. (getitimer, setitimer): Add prototypes. nt/inc/ms-w32.h [_MSVC_VER]: Make the typedef consistent with MinGW. (SA_RESTART, SIGPROF): Define. nt/config.nt (HAVE_SETITIMER): Define to 1. diff: === modified file 'nt/ChangeLog' --- nt/ChangeLog 2012-09-30 12:27:23 +0000 +++ nt/ChangeLog 2012-09-30 15:49:05 +0000 @@ -1,3 +1,15 @@ +2012-09-30 Eli Zaretskii + + * inc/sys/time.h (ITIMER_REAL, ITIMER_PROF): Define. + (struct itimerval): Define. + (getitimer, setitimer): Add prototypes. + + * inc/ms-w32.h [_MSVC_VER]: Make the typedef consistent + with MinGW. + (SA_RESTART, SIGPROF): Define. + + * config.nt (HAVE_SETITIMER): Define to 1. + 2012-09-30 Juanma Barranquero * config.nt: Sync with autogen/config.in. === modified file 'nt/config.nt' --- nt/config.nt 2012-09-30 12:27:23 +0000 +++ nt/config.nt 2012-09-30 15:49:05 +0000 @@ -774,7 +774,7 @@ #define HAVE_SENDTO 1 /* Define to 1 if you have the `setitimer' function. */ -#undef HAVE_SETITIMER +#define HAVE_SETITIMER 1 /* Define to 1 if you have the `setlocale' function. */ #define HAVE_SETLOCALE 1 === modified file 'nt/inc/ms-w32.h' --- nt/inc/ms-w32.h 2012-09-23 17:34:30 +0000 +++ nt/inc/ms-w32.h 2012-09-30 15:49:05 +0000 @@ -121,7 +121,7 @@ #include #ifdef _MSC_VER -typedef unsigned long sigset_t; +typedef int sigset_t; typedef int ssize_t; #endif @@ -130,6 +130,7 @@ void (_CALLBACK_ *sa_handler)(int); sigset_t sa_mask; }; +#define SA_RESTART 0 #define SIG_BLOCK 1 #define SIG_SETMASK 2 #define SIG_UNBLOCK 3 @@ -293,6 +294,7 @@ #define SIGPIPE 13 /* Write on pipe with no readers */ #define SIGALRM 14 /* Alarm */ #define SIGCHLD 18 /* Death of child */ +#define SIGPROF 19 /* Profiling */ #ifndef NSIG #define NSIG 23 === modified file 'nt/inc/sys/time.h' --- nt/inc/sys/time.h 2012-06-24 17:21:20 +0000 +++ nt/inc/sys/time.h 2012-09-30 15:49:05 +0000 @@ -2,7 +2,8 @@ #define SYS_TIME_H_INCLUDED /* - * sys/time.h doesn't exist on NT + * sys/time.h either doesn't exist on Windows, or doesn't necessarily + * have the below stuff. */ struct timeval @@ -19,6 +20,18 @@ void gettimeofday (struct timeval *, struct timezone *); +#define ITIMER_REAL 0 +#define ITIMER_PROF 1 + +struct itimerval +{ + struct timeval it_interval; /* timer interval */ + struct timeval it_value; /* current value */ +}; + +int getitimer (int, struct itimerval *); +int setitimer (int, struct itimerval *, struct itimerval *); + #endif /* SYS_TIME_H_INCLUDED */ /* end of sys/time.h */ === modified file 'src/ChangeLog' --- src/ChangeLog 2012-09-30 14:44:30 +0000 +++ src/ChangeLog 2012-09-30 15:49:05 +0000 @@ -1,3 +1,42 @@ +2012-09-30 Eli Zaretskii + + Support atimers and CPU profiler via profile.c on MS-Windows. + * w32proc.c (sig_mask, crit_sig): New static variables. + (sys_signal): Support SIGALRM and SIGPROF. + (sigemptyset, sigaddset, sigfillset, sigprocmask) + (pthread_sigmask, setpgrp): Moved here from w32.c. sigaddset, + sigfillset, and sigprocmask are no longer no-ops. + (sigismember): New function. + (struct itimer_data): New definition. + (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real) + (crit_prof): New static variables. + (MAX_SINGLE_SLEEP): New definition. + (timer_loop, stop_timer_thread, term_timers, init_timers) + (start_timer_thread, getitimer, setitimer): New functions. + (alarm): No longer a no-op, calls setitimer. + + * w32.c (term_ntproc): Call term_timers. + (init_ntproc): Make sure all signals are unblocked at startup, to + erase any traces of dumping. Call init_timers. + + * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove. + Windows-specific code to display the hourglass mouse pointer is no + longer used. + (w32_wnd_proc): Remove code that handled the WM_TIMER message due + to hourglass timer expiration. + (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY): + Remove, no longer used. + (w32_note_current_window, show_hourglass, hide_hourglass): New + functions, in support of hourglass cursor display similar to other + window systems. + (syms_of_w32fns): Don't initialize hourglass_timer. + + * xdisp.c (start_hourglass, cancel_hourglass): Now used on + WINDOWSNT as well. + (start_hourglass) [WINDOWSNT]: Call w32_note_current_window. + + * w32.h (init_timers, term_timers): Add prototypes. + 2012-09-30 Kenichi Handa * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention === modified file 'src/profiler.c' --- src/profiler.c 2012-09-30 07:26:32 +0000 +++ src/profiler.c 2012-09-30 15:49:05 +0000 @@ -200,8 +200,6 @@ /* Sample profiler. */ -/* FIXME: Add support for the CPU profiler in W32. */ - #ifdef PROFILER_CPU_SUPPORT /* The profiler timer and whether it was properly initialized, if === modified file 'src/w32.c' --- src/w32.c 2012-09-25 11:57:30 +0000 +++ src/w32.c 2012-09-30 15:49:05 +0000 @@ -1528,52 +1528,6 @@ return 1; } -/* Routines that are no-ops on NT but are defined to get Emacs to compile. */ -int -sigemptyset (sigset_t *set) -{ - *set = 0; - return 0; -} - -int -sigaddset (sigset_t *set, int signo) -{ - return 0; -} - -int -sigfillset (sigset_t *set) -{ - return 0; -} - -int -sigprocmask (int how, const sigset_t *set, sigset_t *oset) -{ - return 0; -} - -int -pthread_sigmask (int how, const sigset_t *set, sigset_t *oset) -{ - if (sigprocmask (how, set, oset) == -1) - return EINVAL; - return 0; -} - -int -setpgrp (int pid, int gid) -{ - return 0; -} - -int -alarm (int seconds) -{ - return 0; -} - #define REG_ROOT "SOFTWARE\\GNU\\Emacs" LPBYTE @@ -6623,6 +6577,9 @@ term_ntproc (int ignored) { (void)ignored; + + term_timers (); + /* shutdown the socket interface if necessary */ term_winsock (); @@ -6632,6 +6589,8 @@ void init_ntproc (int dumping) { + sigset_t initial_mask = 0; + /* Initialize the socket interface now if available and requested by the user by defining PRELOAD_WINSOCK; otherwise loading will be delayed until open-network-stream is called (w32-has-winsock can @@ -6708,7 +6667,12 @@ /* unfortunately, atexit depends on implementation of malloc */ /* atexit (term_ntproc); */ if (!dumping) - signal (SIGABRT, term_ntproc); + { + /* Make sure we start with all signals unblocked. */ + sigprocmask (SIG_SETMASK, &initial_mask, NULL); + signal (SIGABRT, term_ntproc); + } + init_timers (); /* determine which drives are fixed, for GetCachedVolumeInformation */ { === modified file 'src/w32.h' --- src/w32.h 2012-09-25 11:57:30 +0000 +++ src/w32.h 2012-09-30 15:49:05 +0000 @@ -142,6 +142,9 @@ extern void syms_of_w32font (void); extern void check_windows_init_file (void); +extern void term_timers (void); +extern void init_timers (void); + extern int _sys_read_ahead (int fd); extern int _sys_wait_accept (int fd); === modified file 'src/w32fns.c' --- src/w32fns.c 2012-09-30 13:43:47 +0000 +++ src/w32fns.c 2012-09-30 15:49:05 +0000 @@ -79,9 +79,7 @@ extern void w32_free_menu_strings (HWND); extern const char *map_w32_filename (const char *, const char **); -/* If non-zero, a w32 timer that, when it expires, displays an - hourglass cursor on all frames. */ -static unsigned hourglass_timer = 0; +/* If non-NULL, a handle to a frame where to display the hourglass cursor. */ static HWND hourglass_hwnd = NULL; #ifndef IDC_HAND @@ -175,7 +173,6 @@ #define MOUSE_BUTTON_ID 1 #define MOUSE_MOVE_ID 2 #define MENU_FREE_ID 3 -#define HOURGLASS_ID 4 /* The delay (milliseconds) before a menu is freed after WM_EXITMENULOOP is received. */ #define MENU_FREE_DELAY 1000 @@ -3313,12 +3310,6 @@ menubar_in_use = 0; } } - else if (wParam == hourglass_timer) - { - KillTimer (hwnd, hourglass_timer); - hourglass_timer = 0; - w32_show_hourglass (x_window_to_frame (dpyinfo, hwnd)); - } return 0; case WM_NCACTIVATE: @@ -5040,66 +5031,50 @@ Busy cursor ***********************************************************************/ -/* Default number of seconds to wait before displaying an hourglass - cursor. Duplicated from xdisp.c, but cannot use the version there - due to lack of atimers on w32. */ -#define DEFAULT_HOURGLASS_DELAY 1 - -/* Cancel a currently active hourglass timer, and start a new one. */ - void -start_hourglass (void) +w32_note_current_window (void) { - DWORD delay; - int secs, msecs = 0; struct frame * f = SELECTED_FRAME (); - /* No cursors on non GUI frames. */ if (!FRAME_W32_P (f)) return; - cancel_hourglass (); - - if (INTEGERP (Vhourglass_delay) - && XINT (Vhourglass_delay) > 0) - secs = XFASTINT (Vhourglass_delay); - else if (FLOATP (Vhourglass_delay) - && XFLOAT_DATA (Vhourglass_delay) > 0) - { - Lisp_Object tem; - tem = Ftruncate (Vhourglass_delay, Qnil); - secs = XFASTINT (tem); - msecs = (XFLOAT_DATA (Vhourglass_delay) - secs) * 1000; - } - else - secs = DEFAULT_HOURGLASS_DELAY; - - delay = secs * 1000 + msecs; hourglass_hwnd = FRAME_W32_WINDOW (f); - hourglass_timer = SetTimer (hourglass_hwnd, HOURGLASS_ID, delay, NULL); -} - - -/* Cancel the hourglass cursor timer if active, hide an hourglass - cursor if shown. */ - -void -cancel_hourglass (void) -{ - if (hourglass_timer) - { - KillTimer (hourglass_hwnd, hourglass_timer); - hourglass_timer = 0; - } - - if (hourglass_shown_p) - w32_hide_hourglass (); -} - - -/* Timer function of hourglass_timer. - - Display an hourglass cursor. Set the hourglass_p flag in display info +} + +void +show_hourglass (struct atimer *timer) +{ + struct frame *f; + + hourglass_atimer = NULL; + + block_input (); + f = x_window_to_frame (&one_w32_display_info, + hourglass_hwnd); + + if (f) + f->output_data.w32->hourglass_p = 0; + else + f = SELECTED_FRAME (); + + if (!FRAME_W32_P (f)) + return; + + w32_show_hourglass (f); + unblock_input (); +} + +void +hide_hourglass (void) +{ + block_input (); + w32_hide_hourglass (); + unblock_input (); +} + + +/* Display an hourglass cursor. Set the hourglass_p flag in display info to indicate that an hourglass cursor is shown. */ static void @@ -7123,8 +7098,6 @@ check_window_system_func = check_w32; - - hourglass_timer = 0; hourglass_hwnd = NULL; defsubr (&Sx_show_tip); === modified file 'src/w32proc.c' --- src/w32proc.c 2012-09-25 11:50:01 +0000 +++ src/w32proc.c 2012-09-30 15:49:05 +0000 @@ -86,18 +86,23 @@ /* Signal handlers...SIG_DFL == 0 so this is initialized correctly. */ static signal_handler sig_handlers[NSIG]; +static sigset_t sig_mask; + +static CRITICAL_SECTION crit_sig; + /* Improve on the CRT 'signal' implementation so that we could record - the SIGCHLD handler. */ + the SIGCHLD handler and fake interval timers. */ signal_handler sys_signal (int sig, signal_handler handler) { signal_handler old; /* SIGCHLD is needed for supporting subprocesses, see sys_kill - below. All the others are the only ones supported by the MS - runtime. */ + below. SIGALRM and SIGPROF are used by setitimer. All the + others are the only ones supported by the MS runtime. */ if (!(sig == SIGCHLD || sig == SIGSEGV || sig == SIGILL - || sig == SIGFPE || sig == SIGABRT || sig == SIGTERM)) + || sig == SIGFPE || sig == SIGABRT || sig == SIGTERM + || sig == SIGALRM || sig == SIGPROF)) { errno = EINVAL; return SIG_ERR; @@ -111,7 +116,7 @@ if (!(sig == SIGABRT && old == term_ntproc)) { sig_handlers[sig] = handler; - if (sig != SIGCHLD) + if (!(sig == SIGCHLD || sig == SIGALRM || sig == SIGPROF)) signal (sig, handler); } return old; @@ -143,6 +148,523 @@ return retval; } +/* Emulate signal sets and blocking of signals used by timers. */ + +int +sigemptyset (sigset_t *set) +{ + *set = 0; + return 0; +} + +int +sigaddset (sigset_t *set, int signo) +{ + if (!set) + { + errno = EINVAL; + return -1; + } + if (signo < 0 || signo >= NSIG) + { + errno = EINVAL; + return -1; + } + + *set |= (1U << signo); + + return 0; +} + +int +sigfillset (sigset_t *set) +{ + if (!set) + { + errno = EINVAL; + return -1; + } + + *set = 0xFFFFFFFF; + return 0; +} + +int +sigprocmask (int how, const sigset_t *set, sigset_t *oset) +{ + if (!(how == SIG_BLOCK || how == SIG_UNBLOCK || how == SIG_SETMASK)) + { + errno = EINVAL; + return -1; + } + + if (oset) + *oset = sig_mask; + + if (!set) + return 0; + + switch (how) + { + case SIG_BLOCK: + sig_mask |= *set; + break; + case SIG_SETMASK: + sig_mask = *set; + break; + case SIG_UNBLOCK: + /* FIXME: Catch signals that are blocked and reissue them when + they are unblocked. Important for SIGALRM and SIGPROF only. */ + sig_mask &= ~(*set); + break; + } + + return 0; +} + +int +pthread_sigmask (int how, const sigset_t *set, sigset_t *oset) +{ + if (sigprocmask (how, set, oset) == -1) + return EINVAL; + return 0; +} + +int +sigismember (const sigset_t *set, int signo) +{ + if (signo < 0 || signo >= NSIG) + { + errno = EINVAL; + return -1; + } + if (signo > sizeof (*set) * BITS_PER_CHAR) + emacs_abort (); + + return (*set & (1U << signo)) != 0; +} + +int +setpgrp (int pid, int gid) +{ + return 0; +} + +/* Emulations of interval timers. + + Limitations: only ITIMER_REAL and ITIMER_PROF are supported. + + Implementation: a separate thread is started for each timer type, + the thread calls the appropriate signal handler when the timer + expires, after stopping the thread which installed the timer. */ + +/* FIXME: clock_t counts overflow after 49 days, need to handle the + wrap-around. */ +struct itimer_data { + clock_t expire; + clock_t reload; + int terminate; + int type; + HANDLE caller_thread; + HANDLE timer_thread; +}; + +static clock_t ticks_now; +static struct itimer_data real_itimer, prof_itimer; +static clock_t clocks_min; + +static CRITICAL_SECTION crit_real, crit_prof; + +#define MAX_SINGLE_SLEEP 30 + +static DWORD WINAPI +timer_loop (LPVOID arg) +{ + struct itimer_data *itimer = (struct itimer_data *)arg; + int which = itimer->type; + int sig = (which == ITIMER_REAL) ? SIGALRM : SIGPROF; + CRITICAL_SECTION *crit = (which == ITIMER_REAL) ? &crit_real : &crit_prof; + const DWORD max_sleep = MAX_SINGLE_SLEEP * 1000 / CLOCKS_PER_SEC; + int new_count = 0; + + while (1) + { + DWORD sleep_time; + signal_handler handler; + clock_t now, expire, reload; + + /* Load new values if requested by setitimer. */ + EnterCriticalSection (crit); + expire = itimer->expire; + reload = itimer->reload; + LeaveCriticalSection (crit); + if (itimer->terminate) + return 0; + + if (itimer->expire == 0) + { + /* We are idle. */ + Sleep (max_sleep); + continue; + } + + expire = itimer->expire; + if (expire > (now = clock ())) + sleep_time = expire - now; + else + sleep_time = 0; + /* Don't sleep too long at a time, to be able to see the + termination flag without too long a delay. */ + while (sleep_time > max_sleep) + { + if (itimer->terminate) + return 0; + Sleep (max_sleep); + expire = itimer->expire; + sleep_time = (expire > (now = clock ())) ? expire - now : 0; + } + if (itimer->terminate) + return 0; + if (sleep_time > 0) + { + Sleep (sleep_time * 1000 / CLOCKS_PER_SEC); + /* Always sleep past the expiration time, to make sure we + never call the handler _before_ the expiration time, + always slightly after it. Sleep(0) relinquishes the rest + of the scheduled slot, so that we let other threads + work. */ + while (clock () < expire) + Sleep (0); + } + + if (itimer->expire == 0) + continue; + + /* Time's up. */ + handler = sig_handlers[sig]; + if (!(handler == SIG_DFL || handler == SIG_IGN || handler == SIG_ERR) + /* FIXME: Don't ignore masked signals. Instead, record that + they happened and reissue them when the signal is + unblocked. */ + && !sigismember (&sig_mask, sig) + /* Simulate masking of SIGALRM and SIGPROF when processing + fatal signals. */ + && !fatal_error_in_progress + && itimer->caller_thread) + { + /* Simulate a signal delivered to the thread which installed + the timer, by suspending that thread while the handler + runs. */ + DWORD result = SuspendThread (itimer->caller_thread); + + if (result == (DWORD)-1) + { + DebPrint (("Thread %d exiting with status 2\n", which)); + return 2; + } + handler (sig); + ResumeThread (itimer->caller_thread); + } + + if (itimer->expire == 0) + continue; + + /* Update expiration time and loop. */ + EnterCriticalSection (crit); + expire = itimer->expire; + reload = itimer->reload; + if (reload > 0) + { + now = clock (); + if (expire <= now) + { + clock_t lag = now - expire; + + /* If we missed some opportunities (presumably while + sleeping or while the signal handler ran), skip + them. */ + if (lag > reload) + expire = now - (lag % reload); + + expire += reload; + } + } + else + expire = 0; /* become idle */ + itimer->expire = expire; + LeaveCriticalSection (crit); + } + return 0; +} + +static void +stop_timer_thread (int which) +{ + struct itimer_data *itimer = + (which == ITIMER_REAL) ? &real_itimer : &prof_itimer; + int i; + DWORD exit_code = 255; + BOOL status, err; + + /* Signal the thread that it should terminate. */ + itimer->terminate = 1; + + if (itimer->timer_thread == NULL) + return; + + /* Wait for the timer thread to terminate voluntarily, then kill it + if it doesn't. This loop waits twice more than the maximum + amount of time a timer thread sleeps, see above. */ + for (i = 0; i < MAX_SINGLE_SLEEP / 5; i++) + { + if (!((status = GetExitCodeThread (itimer->timer_thread, &exit_code)) + && exit_code == STILL_ACTIVE)) + break; + Sleep (10); + } + if ((status == FALSE && (err = GetLastError ()) == ERROR_INVALID_HANDLE) + || exit_code == STILL_ACTIVE) + { + if (!(status == FALSE && err == ERROR_INVALID_HANDLE)) + TerminateThread (itimer->timer_thread, 0); + } + + /* Clean up. */ + CloseHandle (itimer->timer_thread); + itimer->timer_thread = NULL; + if (itimer->caller_thread) + { + CloseHandle (itimer->caller_thread); + itimer->caller_thread = NULL; + } +} + +/* This is called at shutdown time from term_ntproc. */ +void +term_timers (void) +{ + if (real_itimer.timer_thread) + stop_timer_thread (ITIMER_REAL); + if (prof_itimer.timer_thread) + stop_timer_thread (ITIMER_PROF); + + DeleteCriticalSection (&crit_real); + DeleteCriticalSection (&crit_prof); + DeleteCriticalSection (&crit_sig); +} + +/* This is called at initialization time from init_ntproc. */ +void +init_timers (void) +{ + /* Make sure we start with zeroed out itimer structures, since + dumping may have left there traces of threads long dead. */ + memset (&real_itimer, 0, sizeof real_itimer); + memset (&prof_itimer, 0, sizeof prof_itimer); + + InitializeCriticalSection (&crit_real); + InitializeCriticalSection (&crit_prof); + InitializeCriticalSection (&crit_sig); +} + +static int +start_timer_thread (int which) +{ + DWORD exit_code; + struct itimer_data *itimer = + (which == ITIMER_REAL) ? &real_itimer : &prof_itimer; + + if (itimer->timer_thread + && GetExitCodeThread (itimer->timer_thread, &exit_code) + && exit_code == STILL_ACTIVE) + return 0; + + /* Start a new thread. */ + if (!DuplicateHandle (GetCurrentProcess (), GetCurrentThread (), + GetCurrentProcess (), &itimer->caller_thread, 0, + FALSE, DUPLICATE_SAME_ACCESS)) + { + errno = ESRCH; + return -1; + } + + itimer->terminate = 0; + itimer->type = which; + /* Request that no more than 64KB of stack be reserved for this + thread, to avoid reserving too much memory, which would get in + the way of threads we start to wait for subprocesses. See also + new_child below. */ + itimer->timer_thread = CreateThread (NULL, 64 * 1024, timer_loop, + (void *)itimer, 0x00010000, NULL); + + if (!itimer->timer_thread) + { + CloseHandle (itimer->caller_thread); + itimer->caller_thread = NULL; + errno = EAGAIN; + return -1; + } + + /* This is needed to make sure that the timer thread running for + profiling gets CPU as soon as the Sleep call terminates. */ + if (which == ITIMER_PROF) + SetThreadPriority (itimer->caller_thread, THREAD_PRIORITY_TIME_CRITICAL); + + return 0; +} + +/* Most of the code of getitimer and setitimer (but not of their + subroutines) was shamelessly stolen from itimer.c in the DJGPP + library, see www.delorie.com/djgpp. */ +int +getitimer (int which, struct itimerval *value) +{ + volatile clock_t *t_expire; + volatile clock_t *t_reload; + clock_t expire, reload; + __int64 usecs; + CRITICAL_SECTION *crit; + + ticks_now = clock (); + + if (!value) + { + errno = EFAULT; + return -1; + } + + if (which != ITIMER_REAL && which != ITIMER_PROF) + { + errno = EINVAL; + return -1; + } + + t_expire = (which == ITIMER_REAL) ? &real_itimer.expire: &prof_itimer.expire; + t_reload = (which == ITIMER_REAL) ? &real_itimer.reload: &prof_itimer.reload; + crit = (which == ITIMER_REAL) ? &crit_real : &crit_prof; + + EnterCriticalSection (crit); + reload = *t_reload; + expire = *t_expire; + LeaveCriticalSection (crit); + + if (expire) + expire -= ticks_now; + + value->it_value.tv_sec = expire / CLOCKS_PER_SEC; + usecs = (expire % CLOCKS_PER_SEC) * (__int64)1000000 / CLOCKS_PER_SEC; + value->it_value.tv_usec = usecs; + value->it_interval.tv_sec = reload / CLOCKS_PER_SEC; + usecs = (reload % CLOCKS_PER_SEC) * (__int64)1000000 / CLOCKS_PER_SEC; + value->it_interval.tv_usec= usecs; + + return 0; +} + +int +setitimer(int which, struct itimerval *value, struct itimerval *ovalue) +{ + volatile clock_t *t_expire, *t_reload; + clock_t expire, reload, expire_old, reload_old; + __int64 usecs; + CRITICAL_SECTION *crit; + + /* Posix systems expect timer values smaller than the resolution of + the system clock be rounded up to the clock resolution. First + time we are called, measure the clock tick resolution. */ + if (!clocks_min) + { + clock_t t1, t2; + + for (t1 = clock (); (t2 = clock ()) == t1; ) + ; + clocks_min = t2 - t1; + } + + if (ovalue) + { + if (getitimer (which, ovalue)) /* also sets ticks_now */ + return -1; /* errno already set */ + } + else + ticks_now = clock (); + + if (which != ITIMER_REAL && which != ITIMER_PROF) + { + errno = EINVAL; + return -1; + } + + t_expire = + (which == ITIMER_REAL) ? &real_itimer.expire : &prof_itimer.expire; + t_reload = + (which == ITIMER_REAL) ? &real_itimer.reload : &prof_itimer.reload; + + crit = (which == ITIMER_REAL) ? &crit_real : &crit_prof; + + if (!value + || (value->it_value.tv_sec == 0 && value->it_value.tv_usec == 0)) + { + EnterCriticalSection (crit); + /* Disable the timer. */ + *t_expire = 0; + *t_reload = 0; + LeaveCriticalSection (crit); + return 0; + } + + reload = value->it_interval.tv_sec * CLOCKS_PER_SEC; + + usecs = value->it_interval.tv_usec; + if (value->it_interval.tv_sec == 0 + && usecs && usecs * CLOCKS_PER_SEC < clocks_min * 1000000) + reload = clocks_min; + else + { + usecs *= CLOCKS_PER_SEC; + reload += usecs / 1000000; + } + + expire = value->it_value.tv_sec * CLOCKS_PER_SEC; + usecs = value->it_value.tv_usec; + if (value->it_value.tv_sec == 0 + && usecs * CLOCKS_PER_SEC < clocks_min * 1000000) + expire = clocks_min; + else + { + usecs *= CLOCKS_PER_SEC; + expire += usecs / 1000000; + } + + expire += ticks_now; + + EnterCriticalSection (crit); + expire_old = *t_expire; + reload_old = *t_reload; + if (!(expire == expire_old && reload == reload_old)) + { + *t_reload = reload; + *t_expire = expire; + } + LeaveCriticalSection (crit); + + return start_timer_thread (which); +} + +int +alarm (int seconds) +{ + struct itimerval new_values; + + new_values.it_value.tv_sec = seconds; + new_values.it_value.tv_usec = 0; + new_values.it_interval.tv_sec = new_values.it_interval.tv_usec = 0; + + setitimer (ITIMER_REAL, &new_values, NULL); + + return seconds; +} + /* Defined in which conflicts with the local copy */ #define _P_NOWAIT 1 === modified file 'src/xdisp.c' --- src/xdisp.c 2012-09-29 02:02:34 +0000 +++ src/xdisp.c 2012-09-30 15:49:05 +0000 @@ -29357,10 +29357,6 @@ help_echo_showing_p = 0; } -/* Since w32 does not support atimers, it defines its own implementation of - the following three functions in w32fns.c. */ -#ifndef WINDOWSNT - /* Platform-independent portion of hourglass implementation. */ /* Cancel a currently active hourglass timer, and start a new one. */ @@ -29383,6 +29379,10 @@ else delay = make_emacs_time (DEFAULT_HOURGLASS_DELAY, 0); +#ifdef WINDOWSNT + w32_note_current_window (); +#endif + hourglass_atimer = start_atimer (ATIMER_RELATIVE, delay, show_hourglass, NULL); #endif @@ -29405,4 +29405,3 @@ hide_hourglass (); #endif } -#endif /* ! WINDOWSNT */ ------------------------------------------------------------ revno: 110286 committer: Bastien Guerry branch nick: trunk timestamp: Sun 2012-09-30 17:14:59 +0200 message: Sync Org 7.9.2 from the commit tagged "release_7.9.2" in Org's Git repo. diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2012-09-13 07:28:15 +0000 +++ doc/misc/ChangeLog 2012-09-30 15:14:59 +0000 @@ -1,3 +1,207 @@ +2012-09-30 Achim Gratz + + * org.texi: Add description of ORG_ADD_CONTRIB to info + documentation. Add link to Worg for more details. + + * org.texi: Clarify installation procedure. Provide link to the + build system description on Worg. + + * org.texi: Remove reference to utils/, x11idle.c is now in + contrib/scripts. + + * org.texi: Re-normalize to "Org mode" in manual. + + * org.texi (Installation): Adapt documentation to new build + system. Mention GNU ELPA (since it needs to be handled like Emacs + built-in Org). + + * org.texi: Include "org-version.inc" instead of + "git-describe.texi". + + * org.texi: Remove @set for VERSION and DATE and do an @include + git-describe.texi instead. + +2012-09-30 Adam Spiers (tiny change) + + * org.texi: Fix typo in description of the 'Hooks' section. + + * org.texi: Add ID to the list of special properties. + +2012-09-30 Andrew Hyatt (tiny change) + + * org.texi (Moving subtrees): Document the ability to archive to a + datetree. + +2012-09-30 Bastien Guerry + + * org.texi (Installation, Feedback, Batch execution): Use + (add-to-list 'load-path ... t) for the contrib dir. + + * org.texi (results): Update documentation for ":results drawer" + and ":results org". + + * org.texi (Column width and alignment): Fix typo. + + * org.texi (Activation): Point to the "Conflicts" section. + + * org.texi (Conflicts): Mention filladapt.el in the list of + conflicting packages. + + * org.texi (Activation): Adding org-mode to `auto-mode-alist' is + not needed for versions of Emacs > 22.1. + + * org.texi (History and Acknowledgments): Fix typo. + + * org.texi (History and Acknowledgments): Add my own + acknowledgments. + + * org.texi (Agenda commands): Document the new command and the new + option. + + * org.texi (Agenda commands): Delete `org-agenda-action' section. + (Agenda commands): Reorder. Document `*' to toggle persistent + marks. + + * org.texi (Agenda dispatcher): Mention + `org-toggle-agenda-sticky'. + (Agenda commands, Exporting Agenda Views): Fix typo. + + * org.texi (Templates in contexts, Setting Options): Update to + reflect changes in how contexts options are processed. + + * org.texi (Templates in contexts): Document the new structure of + the variables `org-agenda-custom-commands-contexts' and + `org-capture-templates-contexts'. + + * org.texi (Templates in contexts): Document the new option + `org-capture-templates-contexts'. + (Storing searches): Document the new option + `org-agenda-custom-commands-contexts'. + + * org.texi (Formula syntax for Lisp): Reformat. + + * org.texi (Special properties, Column attributes) + (Agenda column view): Document the new special property + CLOCKSUM_T. + + * org.texi (Template expansion): Document the new %l template. + + * org.texi (Fast access to TODO states): Fix documentation about + allowed characters for fast todo selection. + + * org.texi (Weekly/daily agenda): Mention APPT_WARNTIME and its + use in `org-agenda-to-appt'. + + * org.texi (Comment lines): Update wrt comments. + + * org.texi (Resolving idle time): Document new keybinding. + + * org.texi (Clocking commands): Document the use of S-M- + on clock timestamps. + + * org.texi (Fast access to TODO states): Explicitely says only + letters are supported as fast TODO selection keys. + + * org.texi (Link abbreviations): Illustrate the use of the "%h" + specifier. Document the new "%(my-function)" specifier. + + * org.texi (Clocking commands): New cindex. + (Clocking commands): Update documentation for `org-clock-in'. + Document `org-clock-in-last'. Mention `org-clock-out' and + `org-clock-in-last' as commands that can be globally bound. + (Resolving idle time): Document continuous clocking. + + * org.texi (Top, Introduction): Fix formatting. + (Activation): Add index entries. + (Conventions): Update section. + (Embedded @LaTeX{}): Fix formatting. + + * org.texi (Visibility cycling): Document `show-children'. + + * org.texi (Using capture): Mention the `org-capture-last-stored' + bookmark as a way to jump to the last stored capture. + + * org.texi (Uploading files): Fix typo. + + * org.texi (Using capture): Document `C-0' as a prefix argument + for `org-capture'. + + * org.texi (Agenda commands): Document persistent marks. + + * org.texi (Template expansion): Update doc to reflect change. + + * org.texi (Radio tables): Document the :no-escape parameter. + + * org.texi (Repeated tasks): Document repeat cookies for years, + months, weeks, days and hours. + + * org.texi (Export options): State that you can use the d: option + by specifying a list of drawers. + + * org.texi (HTML preamble and postamble): Small doc improvement. + +2012-09-30 Brian van den Broek (tiny change) + + * org.texi: The sections in the Exporting section of the manual + left out articles in the description of the org-export-as-* + commands, among other places. This patch adds them, adds a few + missing prepositions, and switches instances of "an HTML" to "a + html" for internal consistency. + + * org.texi: Alter several examples of headings with timestamps in + them to include the timestamps in the body instead of the heading. + +2012-09-30 Carsten Dominik + + * org.texi (Agenda dispatcher): Document sticky agenda views and + the new key for them. + +2012-09-30 Charles (tiny change) + + * org.texi (Advanced features): Fix error in table. + +2012-09-30 Feng Shu + + * org.texi (@LaTeX{} fragments): Document imagemagick as an + alternative to dvipng. + +2012-09-30 François Allisson (tiny change) + + * org.texi: Remove extra curly bracket. + +2012-09-30 Giovanni Ridolfi (tiny change) + + * org.texi (org-clock-in-last and org-clock-cancel): Update the + defkeys. + +2012-09-30 Ippei FURUHASHI (tiny change) + + * org.texi (Agenda commands): Fix two typos by giving + corresponding function names, according to + `org-agenda-view-mode-dispatch'. + +2012-09-30 Jan Bäcker + + * org.texi (The spreadsheet): Fix typo. + +2012-09-30 Memnon Anon (tiny change) + + * org.texi (Tracking your habits): Point to the "Tracking TODO + state changes" section. + +2012-09-30 Nicolas Goaziou + + * org.texi (Literal examples): Remove reference to unknown + `org-export-latex-minted' variable. Also simplify footnote since + `org-export-latex-listings' documentation is exhaustive already. + + * org.texi (Plain lists): Remove reference to now hard-coded + `bullet' automatic rule. + +2012-09-30 Toby S. Cubitt + + * org.texi: Updated documentation accordingly. + 2012-09-13 Paul Eggert * texinfo.tex: Merge from gnulib. === modified file 'doc/misc/org.texi' --- doc/misc/org.texi 2012-05-25 21:28:05 +0000 +++ doc/misc/org.texi 2012-09-30 15:14:59 +0000 @@ -1,11 +1,8 @@ - \input texinfo @c %**start of header @setfilename ../../info/org @settitle The Org Manual - -@set VERSION 7.8.11 -@set DATE May 2012 +@set VERSION 7.9.2 (GNU Emacs 24.3) @c Use proper quote and backtick for code sections in PDF output @c Cf. Texinfo manual 14.2 @@ -347,7 +344,7 @@ * Installation:: How to install a downloaded version of Org * Activation:: How to activate Org for certain buffers * Feedback:: Bug reports, ideas, patches etc. -* Conventions:: Type-setting conventions in the manual +* Conventions:: Typesetting conventions in the manual Document structure @@ -495,6 +492,7 @@ * Template elements:: What is needed for a complete template entry * Template expansion:: Filling in information about time and context +* Templates in contexts:: Only show a template in a specific context Archiving @@ -560,7 +558,7 @@ * Special symbols:: Greek letters and other symbols * Subscripts and superscripts:: Simple syntax for raising/lowering text -* @LaTeX{} fragments:: Complex formulas made easy +* @LaTeX{} fragments:: Complex formulas made easy * Previewing @LaTeX{} fragments:: What will this snippet look like? * CDLaTeX mode:: Speed up entering of formulas @@ -695,6 +693,7 @@ * results:: Specify the type of results and how they will be collected and handled * file:: Specify a path for file output +* file-desc:: Specify a description for file results * dir:: Specify the default (possibly remote) directory for code block execution * exports:: Export code and/or results @@ -718,6 +717,7 @@ * rownames:: Handle row names in tables * shebang:: Make tangled files executable * eval:: Limit evaluation of specific code blocks +* wrap:: Mark source block evaluation results Miscellaneous @@ -740,7 +740,7 @@ Hacking -* Hooks:: Who to reach into Org's internals +* Hooks:: How to reach into Org's internals * Add-on packages:: Available extensions * Adding hyperlink types:: New custom link types * Context-sensitive commands:: How to add functionality to such commands @@ -776,7 +776,7 @@ * Installation:: How to install a downloaded version of Org * Activation:: How to activate Org for certain buffers * Feedback:: Bug reports, ideas, patches etc. -* Conventions:: Type-setting conventions in the manual +* Conventions:: Typesetting conventions in the manual @end menu @node Summary, Installation, Introduction, Introduction @@ -854,61 +854,111 @@ @cindex installation @cindex XEmacs -@b{Important:} @i{If you are using a version of Org that is part of the Emacs -distribution or an XEmacs package, please skip this section and go directly -to @ref{Activation}. To see what version of Org (if any) is part of your -Emacs distribution, type @kbd{M-x load-library RET org} and then @kbd{M-x -org-version}.} - -If you have downloaded Org from the Web, either as a distribution @file{.zip} -or @file{.tar} file, or as a Git archive, you must take the following steps -to install it: go into the unpacked Org distribution directory and edit the -top section of the file @file{Makefile}. You must set the name of the Emacs -binary (likely either @file{emacs} or @file{xemacs}), and the paths to the -directories where local Lisp and Info files are kept. If you don't have -access to the system-wide directories, you can simply run Org directly from -the distribution directory by adding the @file{lisp} subdirectory to the -Emacs load path. To do this, add the following line to @file{.emacs}: +@b{Important:} @i{If you the version of Org that comes with Emacs or as a +XEmacs package, please skip this section and go directly to @ref{Activation}. +If you downloaded Org as an ELPA package, please read the instructions on the +@uref{http://orgmode.org/elpa/, Org ELPA page}. To see what version of Org +(if any) is part of your Emacs distribution, type @kbd{M-x org-version} (if +your Emacs distribution does not come with Org, this function will not be +defined).} + +Installation of Org mode uses a build system, which is described in more +detail on @uref{http://orgmode.org/worg/dev/org-build-system.html, Worg}. + +If you have downloaded Org from the Web as a distribution @file{.zip} or +@file{.tar.gz} archive, take the following steps to install it: + +@itemize @bullet +@item Unpack the distribution archive. +@item Change into (@code{cd}) the Org directory. +@item Run @code{make help config} +and then check and edit the file @file{local.mk} if the default configuration +does not match your system. Set the name of the Emacs binary (likely either +@file{emacs} or @file{xemacs}), and the paths to the directories where local +Lisp and Info files will be installed. If the Emacs binary is not in your +path, give the full path to the executable. Avoid spaces in any path names. +@item Run @code{make config} +again to check the configuration. +@item Optionally run @code{make test} +to build Org mode and then run the full testsuite. +@item Run @code{make install} or @code{sudo make install} +to build and install Org mode on your system. +@end itemize + +If you use a cloned Git repository, then the procedure is slightly different. +The following description assumes that you are using the @code{master} branch +(where the development is done). You could also use the @code{maint} branch +instead, where the release versions are published, just replace @code{master} +with @code{maint} in the description below. + +@itemize @bullet +@item Change into (@code{cd}) the Org repository. +@item Run @code{git checkout master} +to switch to the @code{master} branch of the Org repository. +@item Run @code{make help} +and then check and edit the file @file{local.mk}. You must set the name of +the Emacs binary (likely either @file{emacs} or @file{xemacs}), and the paths +to the directories where local Lisp and Info files will be installed. If the +Emacs binary is not in your path, you must give the full path to the +executable. Avoid spaces in any path names. +@item Run @code{make config} +to check the configuration. +@item Run @code{make update2} or @code{make up2} +to update the Git repository and build and install Org mode. The latter +invocation runs the complete test suite before installation and installs only +if the build passes all tests. +@end itemize + +If you don't have access to the system-wide directories and you don't want to +install somewhere into your home directory, you can run Org directly from the +distribution directory or Org repository by compiling Org mode in place: + +@itemize @bullet +@item Change into (@code{cd}) the Org repository. +@item Run @code{git checkout master} +to switch to the @code{master} branch of the Org repository. +@item Run @code{make compile} +@end itemize + +Last but not least you can also run Org mode directly from an Org repository +without any compilation. Simply replace the last step in the recipe above +with @code{make uncompiled}. + +Then add the following line to @file{.emacs}: @example -(setq load-path (cons "~/path/to/orgdir/lisp" load-path)) +(add-to-list 'load-path "~/path/to/orgdir/lisp") @end example @noindent -If you plan to use code from the @file{contrib} subdirectory, do a similar -step for this directory: - -@example -(setq load-path (cons "~/path/to/orgdir/contrib/lisp" load-path)) -@end example - -@noindent Now byte-compile the Lisp files with the shell command: - -@example -make -@end example - -@noindent If you are running Org from the distribution directory, this is -all. If you want to install Org into the system directories, use (as -administrator) - -@example -make install -@end example +If you plan to use code from the @file{contrib} subdirectory without +compiling them, do a similar step for this directory: + +@example +(add-to-list 'load-path "~/path/to/orgdir/contrib/lisp" t) +@end example + +If you want to include those files with the build and install, please +customize the variable @code{ORG_ADD_CONTRIB} instead in your @code{local.mk} +file, for more details please see this +@uref{http://orgmode.org/worg/dev/org-build-system.html#sec-4-1-2, +description on Worg}. Installing Info files is system dependent, because of differences in the -@file{install-info} program. The following should correctly install the Info -files on most systems, please send a bug report if not@footnote{The output -from install-info (if any) is also system dependent. In particular Debian -and its derivatives use two different versions of install-info and you may -see the message: +@file{install-info} program. The Info documentation is installed together +with the rest of Org mode. If you don't install Org mode, it is possible to +install the Info documentation seperately (you need to have +install-info@footnote{The output from install-info (if any) is system +dependent. In particular Debian and its derivatives use two different +versions of install-info and you may see the message: @example This is not dpkg install-info anymore, but GNU install-info See the man page for ginstall-info for command line arguments @end example -@noindent which can be safely ignored.}. +@noindent which can be safely ignored.} +on your system). @example make install-info @@ -928,17 +978,28 @@ @section Activation @cindex activation @cindex autoload +@cindex ELPA @cindex global key bindings @cindex key bindings, global - -To make sure files with extension @file{.org} use Org mode, add the following -line to your @file{.emacs} file. +@findex org-agenda +@findex org-capture +@findex org-store-link +@findex org-iswitchb + +Since Emacs 22.2, files with the @file{.org} extension use Org mode by +default. If you are using an earlier version of Emacs, add this line to your +@file{.emacs} file: + @lisp (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode)) @end lisp -@noindent Org mode buffers need font-lock to be turned on - this is the -default in Emacs@footnote{If you don't use font-lock globally, turn it on in -Org buffer with @code{(add-hook 'org-mode-hook 'turn-on-font-lock)}}. + +Org mode buffers need font-lock to be turned on - this is the default in +Emacs@footnote{If you don't use font-lock globally, turn it on in Org buffer +with @code{(add-hook 'org-mode-hook 'turn-on-font-lock)}}. + +There are compatibility issues between Org mode and some other Elisp +packages, please take the time to check the list (@pxref{Conflicts}). The four Org commands @command{org-store-link}, @command{org-capture}, @command{org-agenda}, and @command{org-iswitchb} should be accessible through @@ -1016,8 +1077,9 @@ @end example However if you are using Org mode as distributed with Emacs, a minimal setup -is not necessary. In that case it is sufficient to start Emacs as @code{emacs --Q}. The @code{minimal-org.el} setup file can have contents as shown below. +is not necessary. In that case it is sufficient to start Emacs as +@code{emacs -Q}. The @code{minimal-org.el} setup file can have contents as +shown below. @example ;;; Minimal setup to load latest `org-mode' @@ -1029,7 +1091,7 @@ ;; add latest org-mode to load path (add-to-list 'load-path (expand-file-name "/path/to/org-mode/lisp")) -(add-to-list 'load-path (expand-file-name "/path/to/org-mode/contrib/lisp")) +(add-to-list 'load-path (expand-file-name "/path/to/org-mode/contrib/lisp" t)) ;; activate org (require 'org-install) @@ -1081,7 +1143,9 @@ @node Conventions, , Feedback, Introduction @section Typesetting conventions used in this manual -Org uses three types of keywords: TODO keywords, tags, and property +@subsubheading TODO keywords, tags, properties, etc. + +Org mainly uses three types of keywords: TODO keywords, tags and property names. In this manual we use the following conventions: @table @code @@ -1099,17 +1163,33 @@ special meaning are written with all capitals. @end table -The manual lists both the keys and the corresponding commands for accessing -functionality. Org mode often uses the same key for different functions, -depending on context. The command that is bound to such keys has a generic -name, like @code{org-metaright}. In the manual we will, wherever possible, -give the function that is internally called by the generic command. For -example, in the chapter on document structure, @kbd{M-@key{right}} will be -listed to call @code{org-do-demote}, while in the chapter on tables, it will -be listed to call org-table-move-column-right. - -If you prefer, you can compile the manual without the command names by -unsetting the flag @code{cmdnames} in @file{org.texi}. +Moreover, Org uses @i{option keywords} (like @code{#+TITLE} to set the title) +and @i{environment keywords} (like @code{#+BEGIN_HTML} to start a @code{HTML} +environment). They are written in uppercase in the manual to enhance its +readability, but you can use lowercase in your Org files@footnote{Easy +templates insert lowercase keywords and Babel dynamically inserts +@code{#+results}.} + +@subsubheading Keybindings and commands +@kindex C-c a +@findex org-agenda +@kindex C-c c +@findex org-capture + +The manual suggests two global keybindings: @kbd{C-c a} for @code{org-agenda} +and @kbd{C-c c} for @code{org-capture}. These are only suggestions, but the +rest of the manual assumes that you are using these keybindings. + +Also, the manual lists both the keys and the corresponding commands for +accessing a functionality. Org mode often uses the same key for different +functions, depending on context. The command that is bound to such keys has +a generic name, like @code{org-metaright}. In the manual we will, wherever +possible, give the function that is internally called by the generic command. +For example, in the chapter on document structure, @kbd{M-@key{right}} will +be listed to call @code{org-do-demote}, while in the chapter on tables, it +will be listed to call @code{org-table-move-column-right}. If you prefer, +you can compile the manual without the command names by unsetting the flag +@code{cmdnames} in @file{org.texi}. @node Document Structure, Tables, Introduction, Top @chapter Document structure @@ -1159,7 +1239,8 @@ start with one or more stars, on the left margin@footnote{See the variables @code{org-special-ctrl-a/e}, @code{org-special-ctrl-k}, and @code{org-ctrl-k-protect-subtree} to configure special behavior of @kbd{C-a}, -@kbd{C-e}, and @kbd{C-k} in headlines.}. For example: +@kbd{C-e}, and @kbd{C-k} in headlines.} @footnote{Clocking only works with +headings indented less then 30 stars.}. For example: @example * Top level headline @@ -1239,6 +1320,7 @@ @cindex show all, command @orgcmd{C-u C-u C-u @key{TAB},show-all} Show all, including drawers. +@cindex revealing context @orgcmd{C-c C-r,org-reveal} Reveal context around point, showing the current entry, the following heading and the hierarchy above. Useful for working near a location that has been @@ -1246,8 +1328,13 @@ (@pxref{Agenda commands}). With a prefix argument show, on each level, all sibling headings. With a double prefix argument, also show the entire subtree of the parent. +@cindex show branches, command @orgcmd{C-c C-k,show-branches} Expose all the headings of the subtree, CONTENT view for just one subtree. +@cindex show children, command +@orgcmd{C-c @key{TAB},show-children} +Expose all direct children of the subtree. With a numeric prefix argument N, +expose all children down to level N. @orgcmd{C-c C-x b,org-tree-to-indirect-buffer} Show the current subtree in an indirect buffer@footnote{The indirect buffer @@ -1429,7 +1516,7 @@ @code{org-clone-subtree-with-time-shift}. @orgcmd{C-c C-w,org-refile} Refile entry or region to a different location. @xref{Refiling notes}. -@orgcmd{C-c ^,org-sort-entries-or-items} +@orgcmd{C-c ^,org-sort} Sort same-level entries. When there is an active region, all entries in the region will be sorted. Otherwise the children of the current headline are sorted. The command prompts for the sorting method, which can be @@ -1714,19 +1801,16 @@ consistency in the whole list. @kindex C-c - @vindex org-plain-list-ordered-item-terminator -@vindex org-list-automatic-rules @item C-c - Cycle the entire list level through the different itemize/enumerate bullets (@samp{-}, @samp{+}, @samp{*}, @samp{1.}, @samp{1)}) or a subset of them, depending on @code{org-plain-list-ordered-item-terminator}, the type of list, -and its position@footnote{See @code{bullet} rule in -@code{org-list-automatic-rules} for more information.}. With a numeric -prefix argument N, select the Nth bullet from this list. If there is an -active region when calling this, selected text will be changed into an item. -With a prefix argument, all lines will be converted to list items. If the -first line already was a list item, any item marker will be removed from the -list. Finally, even without an active region, a normal line will be -converted into a list item. +and its indentation. With a numeric prefix argument N, select the Nth bullet +from this list. If there is an active region when calling this, selected +text will be changed into an item. With a prefix argument, all lines will be +converted to list items. If the first line already was a list item, any item +marker will be removed from the list. Finally, even without an active +region, a normal line will be converted into a list item. @kindex C-c * @item C-c * Turn a plain list item into a headline (so that it becomes a subheading at @@ -1756,11 +1840,13 @@ @cindex visibility cycling, drawers @vindex org-drawers +@cindex org-insert-drawer +@kindex C-c C-x d Sometimes you want to keep information associated with an entry, but you normally don't want to see it. For this, Org mode has @emph{drawers}. Drawers need to be configured with the variable -@code{org-drawers}@footnote{You can define drawers on a per-file basis -with a line like @code{#+DRAWERS: HIDDEN PROPERTIES STATE}}. Drawers +@code{org-drawers}@footnote{You can define additional drawers on a +per-file basis with a line like @code{#+DRAWERS: HIDDEN STATE}}. Drawers look like this: @example @@ -1772,6 +1858,13 @@ After the drawer. @end example +You can interactively insert drawers at point by calling +@code{org-insert-drawer}, which is bound to @key{C-c C-x d}. With an active +region, this command will put the region inside the drawer. With a prefix +argument, this command calls @code{org-insert-property-drawer} and add a +property drawer right below the current headline. Completion over drawer +keywords is also possible using @key{M-TAB}. + Visibility cycling (@pxref{Visibility cycling}) on the headline will hide and show the entry, but keep the drawer collapsed to a single line. In order to look inside the drawer, you need to move the cursor to the drawer line and @@ -2226,7 +2319,7 @@ If you would like to overrule the automatic alignment of number-rich columns to the right and of string-rich column to the left, you can use @samp{}, -@samp{c}@footnote{Centering does not work inside Emacs, but it does have an +@samp{}@footnote{Centering does not work inside Emacs, but it does have an effect when exporting to HTML.} or @samp{} in a similar fashion. You may also combine alignment and field width like this: @samp{}. @@ -2577,23 +2670,28 @@ @subsection Emacs Lisp forms as formulas @cindex Lisp forms, as table formulas -It is also possible to write a formula in Emacs Lisp; this can be useful for -string manipulation and control structures, if Calc's functionality is not -enough. If a formula starts with a single-quote followed by an opening -parenthesis, then it is evaluated as a Lisp form. The evaluation should -return either a string or a number. Just as with @file{calc} formulas, you -can specify modes and a printf format after a semicolon. With Emacs Lisp -forms, you need to be conscious about the way field references are -interpolated into the form. By default, a reference will be interpolated as -a Lisp string (in double-quotes) containing the field. If you provide the -@samp{N} mode switch, all referenced elements will be numbers (non-number -fields will be zero) and interpolated as Lisp numbers, without quotes. If -you provide the @samp{L} flag, all fields will be interpolated literally, -without quotes. I.e., if you want a reference to be interpreted as a string -by the Lisp form, enclose the reference operator itself in double-quotes, -like @code{"$3"}. Ranges are inserted as space-separated fields, so you can -embed them in list or vector syntax. Here are a few examples---note how the -@samp{N} mode is used when we do computations in Lisp: +It is also possible to write a formula in Emacs Lisp. This can be useful +for string manipulation and control structures, if Calc's functionality is +not enough. + +If a formula starts with a single-quote followed by an opening parenthesis, +then it is evaluated as a Lisp form. The evaluation should return either a +string or a number. Just as with @file{calc} formulas, you can specify modes +and a printf format after a semicolon. + +With Emacs Lisp forms, you need to be conscious about the way field +references are interpolated into the form. By default, a reference will be +interpolated as a Lisp string (in double-quotes) containing the field. If +you provide the @samp{N} mode switch, all referenced elements will be numbers +(non-number fields will be zero) and interpolated as Lisp numbers, without +quotes. If you provide the @samp{L} flag, all fields will be interpolated +literally, without quotes. I.e., if you want a reference to be interpreted +as a string by the Lisp form, enclose the reference operator itself in +double-quotes, like @code{"$3"}. Ranges are inserted as space-separated +fields, so you can embed them in list or vector syntax. + +Here are a few examples---note how the @samp{N} mode is used when we do +computations in Lisp: @example @r{Swap the first two characters of the content of column 1} @@ -2657,7 +2755,7 @@ happening, in particular in range references, anchor ranges at the table borders (using @code{@@<}, @code{@@>}, @code{$<}, @code{$>}), or at hlines using the @code{@@I} notation. Automatic adaptation of field references does -of cause not happen if you edit the table structure with normal editing +of course not happen if you edit the table structure with normal editing commands---then you must fix the equations yourself. Instead of typing an equation into the field, you may also use the following @@ -2899,7 +2997,7 @@ | # | Peter | 10 | 8 | 23 | 41 | 8.2 | | # | Sam | 2 | 4 | 3 | 9 | 1.8 | |---+---------+--------+--------+--------+-------+------| -| | Average | | | | 29.7 | | +| | Average | | | | 25.0 | | | ^ | | | | | at | | | $ | max=50 | | | | | | |---+---------+--------+--------+--------+-------+------| @@ -3227,6 +3325,8 @@ vm:folder @r{VM folder link} vm:folder#id @r{VM message link} vm://myself@@some.where.org/folder#id @r{VM on remote machine} +vm-imap:account:folder @r{VM IMAP folder link} +vm-imap:account:folder#id @r{VM IMAP message link} wl:folder @r{WANDERLUST folder link} wl:folder#id @r{WANDERLUST message link} mhe:folder @r{MH-E folder link} @@ -3498,18 +3598,26 @@ @smalllisp @group (setq org-link-abbrev-alist - '(("bugzilla" . "http://10.1.2.9/bugzilla/show_bug.cgi?id=") - ("google" . "http://www.google.com/search?q=") - ("gmap" . "http://maps.google.com/maps?q=%s") - ("omap" . "http://nominatim.openstreetmap.org/search?q=%s&polygon=1") - ("ads" . "http://adsabs.harvard.edu/cgi-bin/nph-abs_connect?author=%s&db_key=AST"))) + '(("bugzilla" . "http://10.1.2.9/bugzilla/show_bug.cgi?id=") + ("url-to-ja" . "http://translate.google.fr/translate?sl=en&tl=ja&u=%h") + ("google" . "http://www.google.com/search?q=") + ("gmap" . "http://maps.google.com/maps?q=%s") + ("omap" . "http://nominatim.openstreetmap.org/search?q=%s&polygon=1") + ("ads" . "http://adsabs.harvard.edu/cgi-bin/nph-abs_connect?author=%s&db_key=AST"))) @end group @end smalllisp If the replacement text contains the string @samp{%s}, it will be -replaced with the tag. Otherwise the tag will be appended to the string -in order to create the link. You may also specify a function that will -be called with the tag as the only argument to create the link. +replaced with the tag. Using @samp{%h} instead of @samp{%s} will +url-encode the tag (see the example above, where we need to encode +the URL parameter.) Using @samp{%(my-function)} will pass the tag +to a custom function, and replace it by the resulting string. + +If the replacement text don't contain any specifier, it will simply +be appended to the string in order to create the link. + +Instead of a string, you may also specify a function that will be +called with the tag as the only argument to create the link. With the above setting, you could link to a specific bug with @code{[[bugzilla:129]]}, search the web for @samp{OrgMode} with @@ -3567,7 +3675,7 @@ Search for a link target @samp{<>}, or do a text search for @samp{my target}, similar to the search in internal links, see @ref{Internal links}. In HTML export (@pxref{HTML export}), such a file -link will become an HTML reference to the corresponding named anchor in +link will become a HTML reference to the corresponding named anchor in the linked file. @item *My Target In an Org file, restrict search to headlines. @@ -3844,9 +3952,10 @@ @subsection Fast access to TODO states If you would like to quickly change an entry to an arbitrary TODO state -instead of cycling through the states, you can set up keys for -single-letter access to the states. This is done by adding the section -key after each keyword, in parentheses. For example: +instead of cycling through the states, you can set up keys for single-letter +access to the states. This is done by adding the selection character after +each keyword, in parentheses@footnote{All characters are allowed except +@code{@@^!}, which have a special meaning here.}. For example: @lisp (setq org-todo-keywords @@ -4065,9 +4174,11 @@ headline as an itemized list, newest first@footnote{See the variable @code{org-log-states-order-reversed}}. When taking a lot of notes, you might want to get the notes out of the way into a drawer (@pxref{Drawers}). -Customize the variable @code{org-log-into-drawer} to get this -behavior---the recommended drawer for this is called @code{LOGBOOK}. You can -also overrule the setting of this variable for a subtree by setting a +Customize the variable @code{org-log-into-drawer} to get this behavior---the +recommended drawer for this is called @code{LOGBOOK}@footnote{Note that the +@code{LOGBOOK} drawer is unfolded when pressing @key{SPC} in the agenda to +show an entry---use @key{C-u SPC} to keep it folded here}. You can also +overrule the setting of this variable for a subtree by setting a @code{LOG_INTO_DRAWER} property. Since it is normally too much to record a note for every state, Org mode @@ -4157,10 +4268,10 @@ syntax @samp{.+2d/3d}, which says that you want to do the task at least every three days, but at most every two days. @item -You must also have state logging for the @code{DONE} state enabled, in order -for historical data to be represented in the consistency graph. If it is not -enabled it is not an error, but the consistency graphs will be largely -meaningless. +You must also have state logging for the @code{DONE} state enabled +(@pxref{Tracking TODO state changes}), in order for historical data to be +represented in the consistency graph. If it is not enabled it is not an +error, but the consistency graphs will be largely meaningless. @end enumerate To give you an idea of what the above rules look like in action, here's an @@ -4872,8 +4983,8 @@ @orgcmd{C-c C-x p,org-set-property} Set a property. This prompts for a property name and a value. If necessary, the property drawer is created as well. -@item M-x org-insert-property-drawer -@findex org-insert-property-drawer +@item C-u M-x org-insert-drawer +@cindex org-insert-drawer Insert a property drawer into the current entry. The drawer will be inserted early in the entry, but after the lines with planning information like deadlines. @@ -4904,6 +5015,7 @@ property names are special and (except for @code{:CATEGORY:}) should not be used as keys in the properties drawer: +@cindex property, special, ID @cindex property, special, TODO @cindex property, special, TAGS @cindex property, special, ALLTAGS @@ -4915,11 +5027,14 @@ @cindex property, special, TIMESTAMP @cindex property, special, TIMESTAMP_IA @cindex property, special, CLOCKSUM +@cindex property, special, CLOCKSUM_T @cindex property, special, BLOCKED @c guessing that ITEM is needed in this area; also, should this list be sorted? @cindex property, special, ITEM @cindex property, special, FILE @example +ID @r{A globally unique ID used for synchronization during} + @r{iCalendar or MobileOrg export.} TODO @r{The TODO keyword of the entry.} TAGS @r{The tags defined directly in the headline.} ALLTAGS @r{All tags, including inherited ones.} @@ -4932,8 +5047,11 @@ TIMESTAMP_IA @r{The first inactive timestamp in the entry.} CLOCKSUM @r{The sum of CLOCK intervals in the subtree. @code{org-clock-sum}} @r{must be run first to compute the values in the current buffer.} +CLOCKSUM_T @r{The sum of CLOCK intervals in the subtree for today.} + @r{@code{org-clock-sum-today} must be run first to compute the} + @r{values in the current buffer.} BLOCKED @r{"t" if task is currently blocked by children or siblings} -ITEM @r{The content of the entry.} +ITEM @r{The headline of the entry.} FILE @r{The filename the entry is located in.} @end example @@ -5149,7 +5267,7 @@ @example :COLUMNS: %25ITEM %9Approved(Approved?)@{X@} %Owner %11Status \@footnote{Please note that the COLUMNS definition must be on a single line---it is wrapped here only because of formatting constraints.} - %10Time_Estimate@{:@} %CLOCKSUM + %10Time_Estimate@{:@} %CLOCKSUM %CLOCKSUM_T :Owner_ALL: Tammy Mark Karl Lisa Don :Status_ALL: "In progress" "Not started yet" "Finished" "" :Approved_ALL: "[ ]" "[X]" @@ -5168,8 +5286,9 @@ be created for the @samp{Time_Estimate} column by adding time duration expressions like HH:MM, and for the @samp{Approved} column, by providing an @samp{[X]} status if all children have been checked. The -@samp{CLOCKSUM} column is special, it lists the sum of CLOCK intervals -in the subtree. +@samp{CLOCKSUM} and @samp{CLOCKSUM_T} columns are special, they lists the +sums of CLOCK intervals in the subtree, either for all clocks or just for +today. @node Using column view, Capturing column view, Defining columns, Column view @subsection Using column view @@ -5370,8 +5489,10 @@ plain timestamp will be shown exactly on that date. @example -* Meet Peter at the movies <2006-11-01 Wed 19:15> -* Discussion on climate change <2006-11-02 Thu 20:00-22:00> +* Meet Peter at the movies + <2006-11-01 Wed 19:15> +* Discussion on climate change + <2006-11-02 Thu 20:00-22:00> @end example @item Timestamp with repeater interval @@ -5382,7 +5503,8 @@ following will show up in the agenda every Wednesday: @example -* Pick up Sam at school <2007-05-16 Wed 12:30 +1w> +* Pick up Sam at school + <2007-05-16 Wed 12:30 +1w> @end example @item Diary-style sexp entries @@ -5426,7 +5548,8 @@ @emph{not} trigger an entry to show up in the agenda. @example -* Gillian comes late for the fifth time [2006-11-01 Wed] +* Gillian comes late for the fifth time + [2006-11-01 Wed] @end example @end table @@ -5825,9 +5948,10 @@ @noindent the @code{+1m} is a repeater; the intended interpretation is that the task has a deadline on <2005-10-01> and repeats itself every (one) month starting -from that time. If you need both a repeater and a special warning period in -a deadline entry, the repeater should come first and the warning period last: -@code{DEADLINE: <2005-10-01 Sat +1m -3d>}. +from that time. You can use yearly, monthly, weekly, daily and hourly repeat +cookies by using the @code{y/w/m/d/h} letters. If you need both a repeater +and a special warning period in a deadline entry, the repeater should come +first and the warning period last: @code{DEADLINE: <2005-10-01 Sat +1m -3d>}. @vindex org-todo-repeat-to-state Deadlines and scheduled items produce entries in the agenda when they are @@ -5898,12 +6022,14 @@ @cindex time clocking Org mode allows you to clock the time you spend on specific tasks in a -project. When you start working on an item, you can start the clock. -When you stop working on that task, or when you mark the task done, the -clock is stopped and the corresponding time interval is recorded. It -also computes the total time spent on each subtree of a project. And it -remembers a history or tasks recently clocked, to that you can jump quickly -between a number of tasks absorbing your time. +project. When you start working on an item, you can start the clock. When +you stop working on that task, or when you mark the task done, the clock is +stopped and the corresponding time interval is recorded. It also computes +the total time spent on each subtree@footnote{Clocking only works if all +headings are indented with less than 30 stars. This is a hardcoded +limitation of `lmax' in `org-clock-sum'.} of a project. And it remembers a +history or tasks recently clocked, to that you can jump quickly between a +number of tasks absorbing your time. To save the clock history across Emacs sessions, use @lisp @@ -5928,6 +6054,7 @@ @table @kbd @orgcmd{C-c C-x C-i,org-clock-in} @vindex org-clock-into-drawer +@vindex org-clock-continuously @cindex property, LOG_INTO_DRAWER Start the clock on the current item (clock-in). This inserts the CLOCK keyword together with a timestamp. If this is not the first clocking of @@ -5938,9 +6065,10 @@ @code{CLOCK_INTO_DRAWER} or @code{LOG_INTO_DRAWER} property. When called with a @kbd{C-u} prefix argument, select the task from a list of recently clocked tasks. With two @kbd{C-u -C-u} prefixes, clock into the task at point and mark it as the default task. -The default task will always be available when selecting a clocking task, -with letter @kbd{d}.@* +C-u} prefixes, clock into the task at point and mark it as the default task; +the default task will then always be available with letter @kbd{d} when +selecting a clocking task. With three @kbd{C-u C-u C-u} prefixes, force +continuous clocking by starting the clock when the last clock stopped.@* @cindex property: CLOCK_MODELINE_TOTAL @cindex property: LAST_REPEAT @vindex org-clock-modeline-total @@ -5970,6 +6098,12 @@ possibility to record an additional note together with the clock-out timestamp@footnote{The corresponding in-buffer setting is: @code{#+STARTUP: lognoteclock-out}}. +@orgcmd{C-c C-x C-x,org-clock-in-last} +@vindex org-clock-continuously +Reclock the last clocked task. With one @kbd{C-u} prefix argument, +select the task from the clock history. With two @kbd{C-u} prefixes, +force continuous clocking by starting the clock when the last clock +stopped. @orgcmd{C-c C-x C-e,org-clock-modify-effort-estimate} Update the effort estimate for the current clock task. @kindex C-c C-y @@ -5979,12 +6113,18 @@ is only necessary if you edit the timestamps directly. If you change them with @kbd{S-@key{cursor}} keys, the update is automatic. @orgcmd{C-S-@key{up/down},org-clock-timestamps-up/down} -On @code{CLOCK} log lines, increase/decrease both timestamps at the same -time so that duration keeps the same. +On @code{CLOCK} log lines, increase/decrease both timestamps so that the +clock duration keeps the same. +@orgcmd{S-M-@key{up/down},org-timestamp-up/down} +On @code{CLOCK} log lines, increase/decrease the timestamp at point and +the one of the previous (or the next clock) timestamp by the same duration. +For example, if you hit @kbd{S-M-@key{up}} to increase a clocked-out timestamp +by five minutes, then the clocked-in timestamp of the next clock will be +increased by five minutes. @orgcmd{C-c C-t,org-todo} Changing the TODO state of an item to DONE automatically stops the clock if it is running in this same item. -@orgcmd{C-c C-x C-x,org-clock-cancel} +@orgcmd{C-c C-x C-q,org-clock-cancel} Cancel the current clock. This is useful if a clock was started by mistake, or if you ended up working on something else. @orgcmd{C-c C-x C-j,org-clock-goto} @@ -6004,6 +6144,10 @@ the agenda (@pxref{Weekly/daily agenda}) to show which tasks have been worked on or closed during a day. +@strong{Important:} note that both @code{org-clock-out} and +@code{org-clock-in-last} can have a global keybinding and will not +modify the window disposition. + @node The clock table, Resolving idle time, Clocking commands, Clocking work time @subsection The clock table @cindex clocktable, dynamic block @@ -6141,7 +6285,9 @@ @end example @node Resolving idle time, , The clock table, Clocking work time -@subsection Resolving idle time +@subsection Resolving idle time and continuous clocking + +@subsubheading Resolving idle time @cindex resolve idle time @cindex idle, resolve, dangling @@ -6156,12 +6302,12 @@ being idle for that many minutes@footnote{On computers using Mac OS X, idleness is based on actual user idleness, not just Emacs' idle time. For X11, you can install a utility program @file{x11idle.c}, available in the -UTILITIES directory of the Org git distribution, to get the same general -treatment of idleness. On other systems, idle time refers to Emacs idle time -only.}, and ask what you want to do with the idle time. There will be a -question waiting for you when you get back, indicating how much idle time has -passed (constantly updated with the current amount), as well as a set of -choices to correct the discrepancy: +@code{contrib/scripts} directory of the Org git distribution, to get the same +general treatment of idleness. On other systems, idle time refers to Emacs +idle time only.}, and ask what you want to do with the idle time. There will +be a question waiting for you when you get back, indicating how much idle +time has passed (constantly updated with the current amount), as well as a +set of choices to correct the discrepancy: @table @kbd @item k @@ -6206,7 +6352,19 @@ to a recovery event rather than a set amount of idle time. You can also check all the files visited by your Org agenda for dangling -clocks at any time using @kbd{M-x org-resolve-clocks}. +clocks at any time using @kbd{M-x org-resolve-clocks RET} (or @kbd{C-c C-x C-z}). + +@subsubheading Continuous clocking +@cindex continuous clocking +@vindex org-clock-continuously + +You may want to start clocking from the time when you clocked out the +previous task. To enable this systematically, set @code{org-clock-continuously} +to @code{t}. Each time you clock in, Org retrieves the clock-out time of the +last clocked entry for this session, and start the new clock from there. + +If you only want this from time to time, use three universal prefix arguments +with @code{org-clock-in} and two @kbd{C-u C-u} with @code{org-clock-in-last}. @node Effort estimates, Relative timer, Clocking work time, Dates and Times @section Effort estimates @@ -6436,6 +6594,15 @@ Visit the last stored capture item in its buffer. @end table +@vindex org-capture-bookmark +@cindex org-capture-last-stored +You can also jump to the bookmark @code{org-capture-last-stored}, which will +automatically be created unless you set @code{org-capture-bookmark} to +@code{nil}. + +To insert the capture at point in an Org buffer, call @code{org-capture} with +a @code{C-0} prefix argument. + @node Capture templates, , Using capture, Capture @subsection Capture templates @cindex templates, for Capture @@ -6490,6 +6657,7 @@ @menu * Template elements:: What is needed for a complete template entry * Template expansion:: Filling in information about time and context +* Templates in contexts:: Only show a template in a specific context @end menu @node Template elements, Template expansion, Capture templates, Capture templates @@ -6633,36 +6801,38 @@ @end table @end table -@node Template expansion, , Template elements, Capture templates +@node Template expansion, Templates in contexts, Template elements, Capture templates @subsubsection Template expansion In the template itself, special @kbd{%}-escapes@footnote{If you need one of -these sequences literally, escape the @kbd{%} with a backslash.} allow +these sequences literally, escape the @kbd{%} with a backslash.} allow dynamic insertion of content. The templates are expanded in the order given here: @smallexample -%[@var{file}] @r{insert the contents of the file given by @var{file}.} -%(@var{sexp}) @r{evaluate Elisp @var{sexp} and replace with the result.} -%<...> @r{the result of format-time-string on the ... format specification.} -%t @r{timestamp, date only.} -%T @r{timestamp with date and time.} -%u, %U @r{like the above, but inactive timestamps.} -%a @r{annotation, normally the link created with @code{org-store-link}.} -%i @r{initial content, the region when capture is called while the} +%[@var{file}] @r{Insert the contents of the file given by @var{file}.} +%(@var{sexp}) @r{Evaluate Elisp @var{sexp} and replace with the result.} + @r{The sexp must return a string.} +%<...> @r{The result of format-time-string on the ... format specification.} +%t @r{Timestamp, date only.} +%T @r{Timestamp, with date and time.} +%u, %U @r{Like the above, but inactive timestamps.} +%i @r{Initial content, the region when capture is called while the} @r{region is active.} @r{The entire text will be indented like @code{%i} itself.} -%A @r{like @code{%a}, but prompt for the description part.} +%a @r{Annotation, normally the link created with @code{org-store-link}.} +%A @r{Like @code{%a}, but prompt for the description part.} +%l @r{Like %a, but only insert the literal link.} %c @r{Current kill ring head.} %x @r{Content of the X clipboard.} -%k @r{title of the currently clocked task.} -%K @r{link to the currently clocked task.} -%n @r{user name (taken from @code{user-full-name}).} -%f @r{file visited by current buffer when org-capture was called.} -%F @r{full path of the file or directory visited by current buffer.} -%:keyword @r{specific information for certain link types, see below.} -%^g @r{prompt for tags, with completion on tags in target file.} -%^G @r{prompt for tags, with completion all tags in all agenda files.} -%^t @r{like @code{%t}, but prompt for date. Similarly @code{%^T}, @code{%^u}, @code{%^U}.} +%k @r{Title of the currently clocked task.} +%K @r{Link to the currently clocked task.} +%n @r{User name (taken from @code{user-full-name}).} +%f @r{File visited by current buffer when org-capture was called.} +%F @r{Full path of the file or directory visited by current buffer.} +%:keyword @r{Specific information for certain link types, see below.} +%^g @r{Prompt for tags, with completion on tags in target file.} +%^G @r{Prompt for tags, with completion all tags in all agenda files.} +%^t @r{Like @code{%t}, but prompt for date. Similarly @code{%^T}, @code{%^u}, @code{%^U}.} @r{You may define a prompt like @code{%^@{Birthday@}t}.} %^C @r{Interactive selection of which kill or clip to use.} %^L @r{Like @code{%^C}, but insert as link.} @@ -6671,6 +6841,9 @@ @r{You may specify a default value and a completion table with} @r{%^@{prompt|default|completion2|completion3...@}.} @r{The arrow keys access a prompt-specific history.} +%\n @r{Insert the text entered at the nth %^@{@var{prompt}@}, where @code{n} is} + @r{a number, starting from 1.} +%? @r{After completing the template, position cursor here.} @end smallexample @noindent @@ -6682,21 +6855,21 @@ @vindex org-from-is-user-regexp @smallexample -Link type | Available keywords -------------------------+---------------------------------------------- -bbdb | %:name %:company -irc | %:server %:port %:nick -vm, wl, mh, mew, rmail | %:type %:subject %:message-id - | %:from %:fromname %:fromaddress - | %:to %:toname %:toaddress - | %:date @r{(message date header field)} - | %:date-timestamp @r{(date as active timestamp)} - | %:date-timestamp-inactive @r{(date as inactive timestamp)} - | %:fromto @r{(either "to NAME" or "from NAME")@footnote{This will always be the other, not the user. See the variable @code{org-from-is-user-regexp}.}} -gnus | %:group, @r{for messages also all email fields} -w3, w3m | %:url -info | %:file %:node -calendar | %:date +Link type | Available keywords +---------------------------------+---------------------------------------------- +bbdb | %:name %:company +irc | %:server %:port %:nick +vm, vm-imap, wl, mh, mew, rmail | %:type %:subject %:message-id + | %:from %:fromname %:fromaddress + | %:to %:toname %:toaddress + | %:date @r{(message date header field)} + | %:date-timestamp @r{(date as active timestamp)} + | %:date-timestamp-inactive @r{(date as inactive timestamp)} + | %:fromto @r{(either "to NAME" or "from NAME")@footnote{This will always be the other, not the user. See the variable @code{org-from-is-user-regexp}.}} +gnus | %:group, @r{for messages also all email fields} +w3, w3m | %:url +info | %:file %:node +calendar | %:date @end smallexample @noindent @@ -6706,6 +6879,29 @@ %? @r{After completing the template, position cursor here.} @end smallexample +@node Templates in contexts, , Template expansion, Capture templates +@subsubsection Templates in contexts + +@vindex org-capture-templates-contexts +To control whether a capture template should be accessible from a specific +context, you can customize @var{org-capture-templates-contexts}. Let's say +for example that you have a capture template @code{"p"} for storing Gnus +emails containing patches. Then you would configure this option like this: + +@example +(setq org-capture-templates-contexts + '(("p" (in-mode . "message-mode")))) +@end example + +You can also tell that the command key @code{"p"} should refer to another +template. In that case, add this command key like this: + +@example +(setq org-capture-templates-contexts + '(("p" "q" (in-mode . "message-mode")))) +@end example + +See the docstring of the variable for more information. @node Attachments, RSS Feeds, Capture, Capture - Refile - Archive @section Attachments @@ -6947,16 +7143,20 @@ @cindex archive locations The default archive location is a file in the same directory as the current file, with the name derived by appending @file{_archive} to the -current file name. For information and examples on how to change this, +current file name. You can also choose what heading to file archived +items under, with the possibility to add them to a datetree in a file. +For information and examples on how to specify the file and the heading, see the documentation string of the variable -@code{org-archive-location}. There is also an in-buffer option for -setting this variable, for example@footnote{For backward compatibility, -the following also works: If there are several such lines in a file, -each specifies the archive location for the text below it. The first -such line also applies to any text before its definition. However, -using this method is @emph{strongly} deprecated as it is incompatible -with the outline structure of the document. The correct method for -setting multiple archive locations in a buffer is using properties.}: +@code{org-archive-location}. + +There is also an in-buffer option for setting this variable, for +example@footnote{For backward compatibility, the following also works: +If there are several such lines in a file, each specifies the archive +location for the text below it. The first such line also applies to any +text before its definition. However, using this method is +@emph{strongly} deprecated as it is incompatible with the outline +structure of the document. The correct method for setting multiple +archive locations in a buffer is using properties.}: @cindex #+ARCHIVE @example @@ -7220,6 +7420,17 @@ backward compatibility, you can also press @kbd{0} to restrict to the current region/subtree.}. After pressing @kbd{< <}, you still need to press the character selecting the command. + +@item * +@vindex org-agenda-sticky +Toggle sticky agenda views. By default, Org maintains only a single agenda +buffer and rebuilds it each time you change the view, to make sure everything +is always up to date. If you switch between views often and the build time +bothers you, you can turn on sticky agenda buffers (make this the default by +customizing the variable @code{org-agenda-sticky}). With sticky agendas, the +dispatcher only switches to the selected view, you need to update it by hand +with @kbd{r} or @kbd{g}. You can toggle sticky agenda view any time with +@code{org-toggle-sticky-agenda}. @end table You can also define custom commands that will be accessible through the @@ -7368,11 +7579,13 @@ @cindex appointment @cindex reminders -Org can interact with Emacs appointments notification facility. To add all -the appointments of your agenda files, use the command -@code{org-agenda-to-appt}. This command also lets you filter through the -list of your appointments and add only those belonging to a specific category -or matching a regular expression. See the docstring for details. +Org can interact with Emacs appointments notification facility. To add the +appointments of your agenda files, use the command @code{org-agenda-to-appt}. +This command lets you filter through the list of your appointments and add +only those belonging to a specific category or matching a regular expression. +It also reads a @code{APPT_WARNTIME} property which will then override the +value of @code{appt-message-warning-time} for this appointment. See the +docstring for details. @node Global TODO list, Matching tags and properties, Weekly/daily agenda, Built-in agenda views @subsection The global TODO list @@ -7511,6 +7724,9 @@ that have the tag @samp{boss} and are @emph{not} marked with the TODO keyword DONE. In buffers with @code{org-odd-levels-only} set, @samp{LEVEL} does not count the number of stars, but @samp{LEVEL=2} will correspond to 3 stars etc. +The ITEM special property cannot currently be used in tags/property +searches@footnote{But @pxref{x-agenda-skip-entry-regexp, +,skipping entries based on regexp}.}. Here are more examples: @table @samp @@ -8218,21 +8434,6 @@ @orgcmd{C-c C-d,org-agenda-deadline} Set a deadline for this item. With prefix arg remove the deadline. @c -@orgcmd{k,org-agenda-action} -Agenda actions, to set dates for selected items to the cursor date. -This command also works in the calendar! The command prompts for an -additional key: -@example -m @r{Mark the entry at point for action. You can also make entries} - @r{in Org files with @kbd{C-c C-x C-k}.} -d @r{Set the deadline of the marked entry to the date at point.} -s @r{Schedule the marked entry at the date at point.} -r @r{Call @code{org-capture} with the cursor date as default date.} -@end example -@noindent -Press @kbd{r} afterward to refresh the agenda and see the effect of the -command. -@c @orgcmd{S-@key{right},org-agenda-do-date-later} Change the timestamp associated with the current line by one day into the future. If the date is in the past, the first call to this command will move @@ -8265,9 +8466,18 @@ @c @orgcmd{J,org-agenda-clock-goto} Jump to the running clock in another window. +@c +@orgcmd{k,org-agenda-capture} +Like @code{org-capture}, but use the date at point as the default date for +the capture template. See @var{org-capture-use-agenda-date} to make this +the default behavior of @code{org-capture}. +@cindex capturing, from agenda +@vindex org-capture-use-agenda-date @tsubheading{Bulk remote editing selected entries} @cindex remote editing, bulk, from agenda +@vindex org-agenda-bulk-persistent-marks +@vindex org-agenda-bulk-custom-functions @orgcmd{m,org-agenda-bulk-mark} Mark the entry at point for bulk action. With prefix arg, mark that many @@ -8286,10 +8496,12 @@ Bulk action: act on all marked entries in the agenda. This will prompt for another key to select the action to be applied. The prefix arg to @kbd{B} will be passed through to the @kbd{s} and @kbd{d} commands, to bulk-remove -these special timestamps. +these special timestamps. By default, marks are removed after the bulk. If +you want them to persist, set @code{org-agenda-bulk-persistent-marks} to +@code{t} or hit @kbd{p} at the prompt. + @example -r @r{Prompt for a single refile target and move all entries. The entries} - @r{will no longer be in the agenda; refresh (@kbd{g}) to bring them back.} +* @r{Toggle persistent marks.} $ @r{Archive all selected entries.} A @r{Archive entries by moving them to their respective archive siblings.} t @r{Change TODO state. This prompts for a single TODO keyword and} @@ -8300,10 +8512,12 @@ s @r{Schedule all items to a new date. To shift existing schedule dates} @r{by a fixed number of days, use something starting with double plus} @r{at the prompt, for example @samp{++8d} or @samp{++2w}.} +d @r{Set deadline to a specific date.} +r @r{Prompt for a single refile target and move all entries. The entries} + @r{will no longer be in the agenda; refresh (@kbd{g}) to bring them back.} S @r{Reschedule randomly into the coming N days. N will be prompted for.} @r{With prefix arg (@kbd{C-u B S}), scatter only across weekdays.} -d @r{Set deadline to a specific date.} -f @r{Apply a function to marked entries.} +f @r{Apply a function@footnote{You can also create persistent custom functions through@code{org-agenda-bulk-custom-functions}.} to marked entries.} @r{For example, the function below sets the CATEGORY property of the} @r{entries to web.} @r{(defun set-category ()} @@ -8371,7 +8585,7 @@ This is a globally available command, and also available in the agenda menu. @tsubheading{Exporting to a file} -@orgcmd{C-x C-w,org-write-agenda} +@orgcmd{C-x C-w,org-agenda-write} @cindex exporting agenda views @cindex agenda views, exporting @vindex org-agenda-exporter-settings @@ -8420,11 +8634,12 @@ buffer). @kindex C-c a C @vindex org-agenda-custom-commands + Custom commands are configured in the variable @code{org-agenda-custom-commands}. You can customize this variable, for -example by pressing @kbd{C-c a C}. You can also directly set it with -Emacs Lisp in @file{.emacs}. The following example contains all valid -search types: +example by pressing @kbd{C-c a C}. You can also directly set it with Emacs +Lisp in @file{.emacs}. The following example contains all valid search +types: @lisp @group @@ -8584,6 +8799,27 @@ value is a string, you need to add the double-quotes around the value yourself. +@vindex org-agenda-custom-commands-contexts +To control whether an agenda command should be accessible from a specific +context, you can customize @var{org-agenda-custom-commands-contexts}. Let's +say for example that you have an agenda commands @code{"o"} displaying a view +that you only need when reading emails. Then you would configure this option +like this: + +@example +(setq org-agenda-custom-commands-contexts + '(("o" (in-mode . "message-mode")))) +@end example + +You can also tell that the command key @code{"o"} should refer to another +command key @code{"r"}. In that case, add this command key like this: + +@example +(setq org-agenda-custom-commands-contexts + '(("o" "r" (in-mode . "message-mode")))) +@end example + +See the docstring of the variable for more information. @node Exporting Agenda Views, Agenda column view, Custom agenda views, Agenda Views @section Exporting Agenda Views @@ -8598,7 +8834,7 @@ you want to do this only occasionally, use the command @table @kbd -@orgcmd{C-x C-w,org-write-agenda} +@orgcmd{C-x C-w,org-agenda-write} @cindex exporting agenda views @cindex agenda views, exporting @vindex org-agenda-exporter-settings @@ -8777,6 +9013,14 @@ applications for column view in the agenda. If you want information about clocked time in the displayed period use clock table mode (press @kbd{R} in the agenda). + +@item +@cindex property, special, CLOCKSUM_T +When the column view in the agenda shows the @code{CLOCKSUM_T}, that is +always today's clocked time for this item. So even in the weekly agenda, +the clocksum listed in column view only originates from today. This lets +you compare the time you spent on a task for today, with the time already +spent (via @code{CLOCKSUM}) and with the planned total effort for it. @end enumerate @@ -8988,11 +9232,11 @@ @cindex exporting, not @cindex #+BEGIN_COMMENT -Lines starting with @samp{#} in column zero are treated as comments and will -never be exported. If you want an indented line to be treated as a comment, -start it with @samp{#+ }. Also entire subtrees starting with the word -@samp{COMMENT} will never be exported. Finally, regions surrounded by -@samp{#+BEGIN_COMMENT} ... @samp{#+END_COMMENT} will not be exported. +Lines starting with zero or more whitespace characters followed by @samp{#} +are treated as comments and will never be exported. Also entire subtrees +starting with the word @samp{COMMENT} will never be exported. Finally, +regions surrounded by @samp{#+BEGIN_COMMENT} ... @samp{#+END_COMMENT} will +not be exported. @table @kbd @kindex C-c ; @@ -9016,7 +9260,7 @@ @example #+CAPTION: This is the caption for the next table (or link) -#+LABEL: tbl:basic-data +#+LABEL: tab:basic-data | ... | ...| |-----|----| @end example @@ -9080,23 +9324,14 @@ the HTML backend (it requires version 1.34 of the @file{htmlize.el} package, which is distributed with Org). Fontified code chunks in @LaTeX{} can be achieved using either the listings or the -@url{http://code.google.com/p/minted, minted,} package. To use listings, turn -on the variable @code{org-export-latex-listings} and ensure that the listings -package is included by the @LaTeX{} header (e.g.@: by configuring -@code{org-export-latex-packages-alist}). See the listings documentation for -configuration options, including obtaining colored output. For minted it is -necessary to install the program @url{http://pygments.org, pygments}, in -addition to setting @code{org-export-latex-minted}, ensuring that the minted -package is included by the @LaTeX{} header, and ensuring that the -@code{-shell-escape} option is passed to @file{pdflatex} (see -@code{org-latex-to-pdf-process}). See the documentation of the variables -@code{org-export-latex-listings} and @code{org-export-latex-minted} for -further details.}. This is done with the @samp{src} block, where you also -need to specify the name of the major mode that should be used to fontify the -example@footnote{Code in @samp{src} blocks may also be evaluated either -interactively or on export. See @pxref{Working With Source Code} for more -information on evaluating code blocks.}, see @ref{Easy Templates} for -shortcuts to easily insert code blocks. +@url{http://code.google.com/p/minted, minted,} package. Refer to +@code{org-export-latex-listings} documentation for details.}. This is done +with the @samp{src} block, where you also need to specify the name of the +major mode that should be used to fontify the example@footnote{Code in +@samp{src} blocks may also be evaluated either interactively or on export. +See @pxref{Working With Source Code} for more information on evaluating code +blocks.}, see @ref{Easy Templates} for shortcuts to easily insert code +blocks. @cindex #+BEGIN_SRC @example @@ -9276,7 +9511,7 @@ @menu * Special symbols:: Greek letters and other symbols * Subscripts and superscripts:: Simple syntax for raising/lowering text -* @LaTeX{} fragments:: Complex formulas made easy +* @LaTeX{} fragments:: Complex formulas made easy * Previewing @LaTeX{} fragments:: What will this snippet look like? * CDLaTeX mode:: Speed up entering of formulas @end menu @@ -9382,10 +9617,11 @@ server in order to limit the load of our server.}. Finally, it can also process the mathematical expressions into images@footnote{For this to work you need to be on a system with a working @LaTeX{} installation. You also -need the @file{dvipng} program, available at -@url{http://sourceforge.net/projects/dvipng/}. The @LaTeX{} header that will -be used when processing a fragment can be configured with the variable -@code{org-format-latex-header}.} that can be displayed in a browser or in +need the @file{dvipng} program or the @file{convert}, respectively available +at @url{http://sourceforge.net/projects/dvipng/} and from the +@file{imagemagick} suite. The @LaTeX{} header that will be used when +processing a fragment can be configured with the variable +@code{org-format-latex-header}.} that can be displayed in a browser or in DocBook documents. @LaTeX{} fragments don't need any special marking at all. The following @@ -9630,7 +9866,7 @@ @cindex #+EXPORT_SELECT_TAGS @cindex #+EXPORT_EXCLUDE_TAGS @cindex #+XSLT -@cindex #+LATEX_HEADER +@cindex #+LaTeX_HEADER @vindex user-full-name @vindex user-mail-address @vindex org-export-default-language @@ -9650,7 +9886,7 @@ @r{You need to confirm using these, or configure @code{org-export-allow-BIND}} #+LINK_UP: the ``up'' link of an exported page #+LINK_HOME: the ``home'' link of an exported page -#+LATEX_HEADER: extra line(s) for the @LaTeX{} header, like \usepackage@{xyz@} +#+LaTeX_HEADER: extra line(s) for the @LaTeX{} header, like \usepackage@{xyz@} #+EXPORT_SELECT_TAGS: Tags that select a tree for export #+EXPORT_EXCLUDE_TAGS: Tags that exclude a tree from export #+XSLT: the XSLT stylesheet used by DocBook exporter to generate FO file @@ -9707,7 +9943,7 @@ email: @r{turn on/off inclusion of author email into exported file} creator: @r{turn on/off inclusion of creator info into exported file} timestamp: @r{turn on/off inclusion creation time into exported file} -d: @r{turn on/off inclusion of drawers} +d: @r{turn on/off inclusion of drawers, or list drawers to include} @end example @noindent These options take effect in both the HTML and @LaTeX{} export, except for @@ -9770,7 +10006,7 @@ @table @kbd @orgcmd{C-c C-e a,org-export-as-ascii} @cindex property, EXPORT_FILE_NAME -Export as ASCII file. For an Org file, @file{myfile.org}, the ASCII file +Export as an ASCII file. For an Org file, @file{myfile.org}, the ASCII file will be @file{myfile.txt}. The file will be overwritten without warning. If there is an active region@footnote{This requires @code{transient-mark-mode} be turned on.}, only the region will be @@ -9802,13 +10038,13 @@ @end example @noindent -creates only top level headlines and does the rest as items. When +creates only top level headlines and exports the rest as items. When headlines are converted to items, the indentation of the text following the headline is changed to fit nicely under the item. This is done with the assumption that the first body line indicates the base indentation of the body text. Any indentation larger than this is adjusted to preserve the layout relative to the first line. Should there be lines with less -indentation than the first, these are left alone. +indentation than the first one, these are left alone. @vindex org-export-ascii-links-to-notes Links will be exported in a footnote-like style, with the descriptive part in @@ -9819,7 +10055,7 @@ @section HTML export @cindex HTML export -Org mode contains an HTML (XHTML 1.0 strict) exporter with extensive +Org mode contains a HTML (XHTML 1.0 strict) exporter with extensive HTML formatting, in ways similar to John Gruber's @emph{markdown} language, but with additional support for tables. @@ -9845,7 +10081,7 @@ @table @kbd @orgcmd{C-c C-e h,org-export-as-html} @cindex property, EXPORT_FILE_NAME -Export as HTML file. For an Org file @file{myfile.org}, +Export as a HTML file. For an Org file @file{myfile.org}, the HTML file will be @file{myfile.html}. The file will be overwritten without warning. If there is an active region@footnote{This requires @code{transient-mark-mode} be turned on.}, only the region will be @@ -9854,7 +10090,7 @@ title. If the tree head entry has, or inherits, an @code{EXPORT_FILE_NAME} property, that name will be used for the export. @orgcmd{C-c C-e b,org-export-as-html-and-open} -Export as HTML file and immediately open it with a browser. +Export as a HTML file and immediately open it with a browser. @orgcmd{C-c C-e H,org-export-as-html-to-buffer} Export to a temporary buffer. Do not create a file. @orgcmd{C-c C-e R,org-export-region-as-html} @@ -9864,7 +10100,7 @@ @item C-c C-e v h/b/H/R Export only the visible part of the document. @item M-x org-export-region-as-html -Convert the region to HTML under the assumption that it was Org mode +Convert the region to HTML under the assumption that it was in Org mode syntax before. This is a global command that can be invoked in any buffer. @item M-x org-replace-region-by-HTML @@ -9901,11 +10137,11 @@ The HTML exporter lets you define a preamble and a postamble. The default value for @code{org-export-html-preamble} is @code{t}, which -means that the preamble is inserted depending on the relevant formatting -string in @code{org-export-html-preamble-format}. +means that the preamble is inserted depending on the relevant format string +in @code{org-export-html-preamble-format}. Setting @code{org-export-html-preamble} to a string will override the default -formatting string. Setting it to a function, will insert the output of the +format string. Setting it to a function, will insert the output of the function, which must be a string; such a function takes no argument but you can check against the value of @code{opt-plist}, which contains the list of publishing properties for the current file. Setting to @code{nil} will not @@ -9917,7 +10153,7 @@ @code{org-export-creator-info} and @code{org-export-time-stamp-file}, @code{org-export-html-validation-link} and build the postamble from these values. Setting @code{org-export-html-postamble} to @code{t} will insert the -postamble from the relevant formatting string found in +postamble from the relevant format string found in @code{org-export-html-postamble-format}. Setting it to @code{nil} will not insert any postamble. @@ -9958,7 +10194,7 @@ targets}). Links to external files will still work if the target file is on the same @i{relative} path as the published Org file. Links to other @file{.org} files will be translated into HTML links under the assumption -that an HTML version also exists of the linked file, at the same relative +that a HTML version also exists of the linked file, at the same relative path. @samp{id:} links can then be used to jump to specific entries across files. For information related to linking files while publishing them to a publishing directory see @ref{Publishing links}. @@ -10199,7 +10435,7 @@ path: @r{The path to the script. The default is to grab the script from} @r{@url{http://orgmode.org/org-info.js}, but you might want to have} @r{a local copy and use a path like @samp{../scripts/org-info.js}.} -view: @r{Initial view when website is first shown. Possible values are:} +view: @r{Initial view when the website is first shown. Possible values are:} info @r{Info-like interface with one section per page.} overview @r{Folding interface, initially showing only top-level.} content @r{Folding interface, starting with all headlines visible.} @@ -10265,7 +10501,7 @@ @table @kbd @orgcmd{C-c C-e l,org-export-as-latex} @cindex property EXPORT_FILE_NAME -Export as @LaTeX{} file. For an Org file +Export as a @LaTeX{} file. For an Org file @file{myfile.org}, the @LaTeX{} file will be @file{myfile.tex}. The file will be overwritten without warning. If there is an active region@footnote{This requires @code{transient-mark-mode} be turned on.}, only the region will be @@ -10278,7 +10514,7 @@ @item C-c C-e v l/L Export only the visible part of the document. @item M-x org-export-region-as-latex -Convert the region to @LaTeX{} under the assumption that it was Org mode +Convert the region to @LaTeX{} under the assumption that it was in Org mode syntax before. This is a global command that can be invoked in any buffer. @item M-x org-replace-region-by-latex @@ -10322,11 +10558,11 @@ @vindex org-export-latex-classes @vindex org-export-latex-default-packages-alist @vindex org-export-latex-packages-alist -@cindex #+LATEX_HEADER -@cindex #+LATEX_CLASS -@cindex #+LATEX_CLASS_OPTIONS -@cindex property, LATEX_CLASS -@cindex property, LATEX_CLASS_OPTIONS +@cindex #+LaTeX_HEADER +@cindex #+LaTeX_CLASS +@cindex #+LaTeX_CLASS_OPTIONS +@cindex property, LaTeX_CLASS +@cindex property, LaTeX_CLASS_OPTIONS You can change this globally by setting a different value for @code{org-export-latex-default-class} or locally by adding an option like @code{#+LaTeX_CLASS: myclass} in your file, or with a @code{:LaTeX_CLASS:} @@ -10336,11 +10572,22 @@ @code{org-export-latex-default-packages-alist} and @code{org-export-latex-packages-alist} are spliced.}, and allows you to define the sectioning structure for each class. You can also define your own -classes there. @code{#+LaTeX_CLASS_OPTIONS} or a @code{LaTeX_CLASS_OPTIONS} -property can specify the options for the @code{\documentclass} macro. You -can also use @code{#+LATEX_HEADER: \usepackage@{xyz@}} to add lines to the -header. See the docstring of @code{org-export-latex-classes} for more -information. +classes there. @code{#+LaTeX_CLASS_OPTIONS} or a @code{:LaTeX_CLASS_OPTIONS:} +property can specify the options for the @code{\documentclass} macro. The +options to documentclass have to be provided, as expected by @LaTeX{}, within +square brackets. You can also use @code{#+LaTeX_HEADER: \usepackage@{xyz@}} +to add lines to the header. See the docstring of +@code{org-export-latex-classes} for more information. An example is shown +below. + +@example +#+LaTeX_CLASS: article +#+LaTeX_CLASS_OPTIONS: [a4paper] +#+LaTeX_HEADER: \usepackage@{xyz@} + +* Headline 1 + some text +@end example @node Quoting @LaTeX{} code, Tables in @LaTeX{} export, Header and sectioning, @LaTeX{} and PDF export @subsection Quoting @LaTeX{} code @@ -10424,9 +10671,7 @@ this option can be used with tables as well@footnote{One can also take advantage of this option to pass other, unrelated options into the figure or table environment. For an example see the section ``Exporting org files'' in -@url{http://orgmode.org/worg/org-hacks.html}}. For example the -@code{#+ATTR_LaTeX:} line below is exported as the @code{figure} environment -below it. +@url{http://orgmode.org/worg/org-hacks.html}}. If you would like to let text flow around the image, add the word @samp{wrap} to the @code{#+ATTR_LaTeX:} line, which will make the figure occupy the left @@ -10513,7 +10758,7 @@ Frames will automatically receive a @code{fragile} option if they contain source code that uses the verbatim environment. Special @file{beamer} specific code can be inserted using @code{#+BEAMER:} and -@code{#+BEGIN_beamer...#+end_beamer} constructs, similar to other export +@code{#+BEGIN_BEAMER...#+END_BEAMER} constructs, similar to other export backends, but with the difference that @code{#+LaTeX:} stuff will be included in the presentation as well. @@ -10613,7 +10858,7 @@ @table @kbd @orgcmd{C-c C-e D,org-export-as-docbook} @cindex property EXPORT_FILE_NAME -Export as DocBook file. For an Org file, @file{myfile.org}, the DocBook XML +Export as a DocBook file. For an Org file, @file{myfile.org}, the DocBook XML file will be @file{myfile.xml}. The file will be overwritten without warning. If there is an active region@footnote{This requires @code{transient-mark-mode} to be turned on}, only the region will be @@ -10622,12 +10867,12 @@ title. If the tree head entry has, or inherits, an @code{EXPORT_FILE_NAME} property, that name will be used for the export. @orgcmd{C-c C-e V,org-export-as-docbook-pdf-and-open} -Export as DocBook file, process to PDF, then open the resulting PDF file. +Export as a DocBook file, process to PDF, then open the resulting PDF file. @vindex org-export-docbook-xslt-proc-command @vindex org-export-docbook-xsl-fo-proc-command -Note that, in order to produce PDF output based on exported DocBook file, you -need to have XSLT processor and XSL-FO processor software installed on your +Note that, in order to produce PDF output based on an exported DocBook file, +you need to have XSLT processor and XSL-FO processor software installed on your system. Check variables @code{org-export-docbook-xslt-proc-command} and @code{org-export-docbook-xsl-fo-proc-command}. @@ -10791,7 +11036,7 @@ @cindex org-odt.el @cindex org-modules -Orgmode@footnote{Versions 7.8 or later} supports export to OpenDocument Text +Org Mode@footnote{Versions 7.8 or later} supports export to OpenDocument Text (ODT) format using the @file{org-odt.el} module. Documents created by this exporter use the @cite{OpenDocument-v1.2 specification}@footnote{@url{http://docs.oasis-open.org/office/v1.2/OpenDocument-v1.2.html, @@ -10848,7 +11093,7 @@ export. @orgcmd{C-c C-e O,org-export-as-odt-and-open} -Export as OpenDocument Text file and open the resulting file. +Export as an OpenDocument Text file and open the resulting file. @vindex org-export-odt-preferred-output-format If @code{org-export-odt-preferred-output-format} is specified, open the @@ -11180,11 +11425,11 @@ @table @kbd @item M-x org-export-as-odf -Convert a @LaTeX{} math snippet to OpenDocument formula (@file{.odf}) file. +Convert a @LaTeX{} math snippet to an OpenDocument formula (@file{.odf}) file. @item M-x org-export-as-odf-and-open -Convert a @LaTeX{} math snippet to OpenDocument formula (@file{.odf}) file and -open the formula file with the system-registered application. +Convert a @LaTeX{} math snippet to an OpenDocument formula (@file{.odf}) file +and open the formula file with the system-registered application. @end table @cindex dvipng @@ -11720,10 +11965,10 @@ @table @kbd @orgcmd{C-c C-e j,org-export-as-taskjuggler} -Export as TaskJuggler file. +Export as a TaskJuggler file. @orgcmd{C-c C-e J,org-export-as-taskjuggler-and-open} -Export as TaskJuggler file and then open the file with TaskJugglerUI. +Export as a TaskJuggler file and then open the file with TaskJugglerUI. @end table @subsection Tasks @@ -11833,7 +12078,7 @@ @table @kbd @orgcmd{C-c C-e m,org-export-as-freemind} -Export as Freemind mind map. For an Org file @file{myfile.org}, the Freemind +Export as a Freemind mind map. For an Org file @file{myfile.org}, the Freemind file will be @file{myfile.mm}. @end table @@ -11847,7 +12092,7 @@ @table @kbd @orgcmd{C-c C-e x,org-export-as-xoxo} -Export as XOXO file. For an Org file @file{myfile.org}, the XOXO file will be +Export as an XOXO file. For an Org file @file{myfile.org}, the XOXO file will be @file{myfile.html}. @orgkey{C-c C-e v x} Export only the visible part of the document. @@ -12318,7 +12563,7 @@ @end multitable The file will be created when first publishing a project with the -@code{:makeindex} set. The file only contains a statement @code{#+include: +@code{:makeindex} set. The file only contains a statement @code{#+INCLUDE: "theindex.inc"}. You can then build around this include statement by adding a title, style information, etc. @@ -12352,7 +12597,7 @@ that you can afford more easily to republish entire projects. If you set @code{org-publish-use-timestamps-flag} to @code{nil}, you gain the main benefit of re-including any changed external files such as source example -files you might include with @code{#+INCLUDE}. The timestamp mechanism in +files you might include with @code{#+INCLUDE:}. The timestamp mechanism in Org is not smart enough to detect if included files have been modified. @node Sample configuration, Triggering publication, Uploading files, Publishing @@ -12709,7 +12954,7 @@ @code{org-babel-results-keyword}. By default, the evaluation facility is only enabled for Lisp code blocks -specified as @code{emacs-lisp}. However, source code blocks in many languages +specified as @code{emacs-lisp}. However, source code blocks in many languages can be evaluated within Org mode (see @ref{Languages} for a list of supported languages and @ref{Structure of code blocks} for information on the syntax used to define a code block). @@ -12723,8 +12968,8 @@ its results into the Org mode buffer. @cindex #+CALL -It is also possible to evaluate named code blocks from anywhere in an -Org mode buffer or an Org mode table. Live code blocks located in the current +It is also possible to evaluate named code blocks from anywhere in an Org +mode buffer or an Org mode table. Live code blocks located in the current Org mode buffer or in the ``Library of Babel'' (see @ref{Library of Babel}) can be executed. Named code blocks can be executed with a separate @code{#+CALL:} line or inline within a block of text. @@ -12826,7 +13071,7 @@ Language-specific documentation is available for some languages. If available, it can be found at -@uref{http://orgmode.org/worg/org-contrib/babel/languages}. +@uref{http://orgmode.org/worg/org-contrib/babel/languages.html}. The @code{org-babel-load-languages} controls which languages are enabled for evaluation (by default only @code{emacs-lisp} is enabled). This variable can @@ -13018,7 +13263,7 @@ (message "data1:%S, data2:%S" data1 data2) #+END_SRC - #+results: + #+RESULTS: : data1:1, data2:2 @end example @@ -13030,7 +13275,7 @@ (message "data:%S" data) #+END_SRC - #+results: named-block + #+RESULTS: named-block : data:2 @end example @@ -13065,6 +13310,7 @@ * results:: Specify the type of results and how they will be collected and handled * file:: Specify a path for file output +* file-desc:: Specify a description for file results * dir:: Specify the default (possibly remote) directory for code block execution * exports:: Export code and/or results @@ -13088,6 +13334,7 @@ * rownames:: Handle row names in tables * shebang:: Make tangled files executable * eval:: Limit evaluation of specific code blocks +* wrap:: Mark source block evaluation results @end menu Additional header arguments are defined on a language-specific basis, see @@ -13102,7 +13349,7 @@ case, variables require a default value when they are declared. The values passed to arguments can either be literal values, references, or -Emacs Lisp code (see @ref{var, Emacs Lisp evaluation of variables}). References +Emacs Lisp code (see @ref{var, Emacs Lisp evaluation of variables}). References include anything in the Org mode file that takes a @code{#+NAME:}, @code{#+TBLNAME:}, or @code{#+RESULTS:} line. This includes tables, lists, @code{#+BEGIN_EXAMPLE} blocks, other code blocks, and the results of other @@ -13141,7 +13388,7 @@ (length table) #+END_SRC -#+results: table-length +#+RESULTS: table-length : 4 @end example @@ -13160,7 +13407,7 @@ (print x) #+END_SRC -#+results: +#+RESULTS: | simple | list | @end example @@ -13173,7 +13420,7 @@ (* 2 length) #+END_SRC -#+results: +#+RESULTS: : 8 @end example @@ -13188,7 +13435,7 @@ (* 2 input) #+END_SRC -#+results: double +#+RESULTS: double : 16 #+NAME: squared @@ -13196,7 +13443,7 @@ (* input input) #+END_SRC -#+results: squared +#+RESULTS: squared : 4 @end example @@ -13215,7 +13462,7 @@ (concatenate 'string x " for you.") #+END_SRC -#+results: read-literal-example +#+RESULTS: read-literal-example : A literal example : on two lines for you. @@ -13257,7 +13504,7 @@ data #+END_SRC -#+results: +#+RESULTS: : a @end example @@ -13278,7 +13525,7 @@ data #+END_SRC -#+results: +#+RESULTS: | 2 | b | | 3 | c | | 4 | d | @@ -13300,7 +13547,7 @@ data #+END_SRC -#+results: +#+RESULTS: | 1 | 2 | 3 | 4 | @end example @@ -13320,7 +13567,7 @@ data #+END_SRC -#+results: +#+RESULTS: | 11 | 14 | 17 | @end example @@ -13353,7 +13600,7 @@ $data #+END_SRC -#+results: +#+RESULTS: : (a b c) @end example @@ -13414,15 +13661,19 @@ @item @code{file} The results will be interpreted as the path to a file, and will be inserted into the Org mode buffer as a file link. E.g., @code{:results value file}. -@item @code{raw}, @code{org} +@item @code{raw} The results are interpreted as raw Org mode code and are inserted directly into the buffer. If the results look like a table they will be aligned as such by Org mode. E.g., @code{:results value raw}. +@item @code{org} +The results are will be enclosed in a @code{BEGIN_SRC org} block. +They are not comma-escaped by default but they will be if you hit @kbd{TAB} +in the block and/or if you export the file. E.g., @code{:results value org}. @item @code{html} -Results are assumed to be HTML and will be enclosed in a @code{begin_html} +Results are assumed to be HTML and will be enclosed in a @code{BEGIN_HTML} block. E.g., @code{:results value html}. @item @code{latex} -Results assumed to be @LaTeX{} and are enclosed in a @code{begin_latex} block. +Results assumed to be @LaTeX{} and are enclosed in a @code{BEGIN_LaTeX} block. E.g., @code{:results value latex}. @item @code{code} Result are assumed to be parsable code and are enclosed in a code block. @@ -13431,7 +13682,7 @@ The result is converted to pretty-printed code and is enclosed in a code block. This option currently supports Emacs Lisp, Python, and Ruby. E.g., @code{:results value pp}. -@item @code{wrap} +@item @code{drawer} The result is wrapped in a RESULTS drawer. This can be useful for inserting @code{raw} or @code{org} syntax results in such a way that their extent is known and they can be automatically removed or replaced. @@ -13459,7 +13710,7 @@ inserted as with @code{replace}. @end itemize -@node file, dir, results, Specific header arguments +@node file, file-desc, results, Specific header arguments @subsubsection @code{:file} The header argument @code{:file} is used to specify an external file in which @@ -13475,7 +13726,16 @@ a file, or a list of two strings in which case the first element of the list should be the path to a file and the second a description for the link. -@node dir, exports, file, Specific header arguments +@node file-desc, dir, file, Specific header arguments +@subsubsection @code{:file-desc} + +The value of the @code{:file-desc} header argument is used to provide a +description for file code block results which are inserted as Org mode links +(see @ref{Link format}). If the @code{:file-desc} header argument is given +with no value the link path will be placed in both the ``link'' and the +``description'' portion of the Org mode link. + +@node dir, exports, file-desc, Specific header arguments @subsubsection @code{:dir} and remote execution While the @code{:file} header argument can be used to specify the path to the @@ -13655,21 +13915,34 @@ @node noweb, noweb-ref, session, Specific header arguments @subsubsection @code{:noweb} -The @code{:noweb} header argument controls expansion of ``noweb'' style (see -@ref{Noweb reference syntax}) references in a code block. This header -argument can have one of three values: @code{yes}, @code{no}, or @code{tangle}. +The @code{:noweb} header argument controls expansion of ``noweb'' syntax +references (see @ref{Noweb reference syntax}) when the code block is +evaluated, tangled, or exported. The @code{:noweb} header argument can have +one of the five values: @code{no}, @code{yes}, @code{tangle}, or +@code{no-export} @code{strip-export}. @itemize @bullet +@item @code{no} +The default. ``Noweb'' syntax references in the body of the code block will +not be expanded before the code block is evaluated, tangled or exported. @item @code{yes} -All ``noweb'' syntax references in the body of the code block will be -expanded before the block is evaluated, tangled or exported. -@item @code{no} -The default. No ``noweb'' syntax specific action is taken when the code -block is evaluated, tangled or exported. +``Noweb'' syntax references in the body of the code block will be +expanded before the code block is evaluated, tangled or exported. @item @code{tangle} -All ``noweb'' syntax references in the body of the code block will be -expanded before the block is tangled, however ``noweb'' references will not -be expanded when the block is evaluated or exported. +``Noweb'' syntax references in the body of the code block will be expanded +before the code block is tangled. However, ``noweb'' syntax references will +not be expanded when the code block is evaluated or exported. +@item @code{no-export} +``Noweb'' syntax references in the body of the code block will be expanded +before the block is evaluated or tangled. However, ``noweb'' syntax +references will not be expanded when the code block is exported. +@item @code{strip-export} +``Noweb'' syntax references in the body of the code block will be expanded +before the block is evaluated or tangled. However, ``noweb'' syntax +references will not be removed when the code block is exported. +@item @code{eval} +``Noweb'' syntax references in the body of the code block will only be +expanded before the block is evaluated. @end itemize @subsubheading Noweb prefix lines @@ -13760,7 +14033,7 @@ unchanged code blocks. Note that the @code{:cache} header argument will not attempt to cache results when the @code{:session} header argument is used, because the results of the code block execution may be stored in the session -outside of the Org-mode buffer. The @code{:cache} header argument can have +outside of the Org mode buffer. The @code{:cache} header argument can have one of two values: @code{yes} or @code{no}. @itemize @bullet @@ -13770,7 +14043,7 @@ @item @code{yes} Every time the code block is run a SHA1 hash of the code and arguments passed to the block will be generated. This hash is packed into the -@code{#+results:} line and will be checked on subsequent +@code{#+RESULTS:} line and will be checked on subsequent executions of the code block. If the code block has not changed since the last time it was evaluated, it will not be re-evaluated. @end itemize @@ -13787,7 +14060,7 @@ runif(1) #+END_SRC - #+results[a2a72cd647ad44515fab62e144796432793d68e1]: random + #+RESULTS[a2a72cd647ad44515fab62e144796432793d68e1]: random 0.4659510825295 #+NAME: caller @@ -13795,7 +14068,7 @@ x #+END_SRC - #+results[bec9c8724e397d5df3b696502df3ed7892fc4f5f]: caller + #+RESULTS[bec9c8724e397d5df3b696502df3ed7892fc4f5f]: caller 0.254227238707244 @end example @@ -13839,7 +14112,7 @@ return tab #+END_SRC -#+results: echo-table +#+RESULTS: echo-table | a | b | c | | d | e | f | | g | h | i | @@ -13861,7 +14134,7 @@ return tab #+END_SRC -#+results: echo-table +#+RESULTS: echo-table | a | b | c | |---+---+---| | d | e | f | @@ -13899,7 +14172,7 @@ return [[val + '*' for val in row] for row in tab] #+END_SRC -#+results: echo-table-again +#+RESULTS: echo-table-again | a | |----| | b* | @@ -13942,7 +14215,7 @@ return [[val + 10 for val in row] for row in tab] #+END_SRC -#+results: echo-table-once-again +#+RESULTS: echo-table-once-again | one | 11 | 12 | 13 | 14 | 15 | | two | 16 | 17 | 18 | 19 | 20 | @end example @@ -13960,7 +14233,7 @@ first line of any tangled file holding the code block, and the file permissions of the tangled file are set to make it executable. -@node eval, , shebang, Specific header arguments +@node eval, wrap, shebang, Specific header arguments @subsubsection @code{:eval} The @code{:eval} header argument can be used to limit the evaluation of specific code blocks. The @code{:eval} header argument can be useful for @@ -13985,6 +14258,14 @@ of the @code{org-confirm-babel-evaluate} variable see @ref{Code evaluation security}. +@node wrap, , eval, Specific header arguments +@subsubsection @code{:wrap} +The @code{:wrap} header argument is used to mark the results of source block +evaluation. The header argument can be passed a string that will be appended +to @code{#+BEGIN_} and @code{#+END_}, which will then be used to wrap the +results. If not string is specified then the results will be wrapped in a +@code{#+BEGIN/END_RESULTS} block. + @node Results of evaluation, Noweb reference syntax, Header arguments, Working With Source Code @section Results of evaluation @cindex code block, results of evaluation @@ -14054,7 +14335,7 @@ print "bye" #+END_SRC -#+results: +#+RESULTS: : hello : bye @end example @@ -14067,7 +14348,7 @@ print "bye" #+END_SRC -#+results: +#+RESULTS: : hello : 2 : bye @@ -14112,7 +14393,7 @@ syntactically valid in languages that you use, then please consider setting the default value. -Note: if noweb tangling is slow in large Org-mode files consider setting the +Note: if noweb tangling is slow in large Org mode files consider setting the @code{*org-babel-use-quick-and-dirty-noweb-expansion*} variable to true. This will result in faster noweb reference resolution at the expense of not correctly resolving inherited values of the @code{:noweb-ref} header @@ -14252,7 +14533,7 @@ emacs -Q --batch -l $ORGINSTALL \ --eval "(progn (add-to-list 'load-path (expand-file-name \"~/src/org/lisp/\")) -(add-to-list 'load-path (expand-file-name \"~/src/org/contrib/lisp/\")) +(add-to-list 'load-path (expand-file-name \"~/src/org/contrib/lisp/\" t)) (require 'org)(require 'org-exp)(require 'ob)(require 'ob-tangle) (mapc (lambda (file) (find-file (expand-file-name file \"$DIR\")) @@ -14358,19 +14639,19 @@ The following template selectors are currently supported. @multitable @columnfractions 0.1 0.9 -@item @kbd{s} @tab @code{#+begin_src ... #+end_src} -@item @kbd{e} @tab @code{#+begin_example ... #+end_example} -@item @kbd{q} @tab @code{#+begin_quote ... #+end_quote} -@item @kbd{v} @tab @code{#+begin_verse ... #+end_verse} -@item @kbd{c} @tab @code{#+begin_center ... #+end_center} -@item @kbd{l} @tab @code{#+begin_latex ... #+end_latex} -@item @kbd{L} @tab @code{#+latex:} -@item @kbd{h} @tab @code{#+begin_html ... #+end_html} -@item @kbd{H} @tab @code{#+html:} -@item @kbd{a} @tab @code{#+begin_ascii ... #+end_ascii} -@item @kbd{A} @tab @code{#+ascii:} -@item @kbd{i} @tab @code{#+index:} line -@item @kbd{I} @tab @code{#+include:} line +@item @kbd{s} @tab @code{#+BEGIN_SRC ... #+END_SRC} +@item @kbd{e} @tab @code{#+BEGIN_EXAMPLE ... #+END_EXAMPLE} +@item @kbd{q} @tab @code{#+BEGIN_QUOTE ... #+END_QUOTE} +@item @kbd{v} @tab @code{#+BEGIN_VERSE ... #+END_VERSE} +@item @kbd{c} @tab @code{#+BEGIN_CENTER ... #+END_CENTER} +@item @kbd{l} @tab @code{#+BEGIN_LaTeX ... #+END_LaTeX} +@item @kbd{L} @tab @code{#+LaTeX:} +@item @kbd{h} @tab @code{#+BEGIN_HTML ... #+END_HTML} +@item @kbd{H} @tab @code{#+HTML:} +@item @kbd{a} @tab @code{#+BEGIN_ASCII ... #+END_ASCII} +@item @kbd{A} @tab @code{#+ASCII:} +@item @kbd{i} @tab @code{#+INDEX:} line +@item @kbd{I} @tab @code{#+INCLUDE:} line @end multitable For example, on an empty line, typing "= will promote level-1 subtrees + containing other subtrees. The level-1 headline will be + commented out. You can revert to the previous state with =M-x + undo RET=. + +*** Org Clock + +**** New keybinding =C-c C-x C-z= for [[doc::org-clock-resolve][org-clock-resolve]] + +**** New keybinding =C-c C-x C-q= for [[doc::org-clock-cancel][org-clock-cancel]] + +**** New command [[doc::org-clock-in-last][org-clock-in-last]] to clock in the last clocked item + + This command is bound to =C-c C-x C-x= and will clock in the last + clocked entry, if any. + +**** =C-u M-x= [[doc::org-clock-out][org-clock-out]] =RET= now prompts for a state to switch to + +**** =S-M-= on a clock timestamps adjusts the previous/next clock + +**** New option [[doc::org-clock-continuously][org-clock-continuously]] + + When set to =nil=, clocking in a task will first try to find the + last clocked out task and restart from when that task was clocked + out. + + You can temporarily activate continuous clocking with =C-u C-u + C-u M-x= [[doc::org-clock-in][org-clock-in]] =RET= (three universal prefix arguments) + and =C-u C-u M-x= [[org-clock-in-last][org-clock-in-last]] =RET= (two universal prefix + arguments). + + +**** New option [[doc::org-clock-frame-title-format][org-clock-frame-title-format]] + + This option sets the value of =frame-title-format= when clocking + in. + +**** New options for controlling the clockreport display + + [[doc::org-clock-file-time-cell-format][org-clock-file-time-cell-format]]: Format string for the file time + cells in clockreport. + + [[doc::org-clock-total-time-cell-format][org-clock-total-time-cell-format]]: Format string for the total + time cells in clockreport. + + +**** New options for controlling the clock/timer display + + [[doc::org-clock-clocked-in-display][org-clock-clocked-in-display]]: control whether the current clock + is displayed in the mode line and/or frame title. + + [[doc::org-timer-display][org-timer-display]]: control whether the current timer is displayed + in the mode line and/or frame title. + + This allows the clock and timer to be displayed in the frame + title instead of, or as well as, the mode line. This is useful + for people with limited space in the mode line but with ample + space in the frame title. + +*** Org Appearance + +**** New option [[doc::org-custom-properties][org-custom-properties]] + + The visibility of properties listed in this options can be turn + on/off with [[doc::org-toggle-custom-properties-visibility][org-toggle-custom-properties-visibility]]. This might + be useful for properties used by third-part tools or that you + don't want to see temporarily. + +**** New command [[doc::org-redisplay-inline-images][org-redisplay-inline-images]] + + This will redisplay all images. It is bound to =C-c C-x C-M-v=. + +**** New entities in =org-entities.el= + + There are these new entities: + + : ("tilde" "\\~{}" nil "˜" "~" "~" "~") + : ("slash" "/" nil "/" "/" "/" "/") + : ("plus" "+" nil "+" "+" "+" "+") + : ("under" "\\_" nil "_" "_" "_" "_") + : ("equal" "=" nil "=" "=" "=" "=") + : ("asciicirc" "\\textasciicircum{}" nil "^" "^" "^" "^") + +**** New face =org-list-dt= for definition terms +**** New face =org-date-selected= for the selected calendar day +**** New face value for =org-document-title= + + The face is back to a normal height. + +*** Org Columns + +**** New speed command =:= to activate the column view +**** New special property =CLOCKSUM_T= to display today's clocked time + + You can use =CLOCKSUM_T= the same way you use =CLOCKSUM=. It + will display the time spent on tasks for today only. + +**** Use the =:COLUMNS:= property in columnview dynamic blocks + + If the =:COLUMNS:= is set in a subtree, the columnview dynamic + block will use its value as the column format. + +**** Consider inline tasks when computing a sum + +*** Org Dates and Time Stamps + +**** Enhanced [[doc::org-sparse-tree][org-sparse-tree]] + + =C-c /= can now check for time ranges. + + When checking for dates with =C-c /= it is useful to change the + type of dates that you are interested in. You can now do this + interactively with =c= after =C-c /= and/or by setting + [[doc::org-sparse-tree-default-date-type][org-sparse-tree-default-date-type]] to the default value you want. + +**** Support for hourly repeat cookies + + You can now use + + : SCHEDULED: <2012-08-20 lun. 08:00 +1h> + + if you want to add an hourly repeater to an entry. + +**** =C-u C-u C-c .= inserts a time-stamp with no prompt + +**** When (setq [[doc::org-read-date-prefer-future][org-read-date-prefer-future]] 'time), accept days in the prompt + + "8am Wed" and "Wed 8am" are now acceptable values when entering a + date from the prompt. If [[doc::org-read-date-prefer-future][org-read-date-prefer-future]] is set to + =time=, this will produce the expected prompt indication. + +**** New option [[doc::org-datetree-add-timestamp][org-datetree-add-timestamp]] + + When set to =non-nil=, datetree entries will also have a + timestamp. This is useful if you want to see these entries in a + sparse tree with =C-c /=. + +*** Org Capture + +**** New command [[doc::org-capture-string][org-capture-string]] + + M-x [[doc::org-capture-string][org-capture-string]] RET will prompt for a string and a capture + template. The string will be used as an annotation for the + template. This is useful when capturing in batch mode as it lets + you define the content of the template without being in Emacs. + +**** New option [[doc::org-capture-templates-contexts][org-capture-templates-contexts]] + + Setting this option allows you to define specific context where + capture templates should be available from. For example, when + set to this value + + #+BEGIN_SRC emacs-lisp + (setq org-capture-templates-contexts + '(("c" (in-mode . "message-mode")))) +#+END_SRC + + then the =c= capture template will only be available from + =message-mode= buffers. See the docstring and the manual for + more details on how to use this. + +**** New =%l= template to insert the literal link +**** New option [[doc::org-capture-bookmark][org-capture-bookmark]] + + Org used to automatically add a bookmark with capture a note. + You can now turn this on by setting [[doc::org-capture-bookmark][org-capture-bookmark]] to + =nil=. + +**** Expand =%= escape sequences into text entered for 'th =%^{PROMPT}= escape + + See the manual for more explanations. + +**** More control over empty lines + + You can use =:empty-lines-before= and =:empty-lines-after= to + control the insertion of empty lines. Check the manual for more + explanations. + +**** New hook [[doc::org-capture-prepare-finalize-hook][org-capture-prepare-finalize-hook]] + + This new hook runs before the finalization process starts. + +*** Org Export + +**** New functions =orgtbl-to-table.el= and =orgtbl-to-unicode= + + =orgtbl-to-table.el= convert the table to a =table.el= table, and + =orgtbl-to-unicode= will use =ascii-art-to-unicode.el= (when + available) to print beautiful tables. + +**** [[doc::org-table-export][org-table-export]] now a bit clever about the target format + + When you specify a file name like =table.csv=, [[doc::org-table-export][org-table-export]] + will now suggest =orgtbl-to-csv= the default method for exporting + the table. + +**** New option [[doc::org-export-date-timestamp-format][org-export-date-timestamp-format]] + + The option allows to set a time string format for Org timestamps + in the #+DATE option. + +**** LaTeX: New options for exporting table rules :tstart, :hline and :tend + + See [[doc::org-export-latex-tables-hline][org-export-latex-tables-hline]] and [[doc::org-export-latex-tables-tend][org-export-latex-tables-tend]]. + +**** LaTeX: You can now set =:hfmt= from =#+ATTR_LaTeX= +**** Beamer: Add support and keybinding for the =exampleblock= environment + + Add support for these languages in [[doc::org-export-language-setup][org-export-language-setup]]. + More languages are always welcome. + +**** Beamer: New option [[doc::org-beamer-inherited-properties][org-beamer-inherited-properties]] + + This option allows Beamer export to inherit some properties. + Thanks to Carsten for implementing this. + +**** ODT: Add support for ODT export in org-bbdb.el +**** ODT: Add support for indented tables (see [[http://orgmode.org/w/?p%3Dorg-mode.git%3Ba%3Dcommit%3Bh%3De9fd33][this commit]] for details) +**** ODT: Improve the conversion from ODT to other formats +**** ASCII: Swap the level-1/level-2 characters to underline the headlines +**** Support for Chinese, simplified Chinese, Russian, Ukrainian and Japanese +**** HTML: New option [[doc::org-export-html-date-format-string][org-export-html-date-format-string]] + + Format string to format the date and time in HTML export. Thanks + to Sébastien Vauban for this patch. + +*** Org Babel + +**** New =:results drawer= parameter + +=:results drawer= replaces =:results wrap=, which is deprecated but still +supported. + +**** =:results org= now put results in a =#+BEGIN_SRC org= block + +=:results org= used to put results in a =#+BEGIN_ORG= block but it now puts +results in a =#+BEGIN_SRC org= block, wich comma-escaped lines. + +=#+BEGIN_ORG= blocks are obsolete. + +**** Exporting =#+BEGIN_SRC org= blocks exports the code + +It used to exports the results of the code. + +*** Miscellaneous + +**** New menu entry for [[doc::org-refile][org-refile]] +**** Allow capturing to encrypted entries + +If you capture to an encrypted entry, it will be decrpyted before +inserting the template then re-encrypted after finalizing the capture. + +**** Inactive timestamps are now handled in tables + +Calc can do computation on active time-stamps like <2012-09-29 sat.>. +Inactive time-stamps in a table's cell are now internally deactivated so +that Calc formulas can operate on them. + +**** [[doc::org-table-number-regexp][org-table-number-regexp]] can now accept comma as decimal mark +**** Org allows a new property =APPT_WARNTIME= + + You can set it with the =W= speedy key or set it manually. When + set, exporting to iCalendar and [[doc::org-agenda-to-appt][org-agenda-to-appt]] will use the + value of this property as the number of minutes for the warning + alarm. + +**** New command [[doc::org-inc-effort][org-inc-effort]] + + This will increment the effort value. + + It is bound to =C-c C-x E= and to =E= as a speedy command. + +**** Attach: Add support for creating symbolic links + + =org-attach-method= now supports a new method =lns=, allowing to + attach symbolic links. + +**** Archive: you can now archive to a datetree + +**** New option [[doc::org-inlinetask-show-first-star][org-inlinetask-show-first-star]] + + =Non-nil= means display the first star of an inline task as + additional marker. When =nil=, the first star is not shown. + +**** New option [[doc::org-latex-preview-ltxpng-directory][org-latex-preview-ltxpng-directory]] + + This lets you define the path for the =ltxpng/= directory. + +**** You can now use imagemagick instead of dvipng to preview LaTeX fragments +**** You can now turn off [[doc::orgstruct++-mode][orgstruct++-mode]] safely +**** =C-u C-c C-c= on list items to add check boxes + + =C-u C-c C-c= will add an empty check box on a list item. + + When hit from the top of the list, it will add check boxes for + all top level list items. + +**** =org-list-ending-method= and =org-list-end-regexp= are now obsolete + + Fall back on using =org-list-end-re= only, which see. + +**** org-feed.el now expands =%(sexp)= templates +**** New option [[doc::org-protocol-data-separator][org-protocol-data-separator]] + +**** New option [[doc::org-ditaa-jar-option][org-ditaa-jar-option]] to specify the ditaa jar file + +**** New possible value for [[doc::org-loop-over-headlines-in-active-region][org-loop-over-headlines-in-active-region]] + + When [[doc::org-loop-over-headlines-in-active-region][org-loop-over-headlines-in-active-region]] is set to + =start-level=, the command will loop over the active region but + will only act upon entries that are of the same level than the + first headline in the region. + +**** New option [[doc::org-habit-show-all-today][org-habit-show-all-today]] + + When set to =t=, show all (even unscheduled) habits on today's + agenda. + +** Important bug fixes + +*** M-TAB on options keywords perform completion correctly again + + If you hit =M-TAB= on keywords like =#+TITLE=, Org will try to + perform completion with meaningful values. + +*** Add licenses to javascript embedded and external code snippets + + Embedded javascript code produced when exporting an Org file to + HTML is now licensed under GPLv3 (or later), and the copyright is + owned by the Free Software Foundation, Inc. + + The javascript code for embedding MathJax in the browser mentions + the MathJax copyright and the Apache 2.0 license. + + The javascript code for embedding =org-injo.js= in the browser + mentions the copyright of Sebastian Rose and the GPLv3 (or later) + license. + + =org-export-html-scripts= is now a variable, so that you can adapt + the code and the license to your needs. + + See http://www.gnu.org/philosophy/javascript-trap.html for + explanations on why these changes were necessary. + +* Version 7.8.11 + +** Incompatible changes + +*** Emacs 21 support has been dropped + + Do not use Org mode 7.xx with Emacs 21, use [[http://orgmode.org/org-6.36c.zip][version 6.36c]] instead. + +*** XEmacs support requires the XEmacs development version + + To use Org mode 7.xx with XEmacs, you need to run the developer + version of XEmacs. We were about to drop XEmacs support entirely, + but Michael Sperber stepped in and made changes to XEmacs that + made it easier to keep the support. Thanks to Michael for this + last-minute save. + +*** New keys for TODO sparse trees + + The key =C-c C-v= is now reserved for Org Babel action. TODO + sparse trees can still be made with =C-c / t= (all not-done + states) and =C-c / T= (specific states). + +*** The Agenda =org-agenda-ndays= is now obsolete + + The variable =org-agenda-ndays= is obsolete - please use + =org-agenda-span= instead. + + Thanks to Julien Danjou for this. + +*** Changes to the intended use of =org-export-latex-classes= + + So far this variable has been used to specify the complete header + of the LaTeX document, including all the =\usepackage= calls + necessary for the document. This setup makes it difficult to + maintain the list of packages that Org itself would like to call, + for example for the special symbol support it needs. + + First of all, you can *opt out of this change* in the following + way: You can say: /I want to have full control over headers, and I + will take responsibility to include the packages Org needs/. If + that is what you want, add this to your configuration and skip the + rest of this section (except maybe for the description of the + =[EXTRA]= place holder): + + #+begin_src emacs-lisp + (setq org-export-latex-default-packages-alist nil + org-export-latex-packages-alist nil) + #+end_src + + /Continue to read here if you want to go along with the modified + setup./ + + There are now two variables that should be used to list the LaTeX + packages that need to be included in all classes. The header + definition in =org-export-latex-classes= should then not contain + the corresponding =\usepackage= calls (see below). + + The two new variables are: + + 1. =org-export-latex-default-packages-alist= :: This is the + variable where Org-mode itself puts the packages it needs. + Normally you should not change this variable. The only + reason to change it anyway is when one of these packages + causes a conflict with another package you want to use. Then + you can remove that packages and hope that you are not using + Org-mode functionality that needs it. + + 2. =org-export-latex-packages-alist= :: This is the variable where + you can put the packages that you'd like to use across all + classes. + + The sequence how these customizations will show up in the LaTeX + document are: + + 1. Header from =org-export-latex-classes= + 2. =org-export-latex-default-packages-alist= + 3. =org-export-latex-packages-alist= + 4. Buffer-specific things set with =#+LaTeX_HEADER:= + + If you want more control about which segment is placed where, or + if you want, for a specific class, have full control over the + header and exclude some of the automatic building blocks, you can + put the following macro-like place holders into the header: + + #+begin_example + [DEFAULT-PACKAGES] \usepackage statements for default packages + [NO-DEFAULT-PACKAGES] do not include any of the default packages + [PACKAGES] \usepackage statements for packages + [NO-PACKAGES] do not include the packages + [EXTRA] the stuff from #+LaTeX_HEADER + [NO-EXTRA] do not include #+LaTeX_HEADER stuff + #+end_example + + If you have currently customized =org-export-latex-classes=, you + should revise that customization and remove any package calls that + are covered by =org-export-latex-default-packages-alist=. This + applies to the following packages: + + - inputenc + - fontenc + - fixltx2e + - graphicx + - longtable + - float + - wrapfig + - soul + - t1enc + - textcomp + - marvosym + - wasysym + - latexsym + - amssymb + - hyperref + + If one of these packages creates a conflict with another package + you are using, you can remove it from + =org-export-latex-default-packages-alist=. But then you risk that + some of the advertised export features of Org will not work + properly. + + You can also consider moving packages that you use in all classes + to =org-export-latex-packages-alist=. If necessary, put the place + holders so that the packages get loaded in the right sequence. As + said above, for backward compatibility, if you omit the place + holders, all the variables will dump their content at the end of + the header. + +*** The constant =org-html-entities= is obsolete + + Its content is now part of the new constant =org-entities=, which + is defined in the file org-entities.el. =org-html-entities= was + an internal variable, but it is possible that some users did write + code using it. + +*** =org-bbdb-anniversary-format-alist= has changed + + Please check the docstring and update your settings accordingly. + +*** Deleted =org-mode-p= + + This function has been deleted: please update your code. + +** Important new features + +*** New Org to ODT exporter + + Jambunathan's Org to ODT exporter is now part of Org. + + To use it, it `C-c C-e o' in an Org file. See the documentation + for more information on how to customize it. + +*** org-capture.el is now the default capture system + + This replaces the earlier system org-remember. The manual only + describes org-capture, but for people who prefer to continue to + use org-remember, we keep a static copy of the former manual + section [[http://orgmode.org/org-remember.pdf][chapter about remember]]. + + The new system has a technically cleaner implementation and more + possibilities for capturing different types of data. See + [[http://thread.gmane.org/gmane.emacs.orgmode/26441/focus%3D26441][Carsten's announcement]] for more details. + + To switch over to the new system: + + 1. Run + + : M-x org-capture-import-remember-templates RET + + to get a translated version of your remember templates into the + new variable =org-capture-templates=. This will "mostly" work, + but maybe not for all cases. At least it will give you a good + place to modify your templates. After running this command, + enter the customize buffer for this variable with + + : M-x customize-variable RET org-capture-templates RET + + and convince yourself that everything is OK. Then save the + customization. + + 2. Bind the command =org-capture= to a key, similar to what you did + with org-remember: + + : (define-key global-map "\C-cc" 'org-capture) + + If your fingers prefer =C-c r=, you can also use this key once + you have decided to move over completely to the new + implementation. During a test time, there is nothing wrong + with using both system in parallel. + +** New libraries + +*** New Org libraries +**** org-eshell.el (Konrad Hinsen) + + Implement links to eshell buffers. + +**** org-special-blocks (Carsten Dominik) + + This package generalizes the #+begin_foo and #+end_foo tokens. + + To use, put the following in your init file: + + #+BEGIN_EXAMPLE (require 'org-special-blocks) #+END_EXAMPLE -The tokens #+begin_center, #+begin_verse, etc. existed previously. This -package generalizes them (at least for the LaTeX and html exporters). When -a #+begin_foo token is encountered by the LaTeX exporter, it is expanded -into \begin{foo}. The text inside the environment is not protected, as -text inside environments generally is. When #+begin_foo is encountered by -the html exporter, a div with class foo is inserted into the HTML file. It -is up to the user to add this class to his or her stylesheet if this div is -to mean anything. - -*** org-taskjuggler.el (Christian Egli) - :PROPERTIES: - :OrgVersion: 7.01 - :END: - - Christian Egli's /org-taskjuggler.el/ module is now part of Org. He - also wrote a [[http://orgmode.org/worg/org-tutorials/org-taskjuggler.php][tutorial]] for it. - -*** org-ctags.el (Paul Sexton) - :PROPERTIES: - :OrgVersion: 6.34 - :END: - - Targets like =<>= can now be found by Emacs' etag - functionality, and Org-mode links can be used to to link to etags, also - in non-Org-mode files. For details, see the file /org-ctags.el/. - - This feature uses a new hook =org-open-link-functions= which will call - function to do something special with text links. - - Thanks to Paul Sexton for this contribution. - -*** org-docview.el (Jan Böcker) - :PROPERTIES: - :OrgVersion: 6.34 - :END: - - This new module allows links to various file types using docview, where - Emacs displays images of document pages. Docview link types can point - to a specific page in a document, for example to page 131 of the - Org-mode manual: - - : [[docview:~/.elisp/org/doc/org.pdf::131][Org-Mode Manual]] - - Thanks to Jan Böcker for this contribution. - -** New Babel libraries + The tokens #+begin_center, #+begin_verse, etc. existed + previously. This package generalizes them (at least for the + LaTeX and html exporters). When a #+begin_foo token is + encountered by the LaTeX exporter, it is expanded + into \begin{foo}. The text inside the environment is not + protected, as text inside environments generally is. + When #+begin_foo is encountered by the html exporter, a div with + class foo is inserted into the HTML file. It is up to the user + to add this class to his or her stylesheet if this div is to mean + anything. + +**** org-taskjuggler.el (Christian Egli) + + Christian Egli's /org-taskjuggler.el/ module is now part of Org. + He also wrote a [[http://orgmode.org/worg/org-tutorials/org-taskjuggler.php][tutorial]] for it. + +**** org-ctags.el (Paul Sexton) + + Targets like =<>= can now be found by Emacs' etag + functionality, and Org-mode links can be used to to link to + etags, also in non-Org-mode files. For details, see the file + /org-ctags.el/. + + This feature uses a new hook =org-open-link-functions= which will + call function to do something special with text links. + + Thanks to Paul Sexton for this contribution. + +**** org-docview.el (Jan Böcker) + + This new module allows links to various file types using docview, where + Emacs displays images of document pages. Docview link types can point + to a specific page in a document, for example to page 131 of the + Org-mode manual: + + : [[docview:~/.elisp/org/doc/org.pdf::131][Org-Mode Manual]] + + Thanks to Jan Böcker for this contribution. + +*** New Babel libraries - ob-picolisp.el (Thorsten Jolitz) - ob-fortran.el (Sergey Litvinov) @@ -275,674 +902,531 @@ - ob-lilypond.el (Martyn Jago) - ob-awk.el (Eric Schulte) -* Other new features and various enhancements - -** Hyperlinks - -*** Org-Bibtex -- major improvements - :PROPERTIES: - :OrgVersion: 7.6 - :END: - - Provides support for managing bibtex bibliographical references - data in headline properties. Each headline corresponds to a - single reference and the relevant bibliographic meta-data is - stored in headline properties, leaving the body of the headline - free to hold notes and comments. Org-bibtex is aware of all - standard bibtex reference types and fields. - - The key new functions are - -- org-bibtex-check :: queries the user to flesh out all required - (and with prefix argument optional) bibtex fields available - for the specific reference =type= of the current headline. - -- org-bibtex-create :: Create a new entry at the given level, - using org-bibtex-check to flesh out the relevant fields. - -- org-bibtex-yank :: Yank a bibtex entry on the kill ring as a - formatted Org-mode headline into the current buffer - -- org-bibtex-export-to-kill-ring :: Export the current headline - to the kill ring as a formatted bibtex entry. - - - -*** org-gnus.el now allows link creation from messages - :PROPERTIES: - :OrgVersion: 7.5 - :END: - - You can now create links from messages. This is particularly - useful when the user wants to stored messages that he sends, for - later check. Thanks to Ulf Stegemann for the patch. - - - -*** Modified link escaping - :PROPERTIES: - :OrgVersion: 7.5 - :END: - - David Maus worked on `org-link-escape'. See [[http://article.gmane.org/gmane.emacs.orgmode/37888][his message]]: - -: Percent escaping is used in Org mode to escape certain characters -: in links that would either break the parser (e.g. square brackets -: in link target or description) or are not allowed to appear in -: a particular link type (e.g. non-ascii characters in a http: -: link). -: -: With this change in place Org will apply percent escaping and -: unescaping more consistently especially for non-ascii characters. -: Additionally some of the outstanding bugs or glitches concerning -: percent escaped links are solved. - - Thanks a lot to David for this work. - - - -*** Make =org-store-link= point to directory in a dired buffer - :PROPERTIES: - :OrgVersion: 6.35 - :END: - - When, in a dired buffer, the cursor is not in a line listing a - file, `org-store-link' will store a link to the directory. - - Patch by Stephen Eglen. - - - -*** Allow regexps in =org-file-apps= to capture link parameters - :PROPERTIES: - :OrgVersion: 6.35 - :END: - - The way extension regexps in =org-file-apps= are handled has - changed. Instead of matching against the file name, the regexps - are now matched against the whole link, and you can use grouping - to extract link parameters which you can then use in a command - string to be executed. - - For example, to allow linking to PDF files using the syntax - =file:/doc.pdf::=, you can add the following entry to - org-file-apps: - - #+begin_example - Extension: \.pdf::\([0-9]+\)\' - Command: evince "%s" -p %1 - #+end_example - - Thanks to Jan Böcker for a patch to this effect. - -** Dates and time - -*** Allow relative time when scheduling/adding a deadline - :PROPERTIES: - :OrgVersion: 7.7 - :END: - - You can now use relative duration strings like "-2d" or "++3w" - when calling =org-schedule= or =org-deadline=: it will schedule - (or set the deadline for) the item respectively two days before - today and three weeks after the current timestamp, if any. - - You can use this programmatically: =(org-schedule nil "+2d")= - will work on the current entry. - - You can also use this while (bulk-)rescheduling and - (bulk-)resetting the deadline of (several) items from the agenda. - - Thanks to Memnon Anon for a heads up about this! - - - - -*** American-style dates are now understood by =org-read-date= - :PROPERTIES: - :OrgVersion: 6.35 - :END: - - So when you are prompted for a date, you can now answer like this - - #+begin_example - 2/5/3 --> 2003-02-05 - 2/5 --> -02-05 - #+end_example - -** Agenda - -*** =org-agenda-custom-commands= has a default value - :PROPERTIES: - :OrgVersion: 7.8 - :END: - - This option used to be `nil' by default. This now has a default - value, displaying an agenda and all TODOs. See the docstring for - details. Thanks to Carsten for this. - - -*** Improved filtering through =org-agenda-to-appt= - :PROPERTIES: - :OrgVersion: 7.8 - :END: - - The new function allows the user to refine the scope of entries - to pass to =org-agenda-get-day-entries= and allows to filter out - entries using a function. - - Thanks to Peter Münster for raising a related issue and to - Tassilo Horn for this idea. Also thanks to Peter Münster for - [[git:68ffb7a7][fixing a small bug]] in the final implementation. - - - -*** Allow ap/pm times in agenda time grid - :PROPERTIES: - :OrgVersion: 7.4 - :END: - - Times in the agenda can now be displayed in am/pm format. See the new - variable =org-agenda-timegrid-use-ampm=. Thanks to C. A. Webber for - a patch to this effect. - - - -*** Agenda: Added a bulk "scattering" command - :PROPERTIES: - :OrgVersion: 7.4 - :END: - - =B S= in the agenda buffer will cause tasks to be rescheduled a random - number of days into the future, with 7 as the default. This is useful - if you've got a ton of tasks scheduled for today, you realize you'll - never deal with them all, and you just want them to be distributed - across the next N days. When called with a prefix arg, rescheduling - will avoid weekend days. - - Thanks to John Wiegley for this. - -** Exporting - -*** Simplification of org-export-html-preamble/postamble - :PROPERTIES: - :OrgVersion: 7.5 - :END: - - When set to `t', export the preamble/postamble as usual, honoring the - =org-export-email/author/creator-info= variables. - - When set to a formatting string, insert this string. See the docstring - of these variable for details about available %-sequences. - - You can set =:html-preamble= in publishing project in the same way: `t' - means to honor =:email/creator/author-info=, and a formatting string - will insert a string. - -*** New exporters to Latin-1 and UTF-8 - :PROPERTIES: - :OrgVersion: 6.35 - :END: - - While Ulf Stegemann was going through the entities list to improve the - LaTeX export, he had the great idea to provide representations for many - of the entities in Latin-1, and for all of them in UTF-8. This means - that we can now export files rich in special symbols to Latin-1 and to - UTF-8 files. These new exporters can be reached with the commands =C-c - C-e n= and =C-c C-e u=, respectively. - - When there is no representation for a given symbol in the targeted - coding system, you can choose to keep the TeX-macro-like - representation, or to get an "explanatory" representation. For - example, =\simeq= could be represented as "[approx. equal to]". Please - use the variable =org-entities-ascii-explanatory= to state your - preference. - -*** HTML export: Add class to outline containers using property - :PROPERTIES: - :OrgVersion: 6.35 - :END: - - The =HTML_CONTAINER_CLASS= property can now be used to add a class name - to the outline container of a node in HTML export. - -*** Throw an error when creating an image from a LaTeX snippet fails - :PROPERTIES: - :OrgVersion: 6.35 - :END: - - This behavior can be configured with the new option variable - =org-format-latex-signal-error=. - -*** Support for creating BEAMER presentations from Org-mode documents - :PROPERTIES: - :OrgVersion: 6.34 - :END: - - Org-mode documents or subtrees can now be converted directly in to - BEAMER presentation. Turning a tree into a simple presentations is - straight forward, and there is also quite some support to make richer - presentations as well. See the [[http://orgmode.org/manual/Beamer-class-export.html#Beamer-class-export][BEAMER section]] in the manual for more - details. - - Thanks to everyone who has contributed to the discussion about BEAMER - support and how it should work. This was a great example for how this - community can achieve a much better result than any individual could. - -** Refiling - -*** Refile targets can now be cached - :PROPERTIES: - :OrgVersion: 7.01 - :END: - - You can turn on caching of refile targets by setting the variable - =org-refile-use-cache=. This should speed up refiling if you have many - eligible targets in many files. If you need to update the cache - because Org misses a newly created entry or still offers a deleted one, - press =C-0 C-c C-w=. - -*** New logging support for refiling - :PROPERTIES: - :OrgVersion: 6.35 - :END: - - Whenever you refile an item, a time stamp and even a note can be added - to this entry. For details, see the new option =org-log-refile=. - - Thanks to Charles Cave for this idea. - -** Completion - -*** In-buffer completion is now done using John Wiegley's pcomplete.el - :PROPERTIES: - :OrgVersion: 7.4 - :END: - - Thanks to John Wiegley for much of this code. - -** Tables - -*** New command =org-table-transpose-table-at-point= - :PROPERTIES: - :OrgVersion: 7.8 - :END: - - See the docstring. This hack from Juan Pechiar is now part of Org's - core. Thanks to Juan! - -*** Display field's coordinates when editing it with =C-c `= - :PROPERTIES: - :OrgVersion: 7.7 - :END: - - When editing a field with =C-c `=, the field's coordinate will the - displayed in the buffer. - - Thanks to Michael Brand for a patch to this effect. - -*** Spreadsheet computation of durations and time values - :PROPERTIES: - :OrgVersion: 7.6 - :END: - - If you want to compute time values use the =T= flag, either in Calc - formulas or Elisp formulas: - - | Task 1 | Task 2 | Total | - |--------+--------+---------| - | 35:00 | 35:00 | 1:10:00 | - #+TBLFM: @2$3=$1+$2;T - - Values must be of the form =[HH:]MM:SS=, where hours are optional. - - Thanks to Martin Halder, Eric Schulte and Carsten for code and feedback - on this. - -*** Implement formulas applying to field ranges - :PROPERTIES: - :OrgVersion: 7.5 - :END: - - Carsten implemented this field-ranges formulas. - - : A frequently requested feature for tables has been to be able to define - : row formulas in a way similar to column formulas. The patch below allows - : things like - : - : @3= - : @2$2..@5$7= - : @I$2..@II$4= - : - : as the left hand side for table formulas in order to write a formula that - : is valid for an entire column or for a rectangular section in a - : table. - - Thanks a lot to Carsten for this. - -*** Sending radio tables from org buffers is now allowed - :PROPERTIES: - :OrgVersion: 7.4 - :END: - - Org radio tables can no also be sent inside Org buffers. Also, there - is a new hook which get called after a table has been sent. - - Thanks to Seweryn Kokot. - -** Lists - -*** Improved handling of lists - :PROPERTIES: - :OrgVersion: 7.5 - :END: - - Nicolas Goaziou extended and improved the way Org handles lists. - - 1. Indentation of text determines again end of items in lists. So, some - text less indented than the previous item doesn't close the whole - list anymore, only all items more indented than it. - - 2. Alphabetical bullets are implemented, through the use of the - variable `org-alphabetical-lists'. This also adds alphabetical - counters like [@c] or [@W]. - - 3. Lists can now safely contain drawers, inline tasks, or various - blocks, themselves containing lists. Two variables are controlling - this: `org-list-forbidden-blocks', and `org-list-export-context'. - - 4. Improve `newline-and-indent' (C-j): used in an item, it will keep - text from moving at column 0. This allows to split text and make - paragraphs and still not break the list. - - 5. Improve `org-toggle-item' (C-c -): used on a region with standard - text, it will change the region into one item. With a prefix - argument, it will fallback to the previous behavior and make every - line in region an item. It permits to easily integrate paragraphs - inside a list. - - 6. `fill-paragraph' (M-q) now understands lists. It can freely be used - inside items, or on text just after a list, even with no blank line - around, without breaking list structure. - - Thanks a lot to Nicolas for all this! - -** Inline display of linked images - :PROPERTIES: - :OrgVersion: 6.36 - :END: - - Images can now be displayed inline. The key C-c C-x C-v does toggle the - display of such images. Note that only image links that have no - description part will be inlined. - -** Implement offsets for ordered lists - :PROPERTIES: - :OrgVersion: 6.36 - :END: - - If you want to start an ordered plain list with a number different from - 1, you can now do it like this: - - : 1. [@start:12] will star a lit a number 12 - -** Babel: code block body expansion for table and preview - :PROPERTIES: - :OrgVersion: 6.36 - :END: - - In org-babel, code is "expanded" prior to evaluation. I.e. the code that - is actually evaluated comprises the code block contents, augmented with - the extra code which assigns the referenced data to variables. It is now - possible to preview expanded contents, and also to expand code during - during tangling. This expansion takes into account all header arguments, - and variables. - - A new key-binding `C-c M-b p' bound to `org-babel-expand-src-block' can - be used from inside of a source code block to preview its expanded - contents (which can be very useful for debugging). tangling - - The expanded body can now be tangled, this includes variable values - which may be the results of other source-code blocks, or stored in - headline properties or tables. One possible use for this is to allow - those using org-babel for their emacs initialization to store values - (e.g. usernames, passwords, etc...) in headline properties or in tables. - - Org-babel now supports three new header arguments, and new default - behavior for handling horizontal lines in tables (hlines), column names, - and rownames across all languages. - -** Editing Convenience and Appearance - -*** New command =org-copy-visible= (=C-c C-x v=) - :PROPERTIES: - :OrgVersion: 7.7 - :END: - - This command will copy the visible text in the region into the kill - ring. Thanks to Florian Beck for this function and to Carsten for - adding it to org.el and documenting it! - -*** Make it possible to protect hidden subtrees from being killed by =C-k= - :PROPERTIES: - :OrgVersion: 7.01 - :END: - - See the new variable =org-ctrl-k-protect-subtree=. This was a request - by Scott Otterson. - -*** Implement pretty display of entities, sub-, and superscripts. - :PROPERTIES: - :OrgVersion: 7.01 - :END: - - The command =C-c C-x \= toggles the display of Org's special entities - like =\alpha= as pretty unicode characters. Also, sub and superscripts - are displayed in a pretty way (raised/lower display, in a smaller - font). If you want to exclude sub- and superscripts, see the variable - =org-pretty-entities-include-sub-superscripts=. - - Thanks to Eric Schulte and Ulf Stegeman for making this possible. - -*** New faces for title, date, author and email address lines - :PROPERTIES: - :OrgVersion: 6.35 - :END: - - The keywords in these lines are now dimmed out, and the title is - displayed in a larger font, and a special font is also used for author, - date, and email information. This is implemented by the following new - faces: - - =org-document-title= - =org-document-info= - =org-document-info-keyword= - - In addition, the variable =org-hidden-keywords= can be used to make the - corresponding keywords disappear. - - Thanks to Dan Davison for this feature. - -*** Simpler way to specify faces for tags and todo keywords - :PROPERTIES: - :OrgVersion: 6.35 - :END: - - The variables =org-todo-keyword-faces=, =org-tag-faces=, and - =org-priority-faces= now accept simple color names as specifications. - The colors will be used as either foreground or background color for - the corresponding keyword. See also the variable - =org-faces-easy-properties=, which governs which face property is - affected by this setting. - - This is really a great simplification for setting keyword faces. The - change is based on an idea and patch by Ryan Thompson. - -*** in tables now means fixed width, not maximum width - :PROPERTIES: - :OrgVersion: 6.35 - :END: - - Requested by Michael Brand. - -*** Better level cycling function - :PROPERTIES: - :OrgVersion: 6.35 - :END: - - =TAB= in an empty headline cycles the level of that headline through - likely states. Ryan Thompson implemented an improved version of this - function, which does not depend upon when exactly this command is used. - Thanks to Ryan for this improvement. - -*** Adaptive filling - :PROPERTIES: - :OrgVersion: 6.35 - :END: - - For paragraph text, =org-adaptive-fill-function= did not handle the - base case of regular text which needed to be filled. This is now - fixed. Among other things, it allows email-style ">" comments to be - filled correctly. - - Thanks to Dan Hackney for this patch. - -*** `org-reveal' (=C-c C-r=) also decrypts encrypted entries (org-crypt.el) - :PROPERTIES: - :OrgVersion: 6.35 - :END: - - Thanks to Richard Riley for triggering this change. - -*** Better automatic letter selection for TODO keywords - :PROPERTIES: - :OrgVersion: 6.35 - :END: - - When all first letters of keywords have been used, Org now assigns more - meaningful characters based on the keywords. - - Thanks to Mikael Fornius for this patch. - -** Clocking - -*** Clock: Allow synchronous update of timestamps in CLOCK log - :PROPERTIES: - :OrgVersion: 7.7 - :END: - - Using =S-M-= on CLOCK log timestamps will increase/decrease - the two timestamps on this line so that duration will keep the same. - Note that duration can still be slightly modified in case a timestamp - needs some rounding. - - Thanks to Rainer Stengele for this idea. - -*** Localized clock tables - :PROPERTIES: - :OrgVersion: 7.5 - :END: - - Clock tables now support a new new =:lang= parameter, allowing the user - to customize the localization of the table headers. See the variable - =org-clock-clocktable-language-setup= which controls available - translated strings. - -*** Show clock overruns in mode line - :PROPERTIES: - :OrgVersion: 6.35 - :END: - - When clocking an item with a planned effort, overrunning the planned - time is now made visible in the mode line, for example using the new - face =org-mode-line-clock-overrun=, or by adding an extra string given - by =org-task-overrun-text=. - - Thanks to Richard Riley for a patch to this effect. - -*** Clock reports can now include the running, incomplete clock - :PROPERTIES: - :OrgVersion: 6.35 - :END: - - If you have a clock running, and the entry being clocked falls into the - scope when creating a clock table, the time so far spent can be added - to the total. This behavior depends on the setting of - =org-clock-report-include-clocking-task=. The default is =nil=. - - Thanks to Bernt Hansen for this useful addition. - -** Misc - -*** Improvements with inline tasks and indentation - :PROPERTIES: - :OrgVersion: 7.4 - :END: - - There is now a configurable way on how to export inline tasks. See the - new variable =org-inlinetask-export-templates=. - - Thanks to Nicolas Goaziou for coding these changes. - -*** A property value of "nil" now means to unset a property - :PROPERTIES: - :OrgVersion: 7.01 - :END: - - This can be useful in particular with property inheritance, if some - upper level has the property, and some grandchild of it would like to - have the default settings (i.e. not overruled by a property) back. - - Thanks to Robert Goldman and Bernt Hansen for suggesting this change. - -*** New helper functions in org-table.el - :PROPERTIES: - :OrgVersion: 6.35 - :END: - - There are new functions to access and write to a specific table field. - This is for hackers, and maybe for the org-babel people. - - #+begin_example - org-table-get - org-table-put - org-table-current-line - org-table-goto-line - #+end_example - -*** Archiving: Allow to reverse order in target node - :PROPERTIES: - :OrgVersion: 6.35 - :END: - - The new option =org-archive-reversed-order= allows to have archived - entries inserted in a last-on-top fashion in the target node. - - This was requested by Tom. - -*** Org-reveal: Double prefix arg shows the entire subtree of the parent - :PROPERTIES: - :OrgVersion: 6.35 - :END: - - This can help to get out of an inconsistent state produced for example - by viewing from the agenda. - - This was a request by Matt Lundin. +** Other new features and various enhancements + +*** Hyperlinks + +**** Org-Bibtex -- major improvements + + Provides support for managing bibtex bibliographical references + data in headline properties. Each headline corresponds to a + single reference and the relevant bibliographic meta-data is + stored in headline properties, leaving the body of the headline + free to hold notes and comments. Org-bibtex is aware of all + standard bibtex reference types and fields. + + The key new functions are + + - org-bibtex-check :: queries the user to flesh out all required + (and with prefix argument optional) bibtex fields available + for the specific reference =type= of the current headline. + + - org-bibtex-create :: Create a new entry at the given level, + using org-bibtex-check to flesh out the relevant fields. + + - org-bibtex-yank :: Yank a bibtex entry on the kill ring as a + formatted Org-mode headline into the current buffer + + - org-bibtex-export-to-kill-ring :: Export the current headline + to the kill ring as a formatted bibtex entry. + +**** org-gnus.el now allows link creation from messages + + You can now create links from messages. This is particularily + useful when the user wants to stored messages that he sends, for + later check. Thanks to Ulf Stegemann for the patch. + +**** Modified link escaping + + David Maus worked on `org-link-escape'. See [[http://article.gmane.org/gmane.emacs.orgmode/37888][his message]]: + + : Percent escaping is used in Org mode to escape certain characters + : in links that would either break the parser (e.g. square brackets + : in link target oder description) or are not allowed to appear in + : a particular link type (e.g. non-ascii characters in a http: + : link). + : + : With this change in place Org will apply percent escaping and + : unescaping more consistently especially for non-ascii characters. + : Additionally some of the outstanding bugs or glitches concerning + : percent escaped links are solved. + + Thanks a lot to David for this work. + +**** Make =org-store-link= point to directory in a dired buffer + + When, in a dired buffer, the cursor is not in a line listing a + file, `org-store-link' will store a link to the directory. + + Patch by Stephen Eglen. + +**** Allow regexps in =org-file-apps= to capture link parameters + + The way extension regexps in =org-file-apps= are handled has + changed. Instead of matching against the file name, the regexps + are now matched against the whole link, and you can use grouping + to extract link parameters which you can then use in a command + string to be executed. + + For example, to allow linking to PDF files using the syntax + =file:/doc.pdf::=, you can add the following entry + to org-file-apps: + + #+begin_example + Extension: \.pdf::\([0-9]+\)\' + Command: evince "%s" -p %1 + #+end_example + + Thanks to Jan Böcker for a patch to this effect. + +*** Dates and time + +**** Allow relative time when scheduling/adding a deadline + + You can now use relative duration strings like "-2d" or "++3w" + when calling =org-schedule= or =org-deadline=: it will schedule + (or set the deadline for) the item respectively two days before + today and three weeks after the current timestamp, if any. + + You can use this programmatically: =(org-schedule nil "+2d")= + will work on the current entry. + + You can also use this while (bulk-)rescheduling and + (bulk-)resetting the deadline of (several) items from the agenda. + + Thanks to Memnon Anon for a heads up about this! + +**** American-style dates are now understood by =org-read-date= + + So when you are prompted for a date, you can now answer like this + + #+begin_example + 2/5/3 --> 2003-02-05 + 2/5 --> -02-05 + #+end_example + +*** Agenda + +**** =org-agenda-custom-commands= has a default value + + This option used to be `nil' by default. This now has a default + value, displaying an agenda and all TODOs. See the docstring for + details. Thanks to Carsten for this. + +**** Improved filtering through =org-agenda-to-appt= + + The new function allows the user to refine the scope of entries + to pass to =org-agenda-get-day-entries= and allows to filter out + entries using a function. + + Thanks to Peter Münster for raising a related issue and to + Tassilo Horn for this idea. Also thanks to Peter Münster for + [[git:68ffb7a7][fixing a small bug]] in the final implementation. + +**** Allow ap/pm times in agenda time grid + + Times in the agenda can now be displayed in am/pm format. See + the new variable =org-agenda-timegrid-use-ampm=. Thanks to + C. A. Webber for a patch to this effect. + +**** Agenda: Added a bulk "scattering" command + + =B S= in the agenda buffer will cause tasks to be rescheduled a + random number of days into the future, with 7 as the default. + This is useful if you've got a ton of tasks scheduled for today, + you realize you'll never deal with them all, and you just want + them to be distributed across the next N days. When called with + a prefix arg, rescheduling will avoid weekend days. + + Thanks to John Wiegley for this. + +*** Exporting + +**** Simplification of org-export-html-preamble/postamble + + When set to `t', export the preamble/postamble as usual, honoring + the =org-export-email/author/creator-info= variables. + + When set to a formatting string, insert this string. See the + docstring of these variable for details about available + %-sequences. + + You can set =:html-preamble= in publishing project in the same + way: `t' means to honor =:email/creator/author-info=, and a + formatting string will insert a string. + +**** New exporters to Latin-1 and UTF-8 + + While Ulf Stegemann was going through the entities list to + improve the LaTeX export, he had the great idea to provide + representations for many of the entities in Latin-1, and for all + of them in UTF-8. This means that we can now export files rich + in special symbols to Latin-1 and to UTF-8 files. These new + exporters can be reached with the commands =C-c C-e n= and =C-c + C-e u=, respectively. + + When there is no representation for a given symbol in the + targeted coding system, you can choose to keep the TeX-macro-like + representation, or to get an "explanatory" representation. For + example, =\simeq= could be represented as "[approx. equal to]". + Please use the variable =org-entities-ascii-explanatory= to state + your preference. + +**** HTML export: Add class to outline containers using property + + The =HTML_CONTAINER_CLASS= property can now be used to add a + class name to the outline container of a node in HTML export. + +**** Throw an error when creating an image from a LaTeX snippet fails + + This behavior can be configured with the new option variable + =org-format-latex-signal-error=. + +**** Support for creating BEAMER presentations from Org-mode documents + + Org-mode documents or subtrees can now be converted directly in + to BEAMER presentation. Turning a tree into a simple + presentations is straight forward, and there is also quite some + support to make richer presentations as well. See the [[http://orgmode.org/manual/Beamer-class-export.html#Beamer-class-export][BEAMER + section]] in the manual for more details. + + Thanks to everyone who has contributed to the discussion about + BEAMER support and how it should work. This was a great example + for how this community can achieve a much better result than any + individual could. + +*** Refiling + +**** Refile targets can now be cached + + You can turn on caching of refile targets by setting the variable + =org-refile-use-cache=. This should speed up refiling if you + have many eligible targets in many files. If you need to update + the cache because Org misses a newly created entry or still + offers a deleted one, press =C-0 C-c C-w=. + +**** New logging support for refiling + + Whenever you refile an item, a time stamp and even a note can be + added to this entry. For details, see the new option + =org-log-refile=. + + Thanks to Charles Cave for this idea. + +*** Completion + +**** In-buffer completion is now done using John Wiegleys pcomplete.el + + Thanks to John Wiegley for much of this code. + +*** Tables + +**** New command =org-table-transpose-table-at-point= + + See the docstring. This hack from Juan Pechiar is now part of + Org's core. Thanks to Juan! + +**** Display field's coordinates when editing it with =C-c `= + + When editing a field with =C-c `=, the field's coordinate will + the displayed in the buffer. + + Thanks to Michael Brand for a patch to this effect. + +**** Spreadsheet computation of durations and time values + + If you want to compute time values use the =T= flag, either in + Calc formulas or Elisp formulas: + + | Task 1 | Task 2 | Total | + |--------+--------+---------| + | 35:00 | 35:00 | 1:10:00 | + #+TBLFM: @2$3=$1+$2;T + + Values must be of the form =[HH:]MM:SS=, where hours are + optional. + + Thanks to Martin Halder, Eric Schulte and Carsten for code and + feedback on this. + +**** Implement formulas applying to field ranges + + Carsten implemented this field-ranges formulas. + + : A frequently requested feature for tables has been to be able to define + : row formulas in a way similar to column formulas. The patch below allows + : things like + : + : @3= + : @2$2..@5$7= + : @I$2..@II$4= + : + : as the left hand side for table formulas in order to write a formula that + : is valid for an entire column or for a rectangular section in a + : table. + + Thanks a lot to Carsten for this. + +**** Sending radio tables from org buffers is now allowed + + Org radio tables can no also be sent inside Org buffers. Also, + there is a new hook which get called after a table has been sent. + + Thanks to Seweryn Kokot. + +*** Lists + +**** Improved handling of lists + + Nicolas Goaziou extended and improved the way Org handles lists. + + 1. Indentation of text determines again end of items in + lists. So, some text less indented than the previous item + doesn't close the whole list anymore, only all items more + indented than it. + + 2. Alphabetical bullets are implemented, through the use of the + variable `org-alphabetical-lists'. This also adds alphabetical + counters like [@c] or [@W]. + + 3. Lists can now safely contain drawers, inline tasks, or various + blocks, themselves containing lists. Two variables are + controlling this: `org-list-forbidden-blocks', and + `org-list-export-context'. + + 4. Improve `newline-and-indent' (C-j): used in an item, it will + keep text from moving at column 0. This allows to split text + and make paragraphs and still not break the list. + + 5. Improve `org-toggle-item' (C-c -): used on a region with + standard text, it will change the region into one item. With a + prefix argument, it will fallback to the previous behavior and + make every line in region an item. It permits to easily + integrate paragraphs inside a list. + + 6. `fill-paragraph' (M-q) now understands lists. It can freely be + used inside items, or on text just after a list, even with no + blank line around, without breaking list structure. + + Thanks a lot to Nicolas for all this! + +*** Inline display of linked images + + Images can now be displayed inline. The key C-c C-x C-v does + toggle the display of such images. Note that only image links + that have no description part will be inlined. + +*** Implement offsets for ordered lists + + If you want to start an ordered plain list with a number different + from 1, you can now do it like this: + + : 1. [@start:12] will star a lit a number 12 + +*** Babel: code block body expansion for table and preview + + In org-babel, code is "expanded" prior to evaluation. I.e. the + code that is actually evaluated comprises the code block contents, + augmented with the extra code which assigns the referenced data to + variables. It is now possible to preview expanded contents, and + also to expand code during during tangling. This expansion takes + into account all header arguments, and variables. + + A new keybinding `C-c M-b p' bound to `org-babel-expand-src-block' + can be used from inside of a source code block to preview its + expanded contents (which can be very useful for debugging). + tangling + + The expanded body can now be tangled, this includes variable + values which may be the results of other source-code blocks, or + stored in headline properties or tables. One possible use for this + is to allow those using org-babel for their emacs initialization + to store values (e.g. usernames, passwords, etc...) in headline + properties or in tables. + + Org-babel now supports three new header arguments, and new default + behavior for handling horizontal lines in tables (hlines), column + names, and rownames across all languages. + +*** Editing Convenience and Appearance + +**** New command =org-copy-visible= (=C-c C-x v=) + + This command will copy the visible text in the region into the + kill ring. Thanks to Florian Beck for this function and to + Carsten for adding it to org.el and documenting it! + +**** Make it possible to protect hidden subtrees from being killed by =C-k= + + See the new variable =org-ctrl-k-protect-subtree=. This was a + request by Scott Otterson. + +**** Implement pretty display of entities, sub-, and superscripts. + + The command =C-c C-x \= toggles the display of Org's special + entities like =\alpha= as pretty unicode characters. Also, sub + and superscripts are displayed in a pretty way (raised/lower + display, in a smaller font). If you want to exclude sub- and + superscripts, see the variable + =org-pretty-entities-include-sub-superscripts=. + + Thanks to Eric Schulte and Ulf Stegeman for making this possible. + +**** New faces for title, date, author and email address lines + + The keywords in these lines are now dimmed out, and the title is + displayed in a larger font, and a special font is also used for + author, date, and email information. This is implemented by the + following new faces: + + =org-document-title= + =org-document-info= + =org-document-info-keyword= + + In addition, the variable =org-hidden-keywords= can be used to + make the corresponding keywords disappear. + + Thanks to Dan Davison for this feature. + +**** Simpler way to specify faces for tags and todo keywords + + The variables =org-todo-keyword-faces=, =org-tag-faces=, and + =org-priority-faces= now accept simple color names as + specifications. The colors will be used as either foreground or + background color for the corresponding keyword. See also the + variable =org-faces-easy-properties=, which governs which face + property is affected by this setting. + + This is really a great simplification for setting keyword faces. + The change is based on an idea and patch by Ryan Thompson. + +**** in tables now means fixed width, not maximum width + + Requested by Michael Brand. + +**** Better level cycling function + + =TAB= in an empty headline cycles the level of that headline + through likely states. Ryan Thompson implemented an improved + version of this function, which does not depend upon when exactly + this command is used. Thanks to Ryan for this improvement. + +**** Adaptive filling + + For paragraph text, =org-adaptive-fill-function= did not handle + the base case of regular text which needed to be filled. This is + now fixed. Among other things, it allows email-style ">" + comments to be filled correctly. + + Thanks to Dan Hackney for this patch. + +**** `org-reveal' (=C-c C-r=) also decrypts encrypted entries (org-crypt.el) + + Thanks to Richard Riley for triggering this change. + +**** Better automatic letter selection for TODO keywords + + When all first letters of keywords have been used, Org now + assigns more meaningful characters based on the keywords. + + Thanks to Mikael Fornius for this patch. + +*** Clocking + +**** Clock: Allow synchronous update of timestamps in CLOCK log + + Using =S-M-= on CLOCK log timestamps will + increase/decrease the two timestamps on this line so that + duration will keep the same. Note that duration can still be + slightly modified in case a timestamp needs some rounding. + + Thanks to Rainer Stengele for this idea. + +**** Localized clock tables + + Clock tables now support a new new =:lang= parameter, allowing + the user to customize the localization of the table headers. See + the variable =org-clock-clocktable-language-setup= which controls + available translated strings. + +**** Show clock overruns in mode line + + When clocking an item with a planned effort, overrunning the + planned time is now made visible in the mode line, for example + using the new face =org-mode-line-clock-overrun=, or by adding an + extra string given by =org-task-overrun-text=. + + Thanks to Richard Riley for a patch to this effect. + +**** Clock reports can now include the running, incomplete clock + + If you have a clock running, and the entry being clocked falls + into the scope when creating a clock table, the time so far spent + can be added to the total. This behavior depends on the setting + of =org-clock-report-include-clocking-task=. The default is + =nil=. + + Thanks to Bernt Hansen for this useful addition. + +*** Misc + +**** Improvements with inline tasks and indentation + + There is now a configurable way on how to export inline tasks. + See the new variable =org-inlinetask-export-templates=. + + Thanks to Nicolas Goaziou for coding these changes. + +**** A property value of "nil" now means to unset a property + + This can be useful in particular with property inheritance, if + some upper level has the property, and some grandchild of it + would like to have the default settings (i.e. not overruled by a + property) back. + + Thanks to Robert Goldman and Bernt Hansen for suggesting this + change. + +**** New helper functions in org-table.el + + There are new functions to access and write to a specific table field. + This is for hackers, and maybe for the org-babel people. + + #+begin_example + org-table-get + org-table-put + org-table-current-line + org-table-goto-line + #+end_example + +**** Archiving: Allow to reverse order in target node + + The new option =org-archive-reversed-order= allows to have + archived entries inserted in a last-on-top fashion in the target + node. + + This was requested by Tom. + +**** Org-reveal: Double prefix arg shows the entire subtree of the parent + + This can help to get out of an inconsistent state produced for + example by viewing from the agenda. + + This was a request by Matt Lundin. * License -This file is part of GNU Emacs. - -GNU Emacs is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -GNU Emacs is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Emacs. If not, see . + This file is part of GNU Emacs. + + GNU Emacs is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + GNU Emacs is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Emacs. If not, see . === modified file 'etc/org/OrgOdtContentTemplate.xml' --- etc/org/OrgOdtContentTemplate.xml 2012-04-01 09:49:25 +0000 +++ etc/org/OrgOdtContentTemplate.xml 2012-09-30 15:14:59 +0000 @@ -256,6 +256,7 @@ + === modified file 'etc/org/OrgOdtStyles.xml' --- etc/org/OrgOdtStyles.xml 2012-04-26 17:30:04 +0000 +++ etc/org/OrgOdtStyles.xml 2012-09-30 15:14:59 +0000 @@ -319,6 +319,11 @@ + + + + + === modified file 'etc/refcards/orgcard.pdf' Binary files etc/refcards/orgcard.pdf 2012-05-25 07:39:32 +0000 and etc/refcards/orgcard.pdf 2012-09-30 15:14:59 +0000 differ === modified file 'etc/refcards/orgcard.tex' --- etc/refcards/orgcard.tex 2012-09-17 07:22:17 +0000 +++ etc/refcards/orgcard.tex 2012-09-30 15:14:59 +0000 @@ -1,5 +1,5 @@ % Reference Card for Org Mode -\def\orgversionnumber{7.8.11} +\def\orgversionnumber{7.9} \def\versionyear{2012} % latest update \input emacsver.tex === modified file 'lisp/org/ChangeLog' --- lisp/org/ChangeLog 2012-09-01 01:04:26 +0000 +++ lisp/org/ChangeLog 2012-09-30 15:14:59 +0000 @@ -1,3 +1,3033 @@ +2012-09-30 Abdó Roig-Maranges + + * org-html.el (org-export-html-preprocess) + (org-export-html-format-image): Use + `org-latex-preview-ltxpng-directory'. + + * org-odt.el (org-export-odt-do-preprocess-latex-fragments): + Ditto. + + * org.el (org-latex-preview-ltxpng-directory): New option. + (org-preview-latex-fragment): Store LaTeX preview images in + `org-latex-preview-ltxpng-directory'. + +2012-09-30 Achim Gratz + + * ob-R.el (org-babel-R-initiate-session): Protect against use of + unbound variable `ess-ask-for-ess-directory´. The default for this + variable is true, so act accordingly if it is found unbound. + + * ob-R.el: Remove initialization with `nil´ from + `ess-ask-for-ess-directory´ and `ess-local-process-name´. Remove + second declaration for `ess-local-process-name´. + + * org-id.el: Do not use (random t), we just want a new random + number, not a re-seeding of the PRNG for which (random t) doesn't + provide enough entropy anyway. Even if (random) would always + produce the same sequence, the other components going into the MD5 + hash ensure that the result will be unique. + + * org-gnus.el: Add a missing require for gnus-util. + + * org-compat.el: Rename utils to make throughout. + + * org.el: Move check for outline-mode-keymap after (require + 'outline). + + * org-element.el: New file. Do not (require 'org). + + * org-agenda.el: Remove duplicate requires. + + * org.el (org-mode-map): Add keybindings to + `org-element-transpose' and `org-narrow-to-element'. + (org-metaup): Fall back on `org-element-drag-backward'. + (org-metadown): Fall back on `org-element-drag-forward'. Also + move chunks of declarations and require statements to get rid of + compiler warnings. + + * org-exp-blocks.el (org): Don't require org. Add declarations. + + * org-clock.el (org): Don't require org. + + * ob-exp.el (org-list-forbidden-blocks): Add declarations. + + * ob.el (org-babel-exeext): New defconst to hold extension for + executables or nil if none. Should be ".exe" for both Windows and + Cygwin. + + * ob-C.el (org-babel-C-execute): Use org-babel-exeext when + constructing the target file name for the compiled executable. + + * ob-fortran.el (org-babel-execute:fortran): Add org-babel-exeext + when constructing the target file name for the compiled + executable. + + * org-version.el: New file. + + * org-compat.el (org-check-version): New macro. Check if + org-version.el exists and provide autoloads to that. Otherwise + check if org-fixup.el exists and use it to provide definitions. + Finally if nothing worked, complain about a botched installation + and provide fallback definitions. + + * org.el: Use org-check-version. + + * org.el: Fix a subtle error resulting in version functions + sometimes not being defined and byte-compiling failing. Always + compile in fallback definitions into org.elc -- org-fixup either + provides re-definitions at compile-time or checks org-version.el + and then the git work tree when run uncompiled. So the fallback + definitions will only come into effect when org-fixup is not + available. + + * org.el (org-version): Make org-version more robust, e.g. when + byte-compiling single files with 'make compile-dirty'. + + * org.el (org-reload): Revert an undesirable change in org-reload. + Do not prepend org-dir to babel-files, which prevents the files + from being found in load-path. + + * org.el (org-version): Add optional parameters 'full and 'message + to optionally return the full version string and echo to message + area in non-interactive calls. + + * org.el (org-submit-bug-report): Add optional parameter 'full to + call of (org-version) so that the bug report has all version + information. + + * org.el (org-reload): Simplify file-re (orgtbl-*.el files do not + exist anymore). Keep org-*.el at the end of the files list. + Explicitely load org-version.el (since it doesn't provide feature + 'org-version) at the very end, but ignore errors when it doesn't + exist. Add parameters 'full and 'message to the call of + (org-version) so that after reload the full version information is + displayed in the message area again. + + * org-agenda.el: Replace with-no-warnings with org-no-warnings + (defined in org-macs.el). + + * org-bbdb.el: Replace with-no-warnings with org-no-warnings + (defined in org-macs.el). + + * org-clock.el: Replace with-no-warnings with org-no-warnings + (defined in org-macs.el). + + * org.el: Replace with-no-warnings with org-no-warnings (defined + in org-macs.el). + + * org.el: Add with-not-warnings around call of (org-fixup). + + * org-compat.el (org-find-library-dir): Rename + org-find-library-name (misleading) and implement with a function + that exists identically in Emacs/XEmacs. + + * org-exp-blocks.el: Change calls to org-find-library-dir. + + * org.el: change calls to org-find-library-dir. Make require for + noutline fail silently because it is missing from XEmacs. + + * org.el (org-version): Use functions instead of global variables + to get the version strings and remove the defvaralias to + org-version. Warn when encountering a mixed installation (org and + org-install.el should be found in the same directory). + + * org.el: Add with-no-warning to defvar for two unprefixed global + variables from calendar.el (there's nothing else we can do inside + org until it is fixed in calendar.el). + + * org.el: Require find-func and remove declare-function for + find-library-name, otherwise autoloaded org-version doesn't show + all info correctly. + + * org.el (org-version): Show the full path to org-install.el in + the version string to avoid confusion if multiple installations + exist or a previously loaded org-install.el has already defined a + version string that is now out of date. + + * org.el (org-version): Remove determination of version + information, show "N/A" if the information is not provided via + org-install.el. + + * org.el (org-git-version): Placeholder for recording the Git + version of org during install + + * org.el (org-version): Initialize local git-version with + placeholder and fall through using it when org is not installed in + a Git repository + +2012-09-30 Adam Spiers (tiny change) + + * org-html.el: Add hyperlink to http://orgmode.org/ from export + footer. + + * org-clock.el (org-clock-modify-effort-estimate): Display a + message when no clock is currently active. + +2012-09-30 Andrew Hyatt (tiny change) + + * org-archive.el (org-archive-subtree): Allow archiving to a + datetree. + + * org.el (org-archive-location): Ditto. + +2012-09-30 Bastien Guerry + + * ob-io.el: New file. + + * ob-scala.el: New file. + + * org.el (org-url-hexify-p, org-doi-server-url) + (org-latex-preview-ltxpng-directory, org-custom-properties) + (org-sparse-tree-default-date-type): Add :version "24.3". + + * org-agenda.el (org-agenda-sticky) + (org-agenda-custom-commands-contexts): Ditto. + + * org-capture.el (org-capture-bookmark) + (org-capture-templates-contexts) (org-capture-use-agenda-date): + Ditto. + + * org-latex.el (org-export-latex-hyperref-options-format) + (org-export-latex-link-with-unknown-path-format): Ditto. + + * org-id.el (org-id-link-to-org-use-id): Ditto. + + * org-datetree.el (org-datetree-add-timestamp): Ditto. + + * org.el (org-make-link-description-function): Enhance docstring. + (org-insert-link): Fall back on interactive prompt when + `org-make-link-description-function' fails. + + * org-agenda.el (org-todo-list): Fix redoing of todo agenda when + `org-agenda-sticky' is non-nil. + + * org-agenda.el (org-agenda-quit): Delete last indirect buffer. + (org-agenda-pre-follow-window-conf): New variable. + (org-agenda-tree-to-indirect-buffer): Fix bug: don't split agenda + window when there an indirect buffer is already displayed. + + * org-agenda.el (org-agenda-manipulate-query) + (org-agenda-goto-date, org-agenda-goto-today) + (org-agenda-find-same-or-today-or-agenda, ) + (org-agenda-later, org-agenda-change-time-span) + (org-agenda-change-all-lines) + (org-agenda-execute-calendar-command) + (org-agenda-goto-calendar, org-agenda-convert-date): Make sure to + get a property from (1- (point-max)), not (point-max)). + + * ob-dot.el (org-babel-execute:dot): Throw an error when there is + no :file parameter. + + * org-table.el (org-table-eval-formula): Convert time-stamps to + inactive time-stamp so that Calc can handle them correctly. + + * org-table.el (org-table-fix-formulas): Warn with a message when + formulas have been updated. + + * org-publish.el (org-publish-cache-ctime-of-src): Delete the + base-dir argument and use (file-name-directory file) to get the + file's directory. + (org-publish-update-timestamp) + (org-publish-cache-file-needs-publishing): Call + `org-publish-cache-ctime-of-src' with only one argument. + + * org.el (org-follow-timestamp-link): Fix bug when using sticky + agenda. Add a docstring. + + * org-agenda.el (org-agenda-sticky): Don't use a function to set. + Add a :version string. + + * org.el (org-priority): Use a new argument to show priority + instead of setting it. + (org-show-priority): New function to show priority both in normal + Org buffers and in Org Agenda buffers. + (org-speed-commands-default): Use "," as a speed command for + setting priority. + + * org-agenda.el (org-agenda-mode-map): Bind `org-agenda-priority' + to `C-c ,' as it was before. + (org-agenda-show-priority): Delete. + (org-agenda-priority): Use a new argument to show priority instead + of setting it. + + * org.el (org-font-lock-hook, org-set-font-lock-defaults): Add a + docstring. + (org-display-inline-remove-overlay): Rename from + `org-display-inline-modification-hook'. + (org-speed-command-activate): Rename from + `org-speed-command-default-hook'. + (org-babel-speed-command-hook): Rename from + `org-babel-speed-command-activate'. + + * org-agenda.el (org-agenda-update-agenda-type): Rename from + `org-agenda-post-command-hook'. + (org-agenda-mode): Use the new name. + (org-agenda-post-command-hook): Define as obsolete function. + + * org-lparse.el (org-lparse): Temporarily activate the hooks + needed for the ODT conversion. + (org-lparse-preprocess-after-blockquote): Rename from + `org-lparse-preprocess-after-blockquote-hook'. + (org-lparse-strip-experimental-blocks-maybe): Rename from + `org-lparse-strip-experimental-blocks-maybe'. + (org-lparse-preprocess-after-blockquote-hook) + (org-lparse-strip-experimental-blocks-maybe-hook): Define as + obsolete functions. + + * ob.el (org-babel-insert-result): Comma-escape results inserted + with ":results org". + + * org-src.el (org-edit-src-code, org-edit-src-exit): Fix bug about + saving the source editing window with the default value for + `org-src-window-setup' (i.e. 'reorganize-frame). + + * org-src.el (org-src-font-lock-fontify-block): Fix bug: don't + fontify the last character. + + * org.el (org-open-at-point): Don't follow timestamp within + bracket links. + + * org-capture.el (org-capture-templates): Fix typo in docstring. + + * org-agenda.el (org-agenda-skip): Skip information retrieved from + a source block. + + * ob.el (org-babel-common-header-args-w-values) + (org-babel-insert-result): Reintroduce ":results org" but using + "#+BEGIN_SRC org", not "#+BEGIN_ORG". + + * ob.el (org-babel-common-header-args-w-values): Remove "org" the + list of predefined values for the ":results" parameter. + + * ob.el (org-babel-insert-result): Remove support for ":results + org". + + * ob.el (org-babel-common-header-args-w-values) + (org-babel-insert-result): Deprecate ":results wrap" in favor of + ":results drawer". + + * org-crypt.el (org-at-encrypted-entry-p): Fix bug when the check + happens before the first headline. + + * org-capture.el (org-at-encrypted-entry-p) + (org-encrypt-entry, org-decrypt-entry): Declare. + (org-capture-set-target-location): Check whether `org-crypt' has + been loaded. + + * org-agenda.el (org-agenda-todo-custom-ignore-p): Fix typo in + docstring. + + * org-capture.el (org-capture-finalize): Maybe re-encrypt the + target headline if it was decrypted. + (org-capture-set-target-location): Maybe decrypt the target + headline. + + * org-crypt.el (org-at-encrypted-entry-p): New function. + + * org.el (org-options-keywords): Add "STYLE:". + + * org-agenda.el (org-agenda-ndays): Don't make an alias, as + `org-agenda-span' is defined separately. + + * org.el (org-in-subtree-not-table-p): New utility function for + building the menu. + (org-org-menu): Add an item for refiling. Check more contexts + when activating items. + (org-tree-to-indirect-buffer): Use `org-up-heading-safe'. + + * org-agenda.el (org-agenda-tree-to-indirect-buffer) + (org-agenda-do-tree-to-indirect-buffer): Use argument `arg'. + + * org-capture.el (org-capture-set-target-location): Set a correct + time value when storing a note in a datetree and prompting the + user for a date. + + * org-capture.el (org-capture-mode): Fix bug: don't run the mode's + hook twice. + + * org-agenda.el (org-agenda-menu-two-column) + (org-finalize-agenda-hook, org-agenda-ndays): Use + `define-obsolete-variable-alias' instead of + `make-obsolete-variable'. + + * org.el (org-link-to-org-use-id): Move to org-id.el. + + * org-id.el (org-id-link-to-org-use-id): Rename from + `org-link-to-org-use-id'. Use `nil' as the default value. + (org-link-to-org-use-id): Alias and define as obsolete. + + * org-agenda.el (org-search-view, org-agenda-get-todos) + (org-agenda-get-timestamps, org-agenda-get-blocks): Use the dotime + parameter of `org-agenda-format-item' so that 'time-up and + 'time-down agenda sorting strategies are handled correctly. + + * org-capture.el (org-capture-fill-template): Fix checking of + protected template entries. + + * org.el (org-cycle-global-at-bob): Fix typo in docstring. + + * org.el (org-insert-drawer): Deactivate the mark before trying to + indent the :END: of the drawer. + + * org-agenda.el (org-agenda-export-html-style): Default to nil as + any string value will replace the htmlize style. + + * org.el (org-cycle-hook): Fix tiny typo in docstring. + + * org.el (org-time-string-to-time) + (org-time-string-to-seconds, org-end-of-subtree): Add a dosctring. + + * org-freemind.el (org-freemind-write-node): Enhance links + conversion in nodes. + + * org-freemind.el (org-freemind-write-node): Convert links in + nodes. + + * org.el (org-link-to-org-use-id, org-directory) + (org-default-notes-file, org-reverse-note-order) + (org-extend-today-until, org-finish-function) + (org-store-link-functions): Use "capture" instead of "remember" in + docstrings. Also use the `org-capture' group when it makes sense. + + * org-agenda.el (org-agenda-tree-to-indirect-buffer): Find the + correct agenda buffer. Don't split the agenda window when the + indirect buffer is displayed in another frame. + + * org.el (org-mode): Try to set the org-hide face correctly. + + * org-exp.el (org-export): Set the mark correctly when exporting a + subtree. + + * org-agenda.el (org-agenda-get-restriction-and-command): Fix the + display of the number of commands for block agendas. + + * org-agenda.el (org-agenda-before-write-hook) + (org-agenda-add-entry-text-maxlines): Enhance phrasing. + (org-agenda-finalize-hook, org-agenda-mode-hook): Tell that the + buffer is writable when the hook is called. + (org-agenda-finalize): Allow org-agenda-finalize-hook to modify + the buffer. + + * org-agenda.el (org-habit-show-all-today): Only use defvar to + silent the byte-compiler. + (org-agenda-get-scheduled): Check whether some org-habit.el + options have been defined. + + * org-capture.el (org-capture-entry): New variable. + (org-capture-string, org-capture): Use it to possibly skip the + interactive prompt for a capture template. + + * org.el (org-activate-plain-links): Don't try to check if we are + in a bracket link already. + + * org.el (org-read-date-analyze): Fix bug introduced in commit + cc5f9f: adding a time should not prevent relative answers to be + parsed correctly. + + * org-agenda.el (org-agenda-bulk-action): Always read the date + through `org-read-date'. When possible, use the date at point as + the default date. + + * org-agenda.el (org-agenda-bulk-action): Fix bug when + bulk-shifting timestamps. + + * org.el (org-version): New constant. + + * org-compat.el (org-random): New compatibility function. + + * org-id.el (org-id-uuid): Use it. + + * org-capture.el (org-capture-use-agenda-date): New option. + (org-capture): Use it. + + * org-agenda.el (org-agenda-capture): New command. + (org-agenda-mode-map): Bind it to `k'. + (org-agenda-menu): Add it to the menu. + + * org-capture.el (org-capture): Update docstring. + + * org-capture.el (org-capture): When called from an agenda buffer, + use the cursor date at the default date. + + * org-agenda.el (org-agenda-bulk-action): Use the let-bound + `entries' instead the variable. + + * org-agenda.el (org-agenda-bulk-action): Fix bug: don't remove + persistent marks too early. + + * org-agenda.el (org-agenda-bulk-action): Possibly use the day at + point to reset the scheduled or deadline cookie. On date headers, + use it without prompting the user. On an item, use the item's + date as the default prompt for `org-read-date'. + + * org.el (org-read-date): Docstring fix. + + * org-agenda.el (org-agenda-bulk-action): Reorder possible actions + in the message. + + * org-agenda.el (org-agenda-action, org-agenda-do-action): Delete. + (org-agenda-mode-map): Delete related keys. + + * org-agenda.el (org-agenda-menu): Fix a keybinding. + + * org-colview.el (org-columns-goto-top-level): Correctly move the + marker `org-columns-top-level-marker'. + (org-agenda-columns): Don't set + `org-agenda-overriding-columns-format' as a buffer variable, as we + only need it dynamically. + (org-agenda-colview-summarize): Fix a bug in returning the match + string. + + * org-agenda.el (org-agenda-span-to-ndays): Make the second + argument `starting-day' optional. + (org-agenda-goto-date): Keep parameters of custom agendas. + + * org-agenda.el (org-agenda-list): Allow setting the agenda buffer + name through a temporary variable. + (org-agenda-buffer-tmp-name): New variable to temporary store the + agenda buffer name. + + * org-agenda.el (org-agenda-goto-date): Fix behavior when using + sticky agendas. + + * org-agenda.el (org-diary): Don't check whether there is an + agenda buffer when trying to compile the prefix format. + (org-compile-prefix-format): Check if there is an agenda buffer. + If not, use the current buffer. + + * org-agenda.el (org-agenda-get-day-entries): Set the agenda + buffer inconditionnally. + + * ob.el (org-babel-named-src-block-regexp-for-name): Generate a + more general regexp. + + * ob.el (org-babel-where-is-src-block-head): Find a src block head + correctly when #+header(s) is before #+name. + + * org-agenda.el (org-agenda-finalize-hook) + (org-agenda-finalize, org-agenda-finalize-entries): Rename from + org-finalize-agenda-*. + (org-agenda-run-series, org-agenda-finalize, org-timeline) + (org-agenda-list, org-search-view, org-todo-list) + (org-tags-view, org-diary, org-agenda-finalize-entries) + (org-agenda-change-all-lines): Use the new names. + + * org-agenda.el (org-agenda-local-vars): Remove + ̀org-agenda-last-arguments' from the list of local variables. + (org-agenda-mode-map): `g' does the same than `r' in buffers with + only one agenda view, but its behavior differs when there are + several views. In manually appended agendas (with `A'), `g' + displays only the agenda under the point. With multiple agenda + blocks, `g' reinitializes the view by discarding any temporary + changes (e.g. with ̀f' or `w'), while ̀r' keeps those temporary + changes for the agenda view under the point. + (org-agenda-run-series, org-agenda-redo): Implement the above + changes. + (org-agenda-mark-header-line): Don't set useless properties. + (org-agenda-list, org-todo-only, org-search-view) + (org-todo-list, org-tags-view, org-agenda-list-stuck-projects) + (org-agenda-manipulate-query, org-agenda-goto-today) + (org-agenda-later, org-agenda-change-time-span): Use text + properties for storing the last command and the last arguments for + each agenda block. + (org-unhighlight-once): Delete. + + * org-agenda.el (org-agenda-append-agenda): Fit agenda window to + buffer. + + * org-agenda.el (org-agenda-append-agenda): Bugfix: correctly + check whether we are in org-agenda-mode. + + * org-agenda.el (org-agenda-pre-window-conf): Rename from + `org-pre-agenda-window-conf'. + (org-agenda-local-vars, org-agenda-prepare-window) + (org-agenda-Quit, org-agenda-quit): Use the new name. + + * org-agenda.el (org-keys, org-match): New variable, dynamically + scoped in `org-agenda'. + (org-agenda, org-agenda-list, org-search-view, org-todo-list) + (org-tags-view): Use the new variables. + (org-batch-store-agenda-views): Let-bind `match'. + + * org-agenda.el (org-search-view, org-todo-list) + (org-tags-view): Do not let `org-agenda-sticky' prevent the use of + these functions programmatically. Also use the sticky agenda + function correctly. + + * org-agenda.el (org-agenda): Set `org-agenda-buffer-name' + correctly with sticky agendas and non-custom commands. + + * org-agenda.el (org-agenda-fit-window-to-buffer): Rename from + `org-fit-agenda-window'. + (org-agenda-run-series, org-agenda-prepare, org-agenda-list) + (org-search-view, org-todo-list, org-tags-view): Use the new name. + + * org-agenda.el (org-agenda-prepare): Let `throw' display an + error. + + * org-agenda.el (org-agenda-list): Fix bug: don't throw an error + when called from programs as (org-agenda-list). + + * org-agenda.el (org-todo-list): Make arg optional. + + * org.el (org-agenda-prepare-buffers): Rename from + `org-prepare-agenda-buffers'. + (org-match-sparse-tree, org-map-entries): Use the new names. + + * org-agenda.el (org-agenda-prepare-window): Rename from + `org-prepare-agenda-window'. + (org-agenda-prepare): Rename from `org-prepare-agenda'. + (org-agenda-run-series, org-agenda-prepare, org-timeline) + (org-agenda-list, org-search-view, org-todo-list) + (org-tags-view, org-agenda-list-stuck-projects, org-diary) + (org-agenda-to-appt): Use the new names. + + * org-mobile.el (org-mobile-create-index-file): Ditto. + + * org-icalendar.el (org-export-icalendar): Ditto. + + * org-clock.el (org-dblock-write:clocktable) + (org-dblock-write:clocktable): Ditto. + + * org2rem.el (org2rem): Ditto. + + * org-agenda.el (org-agenda): In sticky agendas, use the current + command's match to set the buffer name. This gives more + information to the user and allows to distinguish various agendas + triggered by the same key. + (org-batch-store-agenda-views): Handle the new sticky agenda + buffer name. + + * org-agenda.el (org-agenda) + (org-agenda-get-restriction-and-command): Use `S' as a key for + searching words in TODO-only entries. + + * org-agenda.el (org-prepare-agenda): Fit agenda window when + displaying a sticky agenda. + + * org-table.el (org-table-number-regexp): Allow the user to set it + to a new regexp, which allows commas as decimal mark. The default + is to not use this setting, but the one before commit 7ff8c1, + which has ben reverted. + + * org-agenda.el (org-agenda-overriding-cmd) + (org-agenda-multi-current-cmd) + (org-agenda-multi-overriding-arguments): New variables. + (org-agenda-run-series): `org-agenda-overriding-arguments' + defaults to the last agenda block arguments, so don't use it + globally. + (org-agenda-mark-header-line): Add properties needed so that + `org-agenda-overriding-arguments', `org-agenda-current-span' and + `org-agenda-last-arguments' can be set to their correct contextual + value. + (org-agenda-multi-back-to-pos): New variable. + (org-agenda-later): Retrieve `org-agenda-current-span' and + `org-agenda-overriding-arguments' from text properties. Also + handle numeric span. + (org-agenda-later, org-agenda-change-time-span): Set + `org-agenda-overriding-cmd' so that we to take overriding + arguments into account for this command only. + + * org-agenda.el (org-agenda-kill, org-agenda-archive-with): Fix + bug when called with a non-nil value of `org-agenda-stick'. + + * org-agenda.el (org-agenda-refile): Fix bug when refiling an + entry from a sticky agenda. + + * org-agenda.el (org-prepare-agenda-window): Use + `org-pre-agenda-window-conf' if already set. + (org-agenda-Quit): Set `org-pre-agenda-window-conf' to nil when + quitting. + (org-agenda-quit): Ditto. + + * org-capture.el (org-capture-fill-template): Protect the text + used for replacement from being further replaced. + + * org.el (org-contextualize-validate-key): Fix the check against a + function. + + * org.el (org-contextualize-keys): Rename from + `org-contextualize-agenda-or-capture'. Fix normalization to + handle empty key replacement string. + (org-contextualize-validate-key): Rename from + `org-contexts-validate'. Allow checking against a custom + function. + + * org-agenda.el (org-agenda-custom-commands-contexts): Update. + (org-agenda): Use `org-contextualize-keys'. + + * org-capture.el (org-capture-templates-contexts): Ditto. + + * org.el (org-contextualize-agenda-or-capture): Normalize + contexts. + + * org.el (org-contextualize-agenda-or-capture): Handle key + replacement depending on the contexts. + + * org-capture.el (org-capture-templates-contexts): Allow to use + the context as a way to replace one capture template by another + one. + + * org-agenda.el (org-agenda-custom-commands-contexts): Allow to + use the context as a way to replace one agenda custom command by + another one. + + * org.el (org-contextualize-agenda-or-capture) + (org-rule-validate): New functions, implement context filtering + for agenda commands and capture templates. + + * org-agenda.el (org-agenda-custom-commands-contexts): New option. + (org-agenda): Use it. + + * org-capture.el (org-capture-templates-contexts): New option. + (org-capture-select-template): Use it. + + * org.el (org-beginning-of-defun, org-end-of-defun): Delete. + (org-mode): Set `beginning-of-defun-function' and + `end-of-defun-function' directly. + + * org.el (org-insert-link): Fix bug: include links abbreviations + when completing. + + * org-icalendar.el (org-icalendar-print-entries): Fix bug: when + `org-icalendar-use-plain-timestamp' is nil, scheduled and deadline + items should not be ignored. + + * org.el (org-ds-keyword-length, org-make-tags-matcher): Docstring + clean-up. + + * org-freemind.el (org-freemind-convert-links-from-org): Replace + literally to prevent errors when replacing with string containing + backslashes. + + * org-pcomplete.el (org-thing-at-point): Allow to match (and then + complete) a "thing" containing dashes. + + * org-table.el (org-table-toggle-coordinate-overlays): Better + message when interactively toggling. + + * org-table.el (org-table-number-regexp): Update the docstring to + show an example of a decimal number using the comma as a + separation mark. + + * org-agenda.el (org-prepare-agenda): Minor code clean-up. + (org-agenda-filter-by-category): Filtering must be turned off only + when a category filter has been set and this filter is not empty. + + * org-agenda.el (org-search-view, org-agenda-get-todos) + (org-agenda-get-timestamps, org-agenda-get-sexps) + (org-agenda-get-progress, org-agenda-get-deadlines) + (org-agenda-get-scheduled, org-agenda-get-blocks): Use + `category-pos' instead of `org-category-pos'. + + * ob-fortran.el (org-babel-fortran-transform-list): Rename from + `ob-fortran-transform-list'. + (org-babel-fortran-var-to-fortran): Use the new function's name. + + * ob-calc.el (org-babel-calc-maybe-resolve-var): Rename from + `ob-calc-maybe-resolve-var'. + (org-babel-execute:calc): Use the new function's name. + + * org-jsinfo.el (org-infojs-template): Add a license. + (org-infojs-handle-options): Replace all template elements. + + * org-html.el (org-export-html-scripts): Add a license. + (org-export-html-mathjax-config): Replace all template elements. + (org-export-html-mathjax-template): Add a license. + (org-export-as-html): Minor code clean-up. + + * org.el (org-options-keywords): Add "#+MATHJAX" and + "#+INFOJS_OPT" to the list of keywords for completion. + + * org.el (org-src-prevent-auto-filling): Remove unused and useless + option. + + * org.el (org-element-at-point): Autoload. + (org-element-up): Remove useless declaration. + (org-fill-context-prefix, org-fill-paragraph) + (org-mark-element, org-narrow-to-element) + (org-transpose-element, org-unindent-buffer): Do not require + org-element. + + * org.el (org-fill-paragraph): Require org-element. + + * org-agenda.el (org-agenda-persistent-marks): Minor docstring + enhancement. + + * org.el (org-create-math-formula): Use the compatibility function + `org-region-active-p'. + + * org-odt.el (org-export-as-odf): Ditto. + + * ob.el (org-babel-demarcate-block): Ditto. + + * org.el (org-mark-subtree): Maybe call `org-mark-element' + interactively. + (org-mark-element): Only mark further elements when called + interactively. + + * org.el (org-mark-element, org-narrow-to-element) + (org-transpose-element): Require org-element. + + * org-agenda.el (org-agenda-get-timestamps) + (org-agenda-get-sexps, org-agenda-get-deadlines) + (org-agenda-get-scheduled): Add the 'warntime as a text property, + getting its value from the APPT_WARNTIME property. + (org-agenda-to-appt): Use the 'warntime text property. + + * org-capture.el (org-capture-place-table-line): Fix bug. + + * org.el (org-activate-plain-links): Don't activate a plain link + when it is part of a bracketed link, unless bracketed links are + not enlisted in `org-activate-links'. + (org-open-at-point): Don't consider the text immediately after a + bracketed link is part of a plain link. + + * org.el (org-compute-latex-and-specials-regexp) + (org-paste-subtree, org-sort-entries, org-store-link) + (org-open-at-point, org-file-remote-p, org-add-log-setup) + (org-set-tags-to, org-fast-tag-selection) + (org-diary-sexp-entry): Ditto. + + * org-agenda.el (org-agenda-get-blocks, org-cmp-priority) + (org-cmp-effort, org-cmp-todo-state, org-cmp-alpha) + (org-cmp-tag, org-cmp-time): Remove useless (t nil) sexps at the + end of (cond ...) constructs. + + * org-mobile.el (org-mobile-create-index-file): Ditto. + + * org-lparse.el (org-lparse-format-table-row): Ditto. + + * org-list.el (org-sort-list): Ditto. + + * org-id.el (org-id-get): Ditto. + + * org-html.el (org-export-html-preprocess): Ditto. + + * org-exp.el (org-default-export-plist) + (org-table-clean-before-export): Ditto. + + * org.el (org-options-keywords): Add "TODO". + (org-make-options-regexp): Make the hashtag mandatory for options + and don't allow whitespaces between the hashtag and the plus sign. + + * org.el (org-refresh-category-properties) + (org-find-dblock, org-dblock-start-re, org-dblock-end-re): Allow + lowercase "#+category" and "#+begin:" dynamic blocks. + + * org.el (org-context): Use case-folding when trying to match + clocktables and source blocks contexts. + + * org-clock.el (org-clock-put-overlay): Put the overlay on the + whole headline, not only on the last character. This fixes a bug + with overlays on headlines ending with a bracketed link. + + * org-html.el (org-export-as-html): Make sure we always process a + string. + + * org-exp.el (org-export-cleanup-toc-line): Always return a + string. + + * org.el (org-fontify-meta-lines-and-blocks-1): Correctly handle + metalines with #+results[...]:. + + * org-exp.el (org-export-handle-metalines): Rename from + `org-export-handle-table-metalines'. Now also handle source block + metalines. + (org-export-res/src-name-cleanup): Delete. + (org-export-preprocess-string): Use `org-export-handle-metalines'. + Don't use `org-export-res/src-name-cleanup' anymore. + + * org-html.el (org-format-org-table-html): Don't include the + caption tag for empty captions in HTML export. Keep it in the + DocBook export so that it produces valid DocBook XML. + + * org.el (org-read-date-analyze): Allow both "8am Wed" and "Wed + 8am" to be parsed correctly with respect to possible values of + `org-read-date-prefer-future'. + (org-read-date-prefer-future): Update docstring to remove the + restriction about inserting only the time. The user can now + insert the time and the day. + + * org-icalendar.el (org-icalendar-print-entries): Rename from + `org-print-icalendar-entries'. + (org-icalendar-start-file): Rename from + `org-start-icalendar-file'. + (org-icalendar-finish-file): Rename from + `org-finish-icalendar-file'. + (org-icalendar-ts-to-string): Rename from `org-ical-ts-to-string'. + (org-export-icalendar): Use the correct functions. + + * ob-ref.el (org-babel-ref-index-list): Fix bug introduced by + commit e85479. + + * org.el (org-fill-context-prefix): Require org-element. + (org-timestamp-change): Fix bug by saving excursion when adjusting + another clock. + + * org.el (org-read-date-prefer-future): Fix docstring formatting. + (org-read-date-analyze): Fix the interpretation of + `org-read-date-prefer-future'. + + * org-agenda.el (org-agenda-menu-two-column): Rename to + `org-agenda-menu-two-columns'. + + * ob.el (org-babel-sha1-hash, org-babel-noweb-p): Replace + `org-labels' by `let*'. + + * org-bibtex.el (org-bibtex-headline): Ditto. + + * org-compat.el: Delete `org-labels'. + + * ob.el (org-babel-get-src-block-info) + (org-babel-check-src-block, org-babel-current-result-hash) + (org-babel-parse-src-block-match, org-babel-read-link) + (org-babel-insert-result, org-babel-clean-text-properties): Use + ̀org-no-properties' instead of `org-babel-clean-text-properties'. + (org-babel-clean-text-properties): Delete redundant function + `org-babel-clean-text-properties'. + + * ob-tangle.el (org-babel-tangle-collect-blocks) + (org-babel-tangle-comment-links): Ditto. + + * ob-table.el (sbe): Ditto. + + * ob-lob.el (org-babel-lob-get-info) + (org-babel-lob-execute): Ditto. + + * ob-exp.el (org-babel-exp-non-block-elements): Ditto. + + * org-macs.el (org-no-properties): Allow a new parameter + `restricted' to restrict the properties removal to those in + `org-rm-props'. The default is now to remove all properties. + + * org-compat.el (org-substring-no-properties): Remove unused + defun. + + * org-remember.el (org-remember-apply-template): Remove redundant + removal of text properties. + (org-remember-apply-template): Use `org-no-properties'. + + * org-capture.el (org-capture-fill-template): Remove redundant + removal of text properties. + (org-capture-fill-template): Use `org-no-properties'. + + * org-gnus.el (org-gnus-open, org-gnus-follow-link): Use + `org-no-properties'. + + * org-colview.el (org-columns-display-here): Ditto. + + * org-table.el (org-table-eval-formula): Ditto. + + * org.el (org-entry-properties): Ditto. + + * org-icalendar.el (org-print-icalendar-entries): Fix bug about + handling `alarm-time'. + + * ob-R.el (org-babel-edit-prep:R): Don't set the session. + + * org.el (org-store-log-note): Only skip comments starting with "# + " when storing a note. + + * org.el (org-custom-properties): New option. + (org-custom-properties-overlays): New variable. + (org-toggle-custom-properties-visibility): New command to toggle + the visibility of custom properties. + (org-check-before-invisible-edit): Also prevent errors when trying + to edit invisible properties. + + * org-datetree.el (org-datetree-add-timestamp): New option. + (org-datetree-insert-line): Use it. + + * org.el (org-fill-template): Fix bug when filling template for a + key associated to the nil value. + + * org-agenda.el (org-diary): Fix tiny typo. + + * org.el (message-in-body-p): Move declaration up to fix compiler + warning. + + * org.el (org-fill-context-prefix): Fix auto-filling in + `message-mode'. + + * org.el (org-fill-paragraph): Correctly fill paragraph in + message-mode. + (org-indent-line): Correctly indent according to mode when + `orgstruct++-mode' is on. + (orgstruct++-mode): Add `fill-prefix' to the variable temporarily + stored in `org-fb-vars'. + + * org.el (org-fill-paragraph): Make a command. Fix bug about + filling message headers and citations. + + * org.el (org-redisplay-inline-images): New command. + (org-mode-map): Bind it to C-c C-x C-M-v. + + * org-colview.el (org-columns-get-format-and-top-level): Fix bug. + (org-columns-get-format): Fix compiler warning. + + * org-feed.el: Add declarations. + + * org-agenda.el (org-agenda-get-sexps): Use `org-get-tags-at' to + allow tag inheritance. + + * org-capture.el (org-capture): Fix bug introduced by commit + 1737d3. + + * org-publish.el (org-publish-needed-p) + (org-publish-update-timestamp, org-publish-file) + (org-publish-cache-file-needs-publishing): New argument + `base-dir'. + (org-publish-cache-ctime-of-src): Use the new argument to make + sure we find the file according to :base-directory. + + * org-capture.el (org-capture-string): New command to prompt for + the interactive text interactively. This can also be used in + Elisp programs to use ̀org-capture' with some initial text. + (org-capture-initial): New variable to store the initial text. + (org-capture): Use `org-capture-initial'. + + * org.el (org-emph-re): Tiny docstring formatting fix. + + * org-compat.el (org-labels): Remove. + + * org-bibtex.el (org-bibtex-headline): Don't use `org-labels'. + + * ob.el (org-babel-sha1-hash, org-babel-noweb-p): Ditto. + + * org.el (org-emph-re): Tiny formatting fix. + + * org.el (orgstruct-setup): Require `org-element'. + + * org.el (org-store-link, org-open-at-point): New link type + "help". + + * org-compat.el (org-flet): Remove alias. + + * ob.el (org-babel-edit-distance, org-babel-sha1-hash) + (org-babel-get-rownames, org-babel-insert-result) + (org-babel-merge-params) + (org-babel-expand-noweb-references): Don't use `org-flet'. Also + indent some functions correctly. + + * ob.el (org-babel-execute-src-block) + (org-babel-join-splits-near-ch, org-babel-format-result) + (org-babel-examplize-region): Don't use `org-flet'. + (org-babel-tramp-handle-call-process-region): Fix typo. + + * ob-awk.el (org-babel-awk-var-to-awk): Don't use `org-flet'. + + * ob-sh.el (org-babel-sh-var-to-string): Ditto. + + * ob-tangle.el (org-babel-tangle, org-babel-spec-to-string): Don't + use `org-flet'. + + * org-pcomplete.el (org-compat): Require. + + * ob-tangle.el (org-babel-load-file): Don't use `org-flet'. + + * org-bibtex.el (org-bibtex-write): Use let*. + + * org-plot.el (org-plot/gnuplot-script): Don't use `org-flet'. + + * org-bibtex.el (org-bibtex-headline, org-bibtex-fleshout) + (org-bibtex-read, org-bibtex-write): Don't use `org-flet'. + + * org-clock.el (org-clock-cancel): Use `org-looking-back'. + + * org-pcomplete.el (org-thing-at-point): Ditto. + + * org.el (org-timestamp-change): Ditto. + + * org-mouse.el (org-mouse-timestamp-today) + (org-mouse-set-priority, org-mouse-popup-global-menu) + (org-mouse-context-menu): Don't use ̀org-flet'. + + * org.el (org-priority): Fix docstring. + + * org-publish.el (org-publish-write-cache-file) + (org-publish-initialize-cache) + (org-publish-cache-file-needs-publishing) + (org-publish-cache-get): Small code clean-up. + + * org-publish.el (org-publish-cache-ctime-of-src): Simplify. + + * org-agenda.el (org-agenda-get-sexps): Add a 'tags property for + agenda entries created from sexps. + + * org-capture.el (org-capture-templates): Docstring clean up. + (org-capture-place-entry, org-capture-place-item) + (org-capture-place-plain-text, org-capture-place-table-line): + Ensure to always position the point according to %?. + + * org-table.el (org-table-convert-refs-to-rc): Fix bug when + converting remote table references. + + * org-agenda.el (org-agenda-switch-to): Run hooks in + ̀org-agenda-after-show-hook'. + + * ob-ref.el (org-babel-ref-index-list): Use let* and rename the + variable `length' to `lgth'. + + * org-plot.el (org-plot/gnuplot-to-grid-data): Don't use + ̀org-flet'. + + * org-exp.el (org-export-format-source-code-or-example): Ditto. + + * org-exp-blocks.el (org-export-blocks-preprocess): Ditto. + + * ob.el (org-babel-view-src-block-info) + (org-babel-execute-src-block, org-babel-edit-distance) + (org-babel-switch-to-session-with-code) + (org-babel-balanced-split, org-babel-insert-result): Ditto. + + * ob-ref.el (org-babel-ref-index-list): Ditto. + + * ob-python.el (org-babel-python-evaluate-session): Ditto. + + * ob-lob.el (org-babel-lob-get-info): Ditto. + + * ob-gnuplot.el (org-babel-expand-body:gnuplot): Ditto. + + * ob-exp.el (org-babel-exp-do-export): Ditto. + + * org-table.el (orgtbl-to-generic): Fix docstring. + + * org-clock.el (org-clock-in): Call `org-clock-out' with the new + argument `switch-to-state' set to nil. Fix docstring. + (org-clock-in-last): Prompt for a todo state to switch to when + called with three universal prefix arguments. Don't display a + message when the clock is already running. Update docstring. + (org-clock-out): New argument `switch-to-state'. When this + argument is non-nil, prompt for a state to switch the clocked out + task to, overriding `org-clock-out-switch-to-state'. + + * org.el (org-entry-get): Don't use `org-flet'. + + * org.el (org-forward-heading-same-level): Rename from + `org-forward-same-level'. + (org-backward-heading-same-level): Rename from + `org-backward-same-level'. + + * org.el (org-forward-element): Rename from `org-element-forward'. + (org-backward-element): Rename from `org-element-backward'. + (org-up-element): Rename from `org-element-up'. + (org-down-element): Rename from `org-element-down'. + (org-drag-element-backward): Rename from + `org-element-drag-backward'. + (org-drag-element-forward): Rename from + `org-element-drag-forward'. + (org-mark-element): Rename from `org-element-mark-element'. + (org-transpose-element): Rename from `org-element-transpose'. + (org-unindent-buffer): Rename from `org-element-unindent-buffer'. + (org-mode-map): Update the names of a commands. Remove useless + declarations. + + * org-element.el (org-element-forward, org-element-backward) + (org-element-up, org-element-down) + (org-element-drag-backward, org-element-drag-forward) + (org-element-mark-element, org-narrow-to-element) + (org-element-transpose, org-element-unindent-buffer): Move to + org.el. + + * org.el (org-forward-same-level): Fix typo in docstring. + + * org-agenda.el (org-agenda-mode-map): Bind + `org-agenda-show-priority' to `C-c,' instead of `P'. + (org-agenda-next-item, org-agenda-previous-item): New commands to + move by one item down/up in the agenda. + (org-agenda-mode-map): Bind `org-agenda-next-item' and + `org-agenda-previous-item' to `N' and `P' respectively. + + * org-rmail.el (org-rmail-store-link, org-rmail-follow-link): + Toggle headers when necessary. + + * org-element.el (org-narrow-to-element): Autoload. + + * org.el (org-mode-map): Use `M-h' for `org-element-mark-element'. + (org-mark-subtree): Allow a numeric prefix argument to move up + into the hierarchy of headlines. + + * org-element.el (org-element-up, org-element-down): Autoload. + + * org.el: Declare functions and don't require org-element. + + * org-element.el (org-element-at-point, org-element-forward) + (org-element-backward, org-element-drag-backward) + (org-element-drag-forward, org-element-mark-element) + (org-element-transpose, org-element-unindent-buffer): Autoload. + Require 'org and remove all declarations. + + * org.el (org-outline-regexp-bol, org-heading-regexp): Use + variables instead of constants. + + * org-archive.el (org-datetree-find-date-create): Declare. + + * org.el (org-open-at-point): Only set + `clean-buffer-list-kill-buffer-names' when the feature 'midnight + has been loaded. + + * org-icalendar.el (org-print-icalendar-entries): Let + APPT_WARNTIME take precedence over ̀org-icalendar-alarm-time'. + + * org.el (org-special-properties): New special property + CLOCKSUM_T. + (org-entry-properties): Handle the new special property. + + * org-colview.el (org-columns): Handle a new special property + CLOCKSUM_T. + (org-agenda-colview-summarize, org-agenda-colview-compute): Ditto. + + * org-clock.el (org-clock-sum-today): New function. + (org-clock-sum): New argument PROPNAME to set a custom text + property instead of :org-clock-minutes. + + * org-agenda.el (org-agenda-check-type): Throw a more appropriate + error message when no agenda is currently being displayed. + + * org.el (org-get-property-block): Find blocks before the first + headline. + (org-entry-properties): Minor code cleanup. + (org-entry-get, org-entry-get-with-inheritance): Get property + before the first headline. + + * org-mobile.el (org-mobile-create-index-file): Use `files-alist'. + + * org.el (org-make-link): Delete. + (org-store-link, org-insert-link) + (org-file-complete-link): Don't use `org-make-link'. + + * org-wl.el (org-wl-store-link-folder) + (org-wl-store-link-message): Ditto. + + * org-vm.el (org-vm-store-link): Ditto. + + * org-rmail.el (org-rmail-store-link): Ditto. + + * org-mhe.el (org-mhe-store-link): Ditto. + + * org-mew.el (org-mew-store-link): Ditto. + + * org-irc.el (org-irc-erc-store-link): Ditto. + + * org-info.el (org-info-store-link): Ditto. + + * org-id.el (org-id-store-link): Ditto. + + * org-gnus.el (org-gnus-group-link, org-gnus-article-link): Ditto. + + * org-eshell.el (org-eshell-store-link): Ditto. + + * org-bbdb.el (org-bbdb-store-link): Ditto. + + * org.el (org-url-hexify-p): New option. When non-nil (the + default), hexify URLs when creating a link. + + * org.el (org-insert-link): Make sure point is at the beginning of + the buffer. + + * org.el (clean-buffer-list-kill-buffer-names): Declare. + (org-open-at-point): Allow opening multiple shell links by + creating a new output buffer for each shell process. The new + buffer is added to `clean-buffer-list-kill-buffer-names'. + + * org-mobile.el (org-mobile-create-index-file): Use + `org-global-tags-completion-table' instead of + `org-tag-alist-for-agenda' to get the tags for the index file. + + * org.el (org-global-tags-completion-table): Fix typo in + docstring. + + * org.el (org-link-to-org-use-id): Use `org-capture' instead of + `org-remember' in the docstring. + (org-link-fontify-links-to-this-file): New function to fontify + links to the current buffer in `org-stored-links'. + (org-store-link): Small code simplification. + (org-link-prettify): Enclose literal links into <...> instead of + [[...]]. + (org-insert-link): Use `org-link-fontify-links-to-this-file'. + Also allow completion over links' descriptions, as well as links + destinations. When the user uses the description for completion, + don't prompt again for a description. + + * org-capture.el (org-capture-templates): Fix docstring by adding + Gnus to the list of mail clients. + + * org.el (org-log-repeat): Enhance docstring. + + * org.el (org-mode-map): Don't bind C- and C- to + `org-element-backward/forward' as these functions stops when there + is no element of the same type before/after point. It is useful + to navigate with `forward/backward-paragraph' with no stop in most + cases. + + * org-capture.el (org-capture-templates): New template %l to + insert the literal link pointing at the current buffer. + + * org.el (org-todo-keywords): Ditto. + + * org.el (org-fill-paragraph): Falls back on + `message-fill-paragraph' if required in `message-mode'. + + * org-pcomplete.el (pcomplete/org-mode/file-option/x): New macro. + (pcomplete/org-mode/file-option/options) + (pcomplete/org-mode/file-option/title) + (pcomplete/org-mode/file-option/author) + (pcomplete/org-mode/file-option/email) + (pcomplete/org-mode/file-option/date): Use the new macro to offer + completion over default values for #+OPTIONS, #+TITLE, #+AUTHOR, + #+EMAIL and #+DATE. + + * org-agenda.el (org-agenda-write): Fix bug when writing agenda to + an external file while `org-agenda-sticky' is non-nil. + + * org.el (org-speed-commands-default): New speedy command to + quickly add the :APPT_WARNTIME: property. + + * org-agenda.el (org-agenda-to-appt): Use the :APPT_WARNTIME: + property to override `appt-message-warning-time' when adding an + appointment from an entry. + + * org.el (org-version): Improve docstring. + (org-self-insert-cluster-for-undo): The default value should be + nil for Emacs >=24.1. See bug#11774. + + * org.el (org-fontify-meta-lines-and-blocks-1): Fix previous + commit. + + * org.el (org-options-keywords): New constant. + (org-additional-option-like-keywords): Remove duplicates with + keywords in the new constant. + (org-additional-option-like-keywords-for-flyspell): Use the new + constant. + (org-mode-flyspell-verify): Exclude keywords from the new + constant. + + * org-pcomplete.el (pcomplete/org-mode/file-option): Use + `org-options-keywords'. + + * org.el (org-toggle-heading): Bugfix: use + `org-element-mark-element' instead of `org-mark-list'. + + * org-list.el (org-mark-list): Delete. + + * org.el: Update a few keybindings. + + * org-element.el (org-element-down): Throw an error when the + element has no content. + + * org-table.el (orgtbl-radio-table-templates): Add a template for + org-mode. + (orgtbl-to-orgtbl): Complete and align the table created with + orgtbl-to-orgtbl, in case the user use the function for radio + tables. + (orgtbl-to-table.el): New function to export a table to another + one using the table.el format. + (orgtbl-to-unicode): New function to export a table using unicode + characters. + + * org-exp.el (org-export-language-setup): Use "Sommaire" for the + french translation of "Table of contents", to avoid a possible bug + when exporting to ODT. + + * org.el (org-additional-option-like-keywords): Add keywords. + (org-additional-option-like-keywords-for-flyspell): New constant + to use with flyspell. + (org-mode-flyspell-verify): Use the dedicated constant and don't + check `org-startup-options'. + + * org-agenda.el (org-batch-store-agenda-views): Use the sticky + agenda buffer name, if required. + (org-agenda-write): New parameter `agenda-bufname' to allow + setting the agenda buffer name. + + * org.el (org-mode-map): Add keybindings for + `org-element-forward', `org-element-backward', `org-element-up' + and `org-element-down'. + + * org.el (org-auto-fill-function): Don't call `do-auto-fill' + within (org-let org-fb-vars ...) as `do-auto-fill' should do the + right thing whether orgstruct++-mode is turned on or off. + + * org.el (org-sparse-tree-default-date-type): New option. + (org-ts-type): New variable. + (org-sparse-tree): New argument `type'. Use the new option + `org-sparse-tree-default-date-type' as the default value for + `type'. Fix docstring. + (org-re-timestamp): New function. + (org-check-before-date, org-check-after-date) + (org-check-dates-range): Use `org-ts-type' and `org-re-timestamp' + to tell compute the date regexp. + + * org.el (orgstruct++-mode, org-get-local-variables): Also set + `normal-auto-fill-function' when turning on/off orgstruct++-mode. + + * org-agenda.el (org-agenda-start-with-log-mode): Add relevant + customization types. + + * org-faces.el (org-document-title): Use the normal height. + + * org-clock.el (org-x11idle-exists-p): New variable. + (org-user-idle-seconds): Use it. + + * org.el (org-mode-map): Rebind `org-insert-all-links' to `C-c + C-M-l'. + + * org.el (org-insert-all-links): New command. + (org-insert-link): `org-keep-stored-link-after-insertion' is now + checked when the link to insert has been defined, regardless on + how it has been defined. Also don't read the description + interactively when the `default-description' parameter was given. + (org-mode-map): Bind `org-insert-all-links' to `C-c C-L'. + + * org.el (org-inc-effort): New command to increment the effort + property. + (org-set-effort): Use it. + (org-mode-map): Bind it to `C-c C-x E'. + (org-speed-commands-default): Use `E' as a speed command for it. + + * org.el (org-re-property-keyword): New function. + (org-entry-put): Use it to fix a bug with respect to setting the + value of a property when a property line with no value already + exists. + + * org.el (org-timestamp-change): Adjust clock in other org files + correctly. + + * org-clock.el (org-user-idle-seconds): Simplify. + + * org.el (org-mode-map): Bind `org-resolve-clocks' to `C-c C-x + C-z'. + + * org.el (org-mode-map): Add keybindings to + `org-element-transpose' and `org-narrow-to-element'. + (org-metaup): Fall back on `org-element-drag-backward'. + (org-metadown): Fall back on `org-element-drag-forward'. Also + move chunks of declarations and require statements to get rid of + compiler warnings. + + * org-exp-blocks.el (org): Don't require org. Add declarations. + + * org-clock.el (org): Don't require org. + + * ob-exp.el (org-list-forbidden-blocks): Add declarations. + + * org.el (org-timestamp-change): Don't use the `position'. + + * org.el (org-clock-history, org-clock-adjust-closest): New + variables. + (org-timestamp-change): Maybe adjust the next or previous clock in + `org-clock-history'. + (org-shiftmetaup, org-shiftmetadown): On clock logs, update the + timestamp at point and adjust the next or previous clock in + `org-clock-history', when possible. + + * org-clock.el (org-clock-in): Set the marker for + `org-clock-history' at a safer position. + + * org-timer.el (org-timer-pause-or-continue, org-timer-stop): + Autoload. + + * org-mobile.el (org-mobile-post-pull-hook): Fix docstring. + + * org.el (org-indent-line): Fix indentation of a property line + starting at the beginning of a line. + + * org-odt.el (org-odt-cleanup-xml-buffers): Use the new alias. + + * org-compat.el: Alias `org-condition-case-unless-debug' to + `condition-case-unless-debug' or `condition-case-no-debug'. + + * org.el (org-todo-keywords): Ditto. + + * org.el (org-use-fast-todo-selection): Reformat docstring. + + * org.el (org-flag-drawer): Add a docstring. + (org-mode-map): Bind ̀org-clock-cancel' to "C-cC-xC-q" and + `org-clock-in-last' to "C-cC-xC-x". This fixes a bug in the + previous keybinding for `org-clock-in-last', which would override + the one for `org-clock-in'. + + * org-clock.el (org-clock-in-last): Prevent errors when there is + no clocking history. + (org-clock-cancel): Fix bug when checking against a clock log in a + folded drawer. + + * org.el (org-link-expand-abbrev): Implement "%(my-function)" as a + new specifier. Update the docstring. + + * org.el (org-startup-options): Fix docstring formatting. + + * org.el (org-use-sub-superscripts): Fix typo in docstring. + + * org.el (org-refile): Fix bug: prevent looping when calling + `org-set-tags' internally. + + * org.el (org-mode-map): Add `C-c C-x C-I' as a keybinding for + `org-clock-in-last'. + + * org-clock.el (org-clock-continuously): New option. + (org-clock-in): Three universal prefix arguments set + `org-clock-continuously' to `t' temporarily. + (org-clock-in-last): Fix call to `org-clock-select-task' and + support continuous clocking. + (org-clock-out-time): New variable. + (org-clock-out): Set `org-clock-out-time' when clocking out. + Small docstring rewriting. + (org-clock-remove-empty-clock-drawer): Fix "invalid search bound" + bug when trying to delete empty logbook drawer. + (org-clock-cancel): If the clock log is gone, send a warning + instead of deleting the region that is supposed to contain it. + + * org.el (org-move-line-down, org-move-line-up): Remove. + (org-metaup, org-metadown): When the region is active, move it + up/down by one line, with no regard to the context. + + * org-odt.el (org-odt-cleanup-xml-buffers): Use the new alias. + + * org-compat.el: Alias `org-condition-case-unless-debug' to + `condition-case-unless-debug' or `condition-case-no-debug'. + + * org-pcomplete.el (org-thing-at-point): Ignore trailing + whitespaces while looking-back at properties. + + * org.el (org-mode): Set `indent-region-function'. + (org-indent-region): New function. + (org-fill-paragraph): When in a src block, use `indent-region' to + indent the whole source code instead of falling back on + `fill-paragraph', as this function messes up the code. + + * org-src.el (org-edit-src-code): Fix docstring formatting. + + * ob.el (org-babel-do-key-sequence-in-edit-buffer): Ditto. + + * org.el (org-mode, org-add-log-setup) + (org-get-property-block, org-entry-put) + (org-property-next-allowed-value, org-return) + (org-indent-line): Rename `org-indent-line-function' to + `org-indent-line'. + + * org-timer.el (org-timer-item): Ditto. + + * org-table.el (org-table-store-formulas): Ditto. + + * org-clock.el (org-clock-in, org-clock-find-position): Ditto. + + * org-src.el (org-src-font-lock-fontify-block) + (org-src-strip-leading-and-trailing-blank-lines) + (org-src-ask-before-returning-to-edit-buffer) + (org-edit-src-code, org-edit-src-continue) + (org-edit-fixed-width-region) + (org-src-do-key-sequence-at-code-block) + (org-src-font-lock-fontify-block, org-src-fontify-buffer): Fix + typos in docstrings. + + * org-docbook.el (org-export-docbook-emphasis-alist): Fix typo: + use "format string" instead of "formatting string". + + * org-latex.el (org-export-latex-emphasis-alist) + (org-export-latex-title-command, org-export-latex-tables): Ditto. + + * org-html.el (org-export-html-postamble): Ditto. + + * org-latex.el (org-export-latex-hyperref-options-format): New + option. + (org-export-latex-make-header): Use it. + + * ob.el (org-babel-confirm-evaluate): Prevent errors when + `org-current-export-file' is void. + + * org-table.el (org-table-export): Use the file name extension to + suggest the right conversion format. Also amend the docstring. + + * org.el (org-speed-commands-default): Two new speed commands. + Use `:' for `org-columns' and ̀#' for `org-toggle-comment'. + + * org.el (org-time-stamp): With two universal arguments, insert an + active timestamp with the current time without prompting the user. + + * org-clock.el (org-clock-in-last): New command. + + * org-clock.el (org-clock-in): Fix typo in docstring. + + * org-mobile.el (org-mobile-edit): Fix reference to a free + variable. + + * org.el (org-doi-server-url): Update :group. + + * ob-lob.el (org-babel-lob-execute): Fix reference to non-existent + variable. + + * org.el (org-doi-server-url): New option. + (org-open-at-point): Use it. + + * org.el (org-at-comment-p): New function. + (org-toggle-heading): Use `org-at-comment-p' to skip comments. + + * org-html.el (org-export-as-html): Add links to the Org mode and + GNU Emacs websites When :html-postamble is set to 't. + + * org-export.el (org-export-creator-string): Add links to the Org + mode and GNU Emacs websites. + + * org-special-blocks.el + (org-special-blocks-convert-html-special-cookies): Prevent errors + by first checking `org-line' is not nil. + + * org-clock.el (org-clock-string-limit) + (org-clock-modeline-total, org-clock-task-overrun-text) + (org-clock-mode-line-entry): Doc fix, "modeline" -> "mode line". + + * org.el (org-at-timestamp-p): Set ̀org-ts-what' to 'after when the + point is right after the timestamp. `org-at-timestamp-p' still + returns `t' in this case, as this is more practical. + (org-return): Check against ̀org-ts-what' to verify that point is + really within the timestamp (if any). + + * org.el (org-return): Follow time-stamp links when point is an a + time-stamp. + + * org-capture.el (org-capture-bookmark): New option. + (org-capture-finalize): Use it. + + * org-publish.el (org-publish-cache-file-needs-publishing): Make + the column mandatory after #+include:. + + * org-exp.el (org-export-handle-include-files): Ditto. + + * org-bibtex.el (org-bibtex-entries): Rename from + (org-bibtex-read, org-bibtex-write): Use the new name. + + * org-exp.el (org-export-handle-include-files): Allow to use + #+include with no column. + + * org-publish.el (org-publish-cache-file-needs-publishing): Make + quotes mandatory around the file name and allow spaces in it. + + * org-html.el (org-export-as-html): Add link to Org's and Emacs's + websites. + + * org-latex.el + (org-export-latex-link-with-unknown-path-format): New option. + (org-export-latex-links): Use it. + + * org-agenda.el (org-agenda-get-timestamps): Remove any active + timestamp from the headline text, not only those for the current + date. + + * org.el (org-set-tags): Allow setting tags for headlines in the + region when `org-loop-over-headlines-in-active-region' is non-nil. + + * org.el (org-allow-promoting-top-level-subtree): New option to + allow promoting a top-level subtree. + (org-called-with-limited-levels): New variable, dynamically bound + within the `org-with-limited-levels' macro. + (org-promote): Use the new option to allow promoting a top-level + subtree. + + * org-macs.el (org-with-limited-levels): Let-bind + `org-called-interactively-p' to t. + + * org.el (org-create-formula-image-with-dvipng) + (org-create-formula-image-with-imagemagick): Make sure a file + exists before trying to delete it. + + * org.el (org-scan-tags): Correctly match TODO keywords. + + * org-agenda.el (org-agenda-bulk-action): Fix bug: use + `org-agenda-bulk-unmark-all'. + + * org.el (orgstruct++-mode): Fix docstring. + (org-fill-paragraph): Use the 'justify parameter when falling back + on `fill-paragraph'. + + * org.el (org-indent-line-function): Use `org-let' instead of + `orgstruct++-ignore-org-filling'. + (org-fill-paragraph, org-auto-fill-function): Ditto. + + * org-macs.el (orgstruct++-ignore-org-filling): Delete. + + * org-table.el (org-table-time-string-to-seconds): Return the + empty string if provided. + (org-table-eval-formula): When assigning a duration string, handle + it correctly -- i.e. don't make any computation on it, except the + one to insert it using the correct duration format. + + * org.el (org-indent-line-function): Fix bug. + + * org-clock.el (org-frame-title-format-backup): New variable to + store the value of `frame-title-format' before `org-clock' might + replace it by `org-clock-frame-title-format'. + (org-clock-frame-title-format): New option. + (org-frame-title-string): Delete. + (org-clock-update-mode-line): Minor code reformatting. + (org-clock-in, org-clock-out, org-clock-cancel): Use + `org-clock-frame-title-format'. + + * org-clock.el (org-clock-get-clock-string): Add a space. + + * org-list.el (org-mark-list): Return an error when there is no + list at point. + + * org.el (org-toggle-heading): Allow `C-u C-c *' to mark the list + at point before converting items to headings. With a simple + universal-argument, set `current-prefix-arg' to 1, otherwise keep + the numeric value. + + * org-agenda.el (org-agenda-view-mode-dispatch): Make the message + more readable. + + * org-agenda.el (org-agenda-mode-map): New keybinding ̀*' to mark + all entries for bulk action. + (org-agenda-menu): New menu item for marking all entries. + (org-agenda-bulk-mark-all): New function to mark all entries. + (org-agenda-bulk-mark-regexp): Minor docstring fix. + (org-agenda-bulk-unmark): With a prefix argument, unmark all. + Also send a better message. + (org-agenda-bulk-remove-all-marks): Rename to + `org-agenda-bulk-unmark-all'. Check against + `org-agenda-bulk-marked-entries' before trying to unmark entries. + Minor docstring fix. + (org-agenda-bulk-unmark-all): Renamed from + ̀org-agenda-bulk-remove-all-marks'. + + * org-agenda.el (org-agenda-bulk-mark-char): New option. + (org-agenda-bulk-mark): Use the new option. + + * org.el (org-src-prevent-auto-filling): New option to prevent + auto-filling in src blocks. This defaults to nil to avoid people + being surprised that no auto-fill occurs in Org buffers where they + use `auto-fill-mode'. + (org-auto-fill-function): Use the new option. + + * org.el (org-properties-postprocess-alist): Better customization + type. + (org-set-property): Fix the check against + `org-properties-postprocess-alist'. + + * org-macs.el (orgstruct++-ignore-org-filling): Set + `def-edebug-spec' correctly. + + * org-colview.el (org-columns-string-to-number): When computing + the values for the colview, match durations and convert them to + HH:MM values. + + * org.el (org-duration-string-to-minutes): Match non-round + numbers. Add a new optional parameter to allow returning the + output as a string. + + * org.el (org-auto-fill-fallback-function) + (org-indent-line-fallback-function) + (org-fill-paragraph-fallback-function) + (org-auto-fill-fallback-function) + (org-indent-line-fallback-function) + (org-fill-paragraph-fallback-function): Remove. + (org-fb-vars): New buffer-local variable. + (orgstruct++-mode): Use the fallback variable `org-fb-vars' to + store, use and restore variables if needed. + (org-fill-paragraph): Ignore `orgstruct++-mode' filling variables + when needed. + (org-auto-fill-function, org-indent-line-function): Ditto. + + * org-macs.el (orgstruct++-ignore-org-filling): New macro. + + * org-exp-block.el: Use `org-find-library-name' instead of + `find-library-name'. + + * org-compat.el (org-find-library-name): Convert into a macro to + avoid compilation of a function from XEmacs in Emacs and vice + versa. + + * org-table.el (org-table-store-formulas): Fix typo. + (org-table-maybe-eval-formula): Fix the regexp to only match + formulas, which never end with the `=' character. If the field + only contain this character, don't eval either. + + * org.el (org-set-property): Perform the correct check against + `org-properties-postprocess-alist'. + + * org-bbdb.el (org-bbdb-anniversary-format-alist): Update the + customization type. + (name): Suppress (defvar 'name) as name is not eval'ed when + setting `org-bbdb-anniversary-format-alist'. + + * org.el (org-version): When called non-interactively, insert the + short version string, otherwise send a message with the complete + version string. + + * org-odt.el (org-odt-update-meta-file): Use (org-version) and + delegate checking whether `org-version' is known as a variable + there. + + * org-html.el (org-export-as-html): Use (org-version). + + * org-docbook.el (org-export-as-docbook): Ditto. + + * org-latex.el (org-export-latex-make-header): Ditto. + + * org-clock.el (org-clocktable-write-default): Temporarily disable + `delete-active-region' so that we don't accidently delete an + active region when exporting a subtree/region. + + * org-clock.el (org-program-exists): Remove. + (org-show-notification, org-clock-play-sound): Use + `executable-find' instead of `org-program-exists'. + + * org-agenda.el (org-diary): Prevent failure from + `org-compile-prefix-format' when there is no agenda buffer. + + * org-agenda.el (org-agenda-mode): Replace obsolete variable + `buffer-substring-filters'. + + * org-indent.el (org-indent-mode): Ditto. + + * org-compat.el (org-find-library-name): Silent the byte-compiler + about a warning related to XEmacs support. + + * org-special-blocks.el + (org-special-blocks-convert-html-special-cookies): Use `org-line' + instead of `line'. + + * org-html.el (org-html-handle-links, org-export-as-html) + (org-format-org-table-html, org-format-table-table-html) + (org-html-export-list-line): Use `org-line' instead of `line' as + the free variable name. + + * org-latex.el (org-export-latex-tables): Let-bind `hfmt'. + + * org-faces.el (org-list-dt): New face. + + * org.el (org-set-font-lock-defaults): Use `org-list-dt' as the + face for definition terms in definition lists. + + * org.el (org-fill-paragraph): Pass the `justify' argument to + `org-fill-paragraph-fallback-function'. + + * org.el (org-eval-in-calendar): Fix docstring to mention the + KEEPDATE parameter. + + * org.el (org-refresh-category-properties): Let-bind + `inhibit-read-only' to t. + + * org.el (org-auto-fill-fallback-function) + (org-indent-line-fallback-function) + (org-fill-paragraph-fallback-function): New variables to store + some fall-back functions when turning `orgstruct++-mode' on. + (orgstruct++-mode): Set the new variables. + (org-indent-line-function, org-fill-paragraph) + (org-auto-fill-function): Use them. + + * org.el (org-read-date): Bugfix: call `org-eval-in-calendar' with + the 'keepdate parameter set to t when setting the cursor type. + + * org-agenda.el (org-agenda-persistent-marks): New option to keep + marks after a bulk action. The option defaults to nil. + (org-agenda-bulk-action): Use the new option. + + * org-capture.el (org-capture-fill-template): Use %\n instead of + %n as a template element to be replaced with the nth prompted + string. + (org-capture-templates): Update docstring. + + * org.el (org-goto): Fix docstring and document what C-u does. + + * org-publish.el (org-publish-cache-file-needs-publishing): Use + (case-fold-search t) when looking for #+INCLUDE:. + + * org.el: Use (case-fold-search t). + (org-edit-special, org-ctrl-c-ctrl-c): Ditto. + + * org-table.el: + (org-table-store-formulas, org-table-get-stored-formulas) + (org-table-fix-formulas, org-table-edit-formulas) + (org-old-auto-fill-inhibit-regexp, orgtbl-ctrl-c-ctrl-c) + (orgtbl-toggle-comment, org-table-get-remote-range): Ditto. + + * org-footnote.el: + (org-footnote-goto-local-insertion-point): Ditto. + + * org-exp.el: Ditto. + + * org-colview.el: + (org-dblock-write:columnview, org-dblock-write:columnview): Ditto. + + * org-clock.el (org-clocktable-write-default): Ditto. + + * org-capture.el (org-capture-place-table-line): Ditto. + + * ob.el (org-babel-data-names, org-babel-goto-named-src-block) + (org-babel-src-block-names) + (org-babel-where-is-src-block-result, org-babel-result-end) + (org-babel-where-is-src-block-head) + (org-babel-find-named-result, org-babel-result-names): Ditto. + + * org-table.el (orgtbl-send-table): Escape special characters. + Introduce a new parameter :no-escape to prevent escaping. + + * org-agenda.el (org-toggle-sticky-agenda): Only shout a message + when called interactively. + (org-agenda-get-restriction-and-command): Call + `org-toggle-sticky-agenda' interactively. + + * org-agenda.el (org-agenda-top-category-filter): New variable for + storing the current top-category filter. + (org-agenda-redo): Apply a top-category filter, if any. + (org-agenda-filter-by-top-category) + (org-agenda-filter-top-category-apply): Set + `org-agenda-top-category-filter' to the right value. + + * org-clock.el (org-clock-out, org-clock-cancel) + (org-clock-in): Don't modify `frame-title-format' if it is a + string. + + * org-latex.el (org-export-latex-special-chars): Fix bug when + escaping special characters in a table. + + * org.el (org-read-date): Set cursor-type to nil in the calendar. + + * org-faces.el (org-date-selected): Use inverse video. Don't + explicitely set bold to nil as it causes `customize-face' to show + the weight property and thus encourage the user to change it. + Warn in the docstring that using bold might cause problems when + displaying the calendar. + + * org-id.el (org-id-update-id-locations): New parameter to silent + `org-id-find'. + (org-id-find): Use the new parameter. + + * org.el (org-show-hierarchy-above, org-cycle) + (org-global-cycle, org-files-list, org-store-link) + (org-link-search, org-open-file, org-display-outline-path) + (org-refile-get-location, org-update-all-dblocks) + (org-change-tag-in-region, org-entry-properties) + (org-save-all-org-buffers, org-revert-all-org-buffers) + (org-buffer-list, org-cdlatex-mode) + (org-install-agenda-files-menu, org-end-of-subtree) + (org-speedbar-set-agenda-restriction): Use (derived-mode-p + 'org-mode) instead of (eq major-mode 'org-mode). + + * org-timer.el (org-timer-set-timer): Ditto. + + * org-table.el (orgtbl-mode, org-table-align, orgtbl-mode): Ditto. + + * org-src.el (org-edit-src-exit, org-edit-src-code) + (org-edit-fixed-width-region, org-edit-src-exit): Ditto. + + * org-remember.el (org-remember-handler): Ditto. + + * org-mouse.el (dnd-open-file, org-mouse-insert-item): Ditto. + + * org-macs.el (org-get-limited-outline-regexp): Ditto. + + * org-lparse.el (org-replace-region-by): Ditto. + + * org-latex.el (org-latex-to-pdf-process) + (org-replace-region-by-latex): Ditto. + + * org-indent.el (org-indent-indent-buffer): Ditto. + + * org-id.el (org-id-store-link, org-id-update-id-locations) + (org-id-store-link): Ditto. + + * org-html.el (org-export-html-preprocess) + (org-replace-region-by-html): Ditto. + + * org-footnote.el (org-footnote-normalize) + (org-footnote-goto-definition) + (org-footnote-create-definition, org-footnote-normalize): Ditto. + + * org-docbook.el (org-replace-region-by-docbook): Ditto. + + * org-ctags.el (find-tag): Ditto. + + * org-colview.el (org-columns-redo) + (org-columns-display-here, org-columns-edit-value) + (org-columns-redo): Ditto. + + * org-capture.el (org-capture-insert-template-here) + (org-capture, org-capture-finalize) + (org-capture-set-target-location) + (org-capture-insert-template-here): Ditto. + + * org-ascii.el (org-replace-region-by-ascii): Ditto. + + * org-archive.el (org-archive-subtree): Ditto. + + * org-agenda.el (org-agenda) + (org-agenda-get-restriction-and-command) + (org-agenda-get-some-entry-text, org-search-view) + (org-tags-view, org-agenda-get-day-entries) + (org-agenda-format-item, org-agenda-goto, org-agenda-kill) + (org-agenda-archive-with, org-agenda-switch-to): Ditto. + + * org.el (org-repeat-re) + (org-clone-subtree-with-time-shift, org-auto-repeat-maybe) + (org-deadline, org-schedule, org-matcher-time) + (org-time-stamp, org-read-date, org-read-date-get-relative) + (org-display-custom-time, org-get-wdays) + (org-time-string-to-absolute, org-closest-date) + (org-timestamp-change): Allow to set hourly repeat cookie. Send + an error when an hourly repeat cookie is set and no hour is + specified in the timestamp. + + * org-icalendar.el (org-print-icalendar-entries): Handle hourly + repeat cookies. + + * org-clock.el (org-program-exists): Fix docstring. + + * org-clock.el (org-clock-file-time-cell-format): New option. + (org-clocktable-write-default): Use it. + + * org-faces.el (org-date-selected): New face. + + * org.el (org-date-ovl): Use `org-date-selected'. + + * org.el (org-mode): Don't use `buffer-face-mode' by default. + + * org-agenda.el (org-agenda-mode-map): Bind `^' to + `org-agenda-filter-by-top-category'. + + * org-ascii.el (org-export-ascii-underline): Change the default + underlining characters for headlines of level 1 and 2. Also + introduce \. as the underline character for headlines of level 5. + + * org-table.el (org-table-recalculate-buffer-tables) + (org-table-iterate-buffer-tables): Add autoload cookie. + + * org.el (org-table-map-tables): Exclude tables in src and example + blocks. + + * org.el (org-fill-paragraph): Leave scheduled/deadline lines + untouched when filling an adjacent paragraph. + + * org-html.el (org-export-html-preamble-format) + (org-export-html-postamble-format): Improve the docstring. + + * org.el (org-todo): Fix regression: rename `state' to + `org-state'. + + * org-clock.el (org-show-notification): Use `fboundp' instead of + `featurep' and the additional `require'. + + * org-clock.el (org-clock-in-prepare-hook): New option to format + the total time cells. + (org-clocktable-write-default): Use the new option. + + * org.el (org-open-at-point): Allow to open the agenda from an + active or inactive timestamp in a headline. + + * org-html.el (org-export-html-date-format-string): Make a + defcustom. + + * org-latex.el (org-export-as-latex): Fix TeX-master declaration. + +2012-09-30 Carsten Dominik + + * org-table.el (org-table-expand-lhs-ranges): Allow hline + references to be expanded correctly in LHS of formulas. + + * org-beamer.el (org-beamer-inherited-properties): New option. + (org-beamer-after-initial-vars): Use new option to look for + inherited properties. + + * org.el (org-ts-regexp0): Allow time stamps without name of day. + + * org-agenda.el (org-toggle-sticky-agenda): + (org-agenda-sticky): Improve :set property. + + * org-agenda.el (org-agenda-local-vars): Clean up the variable + list. + (org-agenda-get-restriction-and-command): Add a key for toggling + sticky agenda views. + + * org-agenda.el (org-agenda-local-vars): Final decisions about + global/local + + * org-agenda.el (org-agenda-force-single-file): Variable removed. + (org-prepare-agenda-window): Store pre-agenda window config + locally. + (org-timeline): Introduce a scoped version of + `org-agenda-show-log'. + (org-agenda-list): Introduce a scoped version of + `org-agenda-show-log'. + (org-agenda-get-progress): Use the scoped version of + `org-agenda-show-log'. + (org-agenda-local-vars): Write the analysis result as a comment - + to be cleaned up in the next iteration. + + * org-agenda.el (org-toggle-sticky-agenda): Kill all agenda + buffers when toggling sticky-agendas. + (org-agenda-get-restriction-and-command): Add `C-c a C-k' as a key + to explicitly kill all agenda buffers. + (org-agenda-run-series): Remove any old agenda markers in the + buffer that is going to take the new block agenda. + (org-prepare-agenda): Reset markers before erasing the buffer anc + running `org-agenda-mode', because after that hte local variable + `org-agenda-markers' will have gone away. + (org-agenda-Quit): + (org-finalize-agenda): Install the marker resetter into the + `kill-buffer-hook'. + (org-agenda-save-markers-for-cut-and-paste): Look for markers in + all agenda buffers. + (org-agenda-kill-all-agenda-buffers): New function. + +2012-09-30 Chris Gray + + * org-html.el (org-export-as-html): Remove the check for body-only + in the code for generating tables of contents. + +2012-09-30 Christoph Dittmann (tiny change) + + * org-beamer.el (org-beamer-auto-fragile-frames): Make + [fragile] work with overlay specifications. + +2012-09-30 Christophe Junke (tiny change) + + * org-agenda.el (org-agenda-list): Ensures that the list returned + by `org-agenda-add-time-grid-maybe' is appended to ̀rtnall' before + checking if the latter is emtpy. + +2012-09-30 Christophe Junke (tiny change) + + * org-agenda.el (org-agenda-list): Ensure that the list returned + by `org-agenda-add-time-grid-maybe' is appended to `rtnall' before + checking if the latter is emtpy. + +2012-09-30 Christophe Rhodes (tiny change) + + * org-latex.el (org-export-latex-tables): Support setting the + :hfmt parameter from #+ATTR_LaTeX. + +2012-09-30 Daniel Dehennin (tiny change) + + * org-exp.el (org-export-handle-include-files) + (org-get-file-contents): Handle new parameter :addlevel. + +2012-09-30 Dave Abrahams (tiny change) + + * org.el (org-link-prettify): New function to prettify links while + displaying them with `org-insert-link'. + (org-insert-link): Use the new function. + +2012-09-30 David Maus + + * org-exp.el (org-export-language-setup): Use numeric character + entities for proper rendering of non-UTF8 documents. + + * org-exp.el (org-export-language-setup): Add japanese + translation. + +2012-09-30 Eric Schulte + + * ob-sh.el (org-babel-sh-evaluate): Don't could 0-length shebangs. + + * ob.el (org-babel-insert-result): Replace key sequence with + function call. Use a more informative flag to the local function. + (org-add-protective-commas): Declare a new external function. + + * org-src.el (org-add-protective-commas): This should be its own + function. + (org-edit-src-exit): Use the new function. + + * org-compat.el (org-labels): Remove. + + * org-bibtex.el (org-bibtex-headline): Don't use `org-labels'. + + * ob.el (org-babel-sha1-hash, org-babel-noweb-p): Ditto. + + * ob.el (org-babel-string-read): Don't automatically evaluate code + block results which look like elisp. + (org-babel-import-elisp-from-file): Raise a warning message when + the process of reading code block results raises an error. + + * ob-tangle.el (org-babel-with-temp-filebuffer): Don't execute + macro argument multiple times. + + * org.el (org-compat): Require org-compat before we first use one + of its functions (a macro actually). + + * ob-comint.el (org-babel-comint-with-output): Don't name the + filter function, but rather pass through the anonymous lambda + directly. + + * org.el (org-babel-load-languages): Common lisp should be + mentioned as a supported babel language. + + * org-clock.el (org-clock-special-range): "concat 'string" -> + "concat" + (org-clocktable-shift): "concat 'string" -> "concat" + + * org-bibtex.el (org-bibtex-headline): Replacing org-flet with + org-labels. + + * ob-calc.el (org-babel-execute:calc): Strip single quotes from + calc internal representations. + + * org-clock.el (org-clock-special-range): Replacing cl concatenate + with concat. + (org-clocktable-shift): Replacing cl concatenate with concat. + + * ob.el (org-babel-edit-distance): Remove use of map at runtime. + + * org-compat.el (org-flet): Compatibility function now that flet + has been removed from cl-macs. + (org-labels): Compatibility function now that labels has been + removed from cl-macs. + + * ob-R.el (org-compat): Require org-compat. + + * ob-comint.el: Require org-compat. + + * ob-exp.el (org-babel-exp-do-export): Switch to compatibility + function. + + * ob-gnuplot.el (org-babel-expand-body:gnuplot): Switch to + compatibility function. + + * ob-lob.el (org-babel-lob-get-info): Switch to compatibility + function. + (org-babel-lob-execute): Switch to compatibility function. + + * ob-python.el (org-babel-python-evaluate-session): Switch to + compatibility function. + + * ob-ref.el (org-babel-ref-index-list): Switch to compatibility + function. + + * ob-sh.el (org-babel-sh-var-to-string): Switch to compatibility + function. + + * ob-tangle.el (org-babel-load-file): Switch to compatibility + function. + (org-babel-tangle): Switch to compatibility function. + (org-babel-spec-to-string): Switch to compatibility function. + + * ob.el (org-babel-view-src-block-info): Switch to compatibility + function. + (org-babel-execute-src-block): Switch to compatibility function. + (org-babel-edit-distance): Switch to compatibility function. + (org-babel-switch-to-session-with-code): Switch to compatibility + function. + (org-babel-sha1-hash): Switch to compatibility function. + (org-babel-balanced-split): Switch to compatibility function. + (org-babel-join-splits-near-ch): Switch to compatibility function. + (org-babel-get-rownames): Switch to compatibility function. + (org-babel-format-result): Switch to compatibility function. + (org-babel-insert-result): Switch to compatibility function. + (org-babel-examplize-region): Switch to compatibility function. + (org-babel-merge-params): Switch to compatibility function. + (org-babel-noweb-p): Switch to compatibility function. + (org-babel-expand-noweb-references): Switch to compatibility + function. + + * org-bibtex.el (org-bibtex-headline): Switch to compatibility + function. + (org-bibtex-fleshout): Switch to compatibility function. + (org-bibtex-read): Switch to compatibility function. + (org-bibtex-write): Switch to compatibility function. + + * org-exp-blocks.el (org-export-blocks-preprocess): Switch to + compatibility function. + + * org-exp.el (org-export-format-source-code-or-example): Switch to + compatibility function. + + * org-macs.el (org-called-interactively-p): Indentation fix. + + * org-mouse.el (org-mouse-timestamp-today): Switch to + compatibility function. + (org-mouse-set-priority): Switch to compatibility function. + (org-mouse-popup-global-menu): Switch to compatibility function. + (org-mouse-context-menu): Switch to compatibility function. + + * org-plot.el (org-plot/gnuplot-to-grid-data): Switch to + compatibility function. + (org-plot/gnuplot-script): Switch to compatibility function. + + * org.el (org-entry-get): Switch to compatibility function. + (org-fill-paragraph): Switch to compatibility function. + (org-auto-fill-function): Switch to compatibility function. + + * ob-lob.el (org-babel-lob-execute): Only try to insert extant + hashes. + + * ob-R.el (org-babel-R-command): From a defvar to a defcustom. + + * ob.el (org-babel-set-current-result-hash): Change the hash of + the results for the current code block. + (org-babel-current-result-hash): Fix documentation. + + * ob-lob.el (org-babel-lob-execute): Don't re-execute the called + function if the current call line hash matches that in its + results. + + * ob-R.el (org-babel-R-assign-elisp): Can't assume every entry in + a table is a sequence. + + * ob-R.el (org-babel-R-assign-elisp): Clean up the code + implementing reads of irregular data into R. + + * ob.el (org-babel-header-arg-expand): In new buffers + (char-before) may return nil so use equal rather than =. + + * ob-R.el (org-babel-header-args:R): Adding values. + + * ob-clojure.el (org-babel-header-args:clojure): Adding values. + + * ob-lisp.el (org-babel-header-args:lisp): Adding values. + + * ob-sql.el (org-babel-header-args:sql): Adding values. + + * ob-sqlite.el (org-babel-header-args:sqlite): Adding values. + + * ob.el (org-babel-combine-header-arg-lists): Combine lists of + arguments and values. + (org-babel-insert-header-arg): Use new combined header argument + lists. + (org-babel-header-arg-expand): Add support for completing-read + insertion of header arguments after ":" + (org-babel-enter-header-arg-w-completion): Completing read + insertion of header arguments + (org-tab-first-hook): Adding header argument completion. + (org-babel-params-from-properties): Combining header argument + lists. + + * ob-exp.el (org-babel-exp-results): Ensure noweb expanded body is + used on export. + + * ob.el (org-babel-result-to-file): New optional description + argument. + (org-babel-insert-result): Moved description logic to another + function. + + * ob.el (org-babel-insert-result): Change name of filelinkdescr to + file-desc. + (org-babel-common-header-args-w-values): Change name of + filelinkdescr to file-desc. + + * ob-C.el (org-babel-C-execute): Add .exe to the end of compiled C + files on windows. + + * ob-exp.el (org-babel-exp-code): Escape all lines when exporting + Org-mode blocks. + + * ob.el (org-babel-parse-src-block-match): Make use of the new + language argument to org-babel-strip-protective-commas. + (org-babel-parse-inline-src-block-match): Make use of the new + language argument to org-babel-strip-protective-commas. + (org-babel-strip-protective-commas): Now accepts a language + argument. + +2012-09-30 Fabrice Niessen (tiny change) + + * org-agenda.el (org-agenda-write-buffer-name): Remove the test + for the presence of is required, if not present the variable will be ignored." +you can \"misuse\" it to also add other text to the header." :group 'org-agenda-export :group 'org-export-html :type 'string) @@ -228,9 +235,9 @@ :type 'boolean) (defgroup org-agenda-custom-commands nil - "Options concerning agenda views in Org-mode." - :tag "Org Agenda Custom Commands" - :group 'org-agenda) + "Options concerning agenda views in Org-mode." + :tag "Org Agenda Custom Commands" + :group 'org-agenda) (defconst org-sorting-choice '(choice @@ -247,116 +254,118 @@ ;; Keep custom values for `org-agenda-filter-preset' compatible with ;; the new variable `org-agenda-tag-filter-preset'. -(defvaralias 'org-agenda-filter-preset 'org-agenda-tag-filter-preset) +(if (fboundp 'defvaralias) + (defvaralias 'org-agenda-filter-preset 'org-agenda-tag-filter-preset) + (defvaralias 'org-agenda-filter 'org-agenda-tag-filter)) (defconst org-agenda-custom-commands-local-options - `(repeat :tag "Local settings for this command. Remember to quote values" + `(repeat :tag "Local settings for this command. Remember to quote values" (choice :tag "Setting" - (list :tag "Heading for this block" - (const org-agenda-overriding-header) - (string :tag "Headline")) - (list :tag "Files to be searched" - (const org-agenda-files) - (list - (const :format "" quote) - (repeat (file)))) - (list :tag "Sorting strategy" - (const org-agenda-sorting-strategy) - (list - (const :format "" quote) - (repeat - ,org-sorting-choice))) - (list :tag "Prefix format" - (const org-agenda-prefix-format :value " %-12:c%?-12t% s") - (string)) - (list :tag "Number of days in agenda" - (const org-agenda-span) - (choice (const :tag "Day" 'day) - (const :tag "Week" 'week) - (const :tag "Month" 'month) - (const :tag "Year" 'year) - (integer :tag "Custom"))) - (list :tag "Fixed starting date" - (const org-agenda-start-day) - (string :value "2007-11-01")) - (list :tag "Start on day of week" - (const org-agenda-start-on-weekday) - (choice :value 1 - (const :tag "Today" nil) - (integer :tag "Weekday No."))) - (list :tag "Include data from diary" - (const org-agenda-include-diary) - (boolean)) - (list :tag "Deadline Warning days" - (const org-deadline-warning-days) - (integer :value 1)) - (list :tag "Category filter preset" - (const org-agenda-category-filter-preset) - (list - (const :format "" quote) - (repeat - (string :tag "+category or -category")))) - (list :tag "Tags filter preset" - (const org-agenda-tag-filter-preset) - (list - (const :format "" quote) - (repeat - (string :tag "+tag or -tag")))) - (list :tag "Set daily/weekly entry types" - (const org-agenda-entry-types) - (list - (const :format "" quote) - (set :greedy t :value (:deadline :scheduled :timestamp :sexp) - (const :deadline) - (const :scheduled) - (const :timestamp) - (const :sexp)))) - (list :tag "Standard skipping condition" - :value (org-agenda-skip-function '(org-agenda-skip-entry-if)) - (const org-agenda-skip-function) - (list - (const :format "" quote) - (list - (choice - :tag "Skipping range" - (const :tag "Skip entry" org-agenda-skip-entry-if) - (const :tag "Skip subtree" org-agenda-skip-subtree-if)) - (repeat :inline t :tag "Conditions for skipping" - (choice - :tag "Condition type" - (list :tag "Regexp matches" :inline t (const :format "" 'regexp) (regexp)) - (list :tag "Regexp does not match" :inline t (const :format "" 'notregexp) (regexp)) - (list :tag "TODO state is" :inline t - (const 'todo) - (choice - (const :tag "any not-done state" 'todo) - (const :tag "any done state" 'done) - (const :tag "any state" 'any) - (list :tag "Keyword list" - (const :format "" quote) - (repeat (string :tag "Keyword"))))) - (list :tag "TODO state is not" :inline t - (const 'nottodo) - (choice - (const :tag "any not-done state" 'todo) - (const :tag "any done state" 'done) - (const :tag "any state" 'any) - (list :tag "Keyword list" - (const :format "" quote) - (repeat (string :tag "Keyword"))))) - (const :tag "scheduled" 'scheduled) - (const :tag "not scheduled" 'notscheduled) - (const :tag "deadline" 'deadline) - (const :tag "no deadline" 'notdeadline) - (const :tag "timestamp" 'timestamp) - (const :tag "no timestamp" 'nottimestamp)))))) - (list :tag "Non-standard skipping condition" - :value (org-agenda-skip-function) - (const org-agenda-skip-function) - (sexp :tag "Function or form (quoted!)")) - (list :tag "Any variable" - (variable :tag "Variable") - (sexp :tag "Value (sexp)")))) + (list :tag "Heading for this block" + (const org-agenda-overriding-header) + (string :tag "Headline")) + (list :tag "Files to be searched" + (const org-agenda-files) + (list + (const :format "" quote) + (repeat (file)))) + (list :tag "Sorting strategy" + (const org-agenda-sorting-strategy) + (list + (const :format "" quote) + (repeat + ,org-sorting-choice))) + (list :tag "Prefix format" + (const org-agenda-prefix-format :value " %-12:c%?-12t% s") + (string)) + (list :tag "Number of days in agenda" + (const org-agenda-span) + (choice (const :tag "Day" 'day) + (const :tag "Week" 'week) + (const :tag "Month" 'month) + (const :tag "Year" 'year) + (integer :tag "Custom"))) + (list :tag "Fixed starting date" + (const org-agenda-start-day) + (string :value "2007-11-01")) + (list :tag "Start on day of week" + (const org-agenda-start-on-weekday) + (choice :value 1 + (const :tag "Today" nil) + (integer :tag "Weekday No."))) + (list :tag "Include data from diary" + (const org-agenda-include-diary) + (boolean)) + (list :tag "Deadline Warning days" + (const org-deadline-warning-days) + (integer :value 1)) + (list :tag "Category filter preset" + (const org-agenda-category-filter-preset) + (list + (const :format "" quote) + (repeat + (string :tag "+category or -category")))) + (list :tag "Tags filter preset" + (const org-agenda-tag-filter-preset) + (list + (const :format "" quote) + (repeat + (string :tag "+tag or -tag")))) + (list :tag "Set daily/weekly entry types" + (const org-agenda-entry-types) + (list + (const :format "" quote) + (set :greedy t :value (:deadline :scheduled :timestamp :sexp) + (const :deadline) + (const :scheduled) + (const :timestamp) + (const :sexp)))) + (list :tag "Standard skipping condition" + :value (org-agenda-skip-function '(org-agenda-skip-entry-if)) + (const org-agenda-skip-function) + (list + (const :format "" quote) + (list + (choice + :tag "Skipping range" + (const :tag "Skip entry" org-agenda-skip-entry-if) + (const :tag "Skip subtree" org-agenda-skip-subtree-if)) + (repeat :inline t :tag "Conditions for skipping" + (choice + :tag "Condition type" + (list :tag "Regexp matches" :inline t (const :format "" 'regexp) (regexp)) + (list :tag "Regexp does not match" :inline t (const :format "" 'notregexp) (regexp)) + (list :tag "TODO state is" :inline t + (const 'todo) + (choice + (const :tag "any not-done state" 'todo) + (const :tag "any done state" 'done) + (const :tag "any state" 'any) + (list :tag "Keyword list" + (const :format "" quote) + (repeat (string :tag "Keyword"))))) + (list :tag "TODO state is not" :inline t + (const 'nottodo) + (choice + (const :tag "any not-done state" 'todo) + (const :tag "any done state" 'done) + (const :tag "any state" 'any) + (list :tag "Keyword list" + (const :format "" quote) + (repeat (string :tag "Keyword"))))) + (const :tag "scheduled" 'scheduled) + (const :tag "not scheduled" 'notscheduled) + (const :tag "deadline" 'deadline) + (const :tag "no deadline" 'notdeadline) + (const :tag "timestamp" 'timestamp) + (const :tag "no timestamp" 'nottimestamp)))))) + (list :tag "Non-standard skipping condition" + :value (org-agenda-skip-function) + (const org-agenda-skip-function) + (sexp :tag "Function or form (quoted!)")) + (list :tag "Any variable" + (variable :tag "Variable") + (sexp :tag "Value (sexp)")))) "Selection of examples for agenda command settings. This will be spliced into the custom type of `org-agenda-custom-commands'.") @@ -434,69 +443,69 @@ :group 'org-agenda-custom-commands :type `(repeat (choice :value ("x" "Describe command here" tags "" nil) - (list :tag "Single command" - (string :tag "Access Key(s) ") - (option (string :tag "Description")) - (choice - (const :tag "Agenda" agenda) - (const :tag "TODO list" alltodo) - (const :tag "Search words" search) - (const :tag "Stuck projects" stuck) - (const :tag "Tags/Property match (all agenda files)" tags) - (const :tag "Tags/Property match of TODO entries (all agenda files)" tags-todo) - (const :tag "TODO keyword search (all agenda files)" todo) - (const :tag "Tags sparse tree (current buffer)" tags-tree) - (const :tag "TODO keyword tree (current buffer)" todo-tree) - (const :tag "Occur tree (current buffer)" occur-tree) - (sexp :tag "Other, user-defined function")) - (string :tag "Match (only for some commands)") - ,org-agenda-custom-commands-local-options - (option (repeat :tag "Export" (file :tag "Export to")))) - (list :tag "Command series, all agenda files" - (string :tag "Access Key(s)") - (string :tag "Description ") - (repeat :tag "Component" - (choice - (list :tag "Agenda" - (const :format "" agenda) - (const :tag "" :format "" "") - ,org-agenda-custom-commands-local-options) - (list :tag "TODO list (all keywords)" - (const :format "" alltodo) - (const :tag "" :format "" "") - ,org-agenda-custom-commands-local-options) - (list :tag "Search words" - (const :format "" search) - (string :tag "Match") - ,org-agenda-custom-commands-local-options) - (list :tag "Stuck projects" - (const :format "" stuck) - (const :tag "" :format "" "") - ,org-agenda-custom-commands-local-options) - (list :tag "Tags search" - (const :format "" tags) - (string :tag "Match") - ,org-agenda-custom-commands-local-options) - (list :tag "Tags search, TODO entries only" - (const :format "" tags-todo) - (string :tag "Match") - ,org-agenda-custom-commands-local-options) - (list :tag "TODO keyword search" - (const :format "" todo) - (string :tag "Match") - ,org-agenda-custom-commands-local-options) - (list :tag "Other, user-defined function" - (symbol :tag "function") - (string :tag "Match") - ,org-agenda-custom-commands-local-options))) + (list :tag "Single command" + (string :tag "Access Key(s) ") + (option (string :tag "Description")) + (choice + (const :tag "Agenda" agenda) + (const :tag "TODO list" alltodo) + (const :tag "Search words" search) + (const :tag "Stuck projects" stuck) + (const :tag "Tags/Property match (all agenda files)" tags) + (const :tag "Tags/Property match of TODO entries (all agenda files)" tags-todo) + (const :tag "TODO keyword search (all agenda files)" todo) + (const :tag "Tags sparse tree (current buffer)" tags-tree) + (const :tag "TODO keyword tree (current buffer)" todo-tree) + (const :tag "Occur tree (current buffer)" occur-tree) + (sexp :tag "Other, user-defined function")) + (string :tag "Match (only for some commands)") + ,org-agenda-custom-commands-local-options + (option (repeat :tag "Export" (file :tag "Export to")))) + (list :tag "Command series, all agenda files" + (string :tag "Access Key(s)") + (string :tag "Description ") + (repeat :tag "Component" + (choice + (list :tag "Agenda" + (const :format "" agenda) + (const :tag "" :format "" "") + ,org-agenda-custom-commands-local-options) + (list :tag "TODO list (all keywords)" + (const :format "" alltodo) + (const :tag "" :format "" "") + ,org-agenda-custom-commands-local-options) + (list :tag "Search words" + (const :format "" search) + (string :tag "Match") + ,org-agenda-custom-commands-local-options) + (list :tag "Stuck projects" + (const :format "" stuck) + (const :tag "" :format "" "") + ,org-agenda-custom-commands-local-options) + (list :tag "Tags search" + (const :format "" tags) + (string :tag "Match") + ,org-agenda-custom-commands-local-options) + (list :tag "Tags search, TODO entries only" + (const :format "" tags-todo) + (string :tag "Match") + ,org-agenda-custom-commands-local-options) + (list :tag "TODO keyword search" + (const :format "" todo) + (string :tag "Match") + ,org-agenda-custom-commands-local-options) + (list :tag "Other, user-defined function" + (symbol :tag "function") + (string :tag "Match") + ,org-agenda-custom-commands-local-options))) - (repeat :tag "Settings for entire command set" - (list (variable :tag "Any variable") - (sexp :tag "Value"))) - (option (repeat :tag "Export" (file :tag "Export to")))) - (cons :tag "Prefix key documentation" - (string :tag "Access Key(s)") - (string :tag "Description "))))) + (repeat :tag "Settings for entire command set" + (list (variable :tag "Any variable") + (sexp :tag "Value"))) + (option (repeat :tag "Export" (file :tag "Export to")))) + (cons :tag "Prefix key documentation" + (string :tag "Access Key(s)") + (string :tag "Description "))))) (defcustom org-agenda-query-register ?o "The register holding the current query string. @@ -550,9 +559,9 @@ (const :tag "equal" "="))) (defgroup org-agenda-skip nil - "Options concerning skipping parts of agenda files." - :tag "Org Agenda Skip" - :group 'org-agenda) + "Options concerning skipping parts of agenda files." + :tag "Org Agenda Skip" + :group 'org-agenda) (defcustom org-agenda-skip-function-global nil "Function to be called at each match during agenda construction. @@ -636,11 +645,11 @@ The idea behind this is that by setting a timestamp, you have already \"taken care\" of this item. -This variable can also have an integer as a value. If positive (N), -todos with a timestamp N or more days in the future will be ignored. If +This variable can also have an integer as a value. If positive (N), +todos with a timestamp N or more days in the future will be ignored. If negative (-N), todos with a timestamp N or more days in the past will be -ignored. If 0, todos with a timestamp either today or in the future will -be ignored. For example, a value of -1 will exclude todos with a +ignored. If 0, todos with a timestamp either today or in the future will +be ignored. For example, a value of -1 will exclude todos with a timestamp in the past (yesterday or earlier), while a value of 7 will exclude todos with a timestamp a week or more in the future. @@ -674,7 +683,7 @@ t Same as `all', for backward compatibility. -This variable can also have an integer as a value. See +This variable can also have an integer as a value. See `org-agenda-todo-ignore-timestamp' for more details. See also `org-agenda-todo-ignore-with-date'. @@ -715,7 +724,7 @@ t Same as `near', for backward compatibility. -This variable can also have an integer as a value. See +This variable can also have an integer as a value. See `org-agenda-todo-ignore-timestamp' for more details. See also `org-agenda-todo-ignore-with-date'. @@ -774,6 +783,21 @@ (const :tag "Always" t) (const :tag "Not when scheduled today" not-today))) +(defcustom org-agenda-skip-timestamp-if-deadline-is-shown nil + "Non-nil means skip timestamp line if same entry shows because of deadline. +In the agenda of today, an entry can show up multiple times +because it has both a plain timestamp and has a nearby deadline. +When this variable is t, then only the deadline is shown and the +fact that the entry has a timestamp for or including today is not +shown. When this variable is nil, the entry will be shown +several times." + :group 'org-agenda-skip + :group 'org-agenda-daily/weekly + :version "24.1" + :type '(choice + (const :tag "Never" nil) + (const :tag "Always" t))) + (defcustom org-agenda-skip-deadline-if-done nil "Non-nil means don't show deadlines when the corresponding item is done. When nil, the deadline is still shown and should give you a happy feeling. @@ -799,7 +823,7 @@ :group 'org-agenda-daily/weekly :version "24.1" :type '(choice - (const :tag "Always show prewarning" nil) + (const :tag "Alwas show prewarning" nil) (const :tag "Remove prewarning if entry is scheduled" t) (integer :tag "Restart prewarning N days before deadline"))) @@ -860,12 +884,14 @@ When nil, the matcher string is not shown, but is put into the help-echo property so than moving the mouse over the command shows it. Setting it to nil is good if matcher strings are very long and/or if -you want to use two-column display (see `org-agenda-menu-two-column')." +you want to use two-columns display (see `org-agenda-menu-two-columns')." :group 'org-agenda :version "24.1" :type 'boolean) -(defcustom org-agenda-menu-two-column nil +(define-obsolete-variable-alias 'org-agenda-menu-two-column 'org-agenda-menu-two-columns "24.3") + +(defcustom org-agenda-menu-two-columns nil "Non-nil means, use two columns to show custom commands in the dispatcher. If you use this, you probably want to set `org-agenda-menu-show-matcher' to nil." @@ -873,8 +899,14 @@ :version "24.1" :type 'boolean) -(defcustom org-finalize-agenda-hook nil - "Hook run just before displaying an agenda buffer." +(define-obsolete-variable-alias 'org-finalize-agenda-hook 'org-agenda-finalize-hook "24.3") +(defcustom org-agenda-finalize-hook nil + "Hook run just before displaying an agenda buffer. +The buffer is still writable when the hook is called. + +You can modify some of the buffer substrings but you should be +extra careful not to modify the text properties of the agenda +headlines as the agenda display heavily relies on them." :group 'org-agenda-startup :type 'hook) @@ -932,7 +964,8 @@ expressions listed in `org-agenda-entry-text-exclude-regexps'.") (defvar org-agenda-include-inactive-timestamps nil - "Non-nil means include inactive time stamps in agenda and timeline.") + "Non-nil means include inactive time stamps in agenda and timeline. +Dynamically scoped.") (defgroup org-agenda-windows nil "Options concerning the windows used by the Agenda in Org Mode." @@ -975,11 +1008,11 @@ :type 'boolean) (defcustom org-agenda-ndays nil - "Number of days to include in overview display. + "Number of days to include in overview display. Should be 1 or 7. Obsolete, see `org-agenda-span'." - :group 'org-agenda-daily/weekly - :type 'integer) + :group 'org-agenda-daily/weekly + :type 'integer) (make-obsolete-variable 'org-agenda-ndays 'org-agenda-span "24.1") @@ -1202,10 +1235,18 @@ :type 'boolean) (defcustom org-agenda-start-with-log-mode nil - "The initial value of log-mode in a newly created agenda window." + "The initial value of log-mode in a newly created agenda window. +See `org-agenda-log-mode' and `org-agenda-log-mode-items' for further +explanations on the possible values." :group 'org-agenda-startup :group 'org-agenda-daily/weekly - :type 'boolean) + :type '(choice (const :tag "Don't show log items" nil) + (const :tag "Show only log items" 'only) + (const :tag "Show all possible log items" 'clockcheck) + (repeat :tag "Choose among possible values for `org-agenda-log-mode-items'" + (choice (const :tag "Show closed log items" 'closed) + (const :tag "Show clocked log items" 'clock) + (const :tag "Show all logged state changes" 'state))))) (defcustom org-agenda-start-with-clockreport-mode nil "The initial value of clockreport-mode in a newly created agenda window." @@ -1501,8 +1542,10 @@ :group 'org-agenda-line-format) (defvar org-prefix-format-compiled nil - "The compiled version of the most recently used prefix format. -See the variable `org-agenda-prefix-format'.") + "The compiled prefix format and associated variables. +This is a list where first element is a list of variable bindings, and second +element is the compiled format expression. See the variable +`org-agenda-prefix-format'.") (defcustom org-agenda-todo-keyword-format "%-1s" "Format for the TODO keyword in agenda lines. @@ -1511,6 +1554,16 @@ :group 'org-agenda-line-format :type 'string) +(defcustom org-agenda-diary-sexp-prefix nil + "A regexp that matches part of a diary sexp entry +which should be treated as scheduling/deadline information in +`org-agenda'. + +For example, you can use this to extract the `diary-remind-message' from +`diary-remind' entries." + :group 'org-agenda-line-format + :type '(choice (const :tag "None" nil) (regexp :tag "Regexp"))) + (defcustom org-agenda-timerange-leaders '("" "(%d/%d): ") "Text preceding timerange entries in the agenda view. This is a list with two strings. The first applies when the range @@ -1659,7 +1712,7 @@ (defcustom org-agenda-day-face-function nil "Function called to determine what face should be used to display a day. -The only argument passed to that function is the day. It should +The only argument passed to that function is the day. It should returns a face, or nil if does not want to specify a face and let the normal rules apply." :group 'org-agenda-line-format @@ -1762,10 +1815,6 @@ :version "24.1" :group 'org-agenda) -(eval-when-compile - (require 'cl)) -(require 'org) - (defmacro org-agenda-with-point-at-orig-entry (string &rest body) "Execute BODY with point at location given by `org-hd-marker' property. If STRING is non-nil, the text property will be fetched from position 0 @@ -1789,7 +1838,7 @@ (setcdr ass (cdr entry)) (push entry org-agenda-custom-commands)))) -;;; Define the Org-agenda-mode +;;; Define the org-agenda-mode (defvar org-agenda-mode-map (make-sparse-keymap) "Keymap for `org-agenda-mode'.") @@ -1797,7 +1846,7 @@ (defvaralias 'org-agenda-keymap 'org-agenda-mode-map)) (defvar org-agenda-menu) ; defined later in this file. -(defvar org-agenda-restrict) ; defined later in this file. +(defvar org-agenda-restrict nil) ; defined later in this file. (defvar org-agenda-follow-mode nil) (defvar org-agenda-entry-text-mode nil) (defvar org-agenda-clockreport-mode nil) @@ -1805,10 +1854,76 @@ (defvar org-agenda-redo-command nil) (defvar org-agenda-query-string nil) (defvar org-agenda-mode-hook nil - "Hook for `org-agenda-mode', run after the mode is turned on.") + "Hook run after `org-agenda-mode' is turned on. +The buffer is still writable when this hook is called.") (defvar org-agenda-type nil) (defvar org-agenda-force-single-file nil) -(defvar org-agenda-bulk-marked-entries) ;; Defined further down in this file +(defvar org-agenda-bulk-marked-entries nil + "List of markers that refer to marked entries in the agenda.") + +;;; Multiple agenda buffers support + +(defcustom org-agenda-sticky nil + "Non-nil means agenda q key will bury agenda buffers. +Agenda commands will then show existing buffer instead of generating new ones. +When nil, `q' will kill the single agenda buffer." + :group 'org-agenda + :version "24.3" + :type 'boolean) + +;;;###autoload +(defun org-toggle-sticky-agenda (&optional arg) + "Toggle `org-agenda-sticky'." + (interactive "P") + (let ((new-value (if arg + (> (prefix-numeric-value arg) 0) + (not org-agenda-sticky)))) + (if (equal new-value org-agenda-sticky) + (and (org-called-interactively-p 'interactive) + (message "Sticky agenda was already %s" + (if org-agenda-sticky "enabled" "disabled"))) + (setq org-agenda-sticky new-value) + (org-agenda-kill-all-agenda-buffers) + (and (org-called-interactively-p 'interactive) + (message "Sticky agenda was %s" + (if org-agenda-sticky "enabled" "disabled")))))) + +(defvar org-agenda-buffer nil + "Agenda buffer currently being generated.") + +(defvar org-agenda-last-prefix-arg nil) +(defvar org-agenda-this-buffer-name nil) +(defvar org-agenda-doing-sticky-redo nil) +(defvar org-agenda-this-buffer-is-sticky nil) + +(defconst org-agenda-local-vars + '(org-agenda-this-buffer-name + org-agenda-undo-list + org-agenda-pending-undo-list + org-agenda-follow-mode + org-agenda-entry-text-mode + org-agenda-clockreport-mode + org-agenda-show-log + org-agenda-redo-command + org-agenda-query-string + org-agenda-type + org-agenda-bulk-marked-entries + org-agenda-undo-has-started-in + org-agenda-info + org-agenda-tag-filter-overlays + org-agenda-cat-filter-overlays + org-agenda-pre-window-conf + org-agenda-columns-active + org-agenda-tag-filter + org-agenda-category-filter + org-agenda-markers + org-agenda-last-search-view-search-was-boolean + org-agenda-filtered-by-category + org-agenda-filter-form + org-agenda-show-window + org-agenda-cycle-counter + org-agenda-last-prefix-arg) + "Variables that must be local in agenda buffers to allow multiple buffers.") (defun org-agenda-mode () "Mode for time-sorted view on action items in Org-mode files. @@ -1817,7 +1932,30 @@ \\{org-agenda-mode-map}" (interactive) - (kill-all-local-variables) + (cond (org-agenda-doing-sticky-redo + ;; Refreshing sticky agenda-buffer + ;; + ;; Preserve the value of `org-agenda-local-vars' variables, + ;; while letting `kill-all-local-variables' kill the rest + (let ((save (buffer-local-variables))) + (kill-all-local-variables) + (mapc 'make-local-variable org-agenda-local-vars) + (dolist (elem save) + (let ((var (car elem)) + (val (cdr elem))) + (when (and val + (member var org-agenda-local-vars)) + (set var val))))) + (set (make-local-variable 'org-agenda-this-buffer-is-sticky) t)) + (org-agenda-sticky + ;; Creating a sticky Agenda buffer for the first time + (kill-all-local-variables) + (mapc 'make-local-variable org-agenda-local-vars) + (set (make-local-variable 'org-agenda-this-buffer-is-sticky) t)) + (t + ;; Creating a non-sticky agenda buffer + (kill-all-local-variables) + (set (make-local-variable 'org-agenda-this-buffer-is-sticky) nil))) (setq org-agenda-undo-list nil org-agenda-pending-undo-list nil org-agenda-bulk-marked-entries nil) @@ -1829,14 +1967,13 @@ (easy-menu-add org-agenda-menu) (if org-startup-truncated (setq truncate-lines t)) (org-set-local 'line-move-visual nil) - (org-add-hook 'post-command-hook 'org-agenda-post-command-hook nil 'local) + (org-add-hook 'post-command-hook 'org-agenda-update-agenda-type nil 'local) (org-add-hook 'pre-command-hook 'org-unhighlight nil 'local) ;; Make sure properties are removed when copying text - (when (boundp 'buffer-substring-filters) - (org-set-local 'buffer-substring-filters - (cons (lambda (x) - (set-text-properties 0 (length x) nil x) x) - buffer-substring-filters))) + (make-local-variable 'filter-buffer-substring-functions) + (add-hook 'filter-buffer-substring-functions + (lambda (fun start end delete) + (substring-no-properties (funcall fun start end delete)))) (unless org-agenda-keep-modes (setq org-agenda-follow-mode org-agenda-start-with-follow-mode org-agenda-entry-text-mode org-agenda-start-with-entry-text-mode @@ -1868,11 +2005,13 @@ (org-defkey org-agenda-mode-map "\C-k" 'org-agenda-kill) (org-defkey org-agenda-mode-map "\C-c\C-w" 'org-agenda-refile) (org-defkey org-agenda-mode-map "m" 'org-agenda-bulk-mark) +(org-defkey org-agenda-mode-map "*" 'org-agenda-bulk-mark-all) (org-defkey org-agenda-mode-map "%" 'org-agenda-bulk-mark-regexp) (org-defkey org-agenda-mode-map "u" 'org-agenda-bulk-unmark) -(org-defkey org-agenda-mode-map "U" 'org-agenda-bulk-remove-all-marks) +(org-defkey org-agenda-mode-map "U" 'org-agenda-bulk-unmark-all) +(org-defkey org-agenda-mode-map "B" 'org-agenda-bulk-action) +(org-defkey org-agenda-mode-map "k" 'org-agenda-capture) (org-defkey org-agenda-mode-map "A" 'org-agenda-append-agenda) -(org-defkey org-agenda-mode-map "B" 'org-agenda-bulk-action) (org-defkey org-agenda-mode-map "\C-c\C-x!" 'org-reload) (org-defkey org-agenda-mode-map "\C-c\C-x\C-a" 'org-agenda-archive-default) (org-defkey org-agenda-mode-map "\C-c\C-xa" 'org-agenda-toggle-archive-tag) @@ -1901,8 +2040,6 @@ (org-defkey org-agenda-mode-map "y" 'org-agenda-year-view) (org-defkey org-agenda-mode-map "\C-c\C-z" 'org-agenda-add-note) (org-defkey org-agenda-mode-map "z" 'org-agenda-add-note) -(org-defkey org-agenda-mode-map "k" 'org-agenda-action) -(org-defkey org-agenda-mode-map "\C-c\C-x\C-k" 'org-agenda-action) (org-defkey org-agenda-mode-map [(shift right)] 'org-agenda-do-date-later) (org-defkey org-agenda-mode-map [(shift left)] 'org-agenda-do-date-earlier) (org-defkey org-agenda-mode-map [?\C-c ?\C-x (right)] 'org-agenda-do-date-later) @@ -1913,7 +2050,7 @@ (org-defkey org-agenda-mode-map "\C-c\C-d" 'org-agenda-deadline) (let ((l '(1 2 3 4 5 6 7 8 9 0))) (while l (org-defkey org-agenda-mode-map - (int-to-string (pop l)) 'digit-argument))) + (int-to-string (pop l)) 'digit-argument))) (org-defkey org-agenda-mode-map "F" 'org-agenda-follow-mode) (org-defkey org-agenda-mode-map "R" 'org-agenda-clockreport-mode) @@ -1924,21 +2061,23 @@ (org-defkey org-agenda-mode-map "!" 'org-agenda-toggle-deadlines) (org-defkey org-agenda-mode-map "G" 'org-agenda-toggle-time-grid) (org-defkey org-agenda-mode-map "r" 'org-agenda-redo) -(org-defkey org-agenda-mode-map "g" 'org-agenda-redo) +(org-defkey org-agenda-mode-map "g" (lambda () (interactive) (org-agenda-redo t))) (org-defkey org-agenda-mode-map "e" 'org-agenda-set-effort) (org-defkey org-agenda-mode-map "\C-c\C-xe" 'org-agenda-set-effort) (org-defkey org-agenda-mode-map "\C-c\C-x\C-e" 'org-clock-modify-effort-estimate) (org-defkey org-agenda-mode-map "\C-c\C-xp" 'org-agenda-set-property) (org-defkey org-agenda-mode-map "q" 'org-agenda-quit) +(org-defkey org-agenda-mode-map "Q" 'org-agenda-Quit) (org-defkey org-agenda-mode-map "x" 'org-agenda-exit) (org-defkey org-agenda-mode-map "\C-x\C-w" 'org-agenda-write) (org-defkey org-agenda-mode-map "\C-x\C-s" 'org-save-all-org-buffers) (org-defkey org-agenda-mode-map "s" 'org-save-all-org-buffers) -(org-defkey org-agenda-mode-map "P" 'org-agenda-show-priority) (org-defkey org-agenda-mode-map "T" 'org-agenda-show-tags) (org-defkey org-agenda-mode-map "n" 'org-agenda-next-line) (org-defkey org-agenda-mode-map "p" 'org-agenda-previous-line) +(org-defkey org-agenda-mode-map "N" 'org-agenda-next-item) +(org-defkey org-agenda-mode-map "P" 'org-agenda-previous-item) (substitute-key-definition 'next-line 'org-agenda-next-line org-agenda-mode-map global-map) (substitute-key-definition 'previous-line 'org-agenda-previous-line @@ -1946,8 +2085,8 @@ (org-defkey org-agenda-mode-map "\C-c\C-a" 'org-attach) (org-defkey org-agenda-mode-map "\C-c\C-n" 'org-agenda-next-date-line) (org-defkey org-agenda-mode-map "\C-c\C-p" 'org-agenda-previous-date-line) +(org-defkey org-agenda-mode-map "\C-c," 'org-agenda-priority) (org-defkey org-agenda-mode-map "," 'org-agenda-priority) -(org-defkey org-agenda-mode-map "\C-c," 'org-agenda-priority) (org-defkey org-agenda-mode-map "i" 'org-agenda-diary-entry) (org-defkey org-agenda-mode-map "c" 'org-agenda-goto-calendar) (org-defkey org-agenda-mode-map "C" 'org-agenda-convert-date) @@ -1981,6 +2120,7 @@ (org-defkey org-agenda-mode-map "/" 'org-agenda-filter-by-tag) (org-defkey org-agenda-mode-map "\\" 'org-agenda-filter-by-tag-refine) (org-defkey org-agenda-mode-map "<" 'org-agenda-filter-by-category) +(org-defkey org-agenda-mode-map "^" 'org-agenda-filter-by-top-category) (org-defkey org-agenda-mode-map ";" 'org-timer-set-timer) (define-key org-agenda-mode-map "?" 'org-agenda-show-the-flagging-note) (org-defkey org-agenda-mode-map "\C-c\C-x\C-mg" 'org-mobile-pull) @@ -2034,7 +2174,7 @@ ["Show some entry text" org-agenda-entry-text-mode :style toggle :selected org-agenda-entry-text-mode :active t] - "--" + "--" ["Show Logbook entries" org-agenda-log-mode :style toggle :selected org-agenda-show-log :active (org-agenda-check-type nil 'agenda 'timeline) @@ -2054,9 +2194,10 @@ ["Show original entry" org-agenda-show t] ["Go To (other window)" org-agenda-goto t] ["Go To (this window)" org-agenda-switch-to t] + ["Capture with cursor date" org-agenda-capture t] ["Follow Mode" org-agenda-follow-mode :style toggle :selected org-agenda-follow-mode :active t] -; ["Tree to indirect frame" org-agenda-tree-to-indirect-buffer t] + ;; ["Tree to indirect frame" org-agenda-tree-to-indirect-buffer t] "--" ("TODO" ["Cycle TODO" org-agenda-todo t] @@ -2075,10 +2216,11 @@ ["Delete subtree" org-agenda-kill t]) ("Bulk action" ["Mark entry" org-agenda-bulk-mark t] + ["Mark all" org-agenda-bulk-mark-all t] ["Mark matching regexp" org-agenda-bulk-mark-regexp t] ["Unmark entry" org-agenda-bulk-unmark t] - ["Unmark all entries" org-agenda-bulk-remove-all-marks :active t :keys "C-u s"]) - ["Act on all marked" org-agenda-bulk-action t] + ["Unmark all entries" org-agenda-bulk-unmark-all :active t :keys "U"]) + ["Act on all marked" org-agenda-bulk-action t] "--" ("Tags and Properties" ["Show all Tags" org-agenda-show-tags t] @@ -2090,11 +2232,6 @@ ["Schedule" org-agenda-schedule t] ["Set Deadline" org-agenda-deadline t] "--" - ["Mark item" org-agenda-action :active t :keys "k m"] - ["Show mark item" org-agenda-action :active t :keys "k v"] - ["Schedule marked item" org-agenda-action :active t :keys "k s"] - ["Set Deadline for marked item" org-agenda-action :active t :keys "k d"] - "--" ["Change Date +1 day" org-agenda-date-later (org-agenda-check-type nil 'agenda 'timeline)] ["Change Date -1 day" org-agenda-date-earlier (org-agenda-check-type nil 'agenda 'timeline)] ["Change Time +1 hour" org-agenda-do-date-later :active (org-agenda-check-type nil 'agenda 'timeline) :keys "C-u S-right"] @@ -2115,7 +2252,7 @@ ["Set Priority" org-agenda-priority t] ["Increase Priority" org-agenda-priority-up t] ["Decrease Priority" org-agenda-priority-down t] - ["Show Priority" org-agenda-show-priority t]) + ["Show Priority" org-show-priority t]) ("Calendar/Diary" ["New Diary Entry" org-agenda-diary-entry (org-agenda-check-type nil 'agenda 'timeline)] ["Goto Calendar" org-agenda-goto-calendar (org-agenda-check-type nil 'agenda 'timeline)] @@ -2144,12 +2281,8 @@ (defvar org-agenda-allow-remote-undo t "Non-nil means allow remote undo from the agenda buffer.") -(defvar org-agenda-undo-list nil - "List of undoable operations in the agenda since last refresh.") (defvar org-agenda-undo-has-started-in nil "Buffers that have already seen `undo-start' in the current undo sequence.") -(defvar org-agenda-pending-undo-list nil - "In a series of undo commands, this is the list of remaining undo items.") (defun org-agenda-undo () "Undo a remote editing step in the agenda. @@ -2193,14 +2326,60 @@ ;;; Agenda dispatch -(defvar org-agenda-restrict nil) (defvar org-agenda-restrict-begin (make-marker)) (defvar org-agenda-restrict-end (make-marker)) (defvar org-agenda-last-dispatch-buffer nil) (defvar org-agenda-overriding-restriction nil) +(defcustom org-agenda-custom-commands-contexts nil + "Alist of custom agenda keys and contextual rules. + +For example, if you have a custom agenda command \"p\" and you +want this command to be accessible only from plain text files, +use this: + + '((\"p\" (in-file . \"\\.txt\"))) + +Here are the available contexts definitions: + + in-file: command displayed only in matching files + in-mode: command displayed only in matching modes + not-in-file: command not displayed in matching files + not-in-mode: command not displayed in matching modes + [function]: a custom function taking no argument + +If you define several checks, the agenda command will be +accessible if there is at least one valid check. + +You can also bind a key to another agenda custom command +depending on contextual rules. + + '((\"p\" \"q\" (in-file . \"\\.txt\"))) + +Here it means: in .txt files, use \"p\" as the key for the +agenda command otherwise associated with \"q\". (The command +originally associated with \"q\" is not displayed to avoid +duplicates.)" + :version "24.3" + :group 'org-agenda-custom-commands + :type '(repeat (list :tag "Rule" + (string :tag " Agenda key") + (string :tag "Replace by command") + (repeat :tag "Available when" + (choice + (cons :tag "Condition" + (choice + (const :tag "In file" in-file) + (const :tag "Not in file" not-in-file) + (const :tag "In mode" in-mode) + (const :tag "Not in mode" not-in-mode)) + (regexp)) + (function :tag "Custom function")))))) + +(defvar org-keys nil) +(defvar org-match nil) ;;;###autoload -(defun org-agenda (&optional arg keys restriction) +(defun org-agenda (&optional arg org-keys restriction) "Dispatch agenda commands to collect entries to the agenda buffer. Prompts for a command to execute. Any prefix arg will be passed on to the selected command. The default selections are: @@ -2215,6 +2394,7 @@ L Create a timeline for the current buffer. e Export views to associated files. s Search entries for keywords. +S Search entries for keywords, only with TODO keywords. / Multi occur across all agenda files and also files listed in `org-agenda-text-search-extra-files'. < Restrict agenda commands to buffer, subtree, or region. @@ -2236,6 +2416,7 @@ (interactive "P") (catch 'exit (let* ((prefix-descriptions nil) + (org-agenda-buffer-name org-agenda-buffer-name) (org-agenda-window-setup (if (equal (buffer-name) org-agenda-buffer-name) 'current-window @@ -2253,9 +2434,12 @@ ((not (nth 1 x)) (cons (car x) (cons "" (cddr x)))) (t (cons (car x) (cons "" (cdr x)))))) org-agenda-custom-commands))) + (org-agenda-custom-commands + (org-contextualize-keys + org-agenda-custom-commands org-agenda-custom-commands-contexts)) (buf (current-buffer)) (bfn (buffer-file-name (buffer-base-buffer))) - entry key type match lprops ans) + entry key type org-match lprops ans) ;; Turn off restriction unless there is an overriding one, (unless org-agenda-overriding-restriction (unless (org-bound-and-true-p org-agenda-keep-restricted-file-list) @@ -2270,10 +2454,16 @@ (put 'org-agenda-redo-command 'last-args nil) ;; Remember where this call originated (setq org-agenda-last-dispatch-buffer (current-buffer)) - (unless keys + (unless org-keys (setq ans (org-agenda-get-restriction-and-command prefix-descriptions) - keys (car ans) + org-keys (car ans) restriction (cdr ans))) + ;; If we have sticky agenda buffers, set a name for the buffer, + ;; depending on the invoking keys. The user may still set this + ;; as a command option, which will overwrite what we do here. + (if org-agenda-sticky + (setq org-agenda-buffer-name + (format "*Org Agenda(%s)*" org-keys))) ;; Establish the restriction, if any (when (and (not org-agenda-overriding-restriction) restriction) (put 'org-agenda-files 'org-restrict (list bfn)) @@ -2292,11 +2482,15 @@ ;; For example the todo list should not need it (but does...) (cond - ((setq entry (assoc keys org-agenda-custom-commands)) + ((setq entry (assoc org-keys org-agenda-custom-commands)) (if (or (symbolp (nth 2 entry)) (functionp (nth 2 entry))) (progn - (setq type (nth 2 entry) match (eval (nth 3 entry)) + (setq type (nth 2 entry) org-match (eval (nth 3 entry)) lprops (nth 4 entry)) + (if org-agenda-sticky + (setq org-agenda-buffer-name + (or (and (stringp org-match) (format "*Org Agenda(%s:%s)*" org-keys org-match)) + (format "*Org Agenda(%s)*" org-keys)))) (put 'org-agenda-redo-command 'org-lprops lprops) (cond ((eq type 'agenda) @@ -2304,44 +2498,45 @@ ((eq type 'alltodo) (org-let lprops '(org-todo-list current-prefix-arg))) ((eq type 'search) - (org-let lprops '(org-search-view current-prefix-arg match nil))) + (org-let lprops '(org-search-view current-prefix-arg org-match nil))) ((eq type 'stuck) (org-let lprops '(org-agenda-list-stuck-projects current-prefix-arg))) ((eq type 'tags) - (org-let lprops '(org-tags-view current-prefix-arg match))) + (org-let lprops '(org-tags-view current-prefix-arg org-match))) ((eq type 'tags-todo) - (org-let lprops '(org-tags-view '(4) match))) + (org-let lprops '(org-tags-view '(4) org-match))) ((eq type 'todo) - (org-let lprops '(org-todo-list match))) + (org-let lprops '(org-todo-list org-match))) ((eq type 'tags-tree) (org-check-for-org-mode) - (org-let lprops '(org-match-sparse-tree current-prefix-arg match))) + (org-let lprops '(org-match-sparse-tree current-prefix-arg org-match))) ((eq type 'todo-tree) (org-check-for-org-mode) (org-let lprops '(org-occur (concat "^" org-outline-regexp "[ \t]*" - (regexp-quote match) "\\>")))) + (regexp-quote org-match) "\\>")))) ((eq type 'occur-tree) (org-check-for-org-mode) - (org-let lprops '(org-occur match))) + (org-let lprops '(org-occur org-match))) ((functionp type) - (org-let lprops '(funcall type match))) + (org-let lprops '(funcall type org-match))) ((fboundp type) - (org-let lprops '(funcall type match))) + (org-let lprops '(funcall type org-match))) (t (error "Invalid custom agenda command type %s" type)))) (org-agenda-run-series (nth 1 entry) (cddr entry)))) - ((equal keys "C") + ((equal org-keys "C") (setq org-agenda-custom-commands org-agenda-custom-commands-orig) (customize-variable 'org-agenda-custom-commands)) - ((equal keys "a") (call-interactively 'org-agenda-list)) - ((equal keys "s") (call-interactively 'org-search-view)) - ((equal keys "t") (call-interactively 'org-todo-list)) - ((equal keys "T") (org-call-with-arg 'org-todo-list (or arg '(4)))) - ((equal keys "m") (call-interactively 'org-tags-view)) - ((equal keys "M") (org-call-with-arg 'org-tags-view (or arg '(4)))) - ((equal keys "e") (call-interactively 'org-store-agenda-views)) - ((equal keys "?") (org-tags-view nil "+FLAGGED") + ((equal org-keys "a") (call-interactively 'org-agenda-list)) + ((equal org-keys "s") (call-interactively 'org-search-view)) + ((equal org-keys "S") (org-call-with-arg 'org-search-view (or arg '(4)))) + ((equal org-keys "t") (call-interactively 'org-todo-list)) + ((equal org-keys "T") (org-call-with-arg 'org-todo-list (or arg '(4)))) + ((equal org-keys "m") (call-interactively 'org-tags-view)) + ((equal org-keys "M") (org-call-with-arg 'org-tags-view (or arg '(4)))) + ((equal org-keys "e") (call-interactively 'org-store-agenda-views)) + ((equal org-keys "?") (org-tags-view nil "+FLAGGED") (org-add-hook 'post-command-hook (lambda () @@ -2357,15 +2552,15 @@ (copy-sequence note)) nil 'face 'org-warning))))))) t t)) - ((equal keys "L") - (unless (eq major-mode 'org-mode) + ((equal org-keys "L") + (unless (derived-mode-p 'org-mode) (error "This is not an Org-mode file")) (unless restriction (put 'org-agenda-files 'org-restrict (list bfn)) (org-call-with-arg 'org-timeline arg))) - ((equal keys "#") (call-interactively 'org-agenda-list-stuck-projects)) - ((equal keys "/") (call-interactively 'org-occur-in-agenda-files)) - ((equal keys "!") (customize-variable 'org-stuck-projects)) + ((equal org-keys "#") (call-interactively 'org-agenda-list-stuck-projects)) + ((equal org-keys "/") (call-interactively 'org-occur-in-agenda-files)) + ((equal org-keys "!") (customize-variable 'org-stuck-projects)) (t (error "Invalid agenda key")))))) (defun org-agenda-append-agenda () @@ -2373,11 +2568,13 @@ This function allows interactive building of block agendas. Agenda views are separated by `org-agenda-block-separator'." (interactive) - (unless (string= (buffer-name) org-agenda-buffer-name) + (unless (derived-mode-p 'org-agenda-mode) (error "Can only append from within agenda buffer")) (let ((org-agenda-multi t)) (org-agenda) - (widen))) + (widen) + (org-agenda-finalize) + (org-agenda-fit-window-to-buffer))) (defun org-agenda-normalize-custom-commands (cmds) (delq nil @@ -2393,7 +2590,7 @@ "The user interface for selecting an agenda command." (catch 'exit (let* ((bfn (buffer-file-name (buffer-base-buffer))) - (restrict-ok (and bfn (eq major-mode 'org-mode))) + (restrict-ok (and bfn (derived-mode-p 'org-mode))) (region-p (org-region-active-p)) (custom org-agenda-custom-commands) (selstring "") @@ -2406,15 +2603,15 @@ (erase-buffer) (insert (eval-when-compile (let ((header -" -Press key for an agenda command: < Buffer, subtree/region restriction + "Press key for an agenda command: < Buffer, subtree/region restriction -------------------------------- > Remove restriction a Agenda for current week or day e Export agenda views t List of all TODO entries T Entries with special TODO kwd m Match a TAGS/PROP/TODO query M Like m, but only TODO entries +s Search for keywords S Like s, but only TODO entries L Timeline for current buffer # List stuck projects (!=configure) -s Search for keywords C Configure custom agenda commands -/ Multi-occur ? Find :FLAGGED: entries +/ Multi-occur C Configure custom agenda commands +? Find :FLAGGED: entries * Toggle sticky agenda views ") (start 0)) (while (string-match @@ -2474,13 +2671,12 @@ ((stringp match) (setq match (copy-sequence match)) (org-add-props match nil 'face 'org-warning)) - (match - (format "set of %d commands" (length match))) - (t "")))) + ((listp type) + (format "set of %d commands" (length type)))))) (if (org-string-nw-p match) (add-text-properties 0 (length line) (list 'help-echo - (concat "Matcher: "match)) line))) + (concat "Matcher: " match)) line))) (push line lines))) (setq lines (nreverse lines)) (when prefixes @@ -2497,7 +2693,7 @@ prefixes)) ;; Check if we should display in two columns - (if org-agenda-menu-two-column + (if org-agenda-menu-two-columns (progn (setq n (length lines) n1 (+ (/ n 2) (mod n 2)) @@ -2547,6 +2743,9 @@ nil (cons (substring (car x) 1) (cdr x)))) custom)))) + ((eq c ?*) + (call-interactively 'org-toggle-sticky-agenda) + (sit-for 2)) ((and (not restrict-ok) (memq c '(?1 ?0 ?<))) (message "Restriction is only possible in Org-mode buffers") (ding) (sit-for 1)) @@ -2568,7 +2767,7 @@ ((eq c ?>) (org-agenda-remove-restriction-lock 'noupdate) (setq restriction nil)) - ((and (equal selstring "") (memq c '(?s ?a ?t ?m ?L ?C ?e ?T ?M ?# ?! ?/ ??))) + ((and (equal selstring "") (memq c '(?s ?S ?a ?t ?m ?L ?C ?e ?T ?M ?# ?! ?/ ??))) (throw 'exit (cons (setq selstring (char-to-string c)) restriction))) ((and (> (length selstring) 0) (eq c ?\d)) (delete-window) @@ -2577,55 +2776,72 @@ ((equal c ?q) (error "Abort")) (t (error "Invalid key %c" c)))))))) -(defvar org-agenda-overriding-arguments nil) ; dynamically scoped parameter -(defvar org-agenda-last-arguments nil - "The arguments of the previous call to `org-agenda'.") +(defun org-agenda-fit-window-to-buffer () + "Fit the window to the buffer size." + (and (memq org-agenda-window-setup '(reorganize-frame)) + (fboundp 'fit-window-to-buffer) + (org-fit-window-to-buffer + nil + (floor (* (frame-height) (cdr org-agenda-window-frame-fractions))) + (floor (* (frame-height) (car org-agenda-window-frame-fractions)))))) + +(defvar org-cmd nil) +(defvar org-agenda-overriding-cmd nil) +(defvar org-agenda-overriding-arguments nil) +(defvar org-agenda-overriding-cmd-arguments nil) (defun org-agenda-run-series (name series) - (org-let (nth 1 series) '(org-prepare-agenda name)) + (org-let (nth 1 series) '(org-agenda-prepare name)) + ;; We need to reset agenda markers here, because when constructing a + ;; block agenda, the individual blocks do not do that. + (org-agenda-reset-markers) (let* ((org-agenda-multi t) (redo (list 'org-agenda-run-series name (list 'quote series))) - (org-agenda-overriding-arguments - (or org-agenda-overriding-arguments - (unless (null (delq nil (get 'org-agenda-redo-command 'last-args))) - (get 'org-agenda-redo-command 'last-args)))) (cmds (car series)) (gprops (nth 1 series)) match ;; The byte compiler incorrectly complains about this. Keep it! - cmd type lprops) - (while (setq cmd (pop cmds)) - (setq type (car cmd) match (eval (nth 1 cmd)) lprops (nth 2 cmd)) - (cond - ((eq type 'agenda) - (org-let2 gprops lprops - '(call-interactively 'org-agenda-list))) - ((eq type 'alltodo) - (org-let2 gprops lprops - '(call-interactively 'org-todo-list))) - ((eq type 'search) - (org-let2 gprops lprops - '(org-search-view current-prefix-arg match nil))) - ((eq type 'stuck) - (org-let2 gprops lprops - '(call-interactively 'org-agenda-list-stuck-projects))) - ((eq type 'tags) - (org-let2 gprops lprops - '(org-tags-view current-prefix-arg match))) - ((eq type 'tags-todo) - (org-let2 gprops lprops - '(org-tags-view '(4) match))) - ((eq type 'todo) - (org-let2 gprops lprops - '(org-todo-list match))) - ((fboundp type) - (org-let2 gprops lprops - '(funcall type match))) - (t (error "Invalid type in command series")))) + org-cmd type lprops) + (while (setq org-cmd (pop cmds)) + (setq type (car org-cmd) + match (eval (nth 1 org-cmd)) + lprops (nth 2 org-cmd)) + (let ((org-agenda-overriding-arguments + (if (eq org-agenda-overriding-cmd org-cmd) + (or org-agenda-overriding-arguments + org-agenda-overriding-cmd-arguments)))) + (cond + ((eq type 'agenda) + (org-let2 gprops lprops + '(call-interactively 'org-agenda-list))) + ((eq type 'alltodo) + (org-let2 gprops lprops + '(call-interactively 'org-todo-list))) + ((eq type 'search) + (org-let2 gprops lprops + '(org-search-view current-prefix-arg match nil))) + ((eq type 'stuck) + (org-let2 gprops lprops + '(call-interactively 'org-agenda-list-stuck-projects))) + ((eq type 'tags) + (org-let2 gprops lprops + '(org-tags-view current-prefix-arg match))) + ((eq type 'tags-todo) + (org-let2 gprops lprops + '(org-tags-view '(4) match))) + ((eq type 'todo) + (org-let2 gprops lprops + '(org-todo-list match))) + ((fboundp type) + (org-let2 gprops lprops + '(funcall type match))) + (t (error "Invalid type in command series"))))) (widen) + (let ((inhibit-read-only t)) + (add-text-properties (point-min) (point-max) + `(org-serie t org-serie-redo-cmd ,redo))) (setq org-agenda-redo-command redo) - (put 'org-agenda-redo-command 'last-args org-agenda-last-arguments) (goto-char (point-min))) - (org-fit-agenda-window) - (org-let (nth 1 series) '(org-finalize-agenda))) + (org-agenda-fit-window-to-buffer) + (org-let (nth 1 series) '(org-agenda-finalize))) ;;;###autoload (defmacro org-batch-agenda (cmd-key &rest parameters) @@ -2743,7 +2959,6 @@ (setq res (replace-match ";" t t res))) (org-trim res))) - ;;;###autoload (defun org-store-agenda-views (&rest parameters) (interactive) @@ -2756,11 +2971,18 @@ (pop-up-frames nil) (dir default-directory) (pars (org-make-parameter-alist parameters)) - cmd thiscmdkey files opts cmd-or-set) + cmd thiscmdkey thiscmdcmd match files opts cmd-or-set bufname) (save-window-excursion (while cmds (setq cmd (pop cmds) thiscmdkey (car cmd) + thiscmdcmd (cdr cmd) + match (nth 2 thiscmdcmd) + bufname (if org-agenda-sticky + (or (and (stringp match) + (format "*Org Agenda(%s:%s)*" thiscmdkey match)) + (format "*Org Agenda(%s)*" thiscmdkey)) + org-agenda-buffer-name) cmd-or-set (nth 2 cmd) opts (nth (if (listp cmd-or-set) 3 4) cmd) files (nth (if (listp cmd-or-set) 4 5) cmd)) @@ -2769,15 +2991,17 @@ (org-eval-in-environment (append org-agenda-exporter-settings opts pars) (org-agenda nil thiscmdkey)) - (set-buffer org-agenda-buffer-name) + (set-buffer bufname) (while files (org-eval-in-environment (append org-agenda-exporter-settings opts pars) - (org-agenda-write (expand-file-name (pop files) dir) nil t))) - (and (get-buffer org-agenda-buffer-name) - (kill-buffer org-agenda-buffer-name))))))) + (org-agenda-write (expand-file-name (pop files) dir) nil t bufname))) + (and (get-buffer bufname) + (kill-buffer bufname))))))) (def-edebug-spec org-batch-store-agenda-views (&rest sexp)) +(defvar org-agenda-current-span nil + "The current span used in the agenda view.") ; local variable in the agenda buffer (defun org-agenda-mark-header-line (pos) "Mark the line at POS as an agenda structure header." (save-excursion @@ -2788,9 +3012,9 @@ (put-text-property (point-at-bol) (point-at-eol) 'org-agenda-title-append org-agenda-title-append)))) -(defvar org-mobile-creating-agendas) +(defvar org-mobile-creating-agendas) ; defined in org-mobile.el (defvar org-agenda-write-buffer-name "Agenda View") -(defun org-agenda-write (file &optional open nosettings) +(defun org-agenda-write (file &optional open nosettings agenda-bufname) "Write the current buffer (an agenda view) as a file. Depending on the extension of the file name, plain text (.txt), HTML (.html or .htm) or Postscript (.ps) is produced. @@ -2801,7 +3025,8 @@ If NOSETTINGS is given, do not scope the settings of `org-agenda-exporter-settings' into the export commands. This is used when the settings have already been scoped and we do not wish to overrule other, -higher priority settings." +higher priority settings. +If AGENDA-BUFFER-NAME, use this as the buffer name for the agenda to write." (interactive "FWrite agenda to file: \nP") (if (not (file-writable-p file)) (error "Cannot write agenda to file %s" file)) @@ -2828,9 +3053,7 @@ ((string-match "\\.html?\\'" file) (require 'htmlize) (set-buffer (htmlize-buffer (current-buffer))) - - (when (and org-agenda-export-html-style - (string-match "\n")) "\n" "\n")) @@ -520,14 +519,15 @@ (list node-res note-res)))) (defun org-freemind-write-node (mm-buffer drawers-regexp - num-left-nodes base-level - current-level next-level this-m2 - this-node-end - this-children-visible - next-node-start - next-has-some-visible-child) + num-left-nodes base-level + current-level next-level this-m2 + this-node-end + this-children-visible + next-node-start + next-has-some-visible-child) (let* (this-icons this-bg-color + this-m2-link this-m2-escaped this-rich-node this-rich-note @@ -560,6 +560,10 @@ (add-to-list 'this-icons "full-7")) )))) (setq this-m2 (org-trim this-m2)) + (when (string-match org-bracket-link-analytic-regexp this-m2) + (setq this-m2-link (concat "link=\"" (match-string 1 this-m2) + (match-string 3 this-m2) "\" ") + this-m2 (replace-match "\\5" nil nil this-m2 0))) (setq this-m2-escaped (org-freemind-escape-str-from-org this-m2)) (let ((node-notes (org-freemind-org-text-to-freemind-subnode/note this-m2-escaped @@ -569,7 +573,8 @@ (setq this-rich-node (nth 0 node-notes)) (setq this-rich-note (nth 1 node-notes))) (with-current-buffer mm-buffer - (insert " next-level current-level) (unless (or this-children-visible @@ -784,15 +789,15 @@ ;;; (unless (if node-at-line-last ;;; (>= (point) node-at-line-last) ;;; nil) - ;; Write last node: - (setq this-m2 next-m2) - (setq current-level next-level) - (setq next-node-start (if node-at-line-last - (1+ node-at-line-last) - (point-max))) - (setq num-left-nodes (org-freemind-write-node mm-buffer drawers-regexp num-left-nodes base-level current-level next-level this-m2 this-node-end this-children-visible next-node-start next-has-some-visible-child)) - (with-current-buffer mm-buffer (insert "\n")) - ;) + ;; Write last node: + (setq this-m2 next-m2) + (setq current-level next-level) + (setq next-node-start (if node-at-line-last + (1+ node-at-line-last) + (point-max))) + (setq num-left-nodes (org-freemind-write-node mm-buffer drawers-regexp num-left-nodes base-level current-level next-level this-m2 this-node-end this-children-visible next-node-start next-has-some-visible-child)) + (with-current-buffer mm-buffer (insert "\n")) + ;) ) (with-current-buffer mm-buffer (while (> current-level base-level) @@ -1032,7 +1037,7 @@ (let* ((child-attr-list (cadr child)) (step-attr-copy (copy-sequence step-attr-list))) (dolist (child-attr child-attr-list) - ;; Compare attr names: + ;; Compare attr names: (when (org-freemind-symbols= (caar step-attr-copy) (car child-attr)) ;; Compare values: (let ((step-val (cdar step-attr-copy)) @@ -1066,12 +1071,12 @@ (defun org-freemind-test-get-tree-text () (let ((node '(p nil "\n" - (a - ((href . "link")) - "text") - "\n" - (b nil "hej") - "\n"))) + (a + ((href . "link")) + "text") + "\n" + (b nil "hej") + "\n"))) (org-freemind-get-tree-text node))) ;; (org-freemind-test-get-tree-text) @@ -1085,11 +1090,9 @@ ;;(a (setq is-link t) ) ((h1 h2 h3 h4 h5 h6 p) ;;(setq ntxt (concat "\n" ntxt)) - (setq lf-after 2) - ) + (setq lf-after 2)) (br - (setq lf-after 1) - ) + (setq lf-after 1)) (t (cond ((stringp n) @@ -1106,8 +1109,7 @@ (let ((att (car att-val)) (val (cdr att-val))) (when (eq att 'href) - (setq link val))))) - ))))) + (setq link val)))))))))) (if lf-after (setq ntxt (concat ntxt (make-string lf-after ?\n))) (setq ntxt (concat ntxt " "))) @@ -1184,7 +1186,7 @@ (org-freemind-node-to-org child (1+ level) skip-levels))))) ;; Fix-me: put back special things, like drawers that are stored in -;; the notes. Should maybe all notes contents be put in drawers? +;; the notes. Should maybe all notes contents be put in drawers? ;;;###autoload (defun org-freemind-to-org-mode (mm-file org-file) "Convert FreeMind file MM-FILE to `org-mode' file ORG-FILE." === modified file 'lisp/org/org-gnus.el' --- lisp/org/org-gnus.el 2012-04-03 12:02:21 +0000 +++ lisp/org/org-gnus.el 2012-09-30 15:14:59 +0000 @@ -32,6 +32,7 @@ ;;; Code: (require 'org) +(require 'gnus-util) (eval-when-compile (require 'gnus-sum)) ;; Declare external functions and variables @@ -100,11 +101,11 @@ (if (and (string-match "^nntp" group) ;; Only for nntp groups (org-xor current-prefix-arg org-gnus-prefer-web-links)) - (org-make-link (if (string-match "gmane" unprefixed-group) - "http://news.gmane.org/" - "http://groups.google.com/group/") - unprefixed-group) - (org-make-link "gnus:" group)))) + (concat (if (string-match "gmane" unprefixed-group) + "http://news.gmane.org/" + "http://groups.google.com/group/") + unprefixed-group) + (concat "gnus:" group)))) (defun org-gnus-article-link (group newsgroups message-id x-no-archive) "Create a link to a Gnus article. @@ -125,7 +126,7 @@ "http://mid.gmane.org/%s" "http://groups.google.com/groups/search?as_umsgid=%s") (org-fixup-message-id-for-http message-id)) - (org-make-link "gnus:" group "#" message-id))) + (concat "gnus:" group "#" message-id))) (defun org-gnus-store-link () "Store a link to a Gnus folder or message." @@ -206,7 +207,7 @@ desc link newsgroup xarchive) ; those are always nil for gcc (and (not gcc) - (error "Can not create link: No Gcc header found.")) + (error "Can not create link: No Gcc header found")) (org-store-link-props :type "gnus" :from from :subject subject :message-id id :group gcc :to to) (setq desc (org-email-link-description) @@ -233,9 +234,9 @@ (setq group (match-string 1 path) article (match-string 3 path)) (when group - (setq group (org-substring-no-properties group))) + (setq group (org-no-properties group))) (when article - (setq article (org-substring-no-properties article))) + (setq article (org-no-properties article))) (org-gnus-follow-link group article))) (defun org-gnus-follow-link (&optional group article) @@ -244,9 +245,9 @@ (funcall (cdr (assq 'gnus org-link-frame-setup))) (if gnus-other-frame-object (select-frame gnus-other-frame-object)) (when group - (setq group (org-substring-no-properties group))) + (setq group (org-no-properties group))) (when article - (setq article (org-substring-no-properties article))) + (setq article (org-no-properties article))) (cond ((and group article) (gnus-activate-group group) (condition-case nil @@ -272,7 +273,7 @@ ;; stop on integer overflows (> articles 0)) (setq group-opened (gnus-group-read-group - articles nil group) + articles t group) articles (if (< articles 16) (1+ articles) (* articles 2)))) === modified file 'lisp/org/org-habit.el' --- lisp/org/org-habit.el 2012-04-03 12:02:21 +0000 +++ lisp/org/org-habit.el 2012-09-30 15:14:59 +0000 @@ -67,6 +67,12 @@ :group 'org-habit :type 'boolean) +(defcustom org-habit-show-all-today nil + "If non-nil, will show the consistency graph of all habits on +today's agenda, even if they are not scheduled." + :group 'org-habit + :type 'boolean) + (defcustom org-habit-today-glyph ?! "Glyph character used to identify today." :group 'org-habit === modified file 'lisp/org/org-html.el' --- lisp/org/org-html.el 2012-04-03 12:02:21 +0000 +++ lisp/org/org-html.el 2012-09-30 15:14:59 +0000 @@ -98,8 +98,32 @@ :group 'org-export-html :type 'boolean) -(defconst org-export-html-scripts -"" -"Basic JavaScript that is needed by HTML files produced by Org-mode.") + "Basic JavaScript that is needed by HTML files produced by Org-mode.") (defconst org-export-html-style-default -"