Now on revision 109714. ------------------------------------------------------------ revno: 109714 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-08-20 23:50:55 -0700 message: Use cal-tex-* functions more * lisp/calendar/cal-tex.el (cal-tex-cursor-filofax-year): Use cal-tex-vspace. (cal-tex-vspace, cal-tex-hspace, cal-tex-em, cal-tex-bf) (cal-tex-Huge-bf, cal-tex-large-bf): Use cal-tex-cmd. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-21 06:35:48 +0000 +++ lisp/ChangeLog 2012-08-21 06:50:55 +0000 @@ -1,5 +1,10 @@ 2012-08-21 Glenn Morris + * calendar/cal-tex.el (cal-tex-cursor-filofax-year): + Use cal-tex-vspace. + (cal-tex-vspace, cal-tex-hspace, cal-tex-em, cal-tex-bf) + (cal-tex-Huge-bf, cal-tex-large-bf): Use cal-tex-cmd. + * calendar/cal-tex.el (cal-tex-cursor-filofax-year) (cal-tex-cursor-week, cal-tex-cursor-week2) (cal-tex-cursor-week-iso, cal-tex-cursor-week-at-a-glance) === modified file 'lisp/calendar/cal-tex.el' --- lisp/calendar/cal-tex.el 2012-08-21 06:35:48 +0000 +++ lisp/calendar/cal-tex.el 2012-08-21 06:50:55 +0000 @@ -377,7 +377,7 @@ (cal-tex-cmd "\\fboxsep 0.5mm") (cal-tex-cmd "\\pagestyle" "empty") (cal-tex-b-document) - (cal-tex-cmd "\\vspace*" "0.25in") + (cal-tex-vspace "0.25in") (dotimes (j n) (insert (format "\\hfil \\textbf{\\Large %s} \\hfil\\\\\n" year)) (cal-tex-b-center) @@ -405,7 +405,7 @@ (if (= j (1- n)) (cal-tex-end-document) (cal-tex-newpage) - (cal-tex-cmd "\\vspace*" "0.25in")) + (cal-tex-vspace "0.25in")) (run-hooks 'cal-tex-year-hook)) (run-hooks 'cal-tex-hook))) @@ -1809,13 +1809,11 @@ (defun cal-tex-vspace (space) "Insert vspace command to move SPACE vertically." - (insert "\\vspace*{" space "}") - (cal-tex-comment)) + (cal-tex-cmd "\\vspace*" space)) (defun cal-tex-hspace (space) "Insert hspace command to move SPACE horizontally." - (insert "\\hspace*{" space "}") - (cal-tex-comment)) + (cal-tex-cmd "\\hspace*" space)) (defun cal-tex-comment (&optional comment) "Insert `% ', followed by optional string COMMENT, followed by newline. @@ -1922,11 +1920,11 @@ (defun cal-tex-em (string) "Insert STRING in italic font." - (insert "\\textit{" string "}")) + (cal-tex-cmd "\\textit" string)) (defun cal-tex-bf (string) "Insert STRING in bf font." - (insert "\\textbf{ " string "}")) + (cal-tex-cmd "\\textbf" string)) (defun cal-tex-scriptsize (string) "Insert STRING in scriptsize font." @@ -1942,7 +1940,7 @@ (defun cal-tex-Huge-bf (string) "Insert STRING in Huge bf font." - (insert "\\textbf{\\Huge " string "}")) + (cal-tex-cmd "\\textbf" (concat "\\Huge " string))) (defun cal-tex-large (string) "Insert STRING in large font." @@ -1950,7 +1948,7 @@ (defun cal-tex-large-bf (string) "Insert STRING in large bf font." - (insert "\\textbf{\\large " string "}")) + (cal-tex-cmd "\\textbf" (concat "\\large " string))) (provide 'cal-tex) ------------------------------------------------------------ revno: 109713 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-08-20 23:35:48 -0700 message: Improve cal-tex-cmd usage * lisp/calendar/cal-tex.el (cal-tex-cursor-filofax-year) (cal-tex-cursor-week, cal-tex-cursor-week2) (cal-tex-cursor-week-iso, cal-tex-cursor-week-at-a-glance) (cal-tex-cursor-filofax-2week, cal-tex-cursor-filofax-week) (cal-tex-cursor-filofax-daily, cal-tex-cursor-day) (cal-tex-insert-preamble, cal-tex-b-document) (cal-tex-e-document, cal-tex-b-center, cal-tex-e-center): Improve cal-tex-cmd usage. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-21 02:29:25 +0000 +++ lisp/ChangeLog 2012-08-21 06:35:48 +0000 @@ -1,5 +1,14 @@ 2012-08-21 Glenn Morris + * calendar/cal-tex.el (cal-tex-cursor-filofax-year) + (cal-tex-cursor-week, cal-tex-cursor-week2) + (cal-tex-cursor-week-iso, cal-tex-cursor-week-at-a-glance) + (cal-tex-cursor-filofax-2week, cal-tex-cursor-filofax-week) + (cal-tex-cursor-filofax-daily, cal-tex-cursor-day) + (cal-tex-insert-preamble, cal-tex-b-document) + (cal-tex-e-document, cal-tex-b-center, cal-tex-e-center): + Improve cal-tex-cmd usage. + * calendar/cal-tex.el (cal-tex-filofax-paper): New function. (cal-tex-cursor-filofax-year, cal-tex-cursor-filofax-2week) (cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily): Use it. === modified file 'lisp/calendar/cal-tex.el' --- lisp/calendar/cal-tex.el 2012-08-21 02:29:25 +0000 +++ lisp/calendar/cal-tex.el 2012-08-21 06:35:48 +0000 @@ -375,9 +375,9 @@ (cal-tex-preamble "twoside") (cal-tex-filofax-paper 'year) (cal-tex-cmd "\\fboxsep 0.5mm") - (cal-tex-cmd "\\pagestyle{empty}") + (cal-tex-cmd "\\pagestyle" "empty") (cal-tex-b-document) - (cal-tex-cmd "\\vspace*{0.25in}") + (cal-tex-cmd "\\vspace*" "0.25in") (dotimes (j n) (insert (format "\\hfil \\textbf{\\Large %s} \\hfil\\\\\n" year)) (cal-tex-b-center) @@ -405,7 +405,7 @@ (if (= j (1- n)) (cal-tex-end-document) (cal-tex-newpage) - (cal-tex-cmd "\\vspace*{0.25in}")) + (cal-tex-cmd "\\vspace*" "0.25in")) (run-hooks 'cal-tex-year-hook)) (run-hooks 'cal-tex-hook))) @@ -703,7 +703,7 @@ (cal-tex-weekly-paper) (insert cal-tex-LaTeX-hourbox) (cal-tex-b-document) - (cal-tex-cmd "\\pagestyle{empty}") + (cal-tex-cmd "\\pagestyle" "empty") (dotimes (i n) (cal-tex-vspace "-1.5in") (cal-tex-b-center) @@ -755,7 +755,7 @@ (cal-tex-weekly-paper) (insert cal-tex-LaTeX-hourbox) (cal-tex-b-document) - (cal-tex-cmd "\\pagestyle{empty}") + (cal-tex-cmd "\\pagestyle" "empty") (dotimes (i n) (cal-tex-vspace "-1.5in") (cal-tex-b-center) @@ -838,7 +838,7 @@ (cal-tex-preamble "11pt") (cal-tex-weekly-paper) (cal-tex-b-document) - (cal-tex-cmd "\\pagestyle{empty}") + (cal-tex-cmd "\\pagestyle" "empty") (dotimes (i n) (cal-tex-vspace "-1.5in") (cal-tex-b-center) @@ -1043,14 +1043,15 @@ (diary-list (if cal-tex-diary (cal-tex-list-diary-entries d1 d2)))) (cal-tex-preamble "twoside,12pt") - (cal-tex-cmd "\\textwidth 7in") - (cal-tex-cmd "\\textheight 10.5in") - (cal-tex-cmd "\\oddsidemargin 0in") - (cal-tex-cmd "\\evensidemargin 0in") - (cal-tex-cmd "\\topmargin 0pt") - (cal-tex-cmd "\\headheight -0.875in") - (cal-tex-cmd "\\headsep 0.125in") - (cal-tex-cmd "\\footskip .125in") + (insert "\\textwidth 7in +\\textheight 10.5in +\\oddsidemargin 0in +\\evensidemargin 0in +\\topmargin 0pt +\\headheight -0.875in +\\headsep 0.125in +\\footskip .125in +") (insert "\\def\\righthead#1{\\hfill {\\normalsize \\bf #1}\\\\[-6pt]} \\long\\def\\rightday#1#2#3#4#5{% \\rule{\\textwidth}{0.3pt}\\\\% @@ -1079,7 +1080,7 @@ \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\} ") (cal-tex-b-document) - (cal-tex-cmd "\\pagestyle{empty}\\ ") + (cal-tex-cmd "\\pagestyle" "empty") (dotimes (i n) (insert "\\lefthead") (cal-tex-arg @@ -1224,7 +1225,7 @@ \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\} ") (cal-tex-b-document) - (cal-tex-cmd "\\pagestyle{empty}") + (cal-tex-cmd "\\pagestyle" "empty") (dotimes (i n) (if (zerop (mod i 2)) (insert "\\righthead") @@ -1319,7 +1320,7 @@ \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\} ") (cal-tex-b-document) - (cal-tex-cmd "\\pagestyle{empty}\\ ") + (cal-tex-cmd "\\pagestyle" "empty") (dotimes (i n) (insert "\\lefthead") (cal-tex-arg @@ -1455,7 +1456,7 @@ \\def\\linesfill{\\par\\leaders\\copy\\LineBox\\vfill} ") (cal-tex-b-document) - (cal-tex-cmd "\\pagestyle{empty}") + (cal-tex-cmd "\\pagestyle" "empty") (dotimes (i n) (dotimes (j 4) (let ((even (zerop (% j 2)))) @@ -1517,7 +1518,7 @@ (cal-tex-preamble "12pt") (cal-tex-weekly-paper 'nomargins) (cal-tex-b-document) - (cal-tex-cmd "\\pagestyle{empty}") + (cal-tex-cmd "\\pagestyle" "empty") (dotimes (i n) (cal-tex-vspace "-1.7in") (cal-tex-daily-page (calendar-gregorian-from-absolute date)) @@ -1736,16 +1737,16 @@ (if (not landscape) (progn (cal-tex-cmd "\\oddsidemargin -1.75cm") - (cal-tex-cmd "\\def\\holidaymult{.06}")) - (cal-tex-cmd "\\special{landscape}") + (cal-tex-cmd "\\def\\holidaymult" ".06")) + (cal-tex-cmd "\\special" "landscape") (cal-tex-cmd "\\textwidth 9.5in") (cal-tex-cmd "\\textheight 7in") (cal-tex-comment) - (cal-tex-cmd "\\def\\holidaymult{.08}")) + (cal-tex-cmd "\\def\\holidaymult" ".08")) (cal-tex-cmd cal-tex-caldate) (cal-tex-cmd cal-tex-myday) (cal-tex-b-document) - (cal-tex-cmd "\\pagestyle{empty}")) + (cal-tex-cmd "\\pagestyle" "empty")) (cal-tex-cmd "\\setlength{\\cellwidth}" width) (insert (format "\\setlength{\\cellwidth}{%f\\cellwidth}\n" (/ 1.1 (length cal-tex-which-days)))) @@ -1853,20 +1854,20 @@ (defun cal-tex-b-document () "Insert beginning of document." - (cal-tex-cmd "\\begin{document}")) + (cal-tex-cmd "\\begin" "document")) (defun cal-tex-e-document () "Insert end of document." - (cal-tex-cmd "\\end{document}")) + (cal-tex-cmd "\\end" "document")) (defun cal-tex-b-center () "Insert beginning of centered block." - (cal-tex-cmd "\\begin{center}")) + (cal-tex-cmd "\\begin" "center")) (defun cal-tex-e-center () "Insert end of centered block." (cal-tex-comment) - (cal-tex-cmd "\\end{center}")) + (cal-tex-cmd "\\end" "center")) ;;; ------------------------------------------------------------ revno: 109712 committer: Dmitry Antipov branch nick: trunk timestamp: Tue 2012-08-21 08:46:05 +0400 message: Setter macros for fontsets. * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII) (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE) (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros. Adjust users. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-20 23:57:35 +0000 +++ src/ChangeLog 2012-08-21 04:46:05 +0000 @@ -1,3 +1,11 @@ +2012-08-21 Dmitry Antipov + + Setter macros for fontsets. + * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII) + (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE) + (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros. + Adjust users. + 2012-08-20 Glenn Morris * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)): === modified file 'src/fontset.c' --- src/fontset.c 2012-08-17 17:08:30 +0000 +++ src/fontset.c 2012-08-21 04:46:05 +0000 @@ -214,26 +214,46 @@ #define FONTSET_FROM_ID(id) AREF (Vfontset_table, id) /* Macros to access special values of FONTSET. */ -#define FONTSET_ID(fontset) XCHAR_TABLE (fontset)->extras[0] + +#define FONTSET_ID(fontset) XCHAR_TABLE (fontset)->extras[0] +#define SET_FONTSET_ID(fontset, id) \ + set_char_table_extras ((fontset), 0, (id)) /* Macros to access special values of (base) FONTSET. */ -#define FONTSET_NAME(fontset) XCHAR_TABLE (fontset)->extras[1] -#define FONTSET_ASCII(fontset) XCHAR_TABLE (fontset)->extras[4] -/* #define FONTSET_SPEC(fontset) XCHAR_TABLE (fontset)->extras[5] */ + +#define FONTSET_NAME(fontset) XCHAR_TABLE (fontset)->extras[1] +#define SET_FONTSET_NAME(fontset, name) \ + set_char_table_extras ((fontset), 1, (name)) + +#define FONTSET_ASCII(fontset) XCHAR_TABLE (fontset)->extras[4] +#define SET_FONTSET_ASCII(fontset, ascii) \ + set_char_table_extras ((fontset), 4, (ascii)) /* Macros to access special values of (realized) FONTSET. */ -#define FONTSET_BASE(fontset) XCHAR_TABLE (fontset)->extras[2] -#define FONTSET_FRAME(fontset) XCHAR_TABLE (fontset)->extras[3] -/* #define FONTSET_OBJLIST(fontset) XCHAR_TABLE (fontset)->extras[4] */ -#define FONTSET_NOFONT_FACE(fontset) XCHAR_TABLE (fontset)->extras[5] -/* #define FONTSET_REPERTORY(fontset) XCHAR_TABLE (fontset)->extras[6] */ -#define FONTSET_DEFAULT(fontset) XCHAR_TABLE (fontset)->extras[7] + +#define FONTSET_BASE(fontset) XCHAR_TABLE (fontset)->extras[2] +#define SET_FONTSET_BASE(fontset, base) \ + set_char_table_extras ((fontset), 2, (base)) + +#define FONTSET_FRAME(fontset) XCHAR_TABLE (fontset)->extras[3] +#define SET_FONTSET_FRAME(fontset, frame) \ + set_char_table_extras ((fontset), 3, (frame)) + +#define FONTSET_NOFONT_FACE(fontset) XCHAR_TABLE (fontset)->extras[5] +#define SET_FONTSET_NOFONT_FACE(fontset, face) \ + set_char_table_extras ((fontset), 5, (face)) + +#define FONTSET_DEFAULT(fontset) XCHAR_TABLE (fontset)->extras[7] +#define SET_FONTSET_DEFAULT(fontset, def) \ + set_char_table_extras ((fontset), 7, (def)) /* For both base and realized fontset. */ -#define FONTSET_FALLBACK(fontset) XCHAR_TABLE (fontset)->extras[8] - -#define BASE_FONTSET_P(fontset) (NILP (FONTSET_BASE (fontset))) - + +#define FONTSET_FALLBACK(fontset) XCHAR_TABLE (fontset)->extras[8] +#define SET_FONTSET_FALLBACK(fontset, fallback) \ + set_char_table_extras ((fontset), 8, (fallback)) + +#define BASE_FONTSET_P(fontset) (NILP (FONTSET_BASE (fontset))) /* Macros for FONT-DEF and RFONT-DEF of fontset. */ #define FONT_DEF_NEW(font_def, font_spec, encoding, repertory) \ @@ -265,7 +285,7 @@ #define RFONT_DEF_NEW(rfont_def, font_def) \ do { \ (rfont_def) = Fmake_vector (make_number (4), Qnil); \ - ASET ((rfont_def), 1, (font_def)); \ + ASET ((rfont_def), 1, (font_def)); \ RFONT_DEF_SET_SCORE ((rfont_def), 0); \ } while (0) @@ -307,12 +327,13 @@ replace with ELT, if ADD is `prepend', prepend ELT, otherwise, append ELT. */ -#define FONTSET_ADD(fontset, range, elt, add) \ - (NILP (add) \ - ? (NILP (range) \ - ? (FONTSET_FALLBACK (fontset) = Fmake_vector (make_number (1), (elt))) \ - : Fset_char_table_range ((fontset), (range), \ - Fmake_vector (make_number (1), (elt)))) \ +#define FONTSET_ADD(fontset, range, elt, add) \ + (NILP (add) \ + ? (NILP (range) \ + ? (SET_FONTSET_FALLBACK \ + (fontset, Fmake_vector (make_number (1), (elt)))) \ + : Fset_char_table_range ((fontset), (range), \ + Fmake_vector (make_number (1), (elt)))) \ : fontset_add ((fontset), (range), (elt), (add))) static Lisp_Object @@ -341,8 +362,8 @@ else { args[idx] = FONTSET_FALLBACK (fontset); - FONTSET_FALLBACK (fontset) - = NILP (args[idx]) ? args[1 - idx] : Fvconcat (2, args); + SET_FONTSET_FALLBACK + (fontset, NILP (args[idx]) ? args[1 - idx] : Fvconcat (2, args)); } return Qnil; } @@ -485,7 +506,7 @@ if (c >= 0) char_table_set_range (fontset, from, to, font_group); else - FONTSET_FALLBACK (fontset) = font_group; + SET_FONTSET_FALLBACK (fontset, font_group); return font_group; } @@ -720,8 +741,9 @@ if (! EQ (base_fontset, Vdefault_fontset)) { if (NILP (FONTSET_DEFAULT (fontset))) - FONTSET_DEFAULT (fontset) - = make_fontset (FONTSET_FRAME (fontset), Qnil, Vdefault_fontset); + SET_FONTSET_DEFAULT + (fontset, + make_fontset (FONTSET_FRAME (fontset), Qnil, Vdefault_fontset)); FONT_DEFERRED_LOG ("default fontset: font for", make_number (c), Qnil); default_rfont_def = fontset_find_font (FONTSET_DEFAULT (fontset), c, face, id, 0); @@ -781,16 +803,14 @@ fontset = Fmake_char_table (Qfontset, Qnil); - FONTSET_ID (fontset) = make_number (id); + SET_FONTSET_ID (fontset, make_number (id)); if (NILP (base)) - { - FONTSET_NAME (fontset) = name; - } + SET_FONTSET_NAME (fontset, name); else { - FONTSET_NAME (fontset) = Qnil; - FONTSET_FRAME (fontset) = frame; - FONTSET_BASE (fontset) = base; + SET_FONTSET_NAME (fontset, Qnil); + SET_FONTSET_FRAME (fontset, frame); + SET_FONTSET_BASE (fontset, base); } ASET (Vfontset_table, id, fontset); @@ -958,7 +978,7 @@ else { face_id = face_for_font (f, Qnil, face); - FONTSET_NOFONT_FACE (fontset) = make_number (face_id); + SET_FONTSET_NOFONT_FACE (fontset, make_number (face_id)); } } eassert (face_id >= 0); @@ -1580,7 +1600,7 @@ Lisp_Object tail, fr, alist; int fontset_id = XINT (FONTSET_ID (fontset)); - FONTSET_ASCII (fontset) = fontname; + SET_FONTSET_ASCII (fontset, fontname); name = FONTSET_NAME (fontset); FOR_EACH_FRAME (tail, fr) { @@ -1658,7 +1678,7 @@ len = font_unparse_xlfd (font_spec, 0, xlfd, 256); if (len < 0) error ("Invalid fontset name (perhaps too long): %s", SDATA (name)); - FONTSET_ASCII (fontset) = make_unibyte_string (xlfd, len); + SET_FONTSET_ASCII (fontset, make_unibyte_string (xlfd, len)); } else { @@ -1744,7 +1764,7 @@ Fset_fontset_font (name, Qnil, font_spec, Qnil, Qnil); } - FONTSET_ASCII (fontset) = font_name; + SET_FONTSET_ASCII (fontset, font_name); return XINT (FONTSET_ID (fontset)); } @@ -2161,9 +2181,10 @@ Vdefault_fontset = Fmake_char_table (Qfontset, Qnil); staticpro (&Vdefault_fontset); - FONTSET_ID (Vdefault_fontset) = make_number (0); - FONTSET_NAME (Vdefault_fontset) - = build_pure_c_string ("-*-*-*-*-*-*-*-*-*-*-*-*-fontset-default"); + SET_FONTSET_ID (Vdefault_fontset, make_number (0)); + SET_FONTSET_NAME + (Vdefault_fontset, + build_pure_c_string ("-*-*-*-*-*-*-*-*-*-*-*-*-fontset-default")); ASET (Vfontset_table, 0, Vdefault_fontset); next_fontset_id = 1; ------------------------------------------------------------ revno: 109711 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-08-20 22:29:25 -0400 message: Reduce some cal-tex code duplication * lisp/calendar/cal-tex.el (cal-tex-filofax-paper): New function. (cal-tex-cursor-filofax-year, cal-tex-cursor-filofax-2week) (cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily): Use it. (cal-tex-weekly-paper): New function. (cal-tex-cursor-week, cal-tex-cursor-week2) (cal-tex-cursor-week-iso, cal-tex-cursor-week-monday) (cal-tex-cursor-day): Use it. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-21 01:36:27 +0000 +++ lisp/ChangeLog 2012-08-21 02:29:25 +0000 @@ -1,5 +1,13 @@ 2012-08-21 Glenn Morris + * calendar/cal-tex.el (cal-tex-filofax-paper): New function. + (cal-tex-cursor-filofax-year, cal-tex-cursor-filofax-2week) + (cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily): Use it. + (cal-tex-weekly-paper): New function. + (cal-tex-cursor-week, cal-tex-cursor-week2) + (cal-tex-cursor-week-iso, cal-tex-cursor-week-monday) + (cal-tex-cursor-day): Use it. + * calendar/cal-tex.el (cal-tex-cursor-week-at-a-glance) (cal-tex-cursor-filofax-week): Remove leading blank page. === modified file 'lisp/calendar/cal-tex.el' --- lisp/calendar/cal-tex.el 2012-08-21 01:36:27 +0000 +++ lisp/calendar/cal-tex.el 2012-08-21 02:29:25 +0000 @@ -344,6 +344,25 @@ (run-hooks 'cal-tex-year-hook)) (run-hooks 'cal-tex-hook)) + +(defun cal-tex-filofax-paper (&optional year) + "Insert some page size settings for filofax layouts." + (insert "\\textwidth 3.25in +\\textheight 6.5in +\\headheight -0.875in +\\topmargin 0pt +") + (insert + ;; Why is this one subtly different? Who knows... + (if year "\\oddsidemargin 1.675in +\\evensidemargin 1.675in +" + "\\oddsidemargin 1.75in +\\evensidemargin 1.5in +\\headsep 0.125in +\\footskip 0.125in +"))) + ;;;###cal-autoload (defun cal-tex-cursor-filofax-year (&optional n event) "Make a Filofax one page yearly calendar of year indicated by cursor. @@ -354,12 +373,7 @@ (or n (setq n 1)) (let ((year (calendar-extract-year (calendar-cursor-to-date t event)))) (cal-tex-preamble "twoside") - (cal-tex-cmd "\\textwidth 3.25in") - (cal-tex-cmd "\\textheight 6.5in") - (cal-tex-cmd "\\oddsidemargin 1.675in") - (cal-tex-cmd "\\evensidemargin 1.675in") - (cal-tex-cmd "\\topmargin 0pt") - (cal-tex-cmd "\\headheight -0.875in") + (cal-tex-filofax-paper 'year) (cal-tex-cmd "\\fboxsep 0.5mm") (cal-tex-cmd "\\pagestyle{empty}") (cal-tex-b-document) @@ -653,6 +667,15 @@ {\\makebox[2em]{\\rule{0cm}{#2ex}#1}\\rule{3in}{.15mm}}\n" "One hour and a line on the right.") +(defun cal-tex-weekly-paper (&optional nomargins) + "Insert some page size settings for weekly layouts." + (insert "\\textwidth 6.5in +\\textheight 10.5in +") + (or nomargins (insert "\\oddsidemargin 0in +\\evensidemargin 0in +"))) + ;; TODO cal-tex-diary-support. ;; TODO respect cal-tex-daily-start,end (see cal-tex-week-hours). ;;;###cal-autoload @@ -677,10 +700,7 @@ (holidays (if cal-tex-holidays (holiday-in-range d1 d2)))) (cal-tex-preamble "11pt") - (cal-tex-cmd "\\textwidth 6.5in") - (cal-tex-cmd "\\textheight 10.5in") - (cal-tex-cmd "\\oddsidemargin 0in") - (cal-tex-cmd "\\evensidemargin 0in") + (cal-tex-weekly-paper) (insert cal-tex-LaTeX-hourbox) (cal-tex-b-document) (cal-tex-cmd "\\pagestyle{empty}") @@ -732,10 +752,7 @@ (holidays (if cal-tex-holidays (holiday-in-range d1 d2)))) (cal-tex-preamble "12pt") - (cal-tex-cmd "\\textwidth 6.5in") - (cal-tex-cmd "\\textheight 10.5in") - (cal-tex-cmd "\\oddsidemargin 0in") - (cal-tex-cmd "\\evensidemargin 0in") + (cal-tex-weekly-paper) (insert cal-tex-LaTeX-hourbox) (cal-tex-b-document) (cal-tex-cmd "\\pagestyle{empty}") @@ -819,10 +836,7 @@ (cal-tex-list-diary-entries d1 d2))) s) (cal-tex-preamble "11pt") - (cal-tex-cmd "\\textwidth 6.5in") - (cal-tex-cmd "\\textheight 10.5in") - (cal-tex-cmd "\\oddsidemargin 0in") - (cal-tex-cmd "\\evensidemargin 0in") + (cal-tex-weekly-paper) (cal-tex-b-document) (cal-tex-cmd "\\pagestyle{empty}") (dotimes (i n) @@ -941,10 +955,7 @@ (calendar-absolute-from-gregorian (calendar-cursor-to-date t event)))))) (cal-tex-preamble "11pt") - (cal-tex-cmd "\\textwidth 6.5in") - (cal-tex-cmd "\\textheight 10.5in") - (cal-tex-cmd "\\oddsidemargin 0in") - (cal-tex-cmd "\\evensidemargin 0in") + (cal-tex-weekly-paper) (cal-tex-b-document) (dotimes (i n) (cal-tex-vspace "-1cm") @@ -1192,14 +1203,7 @@ (diary-list (if cal-tex-diary (cal-tex-list-diary-entries d1 d2)))) (cal-tex-preamble "twoside") - (cal-tex-cmd "\\textwidth 3.25in") - (cal-tex-cmd "\\textheight 6.5in") - (cal-tex-cmd "\\oddsidemargin 1.75in") - (cal-tex-cmd "\\evensidemargin 1.5in") - (cal-tex-cmd "\\topmargin 0pt") - (cal-tex-cmd "\\headheight -0.875in") - (cal-tex-cmd "\\headsep 0.125in") - (cal-tex-cmd "\\footskip .125in") + (cal-tex-filofax-paper) (insert "\\def\\righthead#1{\\hfill {\\normalsize \\bf #1}\\\\[-6pt]} \\long\\def\\rightday#1#2#3#4#5{% \\rule{\\textwidth}{0.3pt}\\\\% @@ -1286,14 +1290,7 @@ (diary-list (if cal-tex-diary (cal-tex-list-diary-entries d1 d2)))) (cal-tex-preamble "twoside") - (cal-tex-cmd "\\textwidth 3.25in") - (cal-tex-cmd "\\textheight 6.5in") - (cal-tex-cmd "\\oddsidemargin 1.75in") - (cal-tex-cmd "\\evensidemargin 1.5in") - (cal-tex-cmd "\\topmargin 0pt") - (cal-tex-cmd "\\headheight -0.875in") - (cal-tex-cmd "\\headsep 0.125in") - (cal-tex-cmd "\\footskip .125in") + (cal-tex-filofax-paper) (insert "\\def\\righthead#1{\\hfill {\\normalsize \\bf #1}\\\\[-6pt]} \\long\\def\\rightday#1#2#3#4#5{% \\rule{\\textwidth}{0.3pt}\\\\% @@ -1425,14 +1422,7 @@ (diary-list (if cal-tex-diary (cal-tex-list-diary-entries d1 d2)))) (cal-tex-preamble "twoside") - (cal-tex-cmd "\\textwidth 3.25in") - (cal-tex-cmd "\\textheight 6.5in") - (cal-tex-cmd "\\oddsidemargin 1.75in") - (cal-tex-cmd "\\evensidemargin 1.5in") - (cal-tex-cmd "\\topmargin 0pt") - (cal-tex-cmd "\\headheight -0.875in") - (cal-tex-cmd "\\headsep 0.125in") - (cal-tex-cmd "\\footskip .125in") + (cal-tex-filofax-paper) (insert "\\def\\righthead#1{\\hfill {\\normalsize \\bf #1}\\\\[-6pt]} \\long\\def\\rightday#1#2#3{% \\rule{\\textwidth}{0.3pt}\\\\% @@ -1525,8 +1515,7 @@ (let ((date (calendar-absolute-from-gregorian (calendar-cursor-to-date t event)))) (cal-tex-preamble "12pt") - (cal-tex-cmd "\\textwidth 6.5in") - (cal-tex-cmd "\\textheight 10.5in") + (cal-tex-weekly-paper 'nomargins) (cal-tex-b-document) (cal-tex-cmd "\\pagestyle{empty}") (dotimes (i n) ------------------------------------------------------------ revno: 109710 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-08-20 21:36:27 -0400 message: Remove some blank pages from cal-tex output * lisp/calendar/cal-tex.el (cal-tex-cursor-week-at-a-glance) (cal-tex-cursor-filofax-week): Remove leading blank page. (Were these supposed to serve some purpose? Printing?) diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-21 01:32:26 +0000 +++ lisp/ChangeLog 2012-08-21 01:36:27 +0000 @@ -1,5 +1,8 @@ 2012-08-21 Glenn Morris + * calendar/cal-tex.el (cal-tex-cursor-week-at-a-glance) + (cal-tex-cursor-filofax-week): Remove leading blank page. + * calendar/cal-tex.el (cal-tex-cursor-week-at-a-glance): Add autoload cookie. For now at least, don't use color, since no other cal-tex function does. === modified file 'lisp/calendar/cal-tex.el' --- lisp/calendar/cal-tex.el 2012-08-21 01:32:26 +0000 +++ lisp/calendar/cal-tex.el 2012-08-21 01:36:27 +0000 @@ -1069,7 +1069,6 @@ ") (cal-tex-b-document) (cal-tex-cmd "\\pagestyle{empty}\\ ") - (cal-tex-newpage) (dotimes (i n) (insert "\\lefthead") (cal-tex-arg @@ -1324,7 +1323,6 @@ ") (cal-tex-b-document) (cal-tex-cmd "\\pagestyle{empty}\\ ") - (cal-tex-newpage) (dotimes (i n) (insert "\\lefthead") (cal-tex-arg ------------------------------------------------------------ revno: 109709 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-08-20 21:32:26 -0400 message: cal-tex-cursor-week-at-a-glance small fixes * lisp/calendar/cal-tex.el (cal-tex-cursor-week-at-a-glance): Add autoload cookie. For now at least, don't use color, since no other cal-tex function does. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-21 01:10:27 +0000 +++ lisp/ChangeLog 2012-08-21 01:32:26 +0000 @@ -1,5 +1,9 @@ 2012-08-21 Glenn Morris + * calendar/cal-tex.el (cal-tex-cursor-week-at-a-glance): + Add autoload cookie. For now at least, don't use color, since + no other cal-tex function does. + * calendar/cal-tex.el (cal-tex-cursor-week-iso) (cal-tex-cursor-filofax-2week, cal-tex-cursor-filofax-week) (cal-tex-cursor-filofax-daily): Correct start date for diary entries. === modified file 'lisp/calendar/cal-tex.el' --- lisp/calendar/cal-tex.el 2012-08-21 01:10:27 +0000 +++ lisp/calendar/cal-tex.el 2012-08-21 01:32:26 +0000 @@ -1006,12 +1006,13 @@ (cal-tex-e-framebox) (cal-tex-hspace "1cm"))) +;;;###cal-autoload (defun cal-tex-cursor-week-at-a-glance (&optional n event) "One-week-at-a-glance full page calendar for week indicated by cursor. Optional prefix argument N specifies number of weeks (default 1), starting on Mondays. The calendar shows holiday and diary entries if `cal-tex-holidays' and `cal-tex-diary', respectively, are non-nil. -It does not show hours of the day. Optional EVENT indicates a buffer +It does not show hours of the day. Optional EVENT indicates a buffer position to use instead of point." (interactive (list (prefix-numeric-value current-prefix-arg) last-nonmenu-event)) @@ -1031,7 +1032,6 @@ (diary-list (if cal-tex-diary (cal-tex-list-diary-entries d1 d2)))) (cal-tex-preamble "twoside,12pt") - (cal-tex-cmd "\\usepackage{color}") (cal-tex-cmd "\\textwidth 7in") (cal-tex-cmd "\\textheight 10.5in") (cal-tex-cmd "\\oddsidemargin 0in") @@ -1047,16 +1047,16 @@ \\vbox to 2.75in{% \\vspace*{2pt}% \\hbox to \\textwidth{\\small #5 \\hfill #1 {\\normalsize \\bf #2}}% - \\hbox to \\textwidth{\\vbox {\\raggedleft \\footnotesize \\em \\textcolor{red}{#4}}}% - \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize \\textcolor{blue}{#3}}}}}\\\\} + \\hbox to \\textwidth{\\vbox {\\raggedleft \\footnotesize \\em #4}}% + \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\} \\long\\def\\weekend#1#2#3#4#5{% \\rule{\\textwidth}{0.3pt}\\\\% \\hbox to \\textwidth{% \\vbox to 1.8in{% \\vspace*{2pt}% \\hbox to \\textwidth{\\small #5 \\hfill #1 {\\normalsize \\bf #2}}% - \\hbox to \\textwidth{\\vbox {\\raggedleft \\footnotesize \\em \\textcolor{red}{#4}}}% - \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize \\textcolor{blue}{#3}}}}}\\\\} + \\hbox to \\textwidth{\\vbox {\\raggedleft \\footnotesize \\em #4}}% + \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\} \\def\\lefthead#1{\\noindent {\\normalsize \\bf #1}\\hfill\\\\[-6pt]} \\long\\def\\leftday#1#2#3#4#5{% \\rule{\\textwidth}{0.3pt}\\\\% @@ -1064,8 +1064,8 @@ \\vbox to 2.75in{% \\vspace*{2pt}% \\hbox to \\textwidth{\\noindent {\\normalsize \\bf #2} \\small #1 \\hfill #5}% - \\hbox to \\textwidth{\\vbox {\\noindent \\footnotesize \\em \\textcolor{red}{#4}}}% - \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize \\textcolor{blue}{#3}}}}}\\\\} + \\hbox to \\textwidth{\\vbox {\\noindent \\footnotesize \\em #4}}% + \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\} ") (cal-tex-b-document) (cal-tex-cmd "\\pagestyle{empty}\\ ") ------------------------------------------------------------ revno: 109708 committer: Katsumi Yamaoka branch nick: trunk timestamp: Tue 2012-08-21 01:23:57 +0000 message: gnus-msg.el (gnus-summary-resend-message): Honor posting-style for `name' and `address' in Resent-From header diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2012-08-14 05:34:20 +0000 +++ lisp/gnus/ChangeLog 2012-08-21 01:23:57 +0000 @@ -1,3 +1,8 @@ +2012-08-21 Katsumi Yamaoka + + * gnus-msg.el (gnus-summary-resend-message): Honor posting-style for + `name' and `address' in Resent-From header. + 2012-08-14 Chong Yidong * gnus-art.el (article-display-face): Handle failure in === modified file 'lisp/gnus/gnus-msg.el' --- lisp/gnus/gnus-msg.el 2012-08-15 16:29:11 +0000 +++ lisp/gnus/gnus-msg.el 2012-08-21 01:23:57 +0000 @@ -1369,7 +1369,21 @@ (nnmail-fetch-field "to")))) current-prefix-arg)) (let ((message-header-setup-hook (copy-sequence message-header-setup-hook)) - (message-sent-hook (copy-sequence message-sent-hook))) + (message-sent-hook (copy-sequence message-sent-hook)) + ;; Honor posting-style for `name' and `address' in Resent-From header. + (styles (gnus-group-find-parameter gnus-newsgroup-name + 'posting-style t)) + (user-full-name user-full-name) + (user-mail-address user-mail-address) + tem) + (dolist (style (if styles + (append gnus-posting-styles (list (cons ".*" styles))) + gnus-posting-styles)) + (when (string-match (pop style) gnus-newsgroup-name) + (when (setq tem (cadr (assq 'name style))) + (setq user-full-name tem)) + (when (setq tem (cadr (assq 'address style))) + (setq user-mail-address tem)))) ;; `gnus-summary-resend-message-insert-gcc' must run last. (add-hook 'message-header-setup-hook 'gnus-summary-resend-message-insert-gcc t) ------------------------------------------------------------ revno: 109707 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-08-20 21:10:27 -0400 message: cal-tex small fix * lisp/calendar/cal-tex.el (cal-tex-cursor-week-iso) (cal-tex-cursor-filofax-2week, cal-tex-cursor-filofax-week) (cal-tex-cursor-filofax-daily): Correct start date for diary entries. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-21 00:12:42 +0000 +++ lisp/ChangeLog 2012-08-21 01:10:27 +0000 @@ -1,3 +1,9 @@ +2012-08-21 Glenn Morris + + * calendar/cal-tex.el (cal-tex-cursor-week-iso) + (cal-tex-cursor-filofax-2week, cal-tex-cursor-filofax-week) + (cal-tex-cursor-filofax-daily): Correct start date for diary entries. + 2012-08-21 Juri Linkov * info.el (Info-file-attributes): New variable. === modified file 'lisp/calendar/cal-tex.el' --- lisp/calendar/cal-tex.el 2012-08-20 07:23:51 +0000 +++ lisp/calendar/cal-tex.el 2012-08-21 01:10:27 +0000 @@ -816,10 +816,7 @@ (holidays (if cal-tex-holidays (holiday-in-range d1 d2))) (diary-list (if cal-tex-diary - (cal-tex-list-diary-entries - ;; FIXME d1? - (calendar-absolute-from-gregorian (list month 1 year)) - d2))) + (cal-tex-list-diary-entries d1 d2))) s) (cal-tex-preamble "11pt") (cal-tex-cmd "\\textwidth 6.5in") @@ -1194,10 +1191,7 @@ (holidays (if cal-tex-holidays (holiday-in-range d1 d2))) (diary-list (if cal-tex-diary - (cal-tex-list-diary-entries - ;; FIXME d1? - (calendar-absolute-from-gregorian (list month 1 year)) - d2)))) + (cal-tex-list-diary-entries d1 d2)))) (cal-tex-preamble "twoside") (cal-tex-cmd "\\textwidth 3.25in") (cal-tex-cmd "\\textheight 6.5in") @@ -1291,10 +1285,7 @@ (holidays (if cal-tex-holidays (holiday-in-range d1 d2))) (diary-list (if cal-tex-diary - (cal-tex-list-diary-entries - ;; FIXME d1? - (calendar-absolute-from-gregorian (list month 1 year)) - d2)))) + (cal-tex-list-diary-entries d1 d2)))) (cal-tex-preamble "twoside") (cal-tex-cmd "\\textwidth 3.25in") (cal-tex-cmd "\\textheight 6.5in") @@ -1434,10 +1425,7 @@ (holidays (if cal-tex-holidays (holiday-in-range d1 d2))) (diary-list (if cal-tex-diary - (cal-tex-list-diary-entries - ;; FIXME d1? - (calendar-absolute-from-gregorian (list month 1 year)) - d2)))) + (cal-tex-list-diary-entries d1 d2)))) (cal-tex-preamble "twoside") (cal-tex-cmd "\\textwidth 3.25in") (cal-tex-cmd "\\textheight 6.5in") ------------------------------------------------------------ revno: 109706 fixes bug: http://debbugs.gnu.org/12230 committer: Juri Linkov branch nick: trunk timestamp: Tue 2012-08-21 03:12:42 +0300 message: * lisp/info.el (Info-file-attributes): New variable. (info-insert-file-contents): Add file attributes to `Info-file-attributes'. Clear the caches `Info-index-nodes' and `Info-toc-nodes' when previous modtime of the Info file is less than new modtime. (Info-toc-nodes, Info-index-nodes): Move definitions up to the top of info.el. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-20 18:13:03 +0000 +++ lisp/ChangeLog 2012-08-21 00:12:42 +0000 @@ -1,3 +1,13 @@ +2012-08-21 Juri Linkov + + * info.el (Info-file-attributes): New variable. + (info-insert-file-contents): Add file attributes to + `Info-file-attributes'. Clear the caches `Info-index-nodes' and + `Info-toc-nodes' when previous modtime of the Info file is less + than new modtime. + (Info-toc-nodes, Info-index-nodes): Move definitions up to the top + of info.el. (Bug#12230) + 2012-08-20 Glenn Morris * calendar/diary-lib.el (diary-include-files, diary-sexp-entry): === modified file 'lisp/info.el' --- lisp/info.el 2012-08-08 08:48:57 +0000 +++ lisp/info.el 2012-08-21 00:12:42 +0000 @@ -417,6 +417,21 @@ (defvar Info-standalone nil "Non-nil if Emacs was started solely as an Info browser.") +(defvar Info-file-attributes nil + "Alist of file attributes of visited Info files. +Each element is a list (FILE-NAME FILE-ATTRIBUTES...).") + +(defvar Info-toc-nodes nil + "Alist of cached parent-children node information in visited Info files. +Each element is (FILE (NODE-NAME PARENT SECTION CHILDREN) ...) +where PARENT is the parent node extracted from the Up pointer, +SECTION is the section name in the Top node where this node is placed, +CHILDREN is a list of child nodes extracted from the node menu.") + +(defvar Info-index-nodes nil + "Alist of cached index node names of visited Info files. +Each element has the form (INFO-FILE INDEX-NODE-NAMES-LIST).") + (defvar Info-virtual-files nil "List of definitions of virtual Info files. Each element of the list has the format (FILENAME (OPERATION . HANDLER) ...) @@ -609,7 +624,26 @@ (apply 'call-process-region (point-min) (point-max) (car decoder) t t nil (cdr decoder)))) (let ((inhibit-null-byte-detection t)) ; Index nodes include null bytes - (insert-file-contents fullname visit))))) + (insert-file-contents fullname visit))) + + ;; Clear the caches of modified Info files. + (let* ((attribs-old (cdr (assoc fullname Info-file-attributes))) + (modtime-old (and attribs-old (nth 5 attribs-old))) + (attribs-new (and (stringp fullname) (file-attributes fullname))) + (modtime-new (and attribs-new (nth 5 attribs-new)))) + (when (and modtime-old modtime-new + (> (float-time modtime-new) (float-time modtime-old))) + (setq Info-index-nodes (remove (assoc (or Info-current-file filename) + Info-index-nodes) + Info-index-nodes)) + (setq Info-toc-nodes (remove (assoc (or Info-current-file filename) + Info-toc-nodes) + Info-toc-nodes))) + ;; Add new modtime to `Info-file-attributes'. + (setq Info-file-attributes + (cons (cons fullname attribs-new) + (remove (assoc fullname Info-file-attributes) + Info-file-attributes)))))) (defun Info-file-supports-index-cookies (&optional file) "Return non-nil value if FILE supports Info index cookies. @@ -2394,13 +2428,6 @@ (message "") (nreverse nodes)))) -(defvar Info-toc-nodes nil - "Alist of cached parent-children node information in visited Info files. -Each element is (FILE (NODE-NAME PARENT SECTION CHILDREN) ...) -where PARENT is the parent node extracted from the Up pointer, -SECTION is the section name in the Top node where this node is placed, -CHILDREN is a list of child nodes extracted from the node menu.") - (defun Info-toc-nodes (filename) "Return a node list of Info FILENAME with parent-children information. This information is cached in the variable `Info-toc-nodes' with the help @@ -3032,10 +3059,6 @@ (if (looking-at "^\\* ") (forward-char 2))))) -(defvar Info-index-nodes nil - "Alist of cached index node names of visited Info files. -Each element has the form (INFO-FILE INDEX-NODE-NAMES-LIST).") - (defun Info-index-nodes (&optional file) "Return a list of names of all index nodes in Info FILE. If FILE is omitted, it defaults to the current Info file. ------------------------------------------------------------ revno: 109705 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-08-20 19:57:35 -0400 message: * src/Makefile.in: Don't assume that `ln -f' works. Presumably it does work fine on all platforms currently building Emacs, but the autoconf manual says not to rely on it. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-20 17:32:31 +0000 +++ src/ChangeLog 2012-08-20 23:57:35 +0000 @@ -1,3 +1,8 @@ +2012-08-20 Glenn Morris + + * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)): + Don't assume that `ln -f' works. + 2012-08-20 Eli Zaretskii * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5 === modified file 'src/Makefile.in' --- src/Makefile.in 2012-08-10 00:47:21 +0000 +++ src/Makefile.in 2012-08-20 23:57:35 +0000 @@ -402,11 +402,13 @@ ## on all of $lisp, and emacs depends on DOC, so it is ok to use $lisp here. emacs$(EXEEXT): temacs$(EXEEXT) $(etc)/DOC $(lisp) $(leimdir)/leim-list.el if test "$(CANNOT_DUMP)" = "yes"; then \ - ln -f temacs$(EXEEXT) emacs$(EXEEXT); \ + rm -f emacs$(EXEEXT); \ + ln temacs$(EXEEXT) emacs$(EXEEXT); \ else \ LC_ALL=C $(RUN_TEMACS) -batch -l loadup dump || exit 1; \ test "X$(PAXCTL)" = X || $(PAXCTL) -zex emacs$(EXEEXT); \ - ln -f emacs$(EXEEXT) bootstrap-emacs$(EXEEXT); \ + rm -f bootstrap-emacs$(EXEEXT); \ + ln emacs$(EXEEXT) bootstrap-emacs$(EXEEXT); \ fi ## We run make-docfile twice because the command line may get too long @@ -600,7 +602,8 @@ bootstrap-emacs$(EXEEXT): temacs$(EXEEXT) cd ../lisp; $(MAKE) $(MFLAGS) update-subdirs if test "$(CANNOT_DUMP)" = "yes"; then \ - ln -f temacs$(EXEEXT) bootstrap-emacs$(EXEEXT); \ + rm -f bootstrap-emacs$(EXEEXT); \ + ln temacs$(EXEEXT) bootstrap-emacs$(EXEEXT); \ else \ $(RUN_TEMACS) --batch --load loadup bootstrap || exit 1; \ test "X$(PAXCTL)" = X || $(PAXCTL) -zex emacs$(EXEEXT); \ ------------------------------------------------------------ revno: 109704 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-08-20 18:12:35 -0400 message: Use symlink in installed bin/ directory, where supported * configure.ac (AC_PROG_LN_S): Test for ln. * Makefile.in (LN_S): New, set by configure. (install-arch-dep): Use $LN_S. diff: === modified file 'ChangeLog' --- ChangeLog 2012-08-19 23:31:24 +0000 +++ ChangeLog 2012-08-20 22:12:35 +0000 @@ -1,3 +1,9 @@ +2012-08-20 Glenn Morris + + * configure.ac (AC_PROG_LN_S): Test for ln. + * Makefile.in (LN_S): New, set by configure. + (install-arch-dep): Use $LN_S. + 2012-08-19 Paul Eggert Merge from gnulib, incorporating: === modified file 'Makefile.in' --- Makefile.in 2012-07-31 07:58:08 +0000 +++ Makefile.in 2012-08-20 22:12:35 +0000 @@ -246,6 +246,7 @@ # By default, we uphold the dignity of our programs. INSTALL_STRIP = MKDIR_P = @MKDIR_P@ +LN_S = @LN_S@ # We use gzip to compress installed .el files. GZIP_PROG = @GZIP_PROG@ @@ -437,7 +438,7 @@ ${INSTALL_PROGRAM} $(INSTALL_STRIP) src/emacs${EXEEXT} $(DESTDIR)${bindir}/$(EMACSFULL) || exit 1 ; \ chmod 1755 $(DESTDIR)${bindir}/$(EMACSFULL) ; \ rm -f $(DESTDIR)${bindir}/$(EMACS) ; \ - ln $(DESTDIR)${bindir}/$(EMACSFULL) $(DESTDIR)${bindir}/$(EMACS) || true ; \ + cd $(DESTDIR)${bindir} && $(LN_S) $(EMACSFULL) $(EMACS); \ else \ subdir=${ns_appresdir}/site-lisp; \ ${write_subdir} || exit 1; \ === modified file 'configure.ac' --- configure.ac 2012-08-17 07:23:21 +0000 +++ configure.ac 2012-08-20 22:12:35 +0000 @@ -731,6 +731,7 @@ dnl if test "x$RANLIB" = x; then dnl AC_PROG_RANLIB dnl fi +AC_PROG_LN_S AC_PATH_PROG(INSTALL_INFO, install-info, :, $PATH$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR/sbin) ------------------------------------------------------------ revno: 109703 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-08-20 14:13:03 -0400 message: Use display-warning in a few places in calendar * lisp/calendar/diary-lib.el (diary-include-files, diary-sexp-entry): * lisp/calendar/holidays.el (calendar-holiday-list): Report errors with display-warning rather than beep'n'sleep. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-20 14:06:06 +0000 +++ lisp/ChangeLog 2012-08-20 18:13:03 +0000 @@ -1,3 +1,9 @@ +2012-08-20 Glenn Morris + + * calendar/diary-lib.el (diary-include-files, diary-sexp-entry): + * calendar/holidays.el (calendar-holiday-list): + Report errors with display-warning rather than beep'n'sleep. + 2012-08-20 Michael Albinus * net/tramp.el (tramp-accept-process-output): Accept only output === modified file 'lisp/calendar/diary-lib.el' --- lisp/calendar/diary-lib.el 2012-02-18 03:08:15 +0000 +++ lisp/calendar/diary-lib.el 2012-08-20 18:13:03 +0000 @@ -951,12 +951,12 @@ (setq diary-entries-list (append diary-entries-list (diary-list-entries original-date number t))))) - (beep) - (message "Can't read included diary file %s" diary-file) - (sleep-for 2)) - (beep) - (message "Can't find included diary file %s" diary-file) - (sleep-for 2)))) + (display-warning + :error + (format "Can't read included diary file %s\n" diary-file))) + (display-warning + :error + (format "Can't find included diary file %s\n" diary-file))))) (goto-char (point-min))) (defun diary-include-other-diary-files () @@ -1456,14 +1456,17 @@ (let ((result (if calendar-debug-sexp (let ((debug-on-error t)) (eval (car (read-from-string sexp)))) - (condition-case nil - (eval (car (read-from-string sexp))) - (error - (beep) - (message "Bad sexp at line %d in %s: %s" - (count-lines (point-min) (point)) - diary-file sexp) - (sleep-for 2)))))) + (let (err) + (condition-case err + (eval (car (read-from-string sexp))) + (error + (display-warning + :error + (format "Bad diary sexp at line %d in %s:\n%s\n\ +Error: %s\n" + (count-lines (point-min) (point)) + diary-file sexp err)) + nil)))))) (cond ((stringp result) result) ((and (consp result) (stringp (cdr result))) result) === modified file 'lisp/calendar/holidays.el' --- lisp/calendar/holidays.el 2012-05-05 20:58:14 +0000 +++ lisp/calendar/holidays.el 2012-08-20 18:13:03 +0000 @@ -458,17 +458,20 @@ (defun calendar-holiday-list () "Form the list of holidays that occur on dates in the calendar window. The holidays are those in the list `calendar-holidays'." - (let (res h) + (let (res h err) (sort (dolist (p calendar-holidays res) (if (setq h (if calendar-debug-sexp (let ((debug-on-error t)) (eval p)) - (condition-case nil + (condition-case err (eval p) - (error (beep) - (message "Bad holiday list item: %s" p) - (sleep-for 2))))) + (error + (display-warning + :error + (format "Bad holiday list item: %s\nError: %s\n" + p err)) + nil)))) (setq res (append h res)))) 'calendar-date-compare))) ------------------------------------------------------------ revno: 109702 committer: Eli Zaretskii branch nick: trunk timestamp: Mon 2012-08-20 20:32:31 +0300 message: Avoid GDB 7.5 warnings about "set main" in src/.gdbinit. src/.gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5 and later about non-assignments with no effect. See discussion at http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for details. diff: === modified file 'src/.gdbinit' --- src/.gdbinit 2012-08-19 10:50:03 +0000 +++ src/.gdbinit 2012-08-20 17:32:31 +0000 @@ -18,9 +18,9 @@ # Boston, MA 02110-1301, USA. # Force loading of symbols, enough to give us VALBITS etc. -set main +set $dummy = main + 8 # With some compilers, we need this to give us struct Lisp_Symbol etc.: -set Fmake_symbol +set $dummy = Fmake_symbol + 8 # Find lwlib source files too. dir ../lwlib === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-20 16:48:10 +0000 +++ src/ChangeLog 2012-08-20 17:32:31 +0000 @@ -1,3 +1,10 @@ +2012-08-20 Eli Zaretskii + + * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5 + and later about non-assignments with no effect. See discussion at + http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for + details. + 2012-08-20 Dmitry Antipov Inline setter functions for Lisp_Objects slots of struct specbinding. ------------------------------------------------------------ revno: 109701 committer: Eli Zaretskii branch nick: trunk timestamp: Mon 2012-08-20 19:48:10 +0300 message: Improve MS-Windows related commentary and log entry for revision 109685. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-20 09:39:57 +0000 +++ src/ChangeLog 2012-08-20 16:48:10 +0000 @@ -42,6 +42,8 @@ Rely on + to declare 'environ', as gnulib does this if the system doesn't. * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]: + Remove declaration. MS-Windows declares it on stdlib.h which is + included by conf_post.h. * emacs.c (environ) [DOUG_LEA_MALLOC]: * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl. * vm-limit.c: Include , for 'environ'. === modified file 'src/conf_post.h' --- src/conf_post.h 2012-08-10 18:23:45 +0000 +++ src/conf_post.h 2012-08-20 16:48:10 +0000 @@ -178,6 +178,9 @@ #endif #include +/* If you think about removing the line below, note that the + MS-Windows build relies on it for declaration of 'environ' needed + by a few source files. */ #include #if __GNUC__ >= 3 /* On GCC 3.0 we might get a warning. */ ------------------------------------------------------------ revno: 109700 committer: Josh Feinstein branch nick: trunk timestamp: Mon 2012-08-20 09:08:51 -0700 message: Hide specified message types sent by lurkers * erc.el (erc-display-message): Abstract message hiding decision to new function erc-hide-current-message-p. (erc-lurker): New customization group. (erc-lurker-state, erc-lurker-trim-nicks, erc-lurker-ignore-chars) (erc-lurker-hide-list, erc-lurker-cleanup-interval) (erc-lurker-threshold-time): New variables. (erc-lurker-maybe-trim, erc-lurker-initialize, erc-lurker-cleanup) (erc-hide-current-message-p, erc-canonicalize-server-name) (erc-lurker-update-status, erc-lurker-p): New functions. Together they maintain state about which users have spoken in the last erc-lurker-threshold-time, with all other users being considered lurkers whose messages of types in erc-lurker-hide-list will not be displayed by erc-display-message. diff: === modified file 'lisp/erc/ChangeLog' --- lisp/erc/ChangeLog 2012-08-06 00:15:34 +0000 +++ lisp/erc/ChangeLog 2012-08-20 16:08:51 +0000 @@ -1,3 +1,19 @@ +2012-08-20 Josh Feinstein + + * erc.el (erc-display-message): Abstract message hiding decision + to new function erc-hide-current-message-p. + (erc-lurker): New customization group. + (erc-lurker-state, erc-lurker-trim-nicks, erc-lurker-ignore-chars) + (erc-lurker-hide-list, erc-lurker-cleanup-interval) + (erc-lurker-threshold-time): New variables. + (erc-lurker-maybe-trim, erc-lurker-initialize, erc-lurker-cleanup) + (erc-hide-current-message-p, erc-canonicalize-server-name) + (erc-lurker-update-status, erc-lurker-p): New functions. Together + they maintain state about which users have spoken in the last + erc-lurker-threshold-time, with all other users being considered + lurkers whose messages of types in erc-lurker-hide-list will not + be displayed by erc-display-message. + 2012-08-06 Julien Danjou * erc-match.el (erc-match-exclude-server-buffer) === modified file 'lisp/erc/erc.el' --- lisp/erc/erc.el 2012-06-15 14:47:31 +0000 +++ lisp/erc/erc.el 2012-08-20 16:08:51 +0000 @@ -100,6 +100,10 @@ "Ignoring certain messages" :group 'erc) +(defgroup erc-lurker nil + "Hide specified message types sent by lurkers" + :group 'erc-ignore) + (defgroup erc-query nil "Using separate buffers for private discussions" :group 'erc) @@ -2455,6 +2459,174 @@ string) string))) +(defvar erc-lurker-state nil + "Track the time of the last PRIVMSG for each (server,nick) pair. + +This is implemented as a hash of hashes, where the outer key is +the canonicalized server name (as returned by +`erc-canonicalize-server-name') and the outer value is a hash +table mapping nicks (as returned by `erc-lurker-maybe-trim') to +the times of their most recently received PRIVMSG on any channel +on the given server.") + +(defcustom erc-lurker-trim-nicks t + "If t, trim trailing `erc-lurker-ignore-chars' from nicks. + +This causes e.g. nick and nick` to be considered as the same +individual for activity tracking and lurkiness detection +purposes." + :group 'erc-lurker + :type 'boolean) + +(defun erc-lurker-maybe-trim (nick) + "Maybe trim trailing `erc-lurker-ignore-chars' from NICK. + +Returns NICK unmodified unless `erc-lurker-trim-nicks' is +non-nil." + (if erc-lurker-trim-nicks + (replace-regexp-in-string + (format "[%s]" + (mapconcat (lambda (char) + (regexp-quote (char-to-string char))) + erc-lurker-ignore-chars "")) + "" nick) + nick)) + +(defcustom erc-lurker-ignore-chars "`_" + "Characters at the end of a nick to strip for activity tracking purposes. + +See also `erc-lurker-trim-nicks'." + :group 'erc-lurker + :type 'string) + +(defcustom erc-lurker-hide-list nil + "List of IRC type messages to hide when sent by lurkers. + +A typical value would be '(\"JOIN\" \"PART\" \"QUIT\"). +See also `erc-lurker-p' and `erc-hide-list'." + :group 'erc-lurker + :type 'erc-message-type) + +(defcustom erc-lurker-threshold-time (* 60 60 24) ; 24h by default + "Nicks from which no PRIVMSGs have been received within this +interval (in units of seconds) are considered lurkers by +`erc-lurker-p' and as a result their messages of types in +`erc-lurker-hide-list' will be hidden." + :group 'erc-lurker + :type 'integer) + +(defun erc-lurker-initialize () + "Initialize ERC lurker tracking functionality. + +This function adds `erc-lurker-update-status' to +`erc-insert-pre-hook' in order to record the time of each nick's +most recent PRIVMSG as well as initializing the state variable +storing this information." + (setq erc-lurker-state (make-hash-table :test 'equal)) + (add-hook 'erc-insert-pre-hook 'erc-lurker-update-status)) + +(defun erc-lurker-cleanup () + "Remove all last PRIVMSG state older than `erc-lurker-threshold-time'. + +This should be called regularly to avoid excessive resource +consumption for long-lived IRC or Emacs sessions." + (maphash + (lambda (server hash) + (maphash + (lambda (nick last-PRIVMSG-time) + (when + (> (time-to-seconds (time-subtract + (current-time) + last-PRIVMSG-time)) + erc-lurker-threshold-time) + (remhash nick hash))) + hash) + (if (zerop (hash-table-count hash)) + (remhash server erc-lurker-state))) + erc-lurker-state)) + +(defvar erc-lurker-cleanup-count 0 + "Internal counter variable for use with `erc-lurker-cleanup-interval'.") + +(defvar erc-lurker-cleanup-interval 100 + "Specifies frequency of cleaning up stale erc-lurker state. + +`erc-lurker-update-status' calls `erc-lurker-cleanup' once for +every `erc-lurker-cleanup-interval' updates to +`erc-lurker-state'. This is designed to limit the memory +consumption of lurker state during long Emacs sessions and/or ERC +sessions with large numbers of incoming PRIVMSGs.") + +(defun erc-lurker-update-status (message) + "Update `erc-lurker-state' if necessary. + +This function is called from `erc-insert-pre-hook'. If the +current message is a PRIVMSG, update `erc-lurker-state' to +reflect the fact that its sender has issued a PRIVMSG at the +current time. Otherwise, take no action. + +This function depends on the fact that `erc-display-message' +dynamically binds `parsed', which is used to check if the current +message is a PRIVMSG and to determine its sender. See also +`erc-lurker-trim-nicks' and `erc-lurker-ignore-chars'. + +In order to limit memory consumption, this function also calls +`erc-lurker-cleanup' once every `erc-lurker-cleanup-interval' +updates of `erc-lurker-state'." + (when (and (boundp 'parsed) (erc-response-p parsed)) + (let* ((command (erc-response.command parsed)) + (sender + (erc-lurker-maybe-trim + (car (erc-parse-user (erc-response.sender parsed))))) + (server + (erc-canonicalize-server-name erc-server-announced-name))) + (when (equal command "PRIVMSG") + (when (>= (incf erc-lurker-cleanup-count) erc-lurker-cleanup-interval) + (setq erc-lurker-cleanup-count 0) + (erc-lurker-cleanup)) + (unless (gethash server erc-lurker-state) + (puthash server (make-hash-table :test 'equal) erc-lurker-state)) + (puthash sender (current-time) + (gethash server erc-lurker-state)))))) + +(defun erc-lurker-p (nick) + "Predicate indicating NICK's lurking status on the current server. + +Lurking is the condition where NICK has issued no PRIVMSG on this +server within `erc-lurker-threshold-time'. See also +`erc-lurker-trim-nicks' and `erc-lurker-ignore-chars'." + (unless erc-lurker-state (erc-lurker-initialize)) + (let* ((server + (erc-canonicalize-server-name erc-server-announced-name)) + (last-PRIVMSG-time + (gethash (erc-lurker-maybe-trim nick) + (gethash server erc-lurker-state (make-hash-table))))) + (or (null last-PRIVMSG-time) + (> (time-to-seconds + (time-subtract (current-time) last-PRIVMSG-time)) + erc-lurker-threshold-time)))) + +(defun erc-canonicalize-server-name (server) + "Returns the canonical network name for SERVER if any, +otherwise `erc-server-announced-name'. SERVER is matched against +`erc-common-server-suffixes'." + (when server + (or (cdar (erc-remove-if-not + (lambda (net) (string-match (car net) server)) + erc-common-server-suffixes)) + erc-server-announced-name))) + +(defun erc-hide-current-message-p (parsed) + "Predicate indicating whether the parsed ERC response PARSED should be hidden. + +Messages are always hidden if the message type of PARSED appears in +`erc-hide-list'. In addition, messages whose type is a member of +`erc-lurker-hide-list' are hidden if `erc-lurker-p' returns true." + (let* ((command (erc-response.command parsed)) + (sender (car (erc-parse-user (erc-response.sender parsed))))) + (or (member command erc-hide-list) + (and (member command erc-lurker-hide-list) (erc-lurker-p sender))))) + (defun erc-display-message (parsed type buffer msg &rest args) "Display MSG in BUFFER. @@ -2479,7 +2651,7 @@ (if (not (erc-response-p parsed)) (erc-display-line string buffer) - (unless (member (erc-response.command parsed) erc-hide-list) + (unless (erc-hide-current-message-p parsed) (erc-put-text-property 0 (length string) 'erc-parsed parsed string) (erc-put-text-property 0 (length string) 'rear-sticky t string) (erc-display-line string buffer))))) ------------------------------------------------------------ revno: 109699 committer: Michael Albinus + + * net/tramp.el (tramp-accept-process-output): Accept only output + from PROC. Otherwise, process filters and sentinels might be + confused. (Bug#12145) + 2012-08-20 Chong Yidong * descr-text.el (describe-text-properties-1): Use overlays-in to === modified file 'lisp/net/tramp.el' --- lisp/net/tramp.el 2012-08-15 16:29:11 +0000 +++ lisp/net/tramp.el 2012-08-20 14:06:06 +0000 @@ -3293,7 +3293,7 @@ ;; Under Windows XP, accept-process-output doesn't return ;; sometimes. So we add an additional timeout. (with-timeout ((or timeout 1)) - (accept-process-output proc timeout timeout-msecs))) + (accept-process-output proc timeout timeout-msecs (and proc t)))) (tramp-message proc 10 "\n%s" (buffer-string)))) (defun tramp-check-for-regexp (proc regexp) ------------------------------------------------------------ revno: 109698 fixes bug: http://debbugs.gnu.org/3322 committer: Chong Yidong branch nick: trunk timestamp: Mon 2012-08-20 19:12:16 +0800 message: Make C-u C-x = report on empty overlays at point. * lisp/descr-text.el (describe-text-properties-1): Use overlays-in to report on empty overlays. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-20 07:45:10 +0000 +++ lisp/ChangeLog 2012-08-20 11:12:16 +0000 @@ -1,3 +1,8 @@ +2012-08-20 Chong Yidong + + * descr-text.el (describe-text-properties-1): Use overlays-in to + report on empty overlays (Bug#3322). + 2012-08-20 Glenn Morris * mail/rmailout.el (rmail-output-read-file-name): === modified file 'lisp/descr-text.el' --- lisp/descr-text.el 2012-08-12 09:35:57 +0000 +++ lisp/descr-text.el 2012-08-20 11:12:16 +0000 @@ -140,7 +140,7 @@ (defun describe-text-properties-1 (pos output-buffer) (let* ((properties (text-properties-at pos)) - (overlays (overlays-at pos)) + (overlays (overlays-in pos (1+ pos))) (wid-field (get-char-property pos 'field)) (wid-button (get-char-property pos 'button)) (wid-doc (get-char-property pos 'widget-doc)) ------------------------------------------------------------ revno: 109697 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-08-20 06:17:51 -0400 message: Auto-commit of generated files. diff: === modified file 'autogen/Makefile.in' --- autogen/Makefile.in 2012-08-03 10:17:23 +0000 +++ autogen/Makefile.in 2012-08-20 10:17:51 +0000 @@ -36,7 +36,7 @@ # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. -# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=errno --avoid=fcntl --avoid=fcntl-h --avoid=fstat --avoid=msvc-inval --avoid=msvc-nothrow --avoid=raise --avoid=select --avoid=sigprocmask --avoid=sys_types --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt c-strcase careadlinkat crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ filemode getloadavg getopt-gnu gettime gettimeofday ignore-value intprops largefile lstat manywarnings mktime pselect pthread_sigmask readlink socklen stat-time stdalign stdarg stdio strftime strtoimax strtoumax symlink sys_stat sys_time time timespec-add timespec-sub utimens warnings +# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=errno --avoid=fcntl --avoid=fcntl-h --avoid=fstat --avoid=msvc-inval --avoid=msvc-nothrow --avoid=raise --avoid=select --avoid=sigprocmask --avoid=sys_types --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt c-ctype c-strcase careadlinkat crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ filemode getloadavg getopt-gnu gettime gettimeofday ignore-value intprops largefile lstat manywarnings mktime pselect pthread_sigmask readlink socklen stat-time stdalign stdarg stdbool stdio strftime strtoimax strtoumax symlink sys_stat sys_time time timespec-add timespec-sub utimens warnings VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ === modified file 'autogen/configure' --- autogen/configure 2012-08-17 10:17:30 +0000 +++ autogen/configure 2012-08-20 10:17:51 +0000 @@ -17317,9 +17317,7 @@ #define HAVE_DECL_GETENV $ac_have_decl _ACEOF - - - +: @@ -20051,7 +20049,7 @@ fi -if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then + if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then @@ -20063,7 +20061,7 @@ gl_LIBOBJS="$gl_LIBOBJS dup2.$ac_objext" -fi + fi @@ -20487,7 +20485,7 @@ fi -if test $HAVE_GETLOADAVG = 0; then + if test $HAVE_GETLOADAVG = 0; then @@ -20615,7 +20613,7 @@ done -fi + fi @@ -20632,7 +20630,7 @@ -if test $REPLACE_GETOPT = 1; then + if test $REPLACE_GETOPT = 1; then @@ -20656,8 +20654,8 @@ - GNULIB_GL_UNISTD_H_GETOPT=1 -fi + GNULIB_GL_UNISTD_H_GETOPT=1 + fi @@ -20680,7 +20678,7 @@ fi -if test $REPLACE_GETOPT = 1; then + if test $REPLACE_GETOPT = 1; then @@ -20704,8 +20702,8 @@ - GNULIB_GL_UNISTD_H_GETOPT=1 -fi + GNULIB_GL_UNISTD_H_GETOPT=1 + fi @@ -20865,7 +20863,7 @@ _ACEOF -if test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1; then + if test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1; then @@ -20901,7 +20899,7 @@ done -fi + fi @@ -20918,7 +20916,6 @@ - if test $ac_cv_func_lstat = yes; then case "$gl_cv_func_lstat_dereferences_slashed_symlink" in @@ -20930,7 +20927,7 @@ HAVE_LSTAT=0 fi -if test $REPLACE_LSTAT = 1; then + if test $REPLACE_LSTAT = 1; then @@ -20945,7 +20942,7 @@ : -fi + fi @@ -21194,7 +21191,7 @@ REPLACE_MKTIME=0 fi -if test $REPLACE_MKTIME = 1; then + if test $REPLACE_MKTIME = 1; then @@ -21205,10 +21202,8 @@ gl_LIBOBJS="$gl_LIBOBJS mktime.$ac_objext" - - - -fi + : + fi @@ -21263,7 +21258,7 @@ REPLACE_PSELECT=1 fi -if test $HAVE_PSELECT = 0 || test $REPLACE_PSELECT = 1; then + if test $HAVE_PSELECT = 0 || test $REPLACE_PSELECT = 1; then @@ -21274,7 +21269,7 @@ gl_LIBOBJS="$gl_LIBOBJS pselect.$ac_objext" -fi + fi @@ -21492,7 +21487,7 @@ esac fi -if test $HAVE_PTHREAD_SIGMASK = 0 || test $REPLACE_PTHREAD_SIGMASK = 1; then + if test $HAVE_PTHREAD_SIGMASK = 0 || test $REPLACE_PTHREAD_SIGMASK = 1; then @@ -21510,7 +21505,7 @@ fi -fi + fi @@ -21613,7 +21608,7 @@ esac fi -if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then + if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then @@ -21627,7 +21622,7 @@ : -fi + fi @@ -21741,7 +21736,7 @@ - ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" " + ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" " /* is not needed according to POSIX, but the in i386-unknown-freebsd4.10 and powerpc-apple-darwin5.5 required it. */ @@ -21841,7 +21836,6 @@ - ac_fn_c_check_member "$LINENO" "struct stat" "st_atim.tv_nsec" "ac_cv_member_struct_stat_st_atim_tv_nsec" "#include #include " @@ -21937,7 +21931,6 @@ - ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtimespec.tv_nsec" "ac_cv_member_struct_stat_st_birthtimespec_tv_nsec" "#include #include " @@ -22648,7 +22641,7 @@ HAVE_STRTOIMAX=0 fi -if test $HAVE_STRTOIMAX = 0 || test $REPLACE_STRTOIMAX = 1; then + if test $HAVE_STRTOIMAX = 0 || test $REPLACE_STRTOIMAX = 1; then @@ -22673,7 +22666,7 @@ -fi + fi @@ -22693,7 +22686,7 @@ HAVE_DECL_STRTOUMAX=0 fi -if test $ac_cv_func_strtoumax = no; then + if test $ac_cv_func_strtoumax = no; then @@ -22718,7 +22711,7 @@ -fi + fi @@ -22790,7 +22783,7 @@ esac fi -if test $HAVE_SYMLINK = 0 || test $REPLACE_SYMLINK = 1; then + if test $HAVE_SYMLINK = 0 || test $REPLACE_SYMLINK = 1; then @@ -22801,7 +22794,7 @@ gl_LIBOBJS="$gl_LIBOBJS symlink.$ac_objext" -fi + fi @@ -23192,7 +23185,7 @@ HAVE_LOCALTIME_R=0 fi -if test $HAVE_LOCALTIME_R = 0 || test $REPLACE_LOCALTIME_R = 1; then + if test $HAVE_LOCALTIME_R = 0 || test $REPLACE_LOCALTIME_R = 1; then @@ -23206,7 +23199,7 @@ : -fi + fi @@ -23218,9 +23211,7 @@ - - - + : @@ -23512,7 +23503,7 @@ ;; esac -if test $REPLACE_STAT = 1; then + if test $REPLACE_STAT = 1; then @@ -23527,7 +23518,7 @@ : -fi + fi @@ -23574,7 +23565,7 @@ fi fi -if test $HAVE_STRTOLL = 0; then + if test $HAVE_STRTOLL = 0; then @@ -23588,7 +23579,7 @@ : -fi + fi @@ -23626,7 +23617,7 @@ fi fi -if test $HAVE_STRTOULL = 0; then + if test $HAVE_STRTOULL = 0; then @@ -23640,7 +23631,7 @@ : -fi + fi ------------------------------------------------------------ revno: 109696 committer: Dmitry Antipov branch nick: trunk timestamp: Mon 2012-08-20 13:39:57 +0400 message: Inline setter functions for Lisp_Objects slots of struct specbinding. * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions. Adjust users. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-20 09:28:39 +0000 +++ src/ChangeLog 2012-08-20 09:39:57 +0000 @@ -1,3 +1,9 @@ +2012-08-20 Dmitry Antipov + + Inline setter functions for Lisp_Objects slots of struct specbinding. + * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions. + Adjust users. + 2012-08-20 Martin Rudalics * window.c (select_window): Always make selected window's buffer === modified file 'src/eval.c' --- src/eval.c 2012-08-17 14:24:43 +0000 +++ src/eval.c 2012-08-20 09:39:57 +0000 @@ -133,7 +133,21 @@ static Lisp_Object funcall_lambda (Lisp_Object, ptrdiff_t, Lisp_Object *); static int interactive_p (int); static Lisp_Object apply_lambda (Lisp_Object fun, Lisp_Object args); - + +/* Functions to set Lisp_Object slots of struct specbinding. */ + +static inline void +set_specpdl_symbol (Lisp_Object symbol) +{ + specpdl_ptr->symbol = symbol; +} + +static inline void +set_specpdl_old_value (Lisp_Object oldval) +{ + specpdl_ptr->old_value = oldval; +} + void init_eval_once (void) { @@ -3136,8 +3150,8 @@ case SYMBOL_PLAINVAL: /* The most common case is that of a non-constant symbol with a trivial value. Make that as fast as we can. */ - specpdl_ptr->symbol = symbol; - specpdl_ptr->old_value = SYMBOL_VAL (sym); + set_specpdl_symbol (symbol); + set_specpdl_old_value (SYMBOL_VAL (sym)); specpdl_ptr->func = NULL; ++specpdl_ptr; if (!sym->constant) @@ -3152,7 +3166,7 @@ { Lisp_Object ovalue = find_symbol_value (symbol); specpdl_ptr->func = 0; - specpdl_ptr->old_value = ovalue; + set_specpdl_old_value (ovalue); eassert (sym->redirect != SYMBOL_LOCALIZED || (EQ (SYMBOL_BLV (sym)->where, @@ -3186,7 +3200,7 @@ let_shadows_buffer_binding_p which is itself only used in set_internal for local_if_set. */ eassert (NILP (where) || EQ (where, cur_buf)); - specpdl_ptr->symbol = Fcons (symbol, Fcons (where, cur_buf)); + set_specpdl_symbol (Fcons (symbol, Fcons (where, cur_buf))); /* If SYMBOL is a per-buffer variable which doesn't have a buffer-local value here, make the `let' change the global @@ -3203,7 +3217,7 @@ } } else - specpdl_ptr->symbol = symbol; + set_specpdl_symbol (symbol); specpdl_ptr++; set_internal (symbol, value, Qnil, 1); @@ -3221,8 +3235,8 @@ if (specpdl_ptr == specpdl + specpdl_size) grow_specpdl (); specpdl_ptr->func = function; - specpdl_ptr->symbol = Qnil; - specpdl_ptr->old_value = arg; + set_specpdl_symbol (Qnil); + set_specpdl_old_value (arg); specpdl_ptr++; } ------------------------------------------------------------ revno: 109695 committer: martin rudalics branch nick: trunk timestamp: Mon 2012-08-20 11:28:39 +0200 message: In select_window always make selected window's buffer current. * window.c (select_window): Always make selected window's buffer current. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-20 08:20:25 +0000 +++ src/ChangeLog 2012-08-20 09:28:39 +0000 @@ -1,3 +1,8 @@ +2012-08-20 Martin Rudalics + + * window.c (select_window): Always make selected window's buffer + current. + 2012-08-20 Dmitry Antipov Use AREF and ASET for docstrings of category tables. === modified file 'src/window.c' --- src/window.c 2012-08-18 06:06:39 +0000 +++ src/window.c 2012-08-20 09:28:39 +0000 @@ -477,6 +477,9 @@ record_buffer (w->buffer); } + /* Make the selected window's buffer current. */ + Fset_buffer (w->buffer); + if (EQ (window, selected_window) && !inhibit_point_swap) return window; @@ -496,9 +499,9 @@ else fset_selected_window (sf, window); - /* Store the current buffer's actual point into the - old selected window. It belongs to that window, - and when the window is not selected, must be in the window. */ + /* Store the old selected window's buffer's point in pointm of the old + selected window. It belongs to that window, and when the window is + not selected, must be in the window. */ if (!inhibit_point_swap) { ow = XWINDOW (selected_window); @@ -509,9 +512,6 @@ } selected_window = window; - - Fset_buffer (w->buffer); - bset_last_selected_window (XBUFFER (w->buffer), window); /* Go to the point recorded in the window. ------------------------------------------------------------ revno: 109694 committer: Dmitry Antipov branch nick: trunk timestamp: Mon 2012-08-20 12:20:25 +0400 message: Use AREF and ASET for docstrings of category tables. * category.h (CATEGORY_DOCSTRING): Use AREF. (SET_CATEGORY_DOCSTRING): Use ASET. * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-20 08:07:38 +0000 +++ src/ChangeLog 2012-08-20 08:20:25 +0000 @@ -1,5 +1,12 @@ 2012-08-20 Dmitry Antipov + Use AREF and ASET for docstrings of category tables. + * category.h (CATEGORY_DOCSTRING): Use AREF. + (SET_CATEGORY_DOCSTRING): Use ASET. + * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING. + +2012-08-20 Dmitry Antipov + Inline setter functions for hash table members. * lisp.h (set_hash_key, set_hash_value, set_hash_next) (set_hash_hash, set_hash_index): Rename with _slot suffix. === modified file 'src/category.c' --- src/category.c 2012-08-18 06:06:39 +0000 +++ src/category.c 2012-08-20 08:20:25 +0000 @@ -143,7 +143,7 @@ error ("Category `%c' is already defined", (int) XFASTINT (category)); if (!NILP (Vpurify_flag)) docstring = Fpurecopy (docstring); - CATEGORY_DOCSTRING (table, XFASTINT (category)) = docstring; + SET_CATEGORY_DOCSTRING (table, XFASTINT (category), docstring); return Qnil; } === modified file 'src/category.h' --- src/category.h 2012-08-02 07:31:34 +0000 +++ src/category.h 2012-08-20 08:20:25 +0000 @@ -96,8 +96,12 @@ #define Vstandard_category_table BVAR (&buffer_defaults, category_table) /* Return the doc string of CATEGORY in category table TABLE. */ -#define CATEGORY_DOCSTRING(table, category) \ - XVECTOR (Fchar_table_extra_slot (table, make_number (0)))->contents[(category) - ' '] +#define CATEGORY_DOCSTRING(table, category) \ + AREF (Fchar_table_extra_slot (table, make_number (0)), ((category) - ' ')) + +/* Set the doc string of CATEGORY to VALUE in category table TABLE. */ +#define SET_CATEGORY_DOCSTRING(table, category, value) \ + ASET (Fchar_table_extra_slot (table, make_number (0)), ((category) - ' '), value) /* Return the version number of category table TABLE. Not used for the moment. */ ------------------------------------------------------------ revno: 109693 committer: Dmitry Antipov branch nick: trunk timestamp: Mon 2012-08-20 12:07:38 +0400 message: Inline setter functions for hash table members. * lisp.h (set_hash_key, set_hash_value, set_hash_next) (set_hash_hash, set_hash_index): Rename with _slot suffix. (set_hash_key_and_value, set_hash_index, set_hash_next) (set_hash_hash): New functions. * charset.c, fns.c: Adjust users. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-20 07:42:06 +0000 +++ src/ChangeLog 2012-08-20 08:07:38 +0000 @@ -1,5 +1,14 @@ 2012-08-20 Dmitry Antipov + Inline setter functions for hash table members. + * lisp.h (set_hash_key, set_hash_value, set_hash_next) + (set_hash_hash, set_hash_index): Rename with _slot suffix. + (set_hash_key_and_value, set_hash_index, set_hash_next) + (set_hash_hash): New functions. + * charset.c, fns.c: Adjust users. + +2012-08-20 Dmitry Antipov + Inline getter and setter functions for per-buffer values. * buffer.h (per_buffer_default, set_per_buffer_default) (per_buffer_value, set_per_buffer_value): New functions. === modified file 'src/charset.c' --- src/charset.c 2012-08-16 21:58:44 +0000 +++ src/charset.c 2012-08-20 08:07:38 +0000 @@ -1131,7 +1131,7 @@ { new_definition_p = 0; id = XFASTINT (CHARSET_SYMBOL_ID (args[charset_arg_name])); - set_hash_value (hash_table, charset.hash_index, attrs); + set_hash_value_slot (hash_table, charset.hash_index, attrs); } else { === modified file 'src/fns.c' --- src/fns.c 2012-08-17 21:12:11 +0000 +++ src/fns.c 2012-08-20 08:07:38 +0000 @@ -3663,7 +3663,7 @@ /* Set up the free list. */ for (i = 0; i < sz - 1; ++i) - set_hash_next (h, i, make_number (i + 1)); + set_hash_next_slot (h, i, make_number (i + 1)); h->next_free = make_number (0); XSET_HASH_TABLE (table, h); @@ -3760,17 +3760,17 @@ } #endif - h->key_and_value = larger_vector (h->key_and_value, - 2 * (new_size - old_size), -1); - h->next = larger_vector (h->next, new_size - old_size, -1); - h->hash = larger_vector (h->hash, new_size - old_size, -1); - h->index = Fmake_vector (make_number (index_size), Qnil); + set_hash_key_and_value (h, larger_vector (h->key_and_value, + 2 * (new_size - old_size), -1)); + set_hash_next (h, larger_vector (h->next, new_size - old_size, -1)); + set_hash_hash (h, larger_vector (h->hash, new_size - old_size, -1)); + set_hash_index (h, Fmake_vector (make_number (index_size), Qnil)); /* Update the free list. Do it so that new entries are added at the end of the free list. This makes some operations like maphash faster. */ for (i = old_size; i < new_size - 1; ++i) - set_hash_next (h, i, make_number (i + 1)); + set_hash_next_slot (h, i, make_number (i + 1)); if (!NILP (h->next_free)) { @@ -3781,7 +3781,7 @@ !NILP (next)) last = next; - set_hash_next (h, XFASTINT (last), make_number (old_size)); + set_hash_next_slot (h, XFASTINT (last), make_number (old_size)); } else XSETFASTINT (h->next_free, old_size); @@ -3792,8 +3792,8 @@ { EMACS_UINT hash_code = XUINT (HASH_HASH (h, i)); ptrdiff_t start_of_bucket = hash_code % ASIZE (h->index); - set_hash_next (h, i, HASH_INDEX (h, start_of_bucket)); - set_hash_index (h, start_of_bucket, make_number (i)); + set_hash_next_slot (h, i, HASH_INDEX (h, start_of_bucket)); + set_hash_index_slot (h, start_of_bucket, make_number (i)); } } } @@ -3852,16 +3852,16 @@ /* Store key/value in the key_and_value vector. */ i = XFASTINT (h->next_free); h->next_free = HASH_NEXT (h, i); - set_hash_key (h, i, key); - set_hash_value (h, i, value); + set_hash_key_slot (h, i, key); + set_hash_value_slot (h, i, value); /* Remember its hash code. */ - set_hash_hash (h, i, make_number (hash)); + set_hash_hash_slot (h, i, make_number (hash)); /* Add new entry to its collision chain. */ start_of_bucket = hash % ASIZE (h->index); - set_hash_next (h, i, HASH_INDEX (h, start_of_bucket)); - set_hash_index (h, start_of_bucket, make_number (i)); + set_hash_next_slot (h, i, HASH_INDEX (h, start_of_bucket)); + set_hash_index_slot (h, start_of_bucket, make_number (i)); return i; } @@ -3892,16 +3892,16 @@ { /* Take entry out of collision chain. */ if (NILP (prev)) - set_hash_index (h, start_of_bucket, HASH_NEXT (h, i)); + set_hash_index_slot (h, start_of_bucket, HASH_NEXT (h, i)); else - set_hash_next (h, XFASTINT (prev), HASH_NEXT (h, i)); + set_hash_next_slot (h, XFASTINT (prev), HASH_NEXT (h, i)); /* Clear slots in key_and_value and add the slots to the free list. */ - set_hash_key (h, i, Qnil); - set_hash_value (h, i, Qnil); - set_hash_hash (h, i, Qnil); - set_hash_next (h, i, h->next_free); + set_hash_key_slot (h, i, Qnil); + set_hash_value_slot (h, i, Qnil); + set_hash_hash_slot (h, i, Qnil); + set_hash_next_slot (h, i, h->next_free); h->next_free = make_number (i); h->count--; eassert (h->count >= 0); @@ -3927,10 +3927,10 @@ for (i = 0; i < size; ++i) { - set_hash_next (h, i, i < size - 1 ? make_number (i + 1) : Qnil); - set_hash_key (h, i, Qnil); - set_hash_value (h, i, Qnil); - set_hash_hash (h, i, Qnil); + set_hash_next_slot (h, i, i < size - 1 ? make_number (i + 1) : Qnil); + set_hash_key_slot (h, i, Qnil); + set_hash_value_slot (h, i, Qnil); + set_hash_hash_slot (h, i, Qnil); } for (i = 0; i < ASIZE (h->index); ++i) @@ -3994,18 +3994,18 @@ { /* Take out of collision chain. */ if (NILP (prev)) - set_hash_index (h, bucket, next); + set_hash_index_slot (h, bucket, next); else - set_hash_next (h, XFASTINT (prev), next); + set_hash_next_slot (h, XFASTINT (prev), next); /* Add to free list. */ - set_hash_next (h, i, h->next_free); + set_hash_next_slot (h, i, h->next_free); h->next_free = idx; /* Clear key, value, and hash. */ - set_hash_key (h, i, Qnil); - set_hash_value (h, i, Qnil); - set_hash_hash (h, i, Qnil); + set_hash_key_slot (h, i, Qnil); + set_hash_value_slot (h, i, Qnil); + set_hash_hash_slot (h, i, Qnil); h->count--; } @@ -4512,7 +4512,7 @@ i = hash_lookup (h, key, &hash); if (i >= 0) - set_hash_value (h, i, value); + set_hash_value_slot (h, i, value); else hash_put (h, key, value, hash); === modified file 'src/lisp.h' --- src/lisp.h 2012-08-18 23:53:43 +0000 +++ src/lisp.h 2012-08-20 08:07:38 +0000 @@ -2345,31 +2345,55 @@ } LISP_INLINE void -set_hash_key (struct Lisp_Hash_Table *h, ptrdiff_t idx, Lisp_Object val) +set_hash_key_and_value (struct Lisp_Hash_Table *h, Lisp_Object key_and_value) +{ + h->key_and_value = key_and_value; +} + +LISP_INLINE void +set_hash_key_slot (struct Lisp_Hash_Table *h, ptrdiff_t idx, Lisp_Object val) { gc_aset (h->key_and_value, 2 * idx, val); } LISP_INLINE void -set_hash_value (struct Lisp_Hash_Table *h, ptrdiff_t idx, Lisp_Object val) +set_hash_value_slot (struct Lisp_Hash_Table *h, ptrdiff_t idx, Lisp_Object val) { gc_aset (h->key_and_value, 2 * idx + 1, val); } LISP_INLINE void -set_hash_next (struct Lisp_Hash_Table *h, ptrdiff_t idx, Lisp_Object val) +set_hash_next (struct Lisp_Hash_Table *h, Lisp_Object next) +{ + h->next = next; +} + +LISP_INLINE void +set_hash_next_slot (struct Lisp_Hash_Table *h, ptrdiff_t idx, Lisp_Object val) { gc_aset (h->next, idx, val); } LISP_INLINE void -set_hash_hash (struct Lisp_Hash_Table *h, ptrdiff_t idx, Lisp_Object val) +set_hash_hash (struct Lisp_Hash_Table *h, Lisp_Object hash) +{ + h->hash = hash; +} + +LISP_INLINE void +set_hash_hash_slot (struct Lisp_Hash_Table *h, ptrdiff_t idx, Lisp_Object val) { gc_aset (h->hash, idx, val); } LISP_INLINE void -set_hash_index (struct Lisp_Hash_Table *h, ptrdiff_t idx, Lisp_Object val) +set_hash_index (struct Lisp_Hash_Table *h, Lisp_Object index) +{ + h->index = index; +} + +LISP_INLINE void +set_hash_index_slot (struct Lisp_Hash_Table *h, ptrdiff_t idx, Lisp_Object val) { gc_aset (h->index, idx, val); } ------------------------------------------------------------ revno: 109692 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-08-20 00:45:10 -0700 message: * lisp/mail/rmailout.el (rmail-output-read-file-name): Trap errors in rmail-output-file-alist elements, and report them. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-20 07:30:40 +0000 +++ lisp/ChangeLog 2012-08-20 07:45:10 +0000 @@ -1,5 +1,8 @@ 2012-08-20 Glenn Morris + * mail/rmailout.el (rmail-output-read-file-name): + Trap and report errors in rmail-output-file-alist elements. + * font-lock.el (font-lock-add-keywords): Doc fix (quote face names since most non-font-lock faces are not also variables). === modified file 'lisp/mail/rmailout.el' --- lisp/mail/rmailout.el 2012-08-19 18:41:35 +0000 +++ lisp/mail/rmailout.el 2012-08-20 07:45:10 +0000 @@ -74,13 +74,21 @@ (widen) (narrow-to-region beg end) (let ((tail rmail-output-file-alist) - answer) + answer err) ;; Suggest a file based on a pattern match. (while (and tail (not answer)) (goto-char (point-min)) (if (re-search-forward (caar tail) nil t) - ;; FIXME trap and report any errors. - (setq answer (eval (cdar tail)))) + (setq answer + (condition-case err + (eval (cdar tail)) + (error + (display-warning + :error + (format "Error evaluating \ +`rmail-output-file-alist' element:\nregexp: %s\naction: %s\nerror: %S\n" + (caar tail) (cdar tail) err)) + nil)))) (setq tail (cdr tail))) answer)))))) ;; If no suggestion, use same file as last time. ------------------------------------------------------------ revno: 109691 committer: Dmitry Antipov branch nick: trunk timestamp: Mon 2012-08-20 11:42:06 +0400 message: Inline getter and setter functions for per-buffer values. * buffer.h (per_buffer_default, set_per_buffer_default) (per_buffer_value, set_per_buffer_value): New functions. (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove. * buffer.c, data.c: Adjust users. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-20 04:04:58 +0000 +++ src/ChangeLog 2012-08-20 07:42:06 +0000 @@ -1,3 +1,11 @@ +2012-08-20 Dmitry Antipov + + Inline getter and setter functions for per-buffer values. + * buffer.h (per_buffer_default, set_per_buffer_default) + (per_buffer_value, set_per_buffer_value): New functions. + (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove. + * buffer.c, data.c: Adjust users. + 2012-08-20 Juanma Barranquero * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies. === modified file 'src/buffer.c' --- src/buffer.c 2012-08-18 06:06:39 +0000 +++ src/buffer.c 2012-08-20 07:42:06 +0000 @@ -695,7 +695,7 @@ if (offset == PER_BUFFER_VAR_OFFSET (name)) continue; - obj = PER_BUFFER_VALUE (from, offset); + obj = per_buffer_value (from, offset); if (MARKERP (obj) && XMARKER (obj)->buffer == from) { struct Lisp_Marker *m = XMARKER (obj); @@ -704,7 +704,7 @@ XMARKER (obj)->insertion_type = m->insertion_type; } - PER_BUFFER_VALUE (to, offset) = obj; + set_per_buffer_value (to, offset, obj); } memcpy (to->local_flags, from->local_flags, sizeof to->local_flags); @@ -1063,7 +1063,7 @@ if ((idx > 0 && (permanent_too || buffer_permanent_local_flags[idx] == 0))) - PER_BUFFER_VALUE (b, offset) = PER_BUFFER_DEFAULT (offset); + set_per_buffer_value (b, offset, per_buffer_default (offset)); } } @@ -1239,7 +1239,7 @@ { union Lisp_Fwd *fwd = SYMBOL_FWD (sym); if (BUFFER_OBJFWDP (fwd)) - result = PER_BUFFER_VALUE (buf, XBUFFER_OBJFWD (fwd)->offset); + result = per_buffer_value (buf, XBUFFER_OBJFWD (fwd)->offset); else result = Fdefault_value (variable); break; @@ -1319,7 +1319,7 @@ && SYMBOLP (PER_BUFFER_SYMBOL (offset))) { Lisp_Object sym = PER_BUFFER_SYMBOL (offset); - Lisp_Object val = PER_BUFFER_VALUE (buf, offset); + Lisp_Object val = per_buffer_value (buf, offset); result = Fcons (EQ (val, Qunbound) ? sym : Fcons (sym, val), result); } === modified file 'src/buffer.h' --- src/buffer.h 2012-08-18 06:06:39 +0000 +++ src/buffer.h 2012-08-20 07:42:06 +0000 @@ -1203,18 +1203,36 @@ #define PER_BUFFER_IDX(OFFSET) \ XINT (*(Lisp_Object *)((OFFSET) + (char *) &buffer_local_flags)) -/* Return the default value of the per-buffer variable at offset - OFFSET in the buffer structure. */ - -#define PER_BUFFER_DEFAULT(OFFSET) \ - (*(Lisp_Object *)((OFFSET) + (char *) &buffer_defaults)) - -/* Return the buffer-local value of the per-buffer variable at offset - OFFSET in the buffer structure. */ - -#define PER_BUFFER_VALUE(BUFFER, OFFSET) \ - (*(Lisp_Object *)((OFFSET) + (char *) (BUFFER))) - +/* Functions to get and set default value of the per-buffer + variable at offset OFFSET in the buffer structure. */ + +BUFFER_INLINE Lisp_Object +per_buffer_default (int offset) +{ + return *(Lisp_Object *)(offset + (char *) &buffer_defaults); +} + +BUFFER_INLINE void +set_per_buffer_default (int offset, Lisp_Object value) +{ + *(Lisp_Object *)(offset + (char *) &buffer_defaults) = value; +} + +/* Functions to get and set buffer-local value of the per-buffer + variable at offset OFFSET in the buffer structure. */ + +BUFFER_INLINE Lisp_Object +per_buffer_value (struct buffer *b, int offset) +{ + return *(Lisp_Object *)(offset + (char *) b); +} + +BUFFER_INLINE void +set_per_buffer_value (struct buffer *b, int offset, Lisp_Object value) +{ + *(Lisp_Object *)(offset + (char *) b) = value; +} + /* Downcase a character C, or make no change if that cannot be done. */ BUFFER_INLINE int downcase (int c) === modified file 'src/data.c' --- src/data.c 2012-08-19 08:40:12 +0000 +++ src/data.c 2012-08-20 07:42:06 +0000 @@ -847,7 +847,7 @@ return *XOBJFWD (valcontents)->objvar; case Lisp_Fwd_Buffer_Obj: - return PER_BUFFER_VALUE (current_buffer, + return per_buffer_value (current_buffer, XBUFFER_OBJFWD (valcontents)->offset); case Lisp_Fwd_Kboard_Obj: @@ -919,7 +919,7 @@ b = XBUFFER (lbuf); if (! PER_BUFFER_VALUE_P (b, idx)) - PER_BUFFER_VALUE (b, offset) = newval; + set_per_buffer_value (b, offset, newval); } } break; @@ -937,7 +937,7 @@ if (buf == NULL) buf = current_buffer; - PER_BUFFER_VALUE (buf, offset) = newval; + set_per_buffer_value (buf, offset, newval); } break; @@ -1309,7 +1309,7 @@ { int offset = XBUFFER_OBJFWD (valcontents)->offset; if (PER_BUFFER_IDX (offset) != 0) - return PER_BUFFER_DEFAULT (offset); + return per_buffer_default (offset); } /* For other variables, get the current value. */ @@ -1396,7 +1396,7 @@ int offset = XBUFFER_OBJFWD (valcontents)->offset; int idx = PER_BUFFER_IDX (offset); - PER_BUFFER_DEFAULT (offset) = value; + set_per_buffer_default (offset, value); /* If this variable is not always local in all buffers, set it in the buffers that don't nominally have a local value. */ @@ -1406,7 +1406,7 @@ FOR_EACH_BUFFER (b) if (!PER_BUFFER_VALUE_P (b, idx)) - PER_BUFFER_VALUE (b, offset) = value; + set_per_buffer_value (b, offset, value); } return value; } @@ -1705,8 +1705,8 @@ if (idx > 0) { SET_PER_BUFFER_VALUE_P (current_buffer, idx, 0); - PER_BUFFER_VALUE (current_buffer, offset) - = PER_BUFFER_DEFAULT (offset); + set_per_buffer_value (current_buffer, offset, + per_buffer_default (offset)); } } return variable; ------------------------------------------------------------ revno: 109690 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-08-20 00:30:40 -0700 message: * lisp/font-lock.el (font-lock-add-keywords): Doc fix (quote face names since most non-font-lock faces are not also variables). diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-20 07:23:51 +0000 +++ lisp/ChangeLog 2012-08-20 07:30:40 +0000 @@ -1,3 +1,8 @@ +2012-08-20 Glenn Morris + + * font-lock.el (font-lock-add-keywords): Doc fix (quote face names + since most non-font-lock faces are not also variables). + 2012-08-20 Edward Reingold * calendar/cal-tex.el (cal-tex-cursor-week-at-a-glance): === modified file 'lisp/font-lock.el' --- lisp/font-lock.el 2012-07-10 11:51:54 +0000 +++ lisp/font-lock.el 2012-08-20 07:30:40 +0000 @@ -146,8 +146,8 @@ ;; fontified automagically. In your ~/.emacs there could be: ;; ;; (defvar foo-font-lock-keywords -;; '(("\\<\\(one\\|two\\|three\\)\\>" . font-lock-keyword-face) -;; ("\\<\\(four\\|five\\|six\\)\\>" . font-lock-type-face)) +;; '(("\\<\\(one\\|two\\|three\\)\\>" . 'font-lock-keyword-face) +;; ("\\<\\(four\\|five\\|six\\)\\>" . 'font-lock-type-face)) ;; "Default expressions to highlight in Foo mode.") ;; ;; (add-hook 'foo-mode-hook @@ -167,8 +167,8 @@ ;; could be: ;; ;; (defvar bar-font-lock-keywords -;; '(("\\<\\(uno\\|due\\|tre\\)\\>" . font-lock-keyword-face) -;; ("\\<\\(quattro\\|cinque\\|sei\\)\\>" . font-lock-type-face)) +;; '(("\\<\\(uno\\|due\\|tre\\)\\>" . 'font-lock-keyword-face) +;; ("\\<\\(quattro\\|cinque\\|sei\\)\\>" . 'font-lock-type-face)) ;; "Default expressions to highlight in Bar mode.") ;; ;; and within `bar-mode' there could be: @@ -679,8 +679,8 @@ For example: (font-lock-add-keywords 'c-mode - '((\"\\\\\\=<\\\\(FIXME\\\\):\" 1 font-lock-warning-face prepend) - (\"\\\\\\=<\\\\(and\\\\|or\\\\|not\\\\)\\\\\\=>\" . font-lock-keyword-face))) + '((\"\\\\\\=<\\\\(FIXME\\\\):\" 1 'font-lock-warning-face prepend) + (\"\\\\\\=<\\\\(and\\\\|or\\\\|not\\\\)\\\\\\=>\" . 'font-lock-keyword-face))) adds two fontification patterns for C mode, to fontify `FIXME:' words, even in comments, and to fontify `and', `or' and `not' words as keywords. @@ -694,9 +694,9 @@ (add-hook 'c-mode-hook (lambda () (font-lock-add-keywords nil - '((\"\\\\\\=<\\\\(FIXME\\\\):\" 1 font-lock-warning-face prepend) + '((\"\\\\\\=<\\\\(FIXME\\\\):\" 1 'font-lock-warning-face prepend) (\"\\\\\\=<\\\\(and\\\\|or\\\\|not\\\\)\\\\\\=>\" . - font-lock-keyword-face))))) + 'font-lock-keyword-face))))) The above procedure may fail to add keywords to derived modes if some involved major mode does not follow the standard conventions. ------------------------------------------------------------ revno: 109689 fixes bug: http://debbugs.gnu.org/12160 author: Edward Reingold committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-08-20 00:23:51 -0700 message: * calendar/cal-tex.el (cal-tex-cursor-week-at-a-glance): New function. (This is basically cal-tex-cursor-filofax-week with a different papersize, mini-calendars, and color.) diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-19 18:41:35 +0000 +++ lisp/ChangeLog 2012-08-20 07:23:51 +0000 @@ -1,3 +1,8 @@ +2012-08-20 Edward Reingold + + * calendar/cal-tex.el (cal-tex-cursor-week-at-a-glance): + New function. (Bug12160) + 2012-08-19 Glenn Morris * mail/rmailout.el (rmail-output-read-file-name): === modified file 'lisp/calendar/cal-tex.el' --- lisp/calendar/cal-tex.el 2012-08-15 16:29:11 +0000 +++ lisp/calendar/cal-tex.el 2012-08-20 07:23:51 +0000 @@ -1009,6 +1009,168 @@ (cal-tex-e-framebox) (cal-tex-hspace "1cm"))) +(defun cal-tex-cursor-week-at-a-glance (&optional n event) + "One-week-at-a-glance full page calendar for week indicated by cursor. +Optional prefix argument N specifies number of weeks (default 1), +starting on Mondays. The calendar shows holiday and diary entries +if `cal-tex-holidays' and `cal-tex-diary', respectively, are non-nil. +It does not show hours of the day. Optional EVENT indicates a buffer +position to use instead of point." + (interactive (list (prefix-numeric-value current-prefix-arg) + last-nonmenu-event)) + (or n (setq n 1)) + (let* ((date (calendar-gregorian-from-absolute + (calendar-dayname-on-or-before + 1 + (calendar-absolute-from-gregorian + (calendar-cursor-to-date t event))))) + (month (calendar-extract-month date)) + (year (calendar-extract-year date)) + (day (calendar-extract-day date)) + (d1 (calendar-absolute-from-gregorian date)) + (d2 (+ (* 7 n) d1)) + (holidays (if cal-tex-holidays + (holiday-in-range d1 d2))) + (diary-list (if cal-tex-diary + (cal-tex-list-diary-entries d1 d2)))) + (cal-tex-preamble "twoside,12pt") + (cal-tex-cmd "\\usepackage{color}") + (cal-tex-cmd "\\textwidth 7in") + (cal-tex-cmd "\\textheight 10.5in") + (cal-tex-cmd "\\oddsidemargin 0in") + (cal-tex-cmd "\\evensidemargin 0in") + (cal-tex-cmd "\\topmargin 0pt") + (cal-tex-cmd "\\headheight -0.875in") + (cal-tex-cmd "\\headsep 0.125in") + (cal-tex-cmd "\\footskip .125in") + (insert "\\def\\righthead#1{\\hfill {\\normalsize \\bf #1}\\\\[-6pt]} +\\long\\def\\rightday#1#2#3#4#5{% + \\rule{\\textwidth}{0.3pt}\\\\% + \\hbox to \\textwidth{% + \\vbox to 2.75in{% + \\vspace*{2pt}% + \\hbox to \\textwidth{\\small #5 \\hfill #1 {\\normalsize \\bf #2}}% + \\hbox to \\textwidth{\\vbox {\\raggedleft \\footnotesize \\em \\textcolor{red}{#4}}}% + \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize \\textcolor{blue}{#3}}}}}\\\\} +\\long\\def\\weekend#1#2#3#4#5{% + \\rule{\\textwidth}{0.3pt}\\\\% + \\hbox to \\textwidth{% + \\vbox to 1.8in{% + \\vspace*{2pt}% + \\hbox to \\textwidth{\\small #5 \\hfill #1 {\\normalsize \\bf #2}}% + \\hbox to \\textwidth{\\vbox {\\raggedleft \\footnotesize \\em \\textcolor{red}{#4}}}% + \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize \\textcolor{blue}{#3}}}}}\\\\} +\\def\\lefthead#1{\\noindent {\\normalsize \\bf #1}\\hfill\\\\[-6pt]} +\\long\\def\\leftday#1#2#3#4#5{% + \\rule{\\textwidth}{0.3pt}\\\\% + \\hbox to \\textwidth{% + \\vbox to 2.75in{% + \\vspace*{2pt}% + \\hbox to \\textwidth{\\noindent {\\normalsize \\bf #2} \\small #1 \\hfill #5}% + \\hbox to \\textwidth{\\vbox {\\noindent \\footnotesize \\em \\textcolor{red}{#4}}}% + \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize \\textcolor{blue}{#3}}}}}\\\\} +") + (cal-tex-b-document) + (cal-tex-cmd "\\pagestyle{empty}\\ ") + (cal-tex-newpage) + (dotimes (i n) + (insert "\\lefthead") + (cal-tex-arg + (let ((d (cal-tex-incr-date date 2))) + (if (= (calendar-extract-month date) + (calendar-extract-month d)) + (format "%s %s" + (cal-tex-month-name (calendar-extract-month date)) + (calendar-extract-year date)) + (if (= (calendar-extract-year date) + (calendar-extract-year d)) + (format "%s---%s %s" + (cal-tex-month-name (calendar-extract-month date)) + (cal-tex-month-name (calendar-extract-month d)) + (calendar-extract-year date)) + (format "%s %s---%s %s" + (cal-tex-month-name (calendar-extract-month date)) + (calendar-extract-year date) + (cal-tex-month-name (calendar-extract-month d)) + (calendar-extract-year d)))))) + (insert "%\n") + (dotimes (_jdummy 3) + (insert "\\leftday") + (cal-tex-arg (cal-tex-LaTeXify-string (calendar-day-name date))) + (cal-tex-arg (number-to-string (calendar-extract-day date))) + (cal-tex-arg (cal-tex-latexify-list diary-list date)) + (cal-tex-arg (cal-tex-latexify-list holidays date)) + (cal-tex-arg (eval cal-tex-daily-string)) + (insert "%\n") + (setq date (cal-tex-incr-date date))) + (insert "\\noindent\\rule{\\textwidth}{0.3pt}\\\\%\n") + (cal-tex-nl) + (insert (cal-tex-mini-calendar + (calendar-extract-month (cal-tex-previous-month date)) + (calendar-extract-year (cal-tex-previous-month date)) + "lastmonth" "1.1in" "1in")) + (insert (cal-tex-mini-calendar + (calendar-extract-month date) + (calendar-extract-year date) + "thismonth" "1.1in" "1in")) + (insert (cal-tex-mini-calendar + (calendar-extract-month (cal-tex-next-month date)) + (calendar-extract-year (cal-tex-next-month date)) + "nextmonth" "1.1in" "1in")) + (insert "\\hbox to \\textwidth{") + (cal-tex-hfill) + (insert "\\lastmonth") + (cal-tex-hfill) + (insert "\\thismonth") + (cal-tex-hfill) + (insert "\\nextmonth") + (cal-tex-hfill) + (insert "}") + (cal-tex-newpage) + (insert "\\righthead") + (cal-tex-arg + (let ((d (cal-tex-incr-date date 3))) + (if (= (calendar-extract-month date) + (calendar-extract-month d)) + (format "%s %s" + (cal-tex-month-name (calendar-extract-month date)) + (calendar-extract-year date)) + (if (= (calendar-extract-year date) + (calendar-extract-year d)) + (format "%s---%s %s" + (cal-tex-month-name (calendar-extract-month date)) + (cal-tex-month-name (calendar-extract-month d)) + (calendar-extract-year date)) + (format "%s %s---%s %s" + (cal-tex-month-name (calendar-extract-month date)) + (calendar-extract-year date) + (cal-tex-month-name (calendar-extract-month d)) + (calendar-extract-year d)))))) + (insert "%\n") + (dotimes (_jdummy 2) + (insert "\\rightday") + (cal-tex-arg (cal-tex-LaTeXify-string (calendar-day-name date))) + (cal-tex-arg (number-to-string (calendar-extract-day date))) + (cal-tex-arg (cal-tex-latexify-list diary-list date)) + (cal-tex-arg (cal-tex-latexify-list holidays date)) + (cal-tex-arg (eval cal-tex-daily-string)) + (insert "%\n") + (setq date (cal-tex-incr-date date))) + (dotimes (_jdummy 2) + (insert "\\weekend") + (cal-tex-arg (cal-tex-LaTeXify-string (calendar-day-name date))) + (cal-tex-arg (number-to-string (calendar-extract-day date))) + (cal-tex-arg (cal-tex-latexify-list diary-list date)) + (cal-tex-arg (cal-tex-latexify-list holidays date)) + (cal-tex-arg (eval cal-tex-daily-string)) + (insert "%\n") + (setq date (cal-tex-incr-date date))) + (unless (= i (1- n)) + (run-hooks 'cal-tex-week-hook) + (cal-tex-newpage))) + (cal-tex-end-document) + (run-hooks 'cal-tex-hook))) + ;;;###cal-autoload (defun cal-tex-cursor-filofax-2week (&optional n event) "Two-weeks-at-a-glance Filofax style calendar for week cursor is in. ------------------------------------------------------------ revno: 109688 committer: Paul Eggert branch nick: trunk timestamp: Sun 2012-08-19 21:04:58 -0700 message: Clarify recent ChangeLog entry. diff: === modified file 'lib-src/ChangeLog' --- lib-src/ChangeLog 2012-08-19 21:00:09 +0000 +++ lib-src/ChangeLog 2012-08-20 04:04:58 +0000 @@ -1,6 +1,6 @@ 2012-08-19 Paul Eggert - Rely on to declare 'environ'. + Rely on + to declare 'environ'. * emacsclient.c (environ): Remove decl. 2012-08-17 Juanma Barranquero === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-20 01:28:35 +0000 +++ src/ChangeLog 2012-08-20 04:04:58 +0000 @@ -4,7 +4,7 @@ 2012-08-19 Paul Eggert - Rely on to declare 'environ', + Rely on + to declare 'environ', as gnulib does this if the system doesn't. * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]: * emacs.c (environ) [DOUG_LEA_MALLOC]: