Now on revision 111692. 1 tag(s) updated. ------------------------------------------------------------ revno: 111692 fixes bug: http://debbugs.gnu.org/13602 author: Jambunathan K committer: Juri Linkov branch nick: trunk timestamp: Fri 2013-02-08 09:53:55 +0200 message: * lisp/icomplete.el (icomplete-forward-completions) (icomplete-backward-completions): Handle corner case. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-02-07 08:50:04 +0000 +++ lisp/ChangeLog 2013-02-08 07:53:55 +0000 @@ -1,3 +1,8 @@ +2013-02-08 Jambunathan K + + * icomplete.el (icomplete-forward-completions) + (icomplete-backward-completions): Handle corner case (bug#13602). + 2013-02-07 Michael Albinus * vc/vc-hooks.el (vc-find-file-hook): `buffer-file-truename' can === modified file 'lisp/icomplete.el' --- lisp/icomplete.el 2013-01-04 08:20:49 +0000 +++ lisp/icomplete.el 2013-02-08 07:53:55 +0000 @@ -167,8 +167,9 @@ (interactive) (let* ((comps (completion-all-sorted-completions)) (last (last comps))) - (setcdr last (cons (car comps) (cdr last))) - (completion--cache-all-sorted-completions (cdr comps)))) + (when comps + (setcdr last (cons (car comps) (cdr last))) + (completion--cache-all-sorted-completions (cdr comps))))) (defun icomplete-backward-completions () "Step backward completions by one entry. @@ -178,7 +179,7 @@ (let* ((comps (completion-all-sorted-completions)) (last-but-one (last comps 2)) (last (cdr last-but-one))) - (when last + (when (consp last) ; At least two elements in comps (setcdr last-but-one (cdr last)) (push (car last) comps) (completion--cache-all-sorted-completions comps)))) ------------------------------------------------------------ revno: 111691 committer: Dmitry Antipov branch nick: trunk timestamp: Fri 2013-02-08 09:28:52 +0400 message: * lisp.h (make_uninit_vector): New function. * alloc.c (Fvector, Fmake_byte_code): * ccl.c (Fregister_ccl_program): * charset.c (Fdefine_charset_internal, define_charset_internal): * coding.c (make_subsidiaries, Fdefine_coding_system_internal): * composite.c (syms_of_composite): * font.c (Fquery_font, Ffont_info, syms_of_font): * fontset.c (FONT_DEF_NEW, Fset_fontset_font): * ftfont.c (ftfont_shape_by_flt): * indent.c (recompute_width_table): * nsselect.m (clean_local_selection_data): * syntax.c (init_syntax_once): * w32unsubscribe.c (uniscribe_shape): * window.c (Fcurrent_window_configuration): * xfaces.c (Fx_family_fonts): * xselect.c (selection_data_to_lisp_data): Use it. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-02-07 16:09:04 +0000 +++ src/ChangeLog 2013-02-08 05:28:52 +0000 @@ -1,3 +1,22 @@ +2013-02-08 Dmitry Antipov + + * lisp.h (make_uninit_vector): New function. + * alloc.c (Fvector, Fmake_byte_code): + * ccl.c (Fregister_ccl_program): + * charset.c (Fdefine_charset_internal, define_charset_internal): + * coding.c (make_subsidiaries, Fdefine_coding_system_internal): + * composite.c (syms_of_composite): + * font.c (Fquery_font, Ffont_info, syms_of_font): + * fontset.c (FONT_DEF_NEW, Fset_fontset_font): + * ftfont.c (ftfont_shape_by_flt): + * indent.c (recompute_width_table): + * nsselect.m (clean_local_selection_data): + * syntax.c (init_syntax_once): + * w32unsubscribe.c (uniscribe_shape): + * window.c (Fcurrent_window_configuration): + * xfaces.c (Fx_family_fonts): + * xselect.c (selection_data_to_lisp_data): Use it. + 2013-02-07 Dmitry Antipov * coding.c (Fdefine_coding_system_internal): Use AREF where === modified file 'src/alloc.c' --- src/alloc.c 2013-01-23 20:07:28 +0000 +++ src/alloc.c 2013-02-08 05:28:52 +0000 @@ -3105,13 +3105,10 @@ usage: (vector &rest OBJECTS) */) (ptrdiff_t nargs, Lisp_Object *args) { - register Lisp_Object len, val; ptrdiff_t i; - register struct Lisp_Vector *p; + register Lisp_Object val = make_uninit_vector (nargs); + register struct Lisp_Vector *p = XVECTOR (val); - XSETFASTINT (len, nargs); - val = Fmake_vector (len, Qnil); - p = XVECTOR (val); for (i = 0; i < nargs; i++) p->contents[i] = args[i]; return val; @@ -3149,9 +3146,9 @@ usage: (make-byte-code ARGLIST BYTE-CODE CONSTANTS DEPTH &optional DOCSTRING INTERACTIVE-SPEC &rest ELEMENTS) */) (ptrdiff_t nargs, Lisp_Object *args) { - register Lisp_Object len, val; ptrdiff_t i; - register struct Lisp_Vector *p; + register Lisp_Object val = make_uninit_vector (nargs); + register struct Lisp_Vector *p = XVECTOR (val); /* We used to purecopy everything here, if purify-flag was set. This worked OK for Emacs-23, but with Emacs-24's lexical binding code, it can be @@ -3161,10 +3158,6 @@ just wasteful and other times plainly wrong (e.g. those free vars may want to be setcar'd). */ - XSETFASTINT (len, nargs); - val = Fmake_vector (len, Qnil); - - p = XVECTOR (val); for (i = 0; i < nargs; i++) p->contents[i] = args[i]; make_byte_code (p); === modified file 'src/ccl.c' --- src/ccl.c 2013-01-01 09:11:05 +0000 +++ src/ccl.c 2013-02-08 05:28:52 +0000 @@ -2228,9 +2228,8 @@ Vccl_program_table = larger_vector (Vccl_program_table, 1, -1); { - Lisp_Object elt; + Lisp_Object elt = make_uninit_vector (4); - elt = Fmake_vector (make_number (4), Qnil); ASET (elt, 0, name); ASET (elt, 1, ccl_prog); ASET (elt, 2, resolved); === modified file 'src/charset.c' --- src/charset.c 2013-01-02 16:13:04 +0000 +++ src/charset.c 2013-02-08 05:28:52 +0000 @@ -1053,7 +1053,7 @@ CHECK_NATNUM (parent_max_code); parent_code_offset = Fnth (make_number (3), val); CHECK_NUMBER (parent_code_offset); - val = Fmake_vector (make_number (4), Qnil); + val = make_uninit_vector (4); ASET (val, 0, make_number (parent_charset->id)); ASET (val, 1, parent_min_code); ASET (val, 2, parent_max_code); @@ -1259,7 +1259,7 @@ args[charset_arg_name] = name; args[charset_arg_dimension] = make_number (dimension); - val = Fmake_vector (make_number (8), make_number (0)); + val = make_uninit_vector (8); for (i = 0; i < 8; i++) ASET (val, i, make_number (code_space[i])); args[charset_arg_code_space] = val; === modified file 'src/coding.c' --- src/coding.c 2013-02-07 16:09:04 +0000 +++ src/coding.c 2013-02-08 05:28:52 +0000 @@ -9483,7 +9483,7 @@ int i; memcpy (buf, SDATA (SYMBOL_NAME (base)), base_name_len); - subsidiaries = Fmake_vector (make_number (3), Qnil); + subsidiaries = make_uninit_vector (3); for (i = 0; i < 3; i++) { strcpy (buf + base_name_len, suffixes[i]); @@ -9988,7 +9988,8 @@ this_name = AREF (eol_type, i); this_aliases = Fcons (this_name, Qnil); this_eol_type = (i == 0 ? Qunix : i == 1 ? Qdos : Qmac); - this_spec = Fmake_vector (make_number (3), attrs); + this_spec = make_uninit_vector (3); + ASET (this_spec, 0, attrs); ASET (this_spec, 1, this_aliases); ASET (this_spec, 2, this_eol_type); Fputhash (this_name, this_spec, Vcoding_system_hash_table); @@ -10001,7 +10002,8 @@ } } - spec_vec = Fmake_vector (make_number (3), attrs); + spec_vec = make_uninit_vector (3); + ASET (spec_vec, 0, attrs); ASET (spec_vec, 1, aliases); ASET (spec_vec, 2, eol_type); === modified file 'src/composite.c' --- src/composite.c 2013-01-02 16:13:04 +0000 +++ src/composite.c 2013-02-08 05:28:52 +0000 @@ -1958,7 +1958,7 @@ } staticpro (&gstring_work_headers); - gstring_work_headers = Fmake_vector (make_number (8), Qnil); + gstring_work_headers = make_uninit_vector (8); for (i = 0; i < 8; i++) ASET (gstring_work_headers, i, Fmake_vector (make_number (i + 2), Qnil)); staticpro (&gstring_work); === modified file 'src/font.c' --- src/font.c 2013-01-25 06:31:41 +0000 +++ src/font.c 2013-02-08 05:28:52 +0000 @@ -4603,7 +4603,7 @@ CHECK_FONT_GET_OBJECT (font_object, font); - val = Fmake_vector (make_number (9), Qnil); + val = make_uninit_vector (9); ASET (val, 0, AREF (font_object, FONT_NAME_INDEX)); ASET (val, 1, AREF (font_object, FONT_FILE_INDEX)); ASET (val, 2, make_number (font->pixel_size)); @@ -4614,6 +4614,8 @@ ASET (val, 7, make_number (font->average_width)); if (font->driver->otf_capability) ASET (val, 8, Fcons (Qopentype, font->driver->otf_capability (font))); + else + ASET (val, 8, Qnil); return val; } @@ -4870,7 +4872,7 @@ return Qnil; font = XFONT_OBJECT (font_object); - info = Fmake_vector (make_number (7), Qnil); + info = make_uninit_vector (7); ASET (info, 0, AREF (font_object, FONT_NAME_INDEX)); ASET (info, 1, AREF (font_object, FONT_FULLNAME_INDEX)); ASET (info, 2, make_number (font->pixel_size)); @@ -5163,7 +5165,7 @@ XSYMBOL (intern_c_string ("font-width-table"))->constant = 1; staticpro (&font_style_table); - font_style_table = Fmake_vector (make_number (3), Qnil); + font_style_table = make_uninit_vector (3); ASET (font_style_table, 0, Vfont_weight_table); ASET (font_style_table, 1, Vfont_slant_table); ASET (font_style_table, 2, Vfont_width_table); === modified file 'src/fontset.c' --- src/fontset.c 2013-01-02 16:13:04 +0000 +++ src/fontset.c 2013-02-08 05:28:52 +0000 @@ -271,7 +271,8 @@ /* Macros for FONT-DEF and RFONT-DEF of fontset. */ #define FONT_DEF_NEW(font_def, font_spec, encoding, repertory) \ do { \ - (font_def) = Fmake_vector (make_number (3), (font_spec)); \ + (font_def) = make_uninit_vector (3); \ + ASET ((font_def), 0, font_spec); \ ASET ((font_def), 1, encoding); \ ASET ((font_def), 2, repertory); \ } while (0) @@ -1591,7 +1592,7 @@ { Lisp_Object arg; - arg = Fmake_vector (make_number (5), Qnil); + arg = make_uninit_vector (5); ASET (arg, 0, fontset); ASET (arg, 1, font_def); ASET (arg, 2, add); === modified file 'src/ftfont.c' --- src/ftfont.c 2013-01-17 06:29:40 +0000 +++ src/ftfont.c 2013-02-08 05:28:52 +0000 @@ -2555,9 +2555,8 @@ LGLYPH_SET_DESCENT (lglyph, g->descent >> 6); if (g->adjusted) { - Lisp_Object vec; + Lisp_Object vec = make_uninit_vector (3); - vec = Fmake_vector (make_number (3), Qnil); ASET (vec, 0, make_number (g->xoff >> 6)); ASET (vec, 1, make_number (g->yoff >> 6)); ASET (vec, 2, make_number (g->xadv >> 6)); === modified file 'src/indent.c' --- src/indent.c 2013-01-12 06:15:12 +0000 +++ src/indent.c 2013-02-08 05:28:52 +0000 @@ -138,7 +138,7 @@ struct Lisp_Vector *widthtab; if (!VECTORP (BVAR (buf, width_table))) - bset_width_table (buf, Fmake_vector (make_number (256), make_number (0))); + bset_width_table (buf, make_uninit_vector (256)); widthtab = XVECTOR (BVAR (buf, width_table)); eassert (widthtab->header.size == 256); === modified file 'src/lisp.h' --- src/lisp.h 2013-02-01 06:30:51 +0000 +++ src/lisp.h 2013-02-08 05:28:52 +0000 @@ -3043,6 +3043,27 @@ extern Lisp_Object Qautomatic_gc; extern Lisp_Object Qchar_table_extra_slots; extern struct Lisp_Vector *allocate_vector (EMACS_INT); + +/* Make an unitialized vector for SIZE objects. NOTE: you must + be sure that GC cannot happen until the vector is completely + initialized. E.g. the following code is likely to crash: + + v = make_uninit_vector (3); + ASET (v, 0, obj0); + ASET (v, 1, Ffunction_can_gc ()); + ASET (v, 2, obj1); */ + +LISP_INLINE Lisp_Object +make_uninit_vector (ptrdiff_t size) +{ + Lisp_Object v; + struct Lisp_Vector *p; + + p = allocate_vector (size); + XSETVECTOR (v, p); + return v; +} + extern struct Lisp_Vector *allocate_pseudovector (int, int, enum pvec_type); #define ALLOCATE_PSEUDOVECTOR(typ,field,tag) \ ((typ*) \ === modified file 'src/nsselect.m' --- src/nsselect.m 2013-01-01 09:11:05 +0000 +++ src/nsselect.m 2013-02-08 05:28:52 +0000 @@ -117,7 +117,7 @@ if (size == 1) return clean_local_selection_data (AREF (obj, 0)); - copy = Fmake_vector (make_number (size), Qnil); + copy = make_uninit_vector (size); for (i = 0; i < size; i++) ASET (copy, i, clean_local_selection_data (AREF (obj, i))); return copy; === modified file 'src/syntax.c' --- src/syntax.c 2013-01-01 09:11:05 +0000 +++ src/syntax.c 2013-02-08 05:28:52 +0000 @@ -3389,8 +3389,8 @@ Qchar_table_extra_slots = intern_c_string ("char-table-extra-slots"); /* Create objects which can be shared among syntax tables. */ - Vsyntax_code_object = Fmake_vector (make_number (Smax), Qnil); - for (i = 0; i < ASIZE (Vsyntax_code_object); i++) + Vsyntax_code_object = make_uninit_vector (Smax); + for (i = 0; i < Smax; i++) ASET (Vsyntax_code_object, i, Fcons (make_number (i), Qnil)); /* Now we are ready to set up this property, so we can === modified file 'src/w32uniscribe.c' --- src/w32uniscribe.c 2013-01-01 09:11:05 +0000 +++ src/w32uniscribe.c 2013-02-08 05:28:52 +0000 @@ -435,8 +435,8 @@ are zero. */ || (!attributes[j].fClusterStart && items[i].a.fRTL)) { - Lisp_Object vec; - vec = Fmake_vector (make_number (3), Qnil); + Lisp_Object vec = make_uninit_vector (3); + if (items[i].a.fRTL) { /* Empirically, it looks like Uniscribe === modified file 'src/window.c' --- src/window.c 2013-02-01 07:23:18 +0000 +++ src/window.c 2013-02-08 05:28:52 +0000 @@ -6190,11 +6190,11 @@ data->minibuf_selected_window = minibuf_level > 0 ? minibuf_selected_window : Qnil; data->root_window = FRAME_ROOT_WINDOW (f); data->focus_frame = FRAME_FOCUS_FRAME (f); - tem = Fmake_vector (make_number (n_windows), Qnil); + tem = make_uninit_vector (n_windows); data->saved_windows = tem; for (i = 0; i < n_windows; i++) ASET (tem, i, - Fmake_vector (make_number (VECSIZE (struct saved_window)), Qnil)); + Fmake_vector (make_number (VECSIZE (struct saved_window)), Qnil)); save_window_save (FRAME_ROOT_WINDOW (f), XVECTOR (tem), 0); XSETWINDOW_CONFIGURATION (tem, data); return (tem); === modified file 'src/xfaces.c' --- src/xfaces.c 2013-01-08 23:50:40 +0000 +++ src/xfaces.c 2013-02-08 05:28:52 +0000 @@ -1585,7 +1585,7 @@ for (i = nfonts - 1; i >= 0; --i) { Lisp_Object font = AREF (vec, i); - Lisp_Object v = Fmake_vector (make_number (8), Qnil); + Lisp_Object v = make_uninit_vector (8); int point; Lisp_Object spacing; === modified file 'src/xselect.c' --- src/xselect.c 2013-02-07 16:09:04 +0000 +++ src/xselect.c 2013-02-08 05:28:52 +0000 @@ -1670,8 +1670,8 @@ return x_atom_to_symbol (display, (Atom) idata[0]); else { - Lisp_Object v = Fmake_vector (make_number (size / sizeof (int)), - make_number (0)); + Lisp_Object v = make_uninit_vector (size / sizeof (int)); + for (i = 0; i < size / sizeof (int); i++) ASET (v, i, x_atom_to_symbol (display, (Atom) idata[i])); return v; @@ -1693,8 +1693,8 @@ else if (format == 16) { ptrdiff_t i; - Lisp_Object v; - v = Fmake_vector (make_number (size / 2), make_number (0)); + Lisp_Object v = make_uninit_vector (size / 2); + for (i = 0; i < size / 2; i++) { short j = ((short *) data) [i]; @@ -1705,8 +1705,8 @@ else { ptrdiff_t i; - Lisp_Object v = Fmake_vector (make_number (size / X_LONG_SIZE), - make_number (0)); + Lisp_Object v = make_uninit_vector (size / X_LONG_SIZE); + for (i = 0; i < size / X_LONG_SIZE; i++) { int j = ((int *) data) [i]; ------------------------------------------------------------ revno: 111690 committer: Dmitry Antipov branch nick: trunk timestamp: Thu 2013-02-07 20:09:04 +0400 message: * coding.c (Fdefine_coding_system_internal): Use AREF where argument is known to be a vector. * fns.c (Flocale_info): Likewise for ASET. * xselect.c (selection_data_to_lisp_data): Likewise for ASET. * w32fns.c (w32_parse_hot_key): Likewise for ASIZE and AREF. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-02-07 06:23:54 +0000 +++ src/ChangeLog 2013-02-07 16:09:04 +0000 @@ -1,3 +1,11 @@ +2013-02-07 Dmitry Antipov + + * coding.c (Fdefine_coding_system_internal): Use AREF where + argument is known to be a vector. + * fns.c (Flocale_info): Likewise for ASET. + * xselect.c (selection_data_to_lisp_data): Likewise for ASET. + * w32fns.c (w32_parse_hot_key): Likewise for ASIZE and AREF. + 2013-02-05 Jan Djärv * nsmenu.m (update_frame_tool_bar): Check for negative tool bar === modified file 'src/coding.c' --- src/coding.c 2013-01-25 04:41:39 +0000 +++ src/coding.c 2013-02-07 16:09:04 +0000 @@ -9783,7 +9783,7 @@ CHECK_VECTOR (initial); for (i = 0; i < 4; i++) { - val = Faref (initial, make_number (i)); + val = AREF (initial, i); if (! NILP (val)) { struct charset *charset; === modified file 'src/fns.c' --- src/fns.c 2013-01-23 20:07:28 +0000 +++ src/fns.c 2013-02-07 16:09:04 +0000 @@ -2807,9 +2807,8 @@ val = build_unibyte_string (str); /* Fixme: Is this coding system necessarily right, even if it is consistent with CODESET? If not, what to do? */ - Faset (v, make_number (i), - code_convert_string_norecord (val, Vlocale_coding_system, - 0)); + ASET (v, i, code_convert_string_norecord (val, Vlocale_coding_system, + 0)); } UNGCPRO; return v; @@ -2829,8 +2828,8 @@ { str = nl_langinfo (months[i]); val = build_unibyte_string (str); - Faset (v, make_number (i), - code_convert_string_norecord (val, Vlocale_coding_system, 0)); + ASET (v, i, code_convert_string_norecord (val, Vlocale_coding_system, + 0)); } UNGCPRO; return v; === modified file 'src/w32fns.c' --- src/w32fns.c 2013-02-02 17:14:24 +0000 +++ src/w32fns.c 2013-02-07 16:09:04 +0000 @@ -6484,12 +6484,12 @@ CHECK_VECTOR (key); - if (XFASTINT (Flength (key)) != 1) + if (ASIZE (key) != 1) return Qnil; GCPRO1 (key); - c = Faref (key, make_number (0)); + c = AREF (key, 0); if (CONSP (c) && lucid_event_type_list_p (c)) c = Fevent_convert_list (c); === modified file 'src/xselect.c' --- src/xselect.c 2013-01-17 06:29:40 +0000 +++ src/xselect.c 2013-02-07 16:09:04 +0000 @@ -1673,8 +1673,7 @@ Lisp_Object v = Fmake_vector (make_number (size / sizeof (int)), make_number (0)); for (i = 0; i < size / sizeof (int); i++) - Faset (v, make_number (i), - x_atom_to_symbol (display, (Atom) idata[i])); + ASET (v, i, x_atom_to_symbol (display, (Atom) idata[i])); return v; } } @@ -1699,7 +1698,7 @@ for (i = 0; i < size / 2; i++) { short j = ((short *) data) [i]; - Faset (v, make_number (i), make_number (j)); + ASET (v, i, make_number (j)); } return v; } @@ -1711,7 +1710,7 @@ for (i = 0; i < size / X_LONG_SIZE; i++) { int j = ((int *) data) [i]; - Faset (v, make_number (i), INTEGER_TO_CONS (j)); + ASET (v, i, INTEGER_TO_CONS (j)); } return v; } ------------------------------------------------------------ revno: 111689 committer: Michael Albinus + + * vc/vc-hooks.el (vc-find-file-hook): `buffer-file-truename' can + be nil. Handle this. (Bug#13636) + 2013-02-07 Richard Stallman * mail/rmail.el (rmail-variables): Specify `no-conversion' for === modified file 'lisp/vc/vc-hooks.el' --- lisp/vc/vc-hooks.el 2013-02-06 08:27:41 +0000 +++ lisp/vc/vc-hooks.el 2013-02-07 08:50:04 +0000 @@ -858,8 +858,10 @@ (set (make-local-variable 'backup-inhibited) t)) ;; Let the backend setup any buffer-local things he needs. (vc-call-backend backend 'find-file-hook)) - ((let* ((truename (expand-file-name buffer-file-truename)) - (link-type (and (not (equal buffer-file-name truename)) + ((let* ((truename (and buffer-file-truename + (expand-file-name buffer-file-truename))) + (link-type (and truename + (not (equal buffer-file-name truename)) (vc-backend truename)))) (cond ((not link-type) nil) ;Nothing to do. ((eq vc-follow-symlinks nil) ------------------------------------------------------------ revno: 111688 [merge] committer: Glenn Morris branch nick: trunk timestamp: Thu 2013-02-07 00:31:21 -0800 message: Merge from emacs-24; up to r111231 diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2013-02-07 06:23:54 +0000 +++ doc/misc/ChangeLog 2013-02-07 08:31:21 +0000 @@ -1,3 +1,10 @@ +2013-02-07 Bastien Guerry + + * org.texi (References): Clarify an example. + (Installation): Fix instructions. + (Org-Plot): Fix link. + (Checkboxes, Radio lists): Fix typos. + 2013-02-07 Glenn Morris * cl.texi (Equality Predicates): Mention memql. === modified file 'doc/misc/org.texi' --- doc/misc/org.texi 2013-01-13 20:03:01 +0000 +++ doc/misc/org.texi 2013-02-07 08:31:21 +0000 @@ -2,7 +2,7 @@ @c %**start of header @setfilename ../../info/org @settitle The Org Manual -@set VERSION 7.9.3d (GNU Emacs 24.3) +@set VERSION 7.9.3e (GNU Emacs 24.3) @c Use proper quote and backtick for code sections in PDF output @c Cf. Texinfo manual 14.2 @@ -903,17 +903,20 @@ $ make autoloads @end example -Note that @code{make autoloads} is mandatory: it defines Org's version and -Org's autoloaded functions, respectively in @file{org-version.el} and in +Note that in this case, @code{make autoloads} is mandatory: it defines Org's +version in @file{org-version.el} and Org's autoloads in @file{org-loaddefs.el}. Remember to add the correct load-path as described in the method above. -You can also compile and install Org from this git repository: check -@code{make help} to get the list of compilation/installation options. +You can also compile with @code{make}, generate the documentation with +@code{make doc}, create a local configuration with @code{make config} and +install Org with @code{make install}. Please run @code{make help} to get +the list of compilation/installation options. For more detailed explanations on Org's build system, please check the Org -Build System page on @uref{http://orgmode.org/worg/dev/org-build-system.html, Worg}. +Build System page on @uref{http://orgmode.org/worg/dev/org-build-system.html, +Worg}. @node Activation, Feedback, Installation, Introduction @section Activation @@ -2444,7 +2447,7 @@ $P..$Q @r{range, using column names (see under Advanced)} $<<<..$>> @r{start in third column, continue to the one but last} @@2$1..@@4$3 @r{6 fields between these two fields (same as @code{A2..C4})} -@@-1$-2..@@-1 @r{3 numbers from the column to the left, 2 up to current row} +@@-1$-2..@@-1 @r{in the first row up, 3 fields from 2 columns on the left} @@I..II @r{between first and second hline, short for @code{@@I..@@II}} @end example @@ -3023,9 +3026,9 @@ Org-Plot can produce 2D and 3D graphs of information stored in org tables using @file{Gnuplot} @uref{http://www.gnuplot.info/} and @file{gnuplot-mode} -@uref{http://cars9.uchicago.edu/~ravel/software/gnuplot-mode.html}. To see -this in action, ensure that you have both Gnuplot and Gnuplot mode installed -on your system, then call @code{org-plot/gnuplot} on the following table. +@uref{http://xafs.org/BruceRavel/GnuplotMode}. To see this in action, ensure +that you have both Gnuplot and Gnuplot mode installed on your system, then +call @code{org-plot/gnuplot} on the following table. @example @group @@ -4486,7 +4489,7 @@ @orgcmd{C-c C-c,org-toggle-checkbox} Toggle checkbox status or (with prefix arg) checkbox presence at point. With a single prefix argument, add an empty checkbox or remove the current -one@footnote{`C-u C-c C-c' on the @emph{first} item of a list with no checkbox +one@footnote{@kbd{C-u C-c C-c} on the @emph{first} item of a list with no checkbox will add checkboxes to the rest of the list.}. With a double prefix argument, set it to @samp{[-]}, which is considered to be an intermediate state. @orgcmd{C-c C-x C-b,org-toggle-checkbox} @@ -15987,7 +15990,7 @@ \end@{comment@} @end example -Pressing `C-c C-c' on @code{a new house} and will insert the converted +Pressing @kbd{C-c C-c} on @code{a new house} and will insert the converted @LaTeX{} list between the two marker lines. @node Dynamic blocks, Special agenda views, Tables in arbitrary syntax, Hacking === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-02-07 08:04:05 +0000 +++ lisp/ChangeLog 2013-02-07 08:31:21 +0000 @@ -12189,7 +12189,7 @@ * server.el (server--on-display-p): New function. (server--on-display-p): Use it. -2012-04-04 Gabor Vida (tiny change) +2012-04-04 Gábor Vida (tiny change) * ido.el (ido-wide-find-dirs-or-files): Use file-name-absolute-p (bug#11145). === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2013-02-07 06:23:54 +0000 +++ lisp/gnus/ChangeLog 2013-02-07 08:31:21 +0000 @@ -1454,7 +1454,7 @@ (nnimap-request-move-article): Delete the message from the correct IMAP server. -2012-02-19 Vida Gábor (tiny change) +2012-02-19 Gábor Vida (tiny change) * gnus-demon.el (gnus-demon-init): Don't multiply time twice. Reported by Peter Münster. @@ -1664,7 +1664,7 @@ * shr.el (shr-browse-url): Fix the name of the `browse-url-mail' function call. -2012-01-27 Vida Gábor (tiny change) +2012-01-27 Gábor Vida (tiny change) * gnus-demon.el (gnus-demon-run-callback, gnus-demon-init): Convert to seconds, and make the repeat clause with HH:MM specs work as === modified file 'lisp/org/ChangeLog' --- lisp/org/ChangeLog 2013-01-13 20:03:01 +0000 +++ lisp/org/ChangeLog 2013-02-07 08:31:21 +0000 @@ -1,3 +1,120 @@ +2013-02-07 Bastien Guerry + + * org-agenda.el (org-agenda-get-deadlines) + (org-agenda-get-scheduled): Fix bug: use text properties for the + headline text since we rely on properties to get e.g. the effort. + + * org-exp.el (org-export-normalize-links): Don't match links + within tags. + + * org-html.el (org-export-html-preamble-format) + (org-export-html-postamble-format): Mention that + org-export-html-preamble/postamble need to be `t' in order for + these variables to have any effect. + + * org-html.el (org-html-handle-links): When the link description + is an image and the attribute is "width", pass the attribute to + the tag. + + * org.el (org-mode): Always honor `org-startup-indented', even + when `org-inhibit-startup' is non-nil. + + * org-indent.el (org-indent-mode): Don't check + `org-inhibit-startup'. + + * org.el (org-fontify-meta-lines-and-blocks-1): Don't try to add + text properties outside of the buffer. + + * org.el (org-agenda-inhibit-startup): Rename from + `org-agenda-inhibit-startup-visibility-cycling'. + (org-agenda-prepare-buffers): Bind `org-inhibit-startup' to + `org-agenda-inhibit-startup'. + + * org.el (org-mode): Don't initialize `org-beamer-mode' when + `org-inhibit-startup' is non-nil. + + * org-footnote.el (org-footnote-create-definition): Prevent + `electric-indent-mode' from inserting the definition at the wrong + place. + + * org-agenda.el (org-agenda-no-heading-message): Delete. + (org-agenda-get-timestamps, org-agenda-get-progress) + (org-agenda-get-deadlines, org-agenda-get-scheduled) + (org-agenda-get-blocks): Don't use + `org-agenda-no-heading-message', skip the entry. + + * org.el (org-agenda-inhibit-startup-visibility-cycling): New + option. + (org-agenda-prepare-buffers): Use it to speed up the agenda + generation. + + * org-agenda.el (org-agenda-skip): Fix bug by correctly skipping + commented scheduled/deadline lines. + + * org-clock.el (org-clock-in): Fix bug when fetching the effort + value. + + * ob-python.el (org-babel-python-command): Fix docstring. + (org-babel-python-initiate-session-by-key): Fix bug: `run-python' + from Emacs >24.1 requires a python command as an argument. + + * org-element.el (org-element-at-point): Fix typo in docstring. + + * org-agenda.el (org-agenda-get-deadlines): Fix bug: use + `org-agenda-show-inherited-tags'. + + * org-agenda.el (org-agenda-skip): Correctly handle commented out + scheduled/deadline lines. Refactor. + + * org-install.el: Do not warn users. + + * org.el (org-adaptive-fill-function): In message-mode, don't + lines in the message header, nor table lines in the body. + Correctly fill lines starting with `org-outline-regexp' in the + body. + + * org-agenda.el (org-agenda-open-link): Fix bug with opening all + links. + +2013-02-07 Francesco Pizzolante (tiny change) + + * org-clock.el (org-clock-sum): Protect with `org-unmodified'. + + * org-macs.el (org-unmodified): Inhibit modification hooks. + +2013-02-07 John K. Luebs (tiny change) + + * org.el (org-get-wdays): Handle matching a lead time specified in + hours. + +2013-02-07 Muchenxuan Tong (tiny change) + + * org-agenda.el (org-agenda-quit): Delete indirect buffer's window + only when it exists. + +2013-02-07 Nicolas Goaziou + + * org-element.el (org-element-macro-parser): Fix error when last + argument ends with a protected comma. + + * org-element.el (org-element-parse-buffer, org-element-map) + (org-element-at-point, org-element-context): Be more verbose in + docstrings. Also fix typos. + + * org-list.el (org-list-struct-fix-box): When a checkbox has to be + resetted because of a non-nil ORDERED property value, make sure it + had a checkbox already. + +2013-02-07 Tokuya Kameshima (tiny change) + + * org-agenda.el (org-search-view): Fix checking + `org-agenda-show-inherited-tags'. + +2013-02-07 racin (tiny change) + + * org-bibtex.el (org-bibtex-search): Don't throw an error when + `org-bibtex-prefix' is nil. + 2013-01-13 Bastien Guerry * org-compat.el (org-condition-case-unless-debug): Delete. === modified file 'lisp/org/ob-python.el' --- lisp/org/ob-python.el 2013-01-01 09:11:05 +0000 +++ lisp/org/ob-python.el 2013-02-07 07:11:59 +0000 @@ -44,7 +44,7 @@ (defvar org-babel-default-header-args:python '()) (defvar org-babel-python-command "python" - "Name of command for executing Python code.") + "Name of the command for executing Python code.") (defvar org-babel-python-mode (if (featurep 'xemacs) 'python-mode 'python) "Preferred python mode for use in running python interactively. @@ -143,7 +143,9 @@ (cond ((and (eq 'python org-babel-python-mode) (fboundp 'run-python)) ; python.el - (run-python)) + (if (version< "24.1" emacs-version) + (run-python org-babel-python-command) + (run-python))) ((and (eq 'python-mode org-babel-python-mode) (fboundp 'py-shell)) ; python-mode.el ;; Make sure that py-which-bufname is initialized, as otherwise === modified file 'lisp/org/org-agenda.el' --- lisp/org/org-agenda.el 2013-01-13 10:33:16 +0000 +++ lisp/org/org-agenda.el 2013-02-07 07:11:59 +0000 @@ -530,7 +530,7 @@ the project is considered to be not stuck. If you specify \"*\" as a tag, any tag will mark the project unstuck. Note that this is about the explicit presence of a tag somewhere in the subtree, inherited - tags to not count here. If inherited tags make a project not stuck, + tags do not count here. If inherited tags make a project not stuck, use \"-TAG\" in the tags part of the matcher under (1.) above. 4. An arbitrary regular expression matching non-stuck projects. @@ -3728,19 +3728,18 @@ Also moves point to the end of the skipped region, so that search can continue from there." (let ((p (point-at-bol)) to) - (when (org-in-src-block-p t) (throw :skip t)) - (and org-agenda-skip-archived-trees (not org-agenda-archives-mode) - (get-text-property p :org-archived) - (org-end-of-subtree t) - (throw :skip t)) - (and org-agenda-skip-comment-trees - (get-text-property p :org-comment) - (org-end-of-subtree t) - (throw :skip t)) - (if (equal (char-after p) ?#) (throw :skip t)) - (when (setq to (or (org-agenda-skip-eval org-agenda-skip-function-global) - (org-agenda-skip-eval org-agenda-skip-function))) - (goto-char to) + (when (or + (save-excursion (goto-char p) (looking-at comment-start-skip)) + (and org-agenda-skip-archived-trees (not org-agenda-archives-mode) + (get-text-property p :org-archived) + (org-end-of-subtree t)) + (and org-agenda-skip-comment-trees + (get-text-property p :org-comment) + (org-end-of-subtree t)) + (and (setq to (or (org-agenda-skip-eval org-agenda-skip-function-global) + (org-agenda-skip-eval org-agenda-skip-function))) + (goto-char to)) + (org-in-src-block-p t)) (throw :skip t)))) (defun org-agenda-skip-eval (form) @@ -4479,7 +4478,8 @@ category-pos (get-text-property (point) 'org-category-position) inherited-tags (or (eq org-agenda-show-inherited-tags 'always) - (memq 'todo org-agenda-show-inherited-tags) + (and (listp org-agenda-show-inherited-tags) + (memq 'todo org-agenda-show-inherited-tags)) (and (eq org-agenda-show-inherited-tags t) (or (eq org-agenda-use-tag-inheritance t) (memq 'todo org-agenda-use-tag-inheritance)))) @@ -5406,9 +5406,6 @@ \(fn &optional END)" nil nil) -(defconst org-agenda-no-heading-message - "No heading for this item in buffer or region.") - (defun org-agenda-get-timestamps (&optional deadline-results) "Return the date stamp information for agenda display." (let* ((props (list 'face 'org-agenda-calendar-event @@ -5488,7 +5485,7 @@ category-pos (get-text-property b0 'org-category-position)) (save-excursion (if (not (re-search-backward org-outline-regexp-bol nil t)) - (setq txt org-agenda-no-heading-message) + (throw :skip nil) (goto-char (match-beginning 0)) (if (and (eq t org-agenda-skip-timestamp-if-deadline-is-shown) (assoc (point) deadline-position-alist)) @@ -5724,7 +5721,7 @@ (and (looking-at ".*\n[ \t]*-[ \t]+\\([^-\n \t].*?\\)[ \t]*$") (match-string 1))))) (if (not (re-search-backward org-outline-regexp-bol nil t)) - (setq txt org-agenda-no-heading-message) + (throw :skip nil) (goto-char (match-beginning 0)) (setq hdmarker (org-agenda-new-marker) inherited-tags @@ -5892,7 +5889,7 @@ (d1 (calendar-absolute-from-gregorian date)) ; DATE bound by calendar d2 diff dfrac wdays pos pos1 category category-pos tags suppress-prewarning ee txt head face s todo-state - show-all upcomingp donep timestr warntime) + show-all upcomingp donep timestr warntime inherited-tags) (goto-char (point-min)) (while (re-search-forward regexp nil t) (setq suppress-prewarning nil) @@ -5941,11 +5938,18 @@ warntime (get-text-property (point) 'org-appt-warntime) category-pos (get-text-property (point) 'org-category-position)) (if (not (re-search-backward "^\\*+[ \t]+" nil t)) - (setq txt org-agenda-no-heading-message) + (throw :skip nil) (goto-char (match-end 0)) (setq pos1 (match-beginning 0)) - (setq tags (org-get-tags-at pos1 t)) - (setq head (buffer-substring-no-properties + (setq inherited-tags + (or (eq org-agenda-show-inherited-tags 'always) + (and (listp org-agenda-show-inherited-tags) + (memq 'agenda org-agenda-show-inherited-tags)) + (and (eq org-agenda-show-inherited-tags t) + (or (eq org-agenda-use-tag-inheritance t) + (memq 'agenda org-agenda-use-tag-inheritance)))) + tags (org-get-tags-at pos1 (not inherited-tags))) + (setq head (buffer-substring (point) (progn (skip-chars-forward "^\r\n") (point)))) @@ -6059,7 +6063,7 @@ (setq category (org-get-category) category-pos (get-text-property (point) 'org-category-position)) (if (not (re-search-backward "^\\*+[ \t]+" nil t)) - (setq txt org-agenda-no-heading-message) + (throw :skip nil) (goto-char (match-end 0)) (setq pos1 (match-beginning 0)) (if habitp @@ -6082,7 +6086,7 @@ (or (eq org-agenda-use-tag-inheritance t) (memq 'agenda org-agenda-use-tag-inheritance)))) tags (org-get-tags-at nil (not inherited-tags))) - (setq head (buffer-substring-no-properties + (setq head (buffer-substring (point) (progn (skip-chars-forward "^\r\n") (point)))) (if (string-match " \\([012]?[0-9]:[0-9][0-9]\\)" s) @@ -6160,7 +6164,7 @@ (setq category (org-get-category) category-pos (get-text-property (point) 'org-category-position)) (if (not (re-search-backward org-outline-regexp-bol nil t)) - (setq txt org-agenda-no-heading-message) + (throw :skip nil) (goto-char (match-beginning 0)) (setq hdmarker (org-agenda-new-marker (point)) inherited-tags @@ -6892,7 +6896,10 @@ (interactive) (if (and (eq org-indirect-buffer-display 'other-window) org-last-indirect-buffer) - (delete-window (get-buffer-window org-last-indirect-buffer))) + (let ((org-last-indirect-window + (get-buffer-window org-last-indirect-buffer))) + (if org-last-indirect-window + (delete-window org-last-indirect-window)))) (if org-agenda-columns-active (org-columns-quit) (if org-agenda-sticky @@ -8012,32 +8019,34 @@ (let* ((marker (or (org-get-at-bol 'org-hd-marker) (org-get-at-bol 'org-marker))) (buffer (and marker (marker-buffer marker))) - (prefix (buffer-substring - (point-at-bol) (point-at-eol))) + (prefix (buffer-substring (point-at-bol) (point-at-eol))) (lkall (org-offer-links-in-entry buffer marker arg prefix)) - (lk (car lkall)) + (lk0 (car lkall)) + (lk (if (stringp lk0) (list lk0) lk0)) (lkend (cdr lkall)) trg) (cond - ((and buffer (stringp lk)) - (with-current-buffer buffer - (setq trg (and (string-match org-bracket-link-regexp lk) - (match-string 1 lk))) - (if (or (not trg) (string-match org-any-link-re trg)) - (save-excursion - (save-restriction - (widen) - (goto-char marker) - (when (search-forward lk nil lkend) - (goto-char (match-beginning 0)) - (org-open-at-point)))) - ;; This is an internal link, widen the buffer - (switch-to-buffer-other-window buffer) - (widen) - (goto-char marker) - (when (search-forward lk nil lkend) - (goto-char (match-beginning 0)) - (org-open-at-point))))) + ((and buffer lk) + (mapcar (lambda(l) + (with-current-buffer buffer + (setq trg (and (string-match org-bracket-link-regexp l) + (match-string 1 l))) + (if (or (not trg) (string-match org-any-link-re trg)) + (save-excursion + (save-restriction + (widen) + (goto-char marker) + (when (search-forward l nil lkend) + (goto-char (match-beginning 0)) + (org-open-at-point)))) + ;; This is an internal link, widen the buffer + (switch-to-buffer-other-window buffer) + (widen) + (goto-char marker) + (when (search-forward l nil lkend) + (goto-char (match-beginning 0)) + (org-open-at-point))))) + lk)) ((or (org-in-regexp (concat "\\(" org-bracket-link-regexp "\\)")) (save-excursion (beginning-of-line 1) === modified file 'lisp/org/org-bibtex.el' --- lisp/org/org-bibtex.el 2013-01-02 16:13:04 +0000 +++ lisp/org/org-bibtex.el 2013-02-07 08:31:21 +0000 @@ -678,7 +678,7 @@ (org-agenda-search-view-always-boolean t)) (org-search-view nil (format "%s +{:%s%s:}" - string org-bibtex-prefix + string (or org-bibtex-prefix "") org-bibtex-type-property-name)))) (provide 'org-bibtex) === modified file 'lisp/org/org-clock.el' --- lisp/org/org-clock.el 2013-01-13 10:33:16 +0000 +++ lisp/org/org-clock.el 2013-02-07 07:11:59 +0000 @@ -1204,7 +1204,7 @@ (setq org-clock-start-time (apply 'encode-time (org-parse-time-string (match-string 1)))) - (setq org-clock-effort (get-text-property (point) 'org-effort)) + (setq org-clock-effort (org-entry-get (point) org-effort-property)) (setq org-clock-total-time (org-clock-sum-current-item (org-clock-get-sum-start)))) ((eq org-clock-in-resume 'auto-restart) @@ -1224,7 +1224,7 @@ (beginning-of-line 1) (org-indent-line-to (- (org-get-indentation) 2))) (insert org-clock-string " ") - (setq org-clock-effort (get-text-property (point) 'org-effort)) + (setq org-clock-effort (org-entry-get (point) org-effort-property)) (setq org-clock-total-time (org-clock-sum-current-item (org-clock-get-sum-start))) (setq org-clock-start-time @@ -1675,86 +1675,85 @@ which HEADLINE-FILTER returns nil are excluded from the clock summation. PROPNAME lets you set a custom text property instead of :org-clock-minutes." (interactive) - (let* ((bmp (buffer-modified-p)) - (re (concat "^\\(\\*+\\)[ \t]\\|^[ \t]*" - org-clock-string - "[ \t]*\\(?:\\(\\[.*?\\]\\)-+\\(\\[.*?\\]\\)\\|=>[ \t]+\\([0-9]+\\):\\([0-9]+\\)\\)")) - (lmax 30) - (ltimes (make-vector lmax 0)) - (t1 0) - (level 0) - ts te dt - time) - (if (stringp tstart) (setq tstart (org-time-string-to-seconds tstart))) - (if (stringp tend) (setq tend (org-time-string-to-seconds tend))) - (if (consp tstart) (setq tstart (org-float-time tstart))) - (if (consp tend) (setq tend (org-float-time tend))) - (remove-text-properties (point-min) (point-max) - `(,(or propname :org-clock-minutes) t - :org-clock-force-headline-inclusion t)) - (save-excursion - (goto-char (point-max)) - (while (re-search-backward re nil t) - (cond - ((match-end 2) - ;; Two time stamps - (setq ts (match-string 2) - te (match-string 3) - ts (org-float-time - (apply 'encode-time (org-parse-time-string ts))) - te (org-float-time - (apply 'encode-time (org-parse-time-string te))) - ts (if tstart (max ts tstart) ts) - te (if tend (min te tend) te) - dt (- te ts) - t1 (if (> dt 0) (+ t1 (floor (/ dt 60))) t1))) - ((match-end 4) - ;; A naked time - (setq t1 (+ t1 (string-to-number (match-string 5)) - (* 60 (string-to-number (match-string 4)))))) - (t ;; A headline - ;; Add the currently clocking item time to the total - (when (and org-clock-report-include-clocking-task - (equal (org-clocking-buffer) (current-buffer)) - (equal (marker-position org-clock-hd-marker) (point)) - tstart - tend - (>= (org-float-time org-clock-start-time) tstart) - (<= (org-float-time org-clock-start-time) tend)) - (let ((time (floor (- (org-float-time) - (org-float-time org-clock-start-time)) 60))) - (setq t1 (+ t1 time)))) - (let* ((headline-forced - (get-text-property (point) - :org-clock-force-headline-inclusion)) - (headline-included - (or (null headline-filter) - (save-excursion - (save-match-data (funcall headline-filter)))))) - (setq level (- (match-end 1) (match-beginning 1))) - (when (or (> t1 0) (> (aref ltimes level) 0)) - (when (or headline-included headline-forced) - (if headline-included - (loop for l from 0 to level do - (aset ltimes l (+ (aref ltimes l) t1)))) - (setq time (aref ltimes level)) - (goto-char (match-beginning 0)) - (put-text-property (point) (point-at-eol) - (or propname :org-clock-minutes) time) - (if headline-filter - (save-excursion - (save-match-data - (while - (> (funcall outline-level) 1) - (outline-up-heading 1 t) - (put-text-property - (point) (point-at-eol) - :org-clock-force-headline-inclusion t)))))) - (setq t1 0) - (loop for l from level to (1- lmax) do - (aset ltimes l 0))))))) - (setq org-clock-file-total-minutes (aref ltimes 0))) - (set-buffer-modified-p bmp))) + (org-unmodified + (let* ((re (concat "^\\(\\*+\\)[ \t]\\|^[ \t]*" + org-clock-string + "[ \t]*\\(?:\\(\\[.*?\\]\\)-+\\(\\[.*?\\]\\)\\|=>[ \t]+\\([0-9]+\\):\\([0-9]+\\)\\)")) + (lmax 30) + (ltimes (make-vector lmax 0)) + (t1 0) + (level 0) + ts te dt + time) + (if (stringp tstart) (setq tstart (org-time-string-to-seconds tstart))) + (if (stringp tend) (setq tend (org-time-string-to-seconds tend))) + (if (consp tstart) (setq tstart (org-float-time tstart))) + (if (consp tend) (setq tend (org-float-time tend))) + (remove-text-properties (point-min) (point-max) + `(,(or propname :org-clock-minutes) t + :org-clock-force-headline-inclusion t)) + (save-excursion + (goto-char (point-max)) + (while (re-search-backward re nil t) + (cond + ((match-end 2) + ;; Two time stamps + (setq ts (match-string 2) + te (match-string 3) + ts (org-float-time + (apply 'encode-time (org-parse-time-string ts))) + te (org-float-time + (apply 'encode-time (org-parse-time-string te))) + ts (if tstart (max ts tstart) ts) + te (if tend (min te tend) te) + dt (- te ts) + t1 (if (> dt 0) (+ t1 (floor (/ dt 60))) t1))) + ((match-end 4) + ;; A naked time + (setq t1 (+ t1 (string-to-number (match-string 5)) + (* 60 (string-to-number (match-string 4)))))) + (t ;; A headline + ;; Add the currently clocking item time to the total + (when (and org-clock-report-include-clocking-task + (equal (org-clocking-buffer) (current-buffer)) + (equal (marker-position org-clock-hd-marker) (point)) + tstart + tend + (>= (org-float-time org-clock-start-time) tstart) + (<= (org-float-time org-clock-start-time) tend)) + (let ((time (floor (- (org-float-time) + (org-float-time org-clock-start-time)) 60))) + (setq t1 (+ t1 time)))) + (let* ((headline-forced + (get-text-property (point) + :org-clock-force-headline-inclusion)) + (headline-included + (or (null headline-filter) + (save-excursion + (save-match-data (funcall headline-filter)))))) + (setq level (- (match-end 1) (match-beginning 1))) + (when (or (> t1 0) (> (aref ltimes level) 0)) + (when (or headline-included headline-forced) + (if headline-included + (loop for l from 0 to level do + (aset ltimes l (+ (aref ltimes l) t1)))) + (setq time (aref ltimes level)) + (goto-char (match-beginning 0)) + (put-text-property (point) (point-at-eol) + (or propname :org-clock-minutes) time) + (if headline-filter + (save-excursion + (save-match-data + (while + (> (funcall outline-level) 1) + (outline-up-heading 1 t) + (put-text-property + (point) (point-at-eol) + :org-clock-force-headline-inclusion t)))))) + (setq t1 0) + (loop for l from level to (1- lmax) do + (aset ltimes l 0))))))) + (setq org-clock-file-total-minutes (aref ltimes 0)))))) (defun org-clock-sum-current-item (&optional tstart) "Return time, clocked on current item in total." === modified file 'lisp/org/org-element.el' --- lisp/org/org-element.el 2013-01-08 14:27:18 +0000 +++ lisp/org/org-element.el 2013-02-07 07:11:59 +0000 @@ -2893,10 +2893,13 @@ (end (point)) (args (let ((args (org-match-string-no-properties 3)) args2) (when args - (setq args (org-split-string args ",")) + ;; Do not use `org-split-string' since empty + ;; strings are meaningful here. + (setq args (split-string args ",")) (while args (while (string-match "\\\\\\'" (car args)) - ;; Repair bad splits. + ;; Repair bad splits, when comma is protected, + ;; and thus not a real separator. (setcar (cdr args) (concat (substring (car args) 0 -1) "," (nth 1 args))) (pop args)) @@ -3611,7 +3614,32 @@ When VISIBLE-ONLY is non-nil, don't parse contents of hidden elements. -Assume buffer is in Org mode." +An element or an objects is represented as a list with the +pattern (TYPE PROPERTIES CONTENTS), where : + + TYPE is a symbol describing the element or object. See + `org-element-all-elements' and `org-element-all-objects' for an + exhaustive list of such symbols. One can retrieve it with + `org-element-type' function. + + PROPERTIES is the list of attributes attached to the element or + object, as a plist. Although most of them are specific to the + element or object type, all types share `:begin', `:end', + `:post-blank' and `:parent' properties, which respectively + refer to buffer position where the element or object starts, + ends, the number of white spaces or blank lines after it, and + the element or object containing it. Properties values can be + obtained by using `org-element-property' function. + + CONTENTS is a list of elements, objects or raw strings + contained in the current element or object, when applicable. + One can access them with `org-element-contents' function. + +The Org buffer has `org-data' as type and nil as properties. +`org-element-map' function can be used to find specific elements +or objects within the parse tree. + +This function assumes that current major mode is `org-mode'." (save-excursion (goto-char (point-min)) (org-skip-whitespace) @@ -3640,11 +3668,12 @@ (defun org-element-map (data types fun &optional info first-match no-recursion) "Map a function on selected elements or objects. -DATA is the parsed tree, as returned by, i.e, +DATA is an Org buffer parse tree, as returned by, i.e, `org-element-parse-buffer'. TYPES is a symbol or list of symbols -of elements or objects types. FUN is the function called on the -matching element or object. It must accept one arguments: the -element or object itself. +of elements or objects types (see `org-element-all-elements' and +`org-element-all-objects' for a complete list of types). FUN is +the function called on the matching element or object. It has to +accept one argument: the element or object itself. When optional argument INFO is non-nil, it should be a plist holding export options. In that case, parts of the parse tree @@ -3658,7 +3687,37 @@ enter any recursive element or object whose type belongs to that list. Though, FUN can still be applied on them. -Nil values returned from FUN do not appear in the results." +Nil values returned from FUN do not appear in the results. + + +Examples: +-------- + +Assuming TREE is a variable containing an Org buffer parse tree, +the following example will return a flat list of all `src-block' +and `example-block' elements in it: + + \(org-element-map tree '(example-block src-block) 'identity) + +The following snippet will find the first headline with a level +of 1 and a \"phone\" tag, and will return its beginning position: + + \(org-element-map + tree 'headline + \(lambda (hl) + \(and (= (org-element-property :level hl) 1) + \(member \"phone\" (org-element-property :tags hl)) + \(org-element-property :begin hl))) + nil t) + +Eventually, this last example will return a flat list of all +`bold' type objects containing a `latex-snippet' type object: + + \(org-element-map + tree 'bold + \(lambda (b) + \(and (org-element-map b 'latex-snippet 'identity nil t) + b)))" ;; Ensure TYPES and NO-RECURSION are a list, even of one element. (unless (listp types) (setq types (list types))) (unless (listp no-recursion) (setq no-recursion (list no-recursion))) @@ -4168,8 +4227,8 @@ element. Possible types are defined in `org-element-all-elements'. -Properties depend on element or object type, but always -include :begin, :end, :parent and :post-blank properties. +Properties depend on element or object type, but always include +`:begin', `:end', `:parent' and `:post-blank' properties. As a special case, if point is at the very beginning of a list or sub-list, returned element will be that list instead of the first @@ -4178,8 +4237,8 @@ first row. If optional argument KEEP-TRAIL is non-nil, the function returns -a list of of elements leading to element at point. The list's -CAR is always the element at point. Following positions contain +a list of elements leading to element at point. The list's CAR +is always the element at point. The following positions contain element's siblings, then parents, siblings of parents, until the first element of current section." (org-with-wide-buffer @@ -4268,8 +4327,8 @@ Possible types are defined in `org-element-all-elements' and `org-element-all-objects'. Properties depend on element or -object type, but always include :begin, :end, :parent -and :post-blank properties." +object type, but always include `:begin', `:end', `:parent' and +`:post-blank'." (org-with-wide-buffer (let* ((origin (point)) (element (org-element-at-point)) === modified file 'lisp/org/org-exp.el' --- lisp/org/org-exp.el 2013-01-08 14:27:18 +0000 +++ lisp/org/org-exp.el 2013-02-07 07:11:59 +0000 @@ -2113,7 +2113,8 @@ (put-text-property (match-beginning 0) (match-end 0) 'org-normalized-link t)) (goto-char (point-min)) (while (re-search-forward re-plain-link nil t) - (unless (get-text-property (match-beginning 0) 'org-normalized-link) + (unless (or (get-text-property (match-beginning 0) 'org-normalized-link) + (assoc :tags (org-context))) (goto-char (1- (match-end 0))) (org-if-unprotected-at (1+ (match-beginning 0)) (let* ((s (concat (match-string 1) === modified file 'lisp/org/org-footnote.el' --- lisp/org/org-footnote.el 2013-01-01 09:11:05 +0000 +++ lisp/org/org-footnote.el 2013-02-07 07:11:59 +0000 @@ -486,7 +486,8 @@ (defun org-footnote-create-definition (label) "Start the definition of a footnote with label LABEL." (interactive "sLabel: ") - (let ((label (org-footnote-normalize-label label))) + (let ((label (org-footnote-normalize-label label)) + electric-indent-mode) ;; Prevent wrong indentation (cond ;; In an Org file. ((derived-mode-p 'org-mode) === modified file 'lisp/org/org-html.el' --- lisp/org/org-html.el 2013-01-08 14:27:18 +0000 +++ lisp/org/org-html.el 2013-02-07 07:11:59 +0000 @@ -464,6 +464,9 @@ (defcustom org-export-html-preamble-format '(("en" "")) "Alist of languages and format strings for the HTML preamble. +To enable the HTML exporter to use these formats, you need to set +`org-export-html-preamble' to `t'. + The first element of each list is the language code, as used for the #+LANGUAGE keyword. @@ -510,6 +513,9 @@ ")) "Alist of languages and format strings for the HTML postamble. +To enable the HTML exporter to use these formats, you need to set +`org-export-html-postamble' to `t'. + The first element of each list is the language code, as used for the #+LANGUAGE keyword. @@ -1030,7 +1036,10 @@ (if (string-match "^file:" desc) (setq desc (substring desc (match-end 0))))) (setq desc (org-add-props - (concat "\""") '(org-protected t)))) (cond === modified file 'lisp/org/org-indent.el' --- lisp/org/org-indent.el 2013-01-01 09:11:05 +0000 +++ lisp/org/org-indent.el 2013-02-07 07:11:59 +0000 @@ -159,69 +159,68 @@ The process is synchronous. Though, initial indentation of buffer, which can take a few seconds on large buffers, is done -during idle time." nil " Ind" nil -(cond - ((org-bound-and-true-p org-inhibit-startup) - (setq org-indent-mode nil)) - ((and org-indent-mode (featurep 'xemacs)) - (message "org-indent-mode does not work in XEmacs - refusing to turn it on") - (setq org-indent-mode nil)) - ((and org-indent-mode - (not (org-version-check "23.1.50" "Org Indent mode" :predicate))) - (message "org-indent-mode can crash Emacs 23.1 - refusing to turn it on!") - (ding) - (sit-for 1) - (setq org-indent-mode nil)) - (org-indent-mode - ;; mode was turned on. - (org-set-local 'indent-tabs-mode nil) - (or org-indent-strings (org-indent-initialize)) - (org-set-local 'org-indent-initial-marker (copy-marker 1)) - (when org-indent-mode-turns-off-org-adapt-indentation - (org-set-local 'org-adapt-indentation nil)) - (when org-indent-mode-turns-on-hiding-stars - (org-set-local 'org-hide-leading-stars-before-indent-mode - org-hide-leading-stars) - (org-set-local 'org-hide-leading-stars t)) - (make-local-variable 'filter-buffer-substring-functions) - (add-hook 'filter-buffer-substring-functions - (lambda (fun start end delete) - (org-indent-remove-properties-from-string - (funcall fun start end delete)))) - (org-add-hook 'after-change-functions 'org-indent-refresh-maybe nil 'local) - (org-add-hook 'before-change-functions - 'org-indent-notify-modified-headline nil 'local) - (and font-lock-mode (org-restart-font-lock)) - (org-indent-remove-properties (point-min) (point-max)) - ;; Submit current buffer to initialize agent. If it's the first - ;; buffer submitted, also start the agent. Current buffer is - ;; pushed in both cases to avoid a race condition. - (if org-indent-agentized-buffers +during idle time." + nil " Ind" nil + (cond + ((and org-indent-mode (featurep 'xemacs)) + (message "org-indent-mode does not work in XEmacs - refusing to turn it on") + (setq org-indent-mode nil)) + ((and org-indent-mode + (not (org-version-check "23.1.50" "Org Indent mode" :predicate))) + (message "org-indent-mode can crash Emacs 23.1 - refusing to turn it on!") + (ding) + (sit-for 1) + (setq org-indent-mode nil)) + (org-indent-mode + ;; mode was turned on. + (org-set-local 'indent-tabs-mode nil) + (or org-indent-strings (org-indent-initialize)) + (org-set-local 'org-indent-initial-marker (copy-marker 1)) + (when org-indent-mode-turns-off-org-adapt-indentation + (org-set-local 'org-adapt-indentation nil)) + (when org-indent-mode-turns-on-hiding-stars + (org-set-local 'org-hide-leading-stars-before-indent-mode + org-hide-leading-stars) + (org-set-local 'org-hide-leading-stars t)) + (make-local-variable 'filter-buffer-substring-functions) + (add-hook 'filter-buffer-substring-functions + (lambda (fun start end delete) + (org-indent-remove-properties-from-string + (funcall fun start end delete)))) + (org-add-hook 'after-change-functions 'org-indent-refresh-maybe nil 'local) + (org-add-hook 'before-change-functions + 'org-indent-notify-modified-headline nil 'local) + (and font-lock-mode (org-restart-font-lock)) + (org-indent-remove-properties (point-min) (point-max)) + ;; Submit current buffer to initialize agent. If it's the first + ;; buffer submitted, also start the agent. Current buffer is + ;; pushed in both cases to avoid a race condition. + (if org-indent-agentized-buffers + (push (current-buffer) org-indent-agentized-buffers) (push (current-buffer) org-indent-agentized-buffers) - (push (current-buffer) org-indent-agentized-buffers) - (setq org-indent-agent-timer - (run-with-idle-timer 0.2 t #'org-indent-initialize-agent)))) - (t - ;; mode was turned off (or we refused to turn it on) - (kill-local-variable 'org-adapt-indentation) - (setq org-indent-agentized-buffers - (delq (current-buffer) org-indent-agentized-buffers)) - (when (markerp org-indent-initial-marker) - (set-marker org-indent-initial-marker nil)) - (when (boundp 'org-hide-leading-stars-before-indent-mode) - (org-set-local 'org-hide-leading-stars - org-hide-leading-stars-before-indent-mode)) - (remove-hook 'filter-buffer-substring-functions - (lambda (fun start end delete) - (org-indent-remove-properties-from-string - (funcall fun start end delete)))) - (remove-hook 'after-change-functions 'org-indent-refresh-maybe 'local) - (remove-hook 'before-change-functions - 'org-indent-notify-modified-headline 'local) - (org-with-wide-buffer - (org-indent-remove-properties (point-min) (point-max))) - (and font-lock-mode (org-restart-font-lock)) - (redraw-display)))) + (setq org-indent-agent-timer + (run-with-idle-timer 0.2 t #'org-indent-initialize-agent)))) + (t + ;; mode was turned off (or we refused to turn it on) + (kill-local-variable 'org-adapt-indentation) + (setq org-indent-agentized-buffers + (delq (current-buffer) org-indent-agentized-buffers)) + (when (markerp org-indent-initial-marker) + (set-marker org-indent-initial-marker nil)) + (when (boundp 'org-hide-leading-stars-before-indent-mode) + (org-set-local 'org-hide-leading-stars + org-hide-leading-stars-before-indent-mode)) + (remove-hook 'filter-buffer-substring-functions + (lambda (fun start end delete) + (org-indent-remove-properties-from-string + (funcall fun start end delete)))) + (remove-hook 'after-change-functions 'org-indent-refresh-maybe 'local) + (remove-hook 'before-change-functions + 'org-indent-notify-modified-headline 'local) + (org-with-wide-buffer + (org-indent-remove-properties (point-min) (point-max))) + (and font-lock-mode (org-restart-font-lock)) + (redraw-display)))) (defun org-indent-indent-buffer () "Add indentation properties to the accessible part of the buffer." === modified file 'lisp/org/org-install.el' --- lisp/org/org-install.el 2013-01-08 14:27:18 +0000 +++ lisp/org/org-install.el 2013-02-07 07:11:59 +0000 @@ -1,10 +1,12 @@ ;;; org-install.el --- backward compatibility file for obsolete configuration ;; ;;; Code: -(warn "The file org-install is obsolete. -It is provided here so that (require 'org-install) does not -trigger an error for users with obsolete Emacs configuration. -You can safely remove (require 'org-install) from your config.") +;; +;; The file org-install is obsolete. +;; +;; It is provided here so that (require 'org-install) does not +;; trigger an error for users with obsolete Emacs configuration. +;; You can safely remove (require 'org-install) from your config." (provide 'org-install) === modified file 'lisp/org/org-list.el' --- lisp/org/org-list.el 2013-01-08 14:27:18 +0000 +++ lisp/org/org-list.el 2013-02-07 07:11:59 +0000 @@ -1802,7 +1802,9 @@ ;; There are boxes checked after an unchecked one: fix that. (when (member "[X]" after-unchecked) (let ((index (- (length struct) (length after-unchecked)))) - (mapc (lambda (e) (org-list-set-checkbox e struct "[ ]")) + (mapc (lambda (e) + (when (org-list-get-checkbox e struct) + (org-list-set-checkbox e struct "[ ]"))) (nthcdr index all-items)) ;; Verify once again the structure, without ORDERED. (org-list-struct-fix-box struct parents prevs nil) === modified file 'lisp/org/org-macs.el' --- lisp/org/org-macs.el 2013-01-08 14:27:18 +0000 +++ lisp/org/org-macs.el 2013-02-07 07:11:59 +0000 @@ -93,7 +93,7 @@ `(set-buffer-modified-p (prog1 (buffer-modified-p) (let ((buffer-undo-list t) - before-change-functions after-change-functions) + (inhibit-modification-hooks t)) ,@body)))) (def-edebug-spec org-unmodified (body)) === modified file 'lisp/org/org-version.el' --- lisp/org/org-version.el 2013-01-13 10:33:16 +0000 +++ lisp/org/org-version.el 2013-02-07 07:11:59 +0000 @@ -5,13 +5,13 @@ (defun org-release () "The release version of org-mode. Inserted by installing org-mode or when a release is made." - (let ((org-release "7.9.3d")) + (let ((org-release "7.9.3e")) org-release)) ;;;###autoload (defun org-git-version () "The Git version of org-mode. Inserted by installing org-mode or when a release is made." - (let ((org-git-version "7.9.3d-GNU-Emacs-24-3 (commit e8f5b0ad)")) + (let ((org-git-version "7.9.3e-3-gb07a9b")) org-git-version)) ;;;###autoload (defvar org-odt-data-dir "/usr/share/emacs/etc/org" === modified file 'lisp/org/org.el' --- lisp/org/org.el 2013-01-13 10:33:16 +0000 +++ lisp/org/org.el 2013-02-07 07:11:59 +0000 @@ -4915,6 +4915,7 @@ (org-set-local 'calc-embedded-open-mode "# ") (modify-syntax-entry ?@ "w") (if org-startup-truncated (setq truncate-lines t)) + (when org-startup-indented (require 'org-indent) (org-indent-mode 1)) (org-set-local 'font-lock-unfontify-region-function 'org-unfontify-region) ;; Activate before-change-function @@ -4970,9 +4971,6 @@ (org-set-local 'outline-isearch-open-invisible-function (lambda (&rest ignore) (org-show-context 'isearch)))) - ;; Turn on org-beamer-mode? - (and org-startup-with-beamer-mode (org-beamer-mode)) - ;; Setup the pcomplete hooks (set (make-local-variable 'pcomplete-command-completion-function) 'org-pcomplete-initial) @@ -4992,15 +4990,13 @@ (= (point-min) (point-max))) (insert "# -*- mode: org -*-\n\n")) (unless org-inhibit-startup + (and org-startup-with-beamer-mode (org-beamer-mode)) (when org-startup-align-all-tables (let ((bmp (buffer-modified-p))) (org-table-map-tables 'org-table-align 'quietly) (set-buffer-modified-p bmp))) (when org-startup-with-inline-images (org-display-inline-images)) - (when org-startup-indented - (require 'org-indent) - (org-indent-mode 1)) (unless org-inhibit-startup-visibility-stuff (org-set-startup-visibility))) ;; Try to set org-hide correctly @@ -5422,7 +5418,7 @@ '(font-lock-fontified t invisible t) '(font-lock-fontified t face org-document-info-keyword))) (add-text-properties - (match-beginning 6) (1+ (match-end 6)) + (match-beginning 6) (min (point-max) (1+ (match-end 6))) (if (string-equal dc1 "+title:") '(font-lock-fontified t face org-document-title) '(font-lock-fontified t face org-document-info)))) @@ -15925,7 +15921,8 @@ (floor (* (string-to-number (match-string 1 ts)) (cdr (assoc (match-string 2 ts) '(("d" . 1) ("w" . 7) - ("m" . 30.4) ("y" . 365.25))))))) + ("m" . 30.4) ("y" . 365.25) + ("h" . 0.041667))))))) ;; go for the default. (t org-deadline-warning-days))) @@ -16662,6 +16659,15 @@ :type '(alist :key-type (string :tag "Modifier") :value-type (number :tag "Minutes"))) +(defcustom org-agenda-inhibit-startup t + "Inhibit startup when preparing agenda buffers. +When this variable is `t' (the default), the initialization of +the Org agenda buffers is inhibited: e.g. the visibility state +is not set, the tables are not re-aligned, etc." + :type 'boolean + :version "24.3" + :group 'org-agenda) + (defun org-duration-string-to-minutes (s &optional output-to-string) "Convert a duration string S to minutes. @@ -17001,6 +17007,7 @@ (pc '(:org-comment t)) (pall '(:org-archived t :org-comment t)) (inhibit-read-only t) + (org-inhibit-startup org-agenda-inhibit-startup) (rea (concat ":" org-archive-tag ":")) bmp file re) (save-excursion @@ -20984,58 +20991,62 @@ (declare-function message-in-body-p "message" ()) (defvar org-element--affiliated-re) ; From org-element.el +(defvar orgtbl-line-start-regexp) ; From org-table.el (defun org-adaptive-fill-function () "Compute a fill prefix for the current line. Return fill prefix, as a string, or nil if current line isn't meant to be filled." (let (prefix) - (when (and (derived-mode-p 'message-mode) (message-in-body-p)) - (save-excursion - (beginning-of-line) - (cond ((looking-at message-cite-prefix-regexp) - (setq prefix (match-string-no-properties 0))) - ((looking-at org-outline-regexp) - (setq prefix ""))))) - (or prefix - (org-with-wide-buffer - (let* ((p (line-beginning-position)) - (element (save-excursion (beginning-of-line) (org-element-at-point))) - (type (org-element-type element)) - (post-affiliated - (save-excursion - (goto-char (org-element-property :begin element)) - (while (looking-at org-element--affiliated-re) (forward-line)) - (point)))) - (unless (< p post-affiliated) - (case type - (comment (looking-at "[ \t]*# ?") (match-string 0)) - (footnote-definition "") - ((item plain-list) - (make-string (org-list-item-body-column post-affiliated) ? )) - (paragraph - ;; Fill prefix is usually the same as the current line, - ;; except if the paragraph is at the beginning of an item. - (let ((parent (org-element-property :parent element))) - (cond ((eq (org-element-type parent) 'item) - (make-string (org-list-item-body-column - (org-element-property :begin parent)) - ? )) - ((save-excursion (beginning-of-line) (looking-at "[ \t]+")) - (match-string 0)) - (t "")))) - (comment-block - ;; Only fill contents if P is within block boundaries. - (let* ((cbeg (save-excursion (goto-char post-affiliated) - (forward-line) - (point))) - (cend (save-excursion - (goto-char (org-element-property :end element)) - (skip-chars-backward " \r\t\n") - (line-beginning-position)))) - (when (and (>= p cbeg) (< p cend)) - (if (save-excursion (beginning-of-line) (looking-at "[ \t]+")) - (match-string 0) - ""))))))))))) + (catch 'exit + (when (derived-mode-p 'message-mode) + (save-excursion + (beginning-of-line) + (cond ((or (not (message-in-body-p)) + (looking-at orgtbl-line-start-regexp)) + (throw 'exit nil)) + ((looking-at message-cite-prefix-regexp) + (throw 'exit (match-string-no-properties 0))) + ((looking-at org-outline-regexp) + (throw 'exit (make-string (length (match-string 0)) ? )))))) + (org-with-wide-buffer + (let* ((p (line-beginning-position)) + (element (save-excursion (beginning-of-line) (org-element-at-point))) + (type (org-element-type element)) + (post-affiliated + (save-excursion + (goto-char (org-element-property :begin element)) + (while (looking-at org-element--affiliated-re) (forward-line)) + (point)))) + (unless (< p post-affiliated) + (case type + (comment (looking-at "[ \t]*# ?") (match-string 0)) + (footnote-definition "") + ((item plain-list) + (make-string (org-list-item-body-column post-affiliated) ? )) + (paragraph + ;; Fill prefix is usually the same as the current line, + ;; except if the paragraph is at the beginning of an item. + (let ((parent (org-element-property :parent element))) + (cond ((eq (org-element-type parent) 'item) + (make-string (org-list-item-body-column + (org-element-property :begin parent)) + ? )) + ((save-excursion (beginning-of-line) (looking-at "[ \t]+")) + (match-string 0)) + (t "")))) + (comment-block + ;; Only fill contents if P is within block boundaries. + (let* ((cbeg (save-excursion (goto-char post-affiliated) + (forward-line) + (point))) + (cend (save-excursion + (goto-char (org-element-property :end element)) + (skip-chars-backward " \r\t\n") + (line-beginning-position)))) + (when (and (>= p cbeg) (< p cend)) + (if (save-excursion (beginning-of-line) (looking-at "[ \t]+")) + (match-string 0) + ""))))))))))) (declare-function message-goto-body "message" ()) (defvar message-cite-prefix-regexp) ; From message.el ------------------------------------------------------------ revno: 111687 committer: Richard Stallman branch nick: trunk timestamp: Thu 2013-02-07 03:04:05 -0500 message: Force saving without encoding, regardless of current message. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-02-07 06:23:54 +0000 +++ lisp/ChangeLog 2013-02-07 08:04:05 +0000 @@ -1,3 +1,8 @@ +2013-02-07 Richard Stallman + + * mail/rmail.el (rmail-variables): Specify `no-conversion' for + `save-buffer-coding-system'. + 2013-02-07 Alan Mackenzie Fix bug in state cache mechanism. Remove 'BOD "strategy". Refactor. === modified file 'lisp/mail/rmail.el' --- lisp/mail/rmail.el 2013-01-19 20:38:13 +0000 +++ lisp/mail/rmail.el 2013-02-07 08:04:05 +0000 @@ -1507,6 +1507,8 @@ (setq file-precious-flag t) (make-local-variable 'desktop-save-buffer) (setq desktop-save-buffer t) + (make-local-variable 'save-buffer-coding-system) + (setq save-buffer-coding-system 'no-conversion) (setq next-error-move-function 'rmail-next-error-move)) ;; Handle M-x revert-buffer done in an rmail-mode buffer. ------------------------------------------------------------ revno: 111686 [merge] committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-02-06 22:23:54 -0800 message: Merge from emacs-24; up to r111228 diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2013-02-01 03:58:50 +0000 +++ doc/misc/ChangeLog 2013-02-07 06:23:54 +0000 @@ -1,3 +1,23 @@ +2013-02-07 Glenn Morris + + * cl.texi (Equality Predicates): Mention memql. + +2013-02-07 Eric Ludlam + + * doc/misc/ede.texi (Creating a project): Make ede-new doc less + specific, and only about items it supports, indicating that there + might be more. Remove refs to simple project and direct automake + from ede new. + (Simple projects): Re-write to not talk about ede-simple-project + which is deprecated, and instead use the term to mean projects + that don't do much management, just project wrapping. Add + ede-generic-project link. + (ede-generic-project): New node (bug#11441). + +2013-02-07 Glenn Morris + + * cl.texi (Equality Predicates): Fix eq/eql pedantry. + 2013-02-01 Glenn Morris * calc.texi (Help Commands): Update calc-view-news description. === modified file 'doc/misc/cl.texi' --- doc/misc/cl.texi 2013-01-02 16:13:04 +0000 +++ doc/misc/cl.texi 2013-02-07 06:23:54 +0000 @@ -817,8 +817,9 @@ Also note that the Common Lisp functions @code{member} and @code{assoc} use @code{eql} to compare elements, whereas Emacs Lisp follows the MacLisp tradition and uses @code{equal} for these two functions. -In Emacs, use @code{memq} (or @code{cl-member}) and @code{assq} (or -@code{cl-assoc}) to get functions which use @code{eql} for comparisons. +The functions @code{cl-member} and @code{cl-assoc} use @code{eql}, +as in Common Lisp. The standard Emacs Lisp functions @code{memq} and +@code{assq} use @code{eq}, and the standard @code{memql} uses @code{eql}. @node Control Structure @chapter Control Structure === modified file 'doc/misc/ede.texi' --- doc/misc/ede.texi 2013-01-05 16:19:53 +0000 +++ doc/misc/ede.texi 2013-02-04 03:07:26 +0000 @@ -450,9 +450,11 @@ The @command{ede-new} command prompts for the type of project you would like to create. Each project type has its own benefits or -language specific enhancements. @ede{} supports four different -project types: @samp{Make}, @samp{Automake}, @samp{direct Automake}, -and @samp{Simple}. +language specific enhancements. Not all projects that @ede{} supports +also allow creating a new project. Projects such as @code{emacs} +or @code{linux} are designed to recognize existing projects only. +Project types such as @samp{Make} and @samp{Automake} do support +creating new project types with @command{ede-new}. @itemize @item @@ -468,21 +470,6 @@ @file{Makefile.am} file. @ede{} handles the Automake bootstrapping routines, which import and maintain a @file{configure.am} script and other required files. - -@item -For the @samp{direct Automake} project type, @ede{} reads directly -from the Automake files. - -You cannot create direct Automake projects with the @command{ede-new} -command. Instead, when you visit a project with existing Automake -files, @ede{} automatically detects them. - -@item -The @samp{Simple} project type provides light-weight constructs for -identifying a project root and looking up files. If you already have -a non-@ede{} project infrastructure, you can use a @samp{Simple} -project to provide other Emacs packages, such as Semantic, with some -information about the project. @xref{Simple projects}. @end itemize A subproject is merely a project in a subdirectory of another project. @@ -795,24 +782,19 @@ @node Simple projects @section Simple Projects -There is a wide array of Simple projects. The root for simple -projects is the class @code{ede-simple-project}. This handles the -infrastructure of storing a .ede file if needed. - -The class @code{ede-simple-project} is designed to be subclassed. -Then key @ede{} methods can be overridden to provide a quick wrapper -over any project. - -A second project type is @code{ede-cpp-root}. This project type is -designed to be created for a directory hierarchy full of C/C++ code. -It can be configured with minimal lisp knowledge to do header file -lookup for @semantic{}, improving code completion performance. +There is a wide array of simple projects. In this case a simple +project is one that detects, or is directed to identify a directory as +belonging to a project, but doesn't provide many features of a typical +@ede{} project. Having the project however allows tools such as +@semantic{} to find sources and perform project level completions. + @menu * ede-cpp-root:: This project marks the root of a C/C++ code project. * ede-java-root:: This project marks the root of a Java project. * ede-emacs:: A project for working with Emacs. * ede-linux:: A project for working with Linux kernels. +* ede-generic-project:: A project type for wrapping build systems with EDE. * Custom Locate:: Customizing how to locate files in a simple project @end menu @@ -1045,7 +1027,7 @@ It pre-populates the C Preprocessor symbol map for correct parsing, and has an optimized include file identification function. -@node ede-linux, Custom Locate, ede-emacs, Simple projects +@node ede-linux, ede-generic-project, ede-emacs, Simple projects @subsection ede-linux The @code{ede-linux} project will automatically identify a Linux @@ -1054,7 +1036,60 @@ It pre-populates the C Preprocessor symbol map for reasonable parsing, and has an optimized include file identification function. -@node Custom Locate, , ede-linux, Simple projects +@node ede-generic-project, Custom Locate, ede-linux, Simple projects +@subsection ede-generic-project + +The @code{ede-generic-project} is a project system that makes it easy +to wrap up different kinds of build systems as an EDE project. +Projects such as @ref{ede-emacs} require coding skills to create. +Generic projects also require writing Emacs Lisp code, but the +requirements are minimal. You can then use +@command{customize-project} to configure build commands, includes, and +other options for that project. The configuration is saved in +@file{EDEConfig.el}. + +Generic projects are disabled by default because they have the +potential to interfere with other projects. To use the generic +project sytem to start detecting projects, you need to enable it. + +@deffn Command ede-enable-generic-projects +Enable generic project loaders. + +This enables generic loaders for projects that are detected using +either a @file{Makefile}, @file{SConstruct}, or @file{CMakeLists}. + +You do not need to use this command if you create your own generic +project type. +@end deffn + +If you want to create your own generic project loader, you need to +define your own project and target classes, and create an autoloader. +The example for Makefiles looks like this: + +@example +;;; MAKEFILE + +(defclass ede-generic-makefile-project (ede-generic-project) + ((buildfile :initform "Makefile") + ) + "Generic Project for makefiles.") + +(defmethod ede-generic-setup-configuration ((proj ede-generic-makefile-project) config) + "Setup a configuration for Make." + (oset config build-command "make -k") + (oset config debug-command "gdb ") + ) + +(ede-generic-new-autoloader "generic-makefile" "Make" + "Makefile" 'ede-generic-makefile-project) +@end example + +This example project will detect any directory with the file +@file{Makefile} in it as belonging to this project type. +Customization of the project will allow you to make build and debug +commands more precise. + +@node Custom Locate, , ede-generic-project, Simple projects @subsection Custom Locate The various simple project styles all have one major drawback, which @@ -1062,8 +1097,6 @@ When the EDE API is used to try and file files by some reference name in the project, then that could fail. -@@TODO - Add ID Utils and CScope examples - @ede{} can therefore use some external locate commands, such as the unix ``locate'' command, or ``GNU Global''. @@ -1093,6 +1126,11 @@ methods. See the code in @file{ede-locate.el} for GNU Global as a simple example. +@@TODO - Add ID Utils and CScope examples + +More on idutils and cscope is in the CEDET manual, and they each have +their own section. + @node Extending EDE, GNU Free Documentation License, Miscellaneous commands, Top @chapter Extending @ede{} === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-02-06 16:10:13 +0000 +++ lisp/ChangeLog 2013-02-07 06:23:54 +0000 @@ -1,3 +1,22 @@ +2013-02-07 Alan Mackenzie + + Fix bug in state cache mechanism. Remove 'BOD "strategy". Refactor. + * progmodes/cc-engine.el (c-get-fallback-scan-pos): Remove. + (c-parse-state-get-strategy): Don't return 'BOD any more. + (c-append-lower-brace-pair-to-state-cache): + Extra parameter HERE instead of narrowing. + Widen to top of buffer before searching backwards for a brace pair. + (c-state-push-any-brace-pair): Add HERE parameter to function call. + (c-append-to-state-cache): Extra parameter HERE in place of narrowing. + Narrow to parameter HERE, in place of being called narrowed. + (c-remove-stale-state-cache): Extra parameter HERE in place of + narrowing. Check there's an open brace in the cache before + searching for its match. + (c-invalidate-state-cache-1): Add HERE parameter to function call. + (c-parse-state-1): Don't narrow here for 'forward strategy, + instead passing extra parameter HERE to several functions. + Remove 'BOD strategy. + 2013-02-06 Nicolas Richard (tiny change) * emacs-lisp/package.el (describe-package-1): Tell what archive is === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2013-01-30 22:45:32 +0000 +++ lisp/gnus/ChangeLog 2013-02-07 06:23:54 +0000 @@ -1,3 +1,8 @@ +2013-02-07 Gábor Vida (tiny change) + + * auth-source.el (auth-source-format-prompt): Don't get confused by + any "\" in replacement text. (Bug#13637) + 2013-01-30 Christopher Schmidt * gnus-int.el (gnus-backend-trace-elapsed): New variable. === modified file 'lisp/gnus/auth-source.el' --- lisp/gnus/auth-source.el 2013-01-02 16:13:04 +0000 +++ lisp/gnus/auth-source.el 2013-02-07 06:23:54 +0000 @@ -913,7 +913,7 @@ (when (and c v) (setq prompt (replace-regexp-in-string (format "%%%c" c) (format "%s" v) - prompt))))) + prompt nil t))))) prompt) (defun auth-source-ensure-strings (values) === modified file 'lisp/progmodes/cc-engine.el' --- lisp/progmodes/cc-engine.el 2013-01-25 18:18:14 +0000 +++ lisp/progmodes/cc-engine.el 2013-02-07 06:23:54 +0000 @@ -2477,20 +2477,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Defuns which analyze the buffer, yet don't change `c-state-cache'. -(defun c-get-fallback-scan-pos (here) - ;; Return a start position for building `c-state-cache' from - ;; scratch. This will be at the top level, 2 defuns back. - (save-excursion - ;; Go back 2 bods, but ignore any bogus positions returned by - ;; beginning-of-defun (i.e. open paren in column zero). - (goto-char here) - (let ((cnt 2)) - (while (not (or (bobp) (zerop cnt))) - (c-beginning-of-defun-1) ; Pure elisp BOD. - (if (eq (char-after) ?\{) - (setq cnt (1- cnt))))) - (point))) - (defun c-state-balance-parens-backwards (here- here+ top) ;; Return the position of the opening paren/brace/bracket before HERE- which ;; matches the outermost close p/b/b between HERE+ and TOP. Except when @@ -2548,47 +2534,23 @@ ;; o - ('forward START-POINT) - scan forward from START-POINT, ;; which is not less than the highest position in `c-state-cache' below here. ;; o - ('backward nil) - scan backwards (from HERE). - ;; o - ('BOD START-POINT) - scan forwards from START-POINT, which is at the - ;; top level. ;; o - ('IN-LIT nil) - point is inside the literal containing point-min. (let ((cache-pos (c-get-cache-scan-pos here)) ; highest position below HERE in cache (or 1) - BOD-pos ; position of 2nd BOD before HERE. - strategy ; 'forward, 'backward, 'BOD, or 'IN-LIT. - start-point - how-far) ; putative scanning distance. + strategy ; 'forward, 'backward, or 'IN-LIT. + start-point) (setq good-pos (or good-pos (c-state-get-min-scan-pos))) (cond ((< here (c-state-get-min-scan-pos)) - (setq strategy 'IN-LIT - start-point nil - cache-pos nil - how-far 0)) + (setq strategy 'IN-LIT)) ((<= good-pos here) (setq strategy 'forward - start-point (max good-pos cache-pos) - how-far (- here start-point))) + start-point (max good-pos cache-pos))) ((< (- good-pos here) (- here cache-pos)) ; FIXME!!! ; apply some sort of weighting. - (setq strategy 'backward - how-far (- good-pos here))) + (setq strategy 'backward)) (t (setq strategy 'forward - how-far (- here cache-pos) - start-point cache-pos))) - - ;; Might we be better off starting from the top level, two defuns back, - ;; instead? This heuristic no longer works well in C++, where - ;; declarations inside namespace brace blocks are frequently placed at - ;; column zero. - (when (and (not (c-major-mode-is 'c++-mode)) - (> how-far c-state-cache-too-far)) - (setq BOD-pos (c-get-fallback-scan-pos here)) ; somewhat EXPENSIVE!!! - (if (< (- here BOD-pos) how-far) - (setq strategy 'BOD - start-point BOD-pos))) - - (list - strategy - (and (memq strategy '(forward BOD)) start-point)))) + start-point cache-pos))) + (list strategy (and (eq strategy 'forward) start-point)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -2630,7 +2592,7 @@ (setq c-state-point-min (point-min))) -(defun c-append-lower-brace-pair-to-state-cache (from &optional upper-lim) +(defun c-append-lower-brace-pair-to-state-cache (from here &optional upper-lim) ;; If there is a brace pair preceding FROM in the buffer, at the same level ;; of nesting (not necessarily immediately preceding), push a cons onto ;; `c-state-cache' to represent it. FROM must not be inside a literal. If @@ -2654,8 +2616,7 @@ ;; reduce the time wasted in repeated fruitless searches in brace deserts. (save-excursion (save-restriction - (let* ((here (point-max)) - new-cons + (let* (new-cons (cache-pos (c-state-cache-top-lparen)) ; might be nil. (macro-start-or-from (progn (goto-char from) @@ -2690,7 +2651,6 @@ ;; search bound, even though the algorithm below would skip ;; over the new paren pair. (cache-lim (and cache-pos (< cache-pos from) cache-pos))) - (widen) (narrow-to-region (cond ((and desert-lim cache-lim) @@ -2698,7 +2658,9 @@ (desert-lim) (cache-lim) ((point-min))) - (point-max))) + ;; The top limit is EOB to ensure that `bra' is inside the + ;; accessible part of the buffer at the next scan operation. + (1+ (buffer-size)))) ;; In the next pair of nested loops, the inner one moves back past a ;; pair of (mis-)matching parens or brackets; the outer one moves @@ -2765,25 +2727,24 @@ (if (consp (car c-state-cache)) (cdr c-state-cache) c-state-cache))) - ;; N.B. This defsubst codes one method for the simple, normal case, + ;; N.B. This defsubst codes one method for the simple, normal case, ;; and a more sophisticated, slower way for the general case. Don't ;; eliminate this defsubst - it's a speed optimization. - (c-append-lower-brace-pair-to-state-cache (1- bra+1))))) + (c-append-lower-brace-pair-to-state-cache (1- bra+1) (point-max))))) -(defun c-append-to-state-cache (from) - ;; Scan the buffer from FROM to (point-max), adding elements into - ;; `c-state-cache' for braces etc. Return a candidate for - ;; `c-state-cache-good-pos'. +(defun c-append-to-state-cache (from here) + ;; Scan the buffer from FROM to HERE, adding elements into `c-state-cache' + ;; for braces etc. Return a candidate for `c-state-cache-good-pos'. ;; ;; FROM must be after the latest brace/paren/bracket in `c-state-cache', if ;; any. Typically, it is immediately after it. It must not be inside a ;; literal. - (let ((here-bol (c-point 'bol (point-max))) + (let ((here-bol (c-point 'bol here)) (macro-start-or-here - (save-excursion (goto-char (point-max)) + (save-excursion (goto-char here) (if (c-beginning-of-macro) (point) - (point-max)))) + here))) pa+1 ; pos just after an opening PAren (or brace). (ren+1 from) ; usually a pos just after an closing paREN etc. ; Is actually the pos. to scan for a (/{/[ from, @@ -2796,75 +2757,77 @@ mstart) ; start of a macro. (save-excursion - ;; Each time round the following loop, we enter a successively deeper - ;; level of brace/paren nesting. (Except sometimes we "continue at - ;; the existing level".) `pa+1' is a pos inside an opening - ;; brace/paren/bracket, usually just after it. - (while - (progn - ;; Each time round the next loop moves forward over an opening then - ;; a closing brace/bracket/paren. This loop is white hot, so it - ;; plays ugly tricks to go fast. DON'T PUT ANYTHING INTO THIS - ;; LOOP WHICH ISN'T ABSOLUTELY NECESSARY!!! It terminates when a - ;; call of `scan-lists' signals an error, which happens when there - ;; are no more b/b/p's to scan. - (c-safe - (while t - (setq pa+1 (scan-lists ren+1 1 -1) ; Into (/{/[; might signal - paren+1s (cons pa+1 paren+1s)) - (setq ren+1 (scan-lists pa+1 1 1)) ; Out of )/}/]; might signal - (if (and (eq (char-before pa+1) ?{)) ; Check for a macro later. - (setq bra+1 pa+1)) - (setcar paren+1s ren+1))) - - (if (and pa+1 (> pa+1 ren+1)) - ;; We've just entered a deeper nesting level. - (progn - ;; Insert the brace pair (if present) and the single open - ;; paren/brace/bracket into `c-state-cache' It cannot be - ;; inside a macro, except one around point, because of what - ;; `c-neutralize-syntax-in-CPP' has done. - (c-state-push-any-brace-pair bra+1 macro-start-or-here) - ;; Insert the opening brace/bracket/paren position. - (setq c-state-cache (cons (1- pa+1) c-state-cache)) - ;; Clear admin stuff for the next more nested part of the scan. - (setq ren+1 pa+1 pa+1 nil bra+1 nil bra+1s nil) - t) ; Carry on the loop - - ;; All open p/b/b's at this nesting level, if any, have probably - ;; been closed by matching/mismatching ones. We're probably - ;; finished - we just need to check for having found an - ;; unmatched )/}/], which we ignore. Such a )/}/] can't be in a - ;; macro, due the action of `c-neutralize-syntax-in-CPP'. - (c-safe (setq ren+1 (scan-lists ren+1 1 1)))))) ; acts as loop control. - - ;; Record the final, innermost, brace-pair if there is one. - (c-state-push-any-brace-pair bra+1 macro-start-or-here) - - ;; Determine a good pos - (while (and (setq paren+1 (car paren+1s)) - (> (if (> paren+1 macro-start-or-here) - paren+1 - (goto-char paren+1) - (setq mstart (and (c-beginning-of-macro) - (point))) - (or mstart paren+1)) - here-bol)) - (setq paren+1s (cdr paren+1s))) - (cond - ((and paren+1 mstart) - (min paren+1 mstart)) - (paren+1) - (t from))))) - -(defun c-remove-stale-state-cache (start-point pps-point) + (save-restriction + (narrow-to-region (point-min) here) + ;; Each time round the following loop, we enter a successively deeper + ;; level of brace/paren nesting. (Except sometimes we "continue at + ;; the existing level".) `pa+1' is a pos inside an opening + ;; brace/paren/bracket, usually just after it. + (while + (progn + ;; Each time round the next loop moves forward over an opening then + ;; a closing brace/bracket/paren. This loop is white hot, so it + ;; plays ugly tricks to go fast. DON'T PUT ANYTHING INTO THIS + ;; LOOP WHICH ISN'T ABSOLUTELY NECESSARY!!! It terminates when a + ;; call of `scan-lists' signals an error, which happens when there + ;; are no more b/b/p's to scan. + (c-safe + (while t + (setq pa+1 (scan-lists ren+1 1 -1) ; Into (/{/[; might signal + paren+1s (cons pa+1 paren+1s)) + (setq ren+1 (scan-lists pa+1 1 1)) ; Out of )/}/]; might signal + (if (and (eq (char-before pa+1) ?{)) ; Check for a macro later. + (setq bra+1 pa+1)) + (setcar paren+1s ren+1))) + + (if (and pa+1 (> pa+1 ren+1)) + ;; We've just entered a deeper nesting level. + (progn + ;; Insert the brace pair (if present) and the single open + ;; paren/brace/bracket into `c-state-cache' It cannot be + ;; inside a macro, except one around point, because of what + ;; `c-neutralize-syntax-in-CPP' has done. + (c-state-push-any-brace-pair bra+1 macro-start-or-here) + ;; Insert the opening brace/bracket/paren position. + (setq c-state-cache (cons (1- pa+1) c-state-cache)) + ;; Clear admin stuff for the next more nested part of the scan. + (setq ren+1 pa+1 pa+1 nil bra+1 nil bra+1s nil) + t) ; Carry on the loop + + ;; All open p/b/b's at this nesting level, if any, have probably + ;; been closed by matching/mismatching ones. We're probably + ;; finished - we just need to check for having found an + ;; unmatched )/}/], which we ignore. Such a )/}/] can't be in a + ;; macro, due the action of `c-neutralize-syntax-in-CPP'. + (c-safe (setq ren+1 (scan-lists ren+1 1 1)))))) ; acts as loop control. + + ;; Record the final, innermost, brace-pair if there is one. + (c-state-push-any-brace-pair bra+1 macro-start-or-here) + + ;; Determine a good pos + (while (and (setq paren+1 (car paren+1s)) + (> (if (> paren+1 macro-start-or-here) + paren+1 + (goto-char paren+1) + (setq mstart (and (c-beginning-of-macro) + (point))) + (or mstart paren+1)) + here-bol)) + (setq paren+1s (cdr paren+1s))) + (cond + ((and paren+1 mstart) + (min paren+1 mstart)) + (paren+1) + (t from)))))) + +(defun c-remove-stale-state-cache (start-point here pps-point) ;; Remove stale entries from the `c-cache-state', i.e. those which will - ;; not be in it when it is amended for position (point-max). - ;; Additionally, the "outermost" open-brace entry before (point-max) - ;; will be converted to a cons if the matching close-brace is scanned. + ;; not be in it when it is amended for position HERE. Additionally, the + ;; "outermost" open-brace entry before HERE will be converted to a cons if + ;; the matching close-brace is scanned. ;; ;; START-POINT is a "maximal" "safe position" - there must be no open - ;; parens/braces/brackets between START-POINT and (point-max). + ;; parens/braces/brackets between START-POINT and HERE. ;; ;; As a second thing, calculate the result of parse-partial-sexp at ;; PPS-POINT, w.r.t. START-POINT. The motivation here is that @@ -2881,23 +2844,23 @@ ;; last element to be removed from `c-state-cache', when that elt is a ;; cons, otherwise nil. ;; o - PPS-STATE is the parse-partial-sexp state at PPS-POINT. - (save-restriction - (narrow-to-region 1 (point-max)) - (save-excursion - (let* ((in-macro-start ; start of macro containing (point-max) or nil. + (save-excursion + (save-restriction + (narrow-to-region 1 (point-max)) + (let* ((in-macro-start ; start of macro containing HERE or nil. (save-excursion - (goto-char (point-max)) + (goto-char here) (and (c-beginning-of-macro) (point)))) (start-point-actual-macro-start ; Start of macro containing ; start-point or nil - (and (< start-point (point-max)) + (and (< start-point here) (save-excursion (goto-char start-point) (and (c-beginning-of-macro) (point))))) (start-point-actual-macro-end ; End of this macro, (maybe - ; (point-max)), or nil. + ; HERE), or nil. (and start-point-actual-macro-start (save-excursion (goto-char start-point-actual-macro-start) @@ -2909,14 +2872,14 @@ scan-back-pos pair-beg pps-point-state target-depth) - ;; Remove entries beyond (point-max). Also remove any entries inside - ;; a macro, unless (point-max) is in the same macro. + ;; Remove entries beyond HERE. Also remove any entries inside + ;; a macro, unless HERE is in the same macro. (setq upper-lim (if (or (null c-state-old-cpp-beg) - (and (> (point-max) c-state-old-cpp-beg) - (< (point-max) c-state-old-cpp-end))) - (point-max) - (min (point-max) c-state-old-cpp-beg))) + (and (> here c-state-old-cpp-beg) + (< here c-state-old-cpp-end))) + here + (min here c-state-old-cpp-beg))) (while (and c-state-cache (>= (c-state-cache-top-lparen) upper-lim)) (setq scan-back-pos (car-safe (car c-state-cache))) (setq c-state-cache (cdr c-state-cache))) @@ -2934,7 +2897,7 @@ ;; time round; the corresponding elements in `c-state-cache' are ;; removed. `pos' is just after the brace-pair or the open paren at ;; (car c-state-cache). There can be no open parens/braces/brackets - ;; between `start-point'/`start-point-actual-macro-start' and (point-max), + ;; between `start-point'/`start-point-actual-macro-start' and HERE, ;; due to the interface spec to this function. (setq pos (if (and start-point-actual-macro-end (not (eq start-point-actual-macro-start @@ -2944,7 +2907,9 @@ start-point)) (goto-char pos) (while (and c-state-cache - (< (point) (point-max))) + (or (numberp (car c-state-cache)) ; Have we a { at all? + (cdr c-state-cache)) + (< (point) here)) (cond ((null pps-state) ; first time through (setq target-depth -1)) @@ -2956,7 +2921,7 @@ ;; Scan! (setq pps-state (parse-partial-sexp - (point) (if (< (point) pps-point) pps-point (point-max)) + (point) (if (< (point) pps-point) pps-point here) target-depth nil pps-state)) @@ -3209,7 +3174,7 @@ ;; Do we need to add in an earlier brace pair, having lopped one off? (if (and dropped-cons (< too-high-pa (+ here c-state-cache-too-far))) - (c-append-lower-brace-pair-to-state-cache too-high-pa here-bol)) + (c-append-lower-brace-pair-to-state-cache too-high-pa here here-bol)) (setq c-state-cache-good-pos (or (c-state-cache-after-top-paren) (c-state-get-min-scan-pos))))) @@ -3285,47 +3250,39 @@ strategy (car res) start-point (cadr res)) - (when (eq strategy 'BOD) - (setq c-state-cache nil - c-state-cache-good-pos start-point)) - ;; SCAN! - (save-restriction - (cond - ((memq strategy '(forward BOD)) - (narrow-to-region (point-min) here) - (setq res (c-remove-stale-state-cache start-point here-bopl)) - (setq cache-pos (car res) - scan-backward-pos (cadr res) - bopl-state (car (cddr res))) ; will be nil if (< here-bopl + (cond + ((eq strategy 'forward) + (setq res (c-remove-stale-state-cache start-point here here-bopl)) + (setq cache-pos (car res) + scan-backward-pos (cadr res) + bopl-state (car (cddr res))) ; will be nil if (< here-bopl ; start-point) - (if scan-backward-pos - (c-append-lower-brace-pair-to-state-cache scan-backward-pos)) - (setq good-pos - (c-append-to-state-cache cache-pos)) - (setq c-state-cache-good-pos - (if (and bopl-state - (< good-pos (- here c-state-cache-too-far))) - (c-state-cache-non-literal-place here-bopl bopl-state) - good-pos))) - - ((eq strategy 'backward) - (setq res (c-remove-stale-state-cache-backwards here) - good-pos (car res) - scan-backward-pos (cadr res) - scan-forward-p (car (cddr res))) - (if scan-backward-pos - (c-append-lower-brace-pair-to-state-cache - scan-backward-pos)) - (setq c-state-cache-good-pos - (if scan-forward-p - (progn (narrow-to-region (point-min) here) - (c-append-to-state-cache good-pos)) - good-pos))) - - (t ; (eq strategy 'IN-LIT) - (setq c-state-cache nil - c-state-cache-good-pos nil))))) + (if scan-backward-pos + (c-append-lower-brace-pair-to-state-cache scan-backward-pos here)) + (setq good-pos + (c-append-to-state-cache cache-pos here)) + (setq c-state-cache-good-pos + (if (and bopl-state + (< good-pos (- here c-state-cache-too-far))) + (c-state-cache-non-literal-place here-bopl bopl-state) + good-pos))) + + ((eq strategy 'backward) + (setq res (c-remove-stale-state-cache-backwards here) + good-pos (car res) + scan-backward-pos (cadr res) + scan-forward-p (car (cddr res))) + (if scan-backward-pos + (c-append-lower-brace-pair-to-state-cache scan-backward-pos here)) + (setq c-state-cache-good-pos + (if scan-forward-p + (c-append-to-state-cache good-pos here) + good-pos))) + + (t ; (eq strategy 'IN-LIT) + (setq c-state-cache nil + c-state-cache-good-pos nil)))) c-state-cache) === modified file 'nt/INSTALL' --- nt/INSTALL 2013-01-01 09:11:05 +0000 +++ nt/INSTALL 2013-02-02 08:23:52 +0000 @@ -110,12 +110,14 @@ WinZip is known to create some subtle and hard to debug problems, such as converting files to DOS CR-LF format, not creating empty directories, etc. We suggest to use djtarnt.exe from the GNU FTP - site. - - In addition to this file, you should also read INSTALL.BZR in the - parent directory, and make sure that you have a version of - "touch.exe" in your path, and that it will create files that do not - yet exist. + site. For modern formats, such as .tar.xz, we suggest bsdtar.exe + from the libarchive package; its precompiled Windows binaries are + available from this site: + + http://sourceforge.net/projects/ezwinports/files/ + + In addition to this file, if you build a development snapshot, you + should also read INSTALL.BZR in the parent directory. * Supported development environments ------------------------------------------------------------ Use --include-merged or -n0 to see merged revisions.