Now on revision 109741. ------------------------------------------------------------ revno: 109741 committer: martin rudalics branch nick: trunk timestamp: Wed 2012-08-22 08:59:38 +0200 message: In dired-mark-remembered don't clobber point (Bug#11795). * dired.el (dired-mark-remembered): Don't clobber point. (Bug#11795) diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-22 06:47:00 +0000 +++ lisp/ChangeLog 2012-08-22 06:59:38 +0000 @@ -1,3 +1,8 @@ +2012-08-22 Martin Rudalics + + * dired.el (dired-mark-remembered): Don't clobber point. + (Bug#11795) + 2012-08-22 Glenn Morris * progmodes/bug-reference.el (bug-reference): New custom group. === modified file 'lisp/dired.el' --- lisp/dired.el 2012-08-15 16:29:11 +0000 +++ lisp/dired.el 2012-08-22 06:59:38 +0000 @@ -1331,16 +1331,16 @@ "Mark all files remembered in ALIST. Each element of ALIST looks like (FILE . MARKERCHAR)." (let (elt fil chr) - (while alist - (setq elt (car alist) - alist (cdr alist) - fil (car elt) - chr (cdr elt)) - (if (dired-goto-file fil) - (save-excursion - (beginning-of-line) - (delete-char 1) - (insert chr)))))) + (save-excursion + (while alist + (setq elt (car alist) + alist (cdr alist) + fil (car elt) + chr (cdr elt)) + (when (dired-goto-file fil) + (beginning-of-line) + (delete-char 1) + (insert chr)))))) (defun dired-remember-hidden () "Return a list of names of subdirs currently hidden." ------------------------------------------------------------ revno: 109740 fixes bug: http://debbugs.gnu.org/12011 committer: Glenn Morris branch nick: trunk timestamp: Tue 2012-08-21 23:55:44 -0700 message: Add option to not create bin/emacs link to bin/emacs-VERSION * Makefile.in (install-arch-dep): If NO_BIN_LINK is non-null, do not create the bin/emacs link. * etc/NEWS: Mention this. diff: === modified file 'ChangeLog' --- ChangeLog 2012-08-21 14:37:56 +0000 +++ ChangeLog 2012-08-22 06:55:44 +0000 @@ -1,3 +1,8 @@ +2012-08-22 Glenn Morris + + * Makefile.in (install-arch-dep): If NO_BIN_LINK is non-null, + do not create the bin/emacs link. (Bug#12011) + 2012-08-21 Paul Eggert Merge from gnulib, incorporating: === modified file 'Makefile.in' --- Makefile.in 2012-08-20 22:12:35 +0000 +++ Makefile.in 2012-08-22 06:55:44 +0000 @@ -437,8 +437,10 @@ if test "${ns_self_contained}" = "no"; then \ ${INSTALL_PROGRAM} $(INSTALL_STRIP) src/emacs${EXEEXT} $(DESTDIR)${bindir}/$(EMACSFULL) || exit 1 ; \ chmod 1755 $(DESTDIR)${bindir}/$(EMACSFULL) ; \ - rm -f $(DESTDIR)${bindir}/$(EMACS) ; \ - cd $(DESTDIR)${bindir} && $(LN_S) $(EMACSFULL) $(EMACS); \ + if test "x${NO_BIN_LINK}" = x; then \ + rm -f $(DESTDIR)${bindir}/$(EMACS) ; \ + cd $(DESTDIR)${bindir} && $(LN_S) $(EMACSFULL) $(EMACS); \ + fi; \ else \ subdir=${ns_appresdir}/site-lisp; \ ${write_subdir} || exit 1; \ === modified file 'etc/NEWS' --- etc/NEWS 2012-08-18 05:11:38 +0000 +++ etc/NEWS 2012-08-22 06:55:44 +0000 @@ -39,6 +39,11 @@ as it was confusingly-named and rarely useful. --- +** You can use `NO_BIN_LINK=t make install' to prevent the installation +overwriting "emacs" in the installation bin/ directory with a link +to emacs-VERSION. + +--- ** Emacs uses libtinfo in preference to libncurses, if available. --- ------------------------------------------------------------ revno: 109739 committer: Glenn Morris branch nick: trunk timestamp: Tue 2012-08-21 23:47:00 -0700 message: Make bug-reference-bug-regexp customizable Ref: http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00427.html * lisp/progmodes/bug-reference.el (bug-reference): New custom group. (bug-reference-bug-regexp): Make it a defcustom. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-22 05:35:38 +0000 +++ lisp/ChangeLog 2012-08-22 06:47:00 +0000 @@ -1,3 +1,8 @@ +2012-08-22 Glenn Morris + + * progmodes/bug-reference.el (bug-reference): New custom group. + (bug-reference-bug-regexp): Make it a defcustom. + 2012-08-22 Daiki Ueno * progmodes/js.el (js-indent-level, js-expr-indent-offset) === modified file 'lisp/progmodes/bug-reference.el' --- lisp/progmodes/bug-reference.el 2012-07-21 06:13:23 +0000 +++ lisp/progmodes/bug-reference.el 2012-08-22 06:47:00 +0000 @@ -32,6 +32,11 @@ ;;; Code: +(defgroup bug-reference nil + "Hyperlinking references to bug reports" + ;; Somewhat arbitrary, by analogy with eg goto-address. + :group 'comm) + (defvar bug-reference-map (let ((map (make-sparse-keymap))) (define-key map [mouse-2] 'bug-reference-push-button) @@ -63,9 +68,13 @@ (and (symbolp s) (get s 'bug-reference-url-format))))) -(defconst bug-reference-bug-regexp +(defcustom bug-reference-bug-regexp "\\([Bb]ug ?#\\|[Pp]atch ?#\\|RFE ?#\\|PR [a-z-+]+/\\)\\([0-9]+\\(?:#[0-9]+\\)?\\)" - "Regular expression which matches bug references.") + "Regular expression matching bug references. +The second subexpression should match the bug reference (usually a number)." + :type 'string + :safe 'stringp + :group 'bug-reference) (defun bug-reference-set-overlay-properties () "Set properties of bug reference overlays." ------------------------------------------------------------ revno: 109738 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12257 committer: Daiki Ueno branch nick: trunk timestamp: Wed 2012-08-22 14:35:38 +0900 message: Add :safe for js indent variables. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-22 01:29:22 +0000 +++ lisp/ChangeLog 2012-08-22 05:35:38 +0000 @@ -1,3 +1,9 @@ +2012-08-22 Daiki Ueno + + * progmodes/js.el (js-indent-level, js-expr-indent-offset) + (js-paren-indent-offset, js-square-indent-offset) + (js-curly-indent-offset): Add :safe (Bug#12257). + 2012-08-22 Edward O'Connor * json.el (json-key-format): Add error properties. === modified file 'lisp/progmodes/js.el' --- lisp/progmodes/js.el 2012-07-11 23:13:41 +0000 +++ lisp/progmodes/js.el 2012-08-22 05:35:38 +0000 @@ -426,18 +426,21 @@ (defcustom js-indent-level 4 "Number of spaces for each indentation step in `js-mode'." :type 'integer + :safe 'integerp :group 'js) (defcustom js-expr-indent-offset 0 "Number of additional spaces for indenting continued expressions. The value must be no less than minus `js-indent-level'." :type 'integer + :safe 'integerp :group 'js) (defcustom js-paren-indent-offset 0 "Number of additional spaces for indenting expressions in parentheses. The value must be no less than minus `js-indent-level'." :type 'integer + :safe 'integerp :group 'js :version "24.1") @@ -445,6 +448,7 @@ "Number of additional spaces for indenting expressions in square braces. The value must be no less than minus `js-indent-level'." :type 'integer + :safe 'integerp :group 'js :version "24.1") @@ -452,6 +456,7 @@ "Number of additional spaces for indenting expressions in curly braces. The value must be no less than minus `js-indent-level'." :type 'integer + :safe 'integerp :group 'js :version "24.1") ------------------------------------------------------------ revno: 109737 committer: Josh Feinstein branch nick: trunk timestamp: Tue 2012-08-21 20:45:51 -0700 message: 2012-08-21 Josh Feinstein * erc-join.el (erc-autojoin-timing): Fix defcustom type. diff: === modified file 'lisp/erc/ChangeLog' --- lisp/erc/ChangeLog 2012-08-21 07:52:42 +0000 +++ lisp/erc/ChangeLog 2012-08-22 03:45:51 +0000 @@ -1,3 +1,7 @@ +2012-08-21 Josh Feinstein + + * erc-join.el (erc-autojoin-timing): Fix defcustom type. + 2012-08-21 Julien Danjou * erc-match.el (erc-match-message): Use === modified file 'lisp/erc/erc-join.el' --- lisp/erc/erc-join.el 2012-04-10 04:43:35 +0000 +++ lisp/erc/erc-join.el 2012-08-22 03:45:51 +0000 @@ -84,8 +84,8 @@ Any other value means the same as `connect'." :group 'erc-autojoin :version "24.1" - :type '(choice (const :tag "On Connection" 'connect) - (const :tag "When Identified" 'ident))) + :type '(choice (const :tag "On Connection" connect) + (const :tag "When Identified" ident))) (defcustom erc-autojoin-delay 30 "Number of seconds to wait before attempting to autojoin channels. ------------------------------------------------------------ revno: 109736 author: Edward O'Connor committer: Glenn Morris branch nick: trunk timestamp: Tue 2012-08-21 21:29:22 -0400 message: strict key encoding for json.el Ref: http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00642.html * lisp/json.el (json-key-format): Add error properties. (json-encode-key): New function. (json-encode-hash-table, json-encode-alist, json-encode-plist): Use json-encode-key. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-22 00:39:44 +0000 +++ lisp/ChangeLog 2012-08-22 01:29:22 +0000 @@ -1,3 +1,10 @@ +2012-08-22 Edward O'Connor + + * json.el (json-key-format): Add error properties. + (json-encode-key): New function. + (json-encode-hash-table, json-encode-alist, json-encode-plist): + Use json-encode-key. + 2012-08-22 Glenn Morris * calendar/cal-tex.el (cal-tex-longday): New function, replacing... === modified file 'lisp/json.el' --- lisp/json.el 2012-01-19 07:21:25 +0000 +++ lisp/json.el 2012-08-22 01:29:22 +0000 @@ -174,6 +174,10 @@ (put 'json-string-format 'error-conditions '(json-string-format json-error error)) +(put 'json-key-format 'error-message "Bad JSON object key") +(put 'json-key-format 'error-conditions + '(json-key-format json-error error)) + (put 'json-object-format 'error-message "Bad JSON object") (put 'json-object-format 'error-conditions '(json-object-format json-error error)) @@ -321,6 +325,15 @@ "Return a JSON representation of STRING." (format "\"%s\"" (mapconcat 'json-encode-char string ""))) +(defun json-encode-key (object) + "Return a JSON representation of OBJECT. +If the resulting JSON object isn't a valid JSON object key, +this signals `json-key-format'." + (let ((encoded (json-encode object))) + (unless (stringp (json-read-from-string encoded)) + (signal 'json-key-format (list object))) + encoded)) + ;;; JSON Objects (defun json-new-object () @@ -395,7 +408,7 @@ (maphash (lambda (k v) (push (format "%s:%s" - (json-encode k) + (json-encode-key k) (json-encode v)) r)) hash-table) @@ -409,7 +422,7 @@ (format "{%s}" (json-join (mapcar (lambda (cons) (format "%s:%s" - (json-encode (car cons)) + (json-encode-key (car cons)) (json-encode (cdr cons)))) alist) ", "))) @@ -418,7 +431,7 @@ "Return a JSON representation of PLIST." (let (result) (while plist - (push (concat (json-encode (car plist)) + (push (concat (json-encode-key (car plist)) ":" (json-encode (cadr plist))) result) ------------------------------------------------------------ revno: 109735 committer: Glenn Morris branch nick: trunk timestamp: Tue 2012-08-21 20:39:44 -0400 message: Combine two cal-tex functions * lisp/calendar/cal-tex.el (cal-tex-longday): New function, replacing... (cal-tex-leftday, cal-tex-rightday): Remove functions. (cal-tex-weekly-common, cal-tex-cursor-filofax-2week): Update for above change. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-21 21:41:35 +0000 +++ lisp/ChangeLog 2012-08-22 00:39:44 +0000 @@ -1,3 +1,10 @@ +2012-08-22 Glenn Morris + + * calendar/cal-tex.el (cal-tex-longday): New function, replacing... + (cal-tex-leftday, cal-tex-rightday): Remove functions. + (cal-tex-weekly-common, cal-tex-cursor-filofax-2week): + Update for above change. + 2012-08-21 Andreas Schwab * cus-face.el (custom-face-attributes): Fix customize type for the === modified file 'lisp/calendar/cal-tex.el' --- lisp/calendar/cal-tex.el 2012-08-21 19:18:56 +0000 +++ lisp/calendar/cal-tex.el 2012-08-22 00:39:44 +0000 @@ -371,27 +371,21 @@ \\footskip 0.125in "))) -(defun cal-tex-leftday (height) - "Insert LaTeX code for leftday function." - (insert "\\long\\def\\leftday#1#2#3#4#5{% - \\rule{\\textwidth}{0.3pt}\\\\% - \\hbox to \\textwidth{% - \\vbox to " height "{% - \\vspace*{2pt}% - \\hbox to \\textwidth{\\noindent {\\normalsize \\bf #2} \\small #1 \\hfill #5}% - \\hbox to \\textwidth{\\vbox {\\noindent \\footnotesize \\em #4}}% - \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\}\n")) - -(defun cal-tex-rightday (height &optional funcname) - "Insert LaTeX code for rightday function." - (insert "\\long\\def\\" (or funcname "rightday") "#1#2#3#4#5{% - \\rule{\\textwidth}{0.3pt}\\\\% - \\hbox to \\textwidth{% - \\vbox to " height "{% - \\vspace*{2pt}% - \\hbox to \\textwidth{\\small #5 \\hfill #1 {\\normalsize \\bf #2}}% - \\hbox to \\textwidth{\\vbox {\\raggedleft \\footnotesize \\em #4}}% - \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\}\n")) +(defun cal-tex-longday (funcname height) + "Insert LaTeX code for a long day function." + (insert "\\long\\def\\" funcname "#1#2#3#4#5{% + \\rule{\\textwidth}{0.3pt}\\\\% + \\hbox to \\textwidth{% + \\vbox to " height "{% + \\vspace*{2pt}% + \\hbox to \\textwidth{" + (if (string-equal funcname "leftday") + "\\noindent {\\normalsize \\bf #2} \\small #1 \\hfill #5}%\n" + "\\small #5 \\hfill #1 {\\normalsize \\bf #2}}%\n") + " \\hbox to \\textwidth{\\vbox {\\" + (if (string-equal funcname "leftday") "noindent" "raggedleft") + " \\footnotesize \\em #4}}% + \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\}\n")) (defun cal-tex-shortday (funcname) "Insert LaTeX code for a short day function." @@ -1082,10 +1076,10 @@ (cal-tex-preamble "twoside") (cal-tex-filofax-paper) (insert cal-tex-righthead) - (cal-tex-rightday "1.85in") - (cal-tex-rightday "0.8in" "weekend") + (cal-tex-longday "rightday" "1.85in") + (cal-tex-longday "weekend" "0.8in") (insert cal-tex-lefthead) - (cal-tex-leftday "1.85in")) + (cal-tex-longday "leftday" "1.85in")) (cal-tex-preamble "twoside,12pt") (insert "\\textwidth 7in \\textheight 10.5in @@ -1097,10 +1091,10 @@ \\footskip .125in ") (insert cal-tex-righthead) - (cal-tex-rightday "2.75in") - (cal-tex-rightday "1.8in" "weekend") + (cal-tex-longday "rightday" "2.75in") + (cal-tex-longday "weekend" "1.8in") (insert cal-tex-lefthead) - (cal-tex-leftday "2.75in")) + (cal-tex-longday "leftday" "2.75in")) (cal-tex-b-document) (cal-tex-cmd "\\pagestyle" "empty") (dotimes (i n) @@ -1241,9 +1235,9 @@ (cal-tex-preamble "twoside") (cal-tex-filofax-paper) (insert cal-tex-righthead) - (cal-tex-rightday "0.7in") + (cal-tex-longday "rightday" "0.7in") (insert cal-tex-lefthead) - (cal-tex-leftday "0.7in") + (cal-tex-longday "leftday" "0.7in") (cal-tex-b-document) (cal-tex-cmd "\\pagestyle" "empty") (dotimes (i n) ------------------------------------------------------------ revno: 109734 committer: Paul Eggert branch nick: trunk timestamp: Tue 2012-08-21 16:39:56 -0700 message: * alloc.c: Use bool for booleans. (gc_in_progress, abort_on_gc) (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]: (dont_register_blocks) [GC_MALLOC_CHECK]: (suppress_checking) [ENABLE_CHECKING]: Now bool, not int. (check_string_bytes, make_specified_string, memory_full) (live_string_p, live_cons_p, live_symbol_p, live_float_p) (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object) (mark_stack, valid_pointer_p, make_pure_string) (Fgarbage_collect, survives_gc_p, gc_sweep): Use bool for booleans, instead of int. (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]: Remove unused local. * alloc.c (PURE_POINTER_P): * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean. * editfns.c (Fformat): * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name) (Fdo_auto_save): * fns.c (sweep_weak_table): * lisp.h (suppress_checking, push_message, survives_gc_p) (make_pure_string, gc_in_progress, abort_on_gc): * lread.c (readchar, read1): * print.c (Fprin1_to_string): * xdisp.c (push_message): Use bool for booleans affected directly or indirectly by alloc.c's changes. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-21 23:09:01 +0000 +++ src/ChangeLog 2012-08-21 23:39:56 +0000 @@ -1,5 +1,32 @@ 2012-08-21 Paul Eggert + * alloc.c: Use bool for booleans. + (gc_in_progress, abort_on_gc) + (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]: + (dont_register_blocks) [GC_MALLOC_CHECK]: + (suppress_checking) [ENABLE_CHECKING]: Now bool, not int. + (check_string_bytes, make_specified_string, memory_full) + (live_string_p, live_cons_p, live_symbol_p, live_float_p) + (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object) + (mark_stack, valid_pointer_p, make_pure_string) + (Fgarbage_collect, survives_gc_p, gc_sweep): + Use bool for booleans, instead of int. + (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]: + Remove unused local. + * alloc.c (PURE_POINTER_P): + * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean. + * editfns.c (Fformat): + * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name) + (Fdo_auto_save): + * fns.c (sweep_weak_table): + * lisp.h (suppress_checking, push_message, survives_gc_p) + (make_pure_string, gc_in_progress, abort_on_gc): + * lread.c (readchar, read1): + * print.c (Fprin1_to_string): + * xdisp.c (push_message): + Use bool for booleans affected directly or indirectly by + alloc.c's changes. + Make recently-introduced setters macros. * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii) (set_fontset_base, set_fontset_frame, set_fontset_nofont_face) === modified file 'src/alloc.c' --- src/alloc.c 2012-08-17 21:12:11 +0000 +++ src/alloc.c 2012-08-21 23:39:56 +0000 @@ -173,15 +173,15 @@ EMACS_INT memory_full_cons_threshold; -/* Nonzero during GC. */ - -int gc_in_progress; - -/* Nonzero means abort if try to GC. +/* True during GC. */ + +bool gc_in_progress; + +/* True means abort if try to GC. This is for code which is written on the assumption that no GC will happen, so as to verify that assumption. */ -int abort_on_gc; +bool abort_on_gc; /* Number of live and free conses etc. */ @@ -223,7 +223,7 @@ static ptrdiff_t pure_bytes_used_before_overflow; -/* Value is non-zero if P points into pure space. */ +/* True if P points into pure space. */ #define PURE_POINTER_P(P) \ ((uintptr_t) (P) - (uintptr_t) purebeg <= pure_size) @@ -392,13 +392,13 @@ static struct Lisp_Vector *allocate_vectorlike (ptrdiff_t); static void lisp_free (void *); static void mark_stack (void); -static int live_vector_p (struct mem_node *, void *); -static int live_buffer_p (struct mem_node *, void *); -static int live_string_p (struct mem_node *, void *); -static int live_cons_p (struct mem_node *, void *); -static int live_symbol_p (struct mem_node *, void *); -static int live_float_p (struct mem_node *, void *); -static int live_misc_p (struct mem_node *, void *); +static bool live_vector_p (struct mem_node *, void *); +static bool live_buffer_p (struct mem_node *, void *); +static bool live_string_p (struct mem_node *, void *); +static bool live_cons_p (struct mem_node *, void *); +static bool live_symbol_p (struct mem_node *, void *); +static bool live_float_p (struct mem_node *, void *); +static bool live_misc_p (struct mem_node *, void *); static void mark_maybe_object (Lisp_Object); static void mark_memory (void *, void *); #if GC_MARK_STACK || defined GC_MALLOC_CHECK @@ -1241,7 +1241,7 @@ #endif #ifdef GC_MALLOC_CHECK -static int dont_register_blocks; +static bool dont_register_blocks; #endif static size_t bytes_used_when_reconsidered; @@ -1828,11 +1828,11 @@ /* Check validity of Lisp strings' string_bytes member. ALL_P - non-zero means check all strings, otherwise check only most + means check all strings, otherwise check only most recently allocated strings. Used for hunting a bug. */ static void -check_string_bytes (int all_p) +check_string_bytes (bool all_p) { if (all_p) { @@ -2437,9 +2437,9 @@ Lisp_Object make_specified_string (const char *contents, - ptrdiff_t nchars, ptrdiff_t nbytes, int multibyte) + ptrdiff_t nchars, ptrdiff_t nbytes, bool multibyte) { - register Lisp_Object val; + Lisp_Object val; if (nchars < 0) { @@ -3094,7 +3094,7 @@ for (block = vector_blocks; block; block = *bprev) { - int free_this_block = 0; + bool free_this_block = 0; for (vector = (struct Lisp_Vector *) block->data; VECTOR_IN_BLOCK (vector, block); vector = next) @@ -3753,7 +3753,7 @@ memory_full (size_t nbytes) { /* Do not go into hysterics merely because a large request failed. */ - int enough_free_memory = 0; + bool enough_free_memory = 0; if (SPARE_MEMORY < nbytes) { void *p; @@ -4246,7 +4246,7 @@ /* Value is non-zero if P is a pointer to a live Lisp string on the heap. M is a pointer to the mem_block for P. */ -static inline int +static inline bool live_string_p (struct mem_node *m, void *p) { if (m->type == MEM_TYPE_STRING) @@ -4269,7 +4269,7 @@ /* Value is non-zero if P is a pointer to a live Lisp cons on the heap. M is a pointer to the mem_block for P. */ -static inline int +static inline bool live_cons_p (struct mem_node *m, void *p) { if (m->type == MEM_TYPE_CONS) @@ -4295,7 +4295,7 @@ /* Value is non-zero if P is a pointer to a live Lisp symbol on the heap. M is a pointer to the mem_block for P. */ -static inline int +static inline bool live_symbol_p (struct mem_node *m, void *p) { if (m->type == MEM_TYPE_SYMBOL) @@ -4321,7 +4321,7 @@ /* Value is non-zero if P is a pointer to a live Lisp float on the heap. M is a pointer to the mem_block for P. */ -static inline int +static inline bool live_float_p (struct mem_node *m, void *p) { if (m->type == MEM_TYPE_FLOAT) @@ -4345,7 +4345,7 @@ /* Value is non-zero if P is a pointer to a live Lisp Misc on the heap. M is a pointer to the mem_block for P. */ -static inline int +static inline bool live_misc_p (struct mem_node *m, void *p) { if (m->type == MEM_TYPE_MISC) @@ -4371,7 +4371,7 @@ /* Value is non-zero if P is a pointer to a live vector-like object. M is a pointer to the mem_block for P. */ -static inline int +static inline bool live_vector_p (struct mem_node *m, void *p) { if (m->type == MEM_TYPE_VECTOR_BLOCK) @@ -4407,7 +4407,7 @@ /* Value is non-zero if P is a pointer to a live buffer. M is a pointer to the mem_block for P. */ -static inline int +static inline bool live_buffer_p (struct mem_node *m, void *p) { /* P must point to the start of the block, and the buffer @@ -4487,7 +4487,7 @@ if (m != MEM_NIL) { - int mark_p = 0; + bool mark_p = 0; switch (XTYPE (obj)) { @@ -4707,7 +4707,8 @@ #if !defined GC_SAVE_REGISTERS_ON_STACK && !defined GC_SETJMP_WORKS -static int setjmp_tested_p, longjmps_done; +static bool setjmp_tested_p; +static int longjmps_done; #define SETJMP_WILL_LIKELY_WORK "\ \n\ @@ -4751,7 +4752,6 @@ char buf[10]; register int x; jmp_buf jbuf; - int result = 0; /* Arrange for X to be put in a register. */ sprintf (buf, "1"); @@ -4891,7 +4891,7 @@ Lisp_Object o; jmp_buf j; } j; - volatile int stack_grows_down_p = (char *) &j > (char *) stack_base; + volatile bool stack_grows_down_p = (char *) &j > (char *) stack_base; #endif /* This trick flushes the register windows so that all the state of the process is contained in the stack. */ @@ -4965,7 +4965,7 @@ if (pipe (fd) == 0) { - int valid = (emacs_write (fd[1], (char *) p, 16) == 16); + bool valid = emacs_write (fd[1], (char *) p, 16) == 16; emacs_close (fd[1]); emacs_close (fd[0]); return valid; @@ -5186,7 +5186,7 @@ /* Return a string allocated in pure space. DATA is a buffer holding NCHARS characters, and NBYTES bytes of string data. MULTIBYTE - non-zero means make the result string multibyte. + means make the result string multibyte. Must get an error if pure storage is full, since if it cannot hold a large string it may be able to hold conses that point to that @@ -5194,7 +5194,7 @@ Lisp_Object make_pure_string (const char *data, - ptrdiff_t nchars, ptrdiff_t nbytes, int multibyte) + ptrdiff_t nchars, ptrdiff_t nbytes, bool multibyte) { Lisp_Object string; struct Lisp_String *s = pure_alloc (sizeof *s, Lisp_String); @@ -5389,11 +5389,11 @@ See Info node `(elisp)Garbage Collection'. */) (void) { - register struct specbinding *bind; - register struct buffer *nextb; + struct specbinding *bind; + struct buffer *nextb; char stack_top_variable; ptrdiff_t i; - int message_p; + bool message_p; ptrdiff_t count = SPECPDL_INDEX (); EMACS_TIME start; Lisp_Object retval = Qnil; @@ -6208,10 +6208,10 @@ /* Value is non-zero if OBJ will survive the current GC because it's either marked or does not need to be marked to survive. */ -int +bool survives_gc_p (Lisp_Object obj) { - int survives_p; + bool survives_p; switch (XTYPE (obj)) { @@ -6456,7 +6456,7 @@ /* Check if the symbol was created during loadup. In such a case it might be pointed to by pure bytecode which we don't trace, so we conservatively assume that it is live. */ - int pure_p = PURE_POINTER_P (XSTRING (sym->s.name)); + bool pure_p = PURE_POINTER_P (XSTRING (sym->s.name)); if (!sym->s.gcmarkbit && !pure_p) { @@ -6681,7 +6681,7 @@ } #ifdef ENABLE_CHECKING -int suppress_checking; +bool suppress_checking; void die (const char *msg, const char *file, int line) === modified file 'src/editfns.c' --- src/editfns.c 2012-08-19 21:00:09 +0000 +++ src/editfns.c 2012-08-21 23:39:56 +0000 @@ -3642,13 +3642,13 @@ ptrdiff_t max_bufsize = STRING_BYTES_BOUND + 1; char *p; Lisp_Object buf_save_value IF_LINT (= {0}); - register char *format, *end, *format_start; + char *format, *end, *format_start; ptrdiff_t formatlen, nchars; - /* Nonzero if the format is multibyte. */ - int multibyte_format = 0; - /* Nonzero if the output should be a multibyte string, + /* True if the format is multibyte. */ + bool multibyte_format = 0; + /* True if the output should be a multibyte string, which is true if any of the inputs is one. */ - int multibyte = 0; + bool multibyte = 0; /* When we make a multibyte string, we must pay attention to the byte combining problem, i.e., a byte may be combined with a multibyte character of the previous string. This flag tells if we === modified file 'src/fileio.c' --- src/fileio.c 2012-08-18 06:06:39 +0000 +++ src/fileio.c 2012-08-21 23:39:56 +0000 @@ -766,7 +766,7 @@ #endif /* DOS_NT */ ptrdiff_t length; Lisp_Object handler, result, handled_name; - int multibyte; + bool multibyte; Lisp_Object hdir; CHECK_STRING (name); @@ -1566,7 +1566,7 @@ char *target = NULL; int total = 0; int substituted = 0; - int multibyte; + bool multibyte; char *xnm; Lisp_Object handler; @@ -5306,7 +5306,7 @@ FILE *stream = NULL; ptrdiff_t count = SPECPDL_INDEX (); int orig_minibuffer_auto_raise = minibuffer_auto_raise; - int old_message_p = 0; + bool old_message_p = 0; struct gcpro gcpro1, gcpro2; if (max_specpdl_size < specpdl_size + 40) === modified file 'src/fns.c' --- src/fns.c 2012-08-21 10:21:04 +0000 +++ src/fns.c 2012-08-21 23:39:56 +0000 @@ -3967,8 +3967,8 @@ for (idx = HASH_INDEX (h, bucket); !NILP (idx); idx = next) { ptrdiff_t i = XFASTINT (idx); - int key_known_to_survive_p = survives_gc_p (HASH_KEY (h, i)); - int value_known_to_survive_p = survives_gc_p (HASH_VALUE (h, i)); + bool key_known_to_survive_p = survives_gc_p (HASH_KEY (h, i)); + bool value_known_to_survive_p = survives_gc_p (HASH_VALUE (h, i)); int remove_p; if (EQ (h->weak, Qkey)) === modified file 'src/lisp.h' --- src/lisp.h 2012-08-21 17:18:21 +0000 +++ src/lisp.h 2012-08-21 23:39:56 +0000 @@ -124,7 +124,7 @@ eassert macro altogether, e.g., if XSTRING (x) uses eassert to test STRINGP (x), but a particular use of XSTRING is invoked only after testing that STRINGP (x) is true, making the test redundant. */ -extern int suppress_checking EXTERNALLY_VISIBLE; +extern bool suppress_checking EXTERNALLY_VISIBLE; # define eassert(cond) \ ((cond) || suppress_checking \ @@ -702,7 +702,7 @@ #define CDR_SAFE(c) \ (CONSP ((c)) ? XCDR ((c)) : Qnil) -/* Nonzero if STR is a multibyte string. */ +/* True if STR is a multibyte string. */ #define STRING_MULTIBYTE(STR) \ (XSTRING (STR)->size_byte >= 0) @@ -2799,7 +2799,7 @@ extern void add_to_log (const char *, Lisp_Object, Lisp_Object); extern void check_message_stack (void); extern void setup_echo_area_for_printing (int); -extern int push_message (void); +extern bool push_message (void); extern Lisp_Object pop_message_unwind (Lisp_Object); extern Lisp_Object restore_message_unwind (Lisp_Object); extern void restore_message (void); @@ -2842,7 +2842,7 @@ extern void malloc_warning (const char *); extern _Noreturn void memory_full (size_t); extern _Noreturn void buffer_memory_full (ptrdiff_t); -extern int survives_gc_p (Lisp_Object); +extern bool survives_gc_p (Lisp_Object); extern void mark_object (Lisp_Object); #if defined REL_ALLOC && !defined SYSTEM_MALLOC extern void refill_memory_reserve (void); @@ -2881,8 +2881,8 @@ extern Lisp_Object make_uninit_multibyte_string (EMACS_INT, EMACS_INT); extern Lisp_Object make_string_from_bytes (const char *, ptrdiff_t, ptrdiff_t); extern Lisp_Object make_specified_string (const char *, - ptrdiff_t, ptrdiff_t, int); -extern Lisp_Object make_pure_string (const char *, ptrdiff_t, ptrdiff_t, int); + ptrdiff_t, ptrdiff_t, bool); +extern Lisp_Object make_pure_string (const char *, ptrdiff_t, ptrdiff_t, bool); extern Lisp_Object make_pure_c_string (const char *, ptrdiff_t); /* Make a string allocated in pure space, use STR as string data. */ @@ -2916,8 +2916,8 @@ extern struct frame *allocate_frame (void); extern struct Lisp_Process *allocate_process (void); extern struct terminal *allocate_terminal (void); -extern int gc_in_progress; -extern int abort_on_gc; +extern bool gc_in_progress; +extern bool abort_on_gc; extern Lisp_Object make_float (double); extern void display_malloc_warning (void); extern ptrdiff_t inhibit_garbage_collection (void); === modified file 'src/lread.c' --- src/lread.c 2012-08-21 10:21:04 +0000 +++ src/lread.c 2012-08-21 23:39:56 +0000 @@ -189,7 +189,7 @@ static int unread_char; static int -readchar (Lisp_Object readcharfun, int *multibyte) +readchar (Lisp_Object readcharfun, bool *multibyte) { Lisp_Object tem; register int c; @@ -2354,9 +2354,9 @@ static Lisp_Object read1 (register Lisp_Object readcharfun, int *pch, int first_in_list) { - register int c; - unsigned uninterned_symbol = 0; - int multibyte; + int c; + bool uninterned_symbol = 0; + bool multibyte; *pch = 0; load_each_byte = 0; === modified file 'src/print.c' --- src/print.c 2012-08-18 06:06:39 +0000 +++ src/print.c 2012-08-21 23:39:56 +0000 @@ -586,6 +586,7 @@ (Lisp_Object object, Lisp_Object noescape) { Lisp_Object printcharfun; + bool prev_abort_on_gc; /* struct gcpro gcpro1, gcpro2; */ Lisp_Object save_deactivate_mark; ptrdiff_t count = SPECPDL_INDEX (); @@ -601,7 +602,8 @@ No need for specbind, since errors deactivate the mark. */ save_deactivate_mark = Vdeactivate_mark; /* GCPRO2 (object, save_deactivate_mark); */ - abort_on_gc++; + prev_abort_on_gc = abort_on_gc; + abort_on_gc = 1; printcharfun = Vprin1_to_string_buffer; PRINTPREPARE; @@ -625,7 +627,7 @@ Vdeactivate_mark = save_deactivate_mark; /* UNGCPRO; */ - abort_on_gc--; + abort_on_gc = prev_abort_on_gc; return unbind_to (count, object); } === modified file 'src/xdisp.c' --- src/xdisp.c 2012-08-19 19:22:41 +0000 +++ src/xdisp.c 2012-08-21 23:39:56 +0000 @@ -10480,11 +10480,10 @@ empty. This is a relatively infrequent operation, so it's not worth optimizing. */ -int +bool push_message (void) { - Lisp_Object msg; - msg = current_message (); + Lisp_Object msg = current_message (); Vmessage_stack = Fcons (msg, Vmessage_stack); return STRINGP (msg); } ------------------------------------------------------------ revno: 109733 committer: Paul Eggert branch nick: trunk timestamp: Tue 2012-08-21 16:09:01 -0700 message: Make recently-introduced setters macros. * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii) (set_fontset_base, set_fontset_frame, set_fontset_nofont_face) (set_fontset_default, set_fontset_fallback): Rename from their upper-case counterparts, and make them functions rather than macros. This is more consistent with the other recently-introduced setters. These don't need to be inline, since they're local. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-21 20:50:31 +0000 +++ src/ChangeLog 2012-08-21 23:09:01 +0000 @@ -1,3 +1,13 @@ +2012-08-21 Paul Eggert + + Make recently-introduced setters macros. + * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii) + (set_fontset_base, set_fontset_frame, set_fontset_nofont_face) + (set_fontset_default, set_fontset_fallback): Rename from their + upper-case counterparts, and make them functions rather than macros. + This is more consistent with the other recently-introduced setters. + These don't need to be inline, since they're local. + 2012-08-21 Jan Djärv * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in === modified file 'src/fontset.c' --- src/fontset.c 2012-08-21 04:46:05 +0000 +++ src/fontset.c 2012-08-21 23:09:01 +0000 @@ -213,45 +213,69 @@ /* Return the fontset with ID. No check of ID's validness. */ #define FONTSET_FROM_ID(id) AREF (Vfontset_table, id) -/* Macros to access special values of FONTSET. */ +/* Access special values of FONTSET. */ #define FONTSET_ID(fontset) XCHAR_TABLE (fontset)->extras[0] -#define SET_FONTSET_ID(fontset, id) \ - set_char_table_extras ((fontset), 0, (id)) +static void +set_fontset_id (Lisp_Object fontset, Lisp_Object id) +{ + set_char_table_extras (fontset, 0, id); +} -/* Macros to access special values of (base) FONTSET. */ +/* Access special values of (base) FONTSET. */ #define FONTSET_NAME(fontset) XCHAR_TABLE (fontset)->extras[1] -#define SET_FONTSET_NAME(fontset, name) \ - set_char_table_extras ((fontset), 1, (name)) +static void +set_fontset_name (Lisp_Object fontset, Lisp_Object 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)) +static void +set_fontset_ascii (Lisp_Object fontset, Lisp_Object ascii) +{ + set_char_table_extras (fontset, 4, ascii); +} -/* Macros to access special values of (realized) FONTSET. */ +/* Access special values of (realized) FONTSET. */ #define FONTSET_BASE(fontset) XCHAR_TABLE (fontset)->extras[2] -#define SET_FONTSET_BASE(fontset, base) \ - set_char_table_extras ((fontset), 2, (base)) +static void +set_fontset_base (Lisp_Object fontset, Lisp_Object 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)) +static void +set_fontset_frame (Lisp_Object fontset, Lisp_Object 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)) +static void +set_fontset_nofont_face (Lisp_Object fontset, Lisp_Object 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)) +static void +set_fontset_default (Lisp_Object fontset, Lisp_Object def) +{ + set_char_table_extras (fontset, 7, def); +} /* For both base and realized fontset. */ #define FONTSET_FALLBACK(fontset) XCHAR_TABLE (fontset)->extras[8] -#define SET_FONTSET_FALLBACK(fontset, fallback) \ - set_char_table_extras ((fontset), 8, (fallback)) +static void +set_fontset_fallback (Lisp_Object fontset, Lisp_Object fallback) +{ + set_char_table_extras (fontset, 8, fallback); +} #define BASE_FONTSET_P(fontset) (NILP (FONTSET_BASE (fontset))) @@ -330,7 +354,7 @@ #define FONTSET_ADD(fontset, range, elt, add) \ (NILP (add) \ ? (NILP (range) \ - ? (SET_FONTSET_FALLBACK \ + ? (set_fontset_fallback \ (fontset, Fmake_vector (make_number (1), (elt)))) \ : Fset_char_table_range ((fontset), (range), \ Fmake_vector (make_number (1), (elt)))) \ @@ -362,7 +386,7 @@ else { args[idx] = FONTSET_FALLBACK (fontset); - SET_FONTSET_FALLBACK + set_fontset_fallback (fontset, NILP (args[idx]) ? args[1 - idx] : Fvconcat (2, args)); } return Qnil; @@ -506,7 +530,7 @@ if (c >= 0) char_table_set_range (fontset, from, to, font_group); else - SET_FONTSET_FALLBACK (fontset, font_group); + set_fontset_fallback (fontset, font_group); return font_group; } @@ -741,7 +765,7 @@ if (! EQ (base_fontset, Vdefault_fontset)) { if (NILP (FONTSET_DEFAULT (fontset))) - SET_FONTSET_DEFAULT + set_fontset_default (fontset, make_fontset (FONTSET_FRAME (fontset), Qnil, Vdefault_fontset)); FONT_DEFERRED_LOG ("default fontset: font for", make_number (c), Qnil); @@ -803,14 +827,14 @@ fontset = Fmake_char_table (Qfontset, Qnil); - SET_FONTSET_ID (fontset, make_number (id)); + set_fontset_id (fontset, make_number (id)); if (NILP (base)) - SET_FONTSET_NAME (fontset, name); + set_fontset_name (fontset, name); else { - SET_FONTSET_NAME (fontset, Qnil); - SET_FONTSET_FRAME (fontset, frame); - SET_FONTSET_BASE (fontset, base); + set_fontset_name (fontset, Qnil); + set_fontset_frame (fontset, frame); + set_fontset_base (fontset, base); } ASET (Vfontset_table, id, fontset); @@ -978,7 +1002,7 @@ else { face_id = face_for_font (f, Qnil, face); - SET_FONTSET_NOFONT_FACE (fontset, make_number (face_id)); + set_fontset_nofont_face (fontset, make_number (face_id)); } } eassert (face_id >= 0); @@ -1600,7 +1624,7 @@ Lisp_Object tail, fr, alist; int fontset_id = XINT (FONTSET_ID (fontset)); - SET_FONTSET_ASCII (fontset, fontname); + set_fontset_ascii (fontset, fontname); name = FONTSET_NAME (fontset); FOR_EACH_FRAME (tail, fr) { @@ -1678,7 +1702,7 @@ len = font_unparse_xlfd (font_spec, 0, xlfd, 256); if (len < 0) error ("Invalid fontset name (perhaps too long): %s", SDATA (name)); - SET_FONTSET_ASCII (fontset, make_unibyte_string (xlfd, len)); + set_fontset_ascii (fontset, make_unibyte_string (xlfd, len)); } else { @@ -1764,7 +1788,7 @@ Fset_fontset_font (name, Qnil, font_spec, Qnil, Qnil); } - SET_FONTSET_ASCII (fontset, font_name); + set_fontset_ascii (fontset, font_name); return XINT (FONTSET_ID (fontset)); } @@ -2181,8 +2205,8 @@ Vdefault_fontset = Fmake_char_table (Qfontset, Qnil); staticpro (&Vdefault_fontset); - SET_FONTSET_ID (Vdefault_fontset, make_number (0)); - SET_FONTSET_NAME + 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); ------------------------------------------------------------ revno: 109732 committer: Andreas Schwab branch nick: emacs timestamp: Tue 2012-08-21 23:41:35 +0200 message: Fixes: debbugs:11805 * cus-face.el (custom-face-attributes): Fix customize type for the :underline attribute. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-21 18:27:14 +0000 +++ lisp/ChangeLog 2012-08-21 21:41:35 +0000 @@ -1,3 +1,8 @@ +2012-08-21 Andreas Schwab + + * cus-face.el (custom-face-attributes): Fix customize type for the + :underline attribute. (Bug#11805) + 2012-08-21 Martin Rudalics * window.el (window-point-1, set-window-point-1): Remove. === modified file 'lisp/cus-face.el' --- lisp/cus-face.el 2012-06-17 00:32:36 +0000 +++ lisp/cus-face.el 2012-08-21 21:41:35 +0000 @@ -136,12 +136,36 @@ :help-echo "Control text underlining." (const :tag "Off" nil) (list :tag "On" + :value (:color foreground-color :style line) (const :format "" :value :color) - (choice :tag "Color" (const :tag "Foreground Color" foreground-color) color) - (const :format "" :value :style) - (choice :tag "Style" - (const :tag "Line" line) - (const :tag "Wave" wave))))) + (choice :tag "Color" + (const :tag "Foreground Color" foreground-color) + color) + (const :format "" :value :style) + (choice :tag "Style" + (const :tag "Line" line) + (const :tag "Wave" wave)))) + ;; filter to make value suitable for customize + (lambda (real-value) + (and real-value + (let ((color + (or (and (consp real-value) (plist-get real-value :color)) + (and (stringp real-value) real-value) + 'foreground-color)) + (style + (or (and (consp real-value) (plist-get real-value :style)) + 'line))) + (list :color color :style style)))) + ;; filter to make customized-value suitable for storing + (lambda (cus-value) + (and cus-value + (let ((color (plist-get cus-value :color)) + (style (plist-get cus-value :style))) + (cond ((eq style 'line) + ;; Use simple value for default style + (if (eq color 'foreground-color) t color)) + (t + `(:color ,color :style ,style))))))) (:overline (choice :tag "Overline" ------------------------------------------------------------ revno: 109731 fixes bug: http://debbugs.gnu.org/12247 committer: Jan D. branch nick: trunk timestamp: Tue 2012-08-21 22:50:31 +0200 message: * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in the loop. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-21 17:18:21 +0000 +++ src/ChangeLog 2012-08-21 20:50:31 +0000 @@ -1,3 +1,8 @@ +2012-08-21 Jan Djärv + + * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in + the loop (Bug#12247). + 2012-08-21 Paul Eggert * lisp.h (vcopy): Use memcpy rather than our own loop. === modified file 'src/nsterm.m' --- src/nsterm.m 2012-08-18 01:42:52 +0000 +++ src/nsterm.m 2012-08-21 20:50:31 +0000 @@ -4600,11 +4600,15 @@ SELECT_TYPE readfds, writefds, *wfds; EMACS_TIME timeout, *tmo; + NSAutoreleasePool *pool = nil; /* NSTRACE (fd_handler); */ for (;;) { + [pool release]; + pool = [[NSAutoreleasePool alloc] init]; + if (waiting) { SELECT_TYPE fds; ------------------------------------------------------------ revno: 109730 committer: Glenn Morris branch nick: trunk timestamp: Tue 2012-08-21 15:18:56 -0400 message: Revert accidental deletion from previous change diff: === modified file 'lisp/calendar/cal-tex.el' --- lisp/calendar/cal-tex.el 2012-08-21 18:27:14 +0000 +++ lisp/calendar/cal-tex.el 2012-08-21 19:18:56 +0000 @@ -1215,6 +1215,78 @@ (cal-tex-weekly-common n event)) ;;;###cal-autoload +(defun cal-tex-cursor-filofax-2week (&optional n event) + "Two-weeks-at-a-glance Filofax style calendar for week cursor is in. +Optional prefix argument N specifies number of weeks (default 1). +The calendar shows holiday and diary entries if +`cal-tex-holidays' and `cal-tex-diary', respectively, are non-nil. +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 + calendar-week-start-day + (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") + (cal-tex-filofax-paper) + (insert cal-tex-righthead) + (cal-tex-rightday "0.7in") + (insert cal-tex-lefthead) + (cal-tex-leftday "0.7in") + (cal-tex-b-document) + (cal-tex-cmd "\\pagestyle" "empty") + (dotimes (i n) + (if (zerop (mod i 2)) + (insert "\\righthead") + (insert "\\lefthead")) + (cal-tex-arg + (let ((d (cal-tex-incr-date date 6))) + (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 7) + (if (zerop (mod i 2)) + (insert "\\rightday") + (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))) + (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-week (&optional n event) "One-week-at-a-glance Filofax style calendar for week indicated by cursor. Optional prefix argument N specifies number of weeks (default 1), @@ -1223,7 +1295,88 @@ Optional EVENT indicates a buffer position to use instead of point." (interactive (list (prefix-numeric-value current-prefix-arg) last-nonmenu-event)) - (cal-tex-weekly-common n event t)) + (cal-tex-weekly-common n event t)) + +;;;###cal-autoload +(defun cal-tex-cursor-filofax-daily (&optional n event) + "Day-per-page Filofax style 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. Pages are ruled if `cal-tex-rules' is non-nil. +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") + (cal-tex-filofax-paper) + (insert cal-tex-righthead) + (cal-tex-shortday "rightday") + (cal-tex-shortday "weekend") + (insert cal-tex-lefthead) + (cal-tex-shortday "leftday") + (insert "\\newbox\\LineBox +\\setbox\\LineBox=\\hbox to\\textwidth{% +\\vrule height.2in width0pt\\leaders\\hrule\\hfill} +\\def\\linesfill{\\par\\leaders\\copy\\LineBox\\vfill} +") + (cal-tex-b-document) + (cal-tex-cmd "\\pagestyle" "empty") + (dotimes (i n) + (dotimes (j 4) + (let ((even (zerop (% j 2)))) + (insert (if even + "\\righthead" + "\\lefthead")) + (cal-tex-arg (calendar-date-string date)) + (insert "%\n") + (insert (if even + "\\rightday" + "\\leftday"))) + (cal-tex-arg (cal-tex-latexify-list diary-list date)) + (cal-tex-arg (cal-tex-latexify-list holidays date "\\\\" t)) + (cal-tex-arg (eval cal-tex-daily-string)) + (insert "%\n") + (if cal-tex-rules + (insert "\\linesfill\n") + (insert "\\vfill\\noindent\\rule{\\textwidth}{0.3pt}\\\\%\n")) + (cal-tex-newpage) + (setq date (cal-tex-incr-date date))) + (insert "%\n") + (dotimes (_jdummy 2) + (insert "\\lefthead") + (cal-tex-arg (calendar-date-string date)) + (insert "\\weekend") + (cal-tex-arg (cal-tex-latexify-list diary-list date)) + (cal-tex-arg (cal-tex-latexify-list holidays date "\\\\" t)) + (cal-tex-arg (eval cal-tex-daily-string)) + (insert "%\n") + (if cal-tex-rules + (insert "\\linesfill\n") + (insert "\\vfill")) + (setq date (cal-tex-incr-date date))) + (or cal-tex-rules + (insert "\\noindent\\rule{\\textwidth}{0.3pt}\\\\%\n")) + (unless (= i (1- n)) + (run-hooks 'cal-tex-week-hook) + (cal-tex-newpage))) + (cal-tex-end-document) + (run-hooks 'cal-tex-hook))) + ;;; ;;; Daily calendars ------------------------------------------------------------ revno: 109729 committer: Glenn Morris branch nick: trunk timestamp: Tue 2012-08-21 14:27:14 -0400 message: Remove yet more cal-tex code duplication * lisp/calendar/cal-tex.el (cal-tex-weekly-common): New function. (cal-tex-cursor-week-at-a-glance, cal-tex-cursor-filofax-week): Use it. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-21 18:15:56 +0000 +++ lisp/ChangeLog 2012-08-21 18:27:14 +0000 @@ -9,6 +9,10 @@ 2012-08-21 Glenn Morris + * calendar/cal-tex.el (cal-tex-weekly-common): New function. + (cal-tex-cursor-week-at-a-glance, cal-tex-cursor-filofax-week): + Use it. + * calendar/cal-tex.el (cal-tex-rightday): Add optional funcname arg. (cal-tex-shortday): New function. (cal-tex-cursor-week-at-a-glance, cal-tex-cursor-filofax-week) === modified file 'lisp/calendar/cal-tex.el' --- lisp/calendar/cal-tex.el 2012-08-21 18:15:56 +0000 +++ lisp/calendar/cal-tex.el 2012-08-21 18:27:14 +0000 @@ -1060,16 +1060,8 @@ (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 -position to use instead of point." - (interactive (list (prefix-numeric-value current-prefix-arg) - last-nonmenu-event)) +(defun cal-tex-weekly-common (n event &optional filofax) + "Common code for weekly calendars." (or n (setq n 1)) (let* ((date (calendar-gregorian-from-absolute (calendar-dayname-on-or-before @@ -1085,6 +1077,15 @@ (holiday-in-range d1 d2))) (diary-list (if cal-tex-diary (cal-tex-list-diary-entries d1 d2)))) + (if filofax + (progn + (cal-tex-preamble "twoside") + (cal-tex-filofax-paper) + (insert cal-tex-righthead) + (cal-tex-rightday "1.85in") + (cal-tex-rightday "0.8in" "weekend") + (insert cal-tex-lefthead) + (cal-tex-leftday "1.85in")) (cal-tex-preamble "twoside,12pt") (insert "\\textwidth 7in \\textheight 10.5in @@ -1099,7 +1100,7 @@ (cal-tex-rightday "2.75in") (cal-tex-rightday "1.8in" "weekend") (insert cal-tex-lefthead) - (cal-tex-leftday "2.75in") + (cal-tex-leftday "2.75in")) (cal-tex-b-document) (cal-tex-cmd "\\pagestyle" "empty") (dotimes (i n) @@ -1133,34 +1134,35 @@ (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 "}") + (unless filofax + (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)) + (calendar-extract-month d)) (format "%s %s" (cal-tex-month-name (calendar-extract-month date)) (calendar-extract-year date)) @@ -1201,76 +1203,16 @@ (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. -Optional prefix argument N specifies number of weeks (default 1). -The calendar shows holiday and diary entries if -`cal-tex-holidays' and `cal-tex-diary', respectively, are non-nil. -Optional EVENT indicates a buffer position to use instead of point." +(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 - calendar-week-start-day - (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") - (cal-tex-filofax-paper) - (insert cal-tex-righthead) - (cal-tex-rightday "0.7in") - (insert cal-tex-lefthead) - (cal-tex-leftday "0.7in") - (cal-tex-b-document) - (cal-tex-cmd "\\pagestyle" "empty") - (dotimes (i n) - (if (zerop (mod i 2)) - (insert "\\righthead") - (insert "\\lefthead")) - (cal-tex-arg - (let ((d (cal-tex-incr-date date 6))) - (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 7) - (if (zerop (mod i 2)) - (insert "\\rightday") - (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))) - (unless (= i (1- n)) - (run-hooks 'cal-tex-week-hook) - (cal-tex-newpage))) - (cal-tex-end-document) - (run-hooks 'cal-tex-hook))) + (cal-tex-weekly-common n event)) ;;;###cal-autoload (defun cal-tex-cursor-filofax-week (&optional n event) @@ -1281,186 +1223,7 @@ 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") - (cal-tex-filofax-paper) - (insert cal-tex-righthead) - (cal-tex-rightday "1.85in") - (cal-tex-rightday "0.8in" "weekend") - (insert cal-tex-lefthead) - (cal-tex-leftday "1.85in") - (cal-tex-b-document) - (cal-tex-cmd "\\pagestyle" "empty") - (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-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-daily (&optional n event) - "Day-per-page Filofax style 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. Pages are ruled if `cal-tex-rules' is non-nil. -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") - (cal-tex-filofax-paper) - (insert cal-tex-righthead) - (cal-tex-shortday "rightday") - (cal-tex-shortday "weekend") - (insert cal-tex-lefthead) - (cal-tex-shortday "leftday") - (insert "\\newbox\\LineBox -\\setbox\\LineBox=\\hbox to\\textwidth{% -\\vrule height.2in width0pt\\leaders\\hrule\\hfill} -\\def\\linesfill{\\par\\leaders\\copy\\LineBox\\vfill} -") - (cal-tex-b-document) - (cal-tex-cmd "\\pagestyle" "empty") - (dotimes (i n) - (dotimes (j 4) - (let ((even (zerop (% j 2)))) - (insert (if even - "\\righthead" - "\\lefthead")) - (cal-tex-arg (calendar-date-string date)) - (insert "%\n") - (insert (if even - "\\rightday" - "\\leftday"))) - (cal-tex-arg (cal-tex-latexify-list diary-list date)) - (cal-tex-arg (cal-tex-latexify-list holidays date "\\\\" t)) - (cal-tex-arg (eval cal-tex-daily-string)) - (insert "%\n") - (if cal-tex-rules - (insert "\\linesfill\n") - (insert "\\vfill\\noindent\\rule{\\textwidth}{0.3pt}\\\\%\n")) - (cal-tex-newpage) - (setq date (cal-tex-incr-date date))) - (insert "%\n") - (dotimes (_jdummy 2) - (insert "\\lefthead") - (cal-tex-arg (calendar-date-string date)) - (insert "\\weekend") - (cal-tex-arg (cal-tex-latexify-list diary-list date)) - (cal-tex-arg (cal-tex-latexify-list holidays date "\\\\" t)) - (cal-tex-arg (eval cal-tex-daily-string)) - (insert "%\n") - (if cal-tex-rules - (insert "\\linesfill\n") - (insert "\\vfill")) - (setq date (cal-tex-incr-date date))) - (or cal-tex-rules - (insert "\\noindent\\rule{\\textwidth}{0.3pt}\\\\%\n")) - (unless (= i (1- n)) - (run-hooks 'cal-tex-week-hook) - (cal-tex-newpage))) - (cal-tex-end-document) - (run-hooks 'cal-tex-hook))) - + (cal-tex-weekly-common n event t)) ;;; ;;; Daily calendars ------------------------------------------------------------ revno: 109728 committer: Glenn Morris branch nick: trunk timestamp: Tue 2012-08-21 14:15:56 -0400 message: Remove more cal-tex code duplication * calendar/cal-tex.el (cal-tex-rightday): Add optional funcname arg. (cal-tex-shortday): New function. (cal-tex-cursor-week-at-a-glance, cal-tex-cursor-filofax-week) (cal-tex-cursor-filofax-daily): Use the above. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-21 09:27:07 +0000 +++ lisp/ChangeLog 2012-08-21 18:15:56 +0000 @@ -9,6 +9,11 @@ 2012-08-21 Glenn Morris + * calendar/cal-tex.el (cal-tex-rightday): Add optional funcname arg. + (cal-tex-shortday): New function. + (cal-tex-cursor-week-at-a-glance, cal-tex-cursor-filofax-week) + (cal-tex-cursor-filofax-daily): Use the above. + * calendar/cal-tex.el (cal-tex-leftday, cal-tex-rightday): New functions. (cal-tex-cursor-week-at-a-glance, cal-tex-cursor-filofax-2week) === modified file 'lisp/calendar/cal-tex.el' --- lisp/calendar/cal-tex.el 2012-08-21 07:59:25 +0000 +++ lisp/calendar/cal-tex.el 2012-08-21 18:15:56 +0000 @@ -268,6 +268,7 @@ ""))) (if (stringp cal-tex-preamble-extra) (insert cal-tex-preamble-extra "\n")) + ;; FIXME boxwidth and boxheight unused? (insert "\\hbadness 20000 \\hfuzz=1000pt \\vbadness 20000 @@ -381,9 +382,9 @@ \\hbox to \\textwidth{\\vbox {\\noindent \\footnotesize \\em #4}}% \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\}\n")) -(defun cal-tex-rightday (height) +(defun cal-tex-rightday (height &optional funcname) "Insert LaTeX code for rightday function." - (insert "\\long\\def\\rightday#1#2#3#4#5{% + (insert "\\long\\def\\" (or funcname "rightday") "#1#2#3#4#5{% \\rule{\\textwidth}{0.3pt}\\\\% \\hbox to \\textwidth{% \\vbox to " height "{% @@ -392,6 +393,19 @@ \\hbox to \\textwidth{\\vbox {\\raggedleft \\footnotesize \\em #4}}% \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\}\n")) +(defun cal-tex-shortday (funcname) + "Insert LaTeX code for a short day function." + (insert "\\long\\def\\" funcname "#1#2#3{% + \\rule{\\textwidth}{0.3pt}\\\\% + \\hbox to \\textwidth{% + \\vbox {% + \\vspace*{2pt}% + \\hbox to \\textwidth{\\hfill \\small #3 \\hfill}% + \\hbox to \\textwidth{\\vbox {\\" + (if (string-equal funcname "rightday") "raggedleft" "noindent") + " \\em #2}}% + \\hbox to \\textwidth{\\vbox {\\noindent \\footnotesize #1}}}}}\n")) + ;;;###cal-autoload (defun cal-tex-cursor-filofax-year (&optional n event) "Make a Filofax one page yearly calendar of year indicated by cursor. @@ -1083,16 +1097,7 @@ ") (insert cal-tex-righthead) (cal-tex-rightday "2.75in") - ;; FIXME this is just (cal-tex-rightday "1.8in"). - (insert "\\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 #4}}% - \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\} -") + (cal-tex-rightday "1.8in" "weekend") (insert cal-tex-lefthead) (cal-tex-leftday "2.75in") (cal-tex-b-document) @@ -1295,16 +1300,7 @@ (cal-tex-filofax-paper) (insert cal-tex-righthead) (cal-tex-rightday "1.85in") - ;; FIXME this is just (cal-tex-rightday "0.8in"). - (insert "\\long\\def\\weekend#1#2#3#4#5{% - \\rule{\\textwidth}{0.3pt}\\\\% - \\hbox to \\textwidth{% - \\vbox to .8in{% - \\vspace*{2pt}% - \\hbox to \\textwidth{\\small #5 \\hfill #1 {\\normalsize \\bf #2}}% - \\hbox to \\textwidth{\\vbox {\\raggedleft \\footnotesize \\em #4}}% - \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\} -") + (cal-tex-rightday "0.8in" "weekend") (insert cal-tex-lefthead) (cal-tex-leftday "1.85in") (cal-tex-b-document) @@ -1413,37 +1409,10 @@ (cal-tex-preamble "twoside") (cal-tex-filofax-paper) (insert cal-tex-righthead) - ;; Not quite cal-tex-rightday. - (insert "\\long\\def\\rightday#1#2#3{% - \\rule{\\textwidth}{0.3pt}\\\\% - \\hbox to \\textwidth{% - \\vbox {% - \\vspace*{2pt}% - \\hbox to \\textwidth{\\hfill \\small #3 \\hfill}% - \\hbox to \\textwidth{\\vbox {\\raggedleft \\em #2}}% - \\hbox to \\textwidth{\\vbox {\\noindent \\footnotesize #1}}}}} -") - ;; FIXME this is just \rightday from above. - (insert "\\long\\def\\weekend#1#2#3{% - \\rule{\\textwidth}{0.3pt}\\\\% - \\hbox to \\textwidth{% - \\vbox {% - \\vspace*{2pt}% - \\hbox to \\textwidth{\\hfill \\small #3 \\hfill}% - \\hbox to \\textwidth{\\vbox {\\noindent \\em #2}}% - \\hbox to \\textwidth{\\vbox {\\noindent \\footnotesize #1}}}}} -") + (cal-tex-shortday "rightday") + (cal-tex-shortday "weekend") (insert cal-tex-lefthead) - ;; Not quite cal-tex-leftday. - (insert "\\long\\def\\leftday#1#2#3{% - \\rule{\\textwidth}{0.3pt}\\\\% - \\hbox to \\textwidth{% - \\vbox {% - \\vspace*{2pt}% - \\hbox to \\textwidth{\\hfill \\small #3 \\hfill}% - \\hbox to \\textwidth{\\vbox {\\noindent \\em #2}}% - \\hbox to \\textwidth{\\vbox {\\noindent \\footnotesize #1}}}}} -") + (cal-tex-shortday "leftday") (insert "\\newbox\\LineBox \\setbox\\LineBox=\\hbox to\\textwidth{% \\vrule height.2in width0pt\\leaders\\hrule\\hfill} ------------------------------------------------------------ revno: 109727 committer: Paul Eggert branch nick: trunk timestamp: Tue 2012-08-21 10:18:21 -0700 message: * lisp.h (vcopy): Use memcpy rather than our own loop. This fixes a performance regression introduced by the recent addition of vcopy. This means 'vcopy' will need to be modified for a copying collector, but that's OK. Also, tighten the checking in the assertion. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-21 17:14:08 +0000 +++ src/ChangeLog 2012-08-21 17:18:21 +0000 @@ -1,3 +1,11 @@ +2012-08-21 Paul Eggert + + * lisp.h (vcopy): Use memcpy rather than our own loop. + This fixes a performance regression introduced by the recent + addition of vcopy. This means 'vcopy' will need to be modified + for a copying collector, but that's OK. Also, tighten the + checking in the assertion. + 2012-08-21 Eli Zaretskii * w32uniscribe.c (uniscribe_shape): Fix producing gstring === modified file 'src/lisp.h' --- src/lisp.h 2012-08-21 10:21:04 +0000 +++ src/lisp.h 2012-08-21 17:18:21 +0000 @@ -2349,11 +2349,8 @@ LISP_INLINE void vcopy (Lisp_Object v, ptrdiff_t offset, Lisp_Object *args, ptrdiff_t count) { - ptrdiff_t i; - - eassert (offset + count <= ASIZE (v)); - for (i = 0; i < count; i++) - ASET (v, offset + i, args[i]); + eassert (0 <= offset && 0 <= count && offset + count <= ASIZE (v)); + memcpy (XVECTOR (v)->contents + offset, args, count * sizeof *args); } /* Functions to modify hash tables. */ ------------------------------------------------------------ revno: 109726 fixes bug: http://debbugs.gnu.org/11860 committer: Eli Zaretskii branch nick: trunk timestamp: Tue 2012-08-21 20:14:08 +0300 message: Fix bug #11860 with displaying composite RTL characters on MS-Windows. src/w32uniscribe.c (uniscribe_shape): Fix producing gstring components for RTL text. Adjust X-OFFSET of each non-base glyph for the width of the base character, according to what x_draw_composite_glyph_string_foreground expects. Generate WADJUST value according to composition_gstring_width's expectations, to produce correct width of the composed character. Reverse the sign of the DU offset produced by ScriptPlace. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-21 16:54:50 +0000 +++ src/ChangeLog 2012-08-21 17:14:08 +0000 @@ -1,3 +1,13 @@ +2012-08-21 Eli Zaretskii + + * w32uniscribe.c (uniscribe_shape): Fix producing gstring + components for RTL text (Bug#11860). Adjust X-OFFSET of each + non-base glyph for the width of the base character, according to + what x_draw_composite_glyph_string_foreground expects. Generate + WADJUST value according to composition_gstring_width's + expectations, to produce correct width of the composed character. + Reverse the sign of the DU offset produced by ScriptPlace. + 2012-08-21 Paul Eggert * dbusbind.c (xd_remove_watch): Do not assume C99 comments. === modified file 'src/w32uniscribe.c' --- src/w32uniscribe.c 2012-07-05 06:32:41 +0000 +++ src/w32uniscribe.c 2012-08-21 17:14:08 +0000 @@ -320,7 +320,23 @@ } if (SUCCEEDED (result)) { - int j, from, to; + int j, from, to, adj_offset = 0; + + /* For RTL text, the Uniscribe shaper prepares the + values in ADVANCES array for layout in reverse order, + whereby "advance width" is applied to move the pen in + reverse direction and _before_ drawing the glyph. + Since we draw glyphs in their normal left-to-right + order, we need to adjust the coordinates of each + non-base glyph in a grapheme cluster via X-OFF + component of the gstring's ADJUSTMENT sub-vector. + This loop computes the initial value of the + adjustment for the base character, which is then + updated for each successive glyph in the grapheme + cluster. */ + if (items[i].a.fRTL) + for (j = 1; j < nglyphs; j++) + adj_offset += advances[j]; from = 0; to = from; @@ -392,9 +408,11 @@ if (SUCCEEDED (result)) { - LGLYPH_SET_LBEARING (lglyph, char_metric.abcA); - LGLYPH_SET_RBEARING (lglyph, (char_metric.abcA - + char_metric.abcB)); + int lbearing = char_metric.abcA; + int rbearing = char_metric.abcA + char_metric.abcB; + + LGLYPH_SET_LBEARING (lglyph, lbearing); + LGLYPH_SET_RBEARING (lglyph, rbearing); } else { @@ -402,18 +420,43 @@ LGLYPH_SET_RBEARING (lglyph, advances[j]); } - if (offsets[j].du || offsets[j].dv) + if (offsets[j].du || offsets[j].dv + /* For non-base glyphs of RTL grapheme clusters, + adjust the X offset even if both DU and DV + are zero. */ + || (!attributes[j].fClusterStart && items[i].a.fRTL)) { Lisp_Object vec; vec = Fmake_vector (make_number (3), Qnil); - ASET (vec, 0, make_number (offsets[j].du)); + if (items[i].a.fRTL) + { + /* Empirically, it looks like Uniscribe + interprets DU in reverse direction for + RTL clusters. E.g., if we don't reverse + the direction, the Hebrew point HOLAM is + drawn above the right edge of the base + consonant, instead of above the left edge. */ + ASET (vec, 0, make_number (-offsets[j].du + + adj_offset)); + /* Update the adjustment value for the width + advance of the glyph we just emitted. */ + adj_offset -= 2 * advances[j]; + } + else + ASET (vec, 0, make_number (offsets[j].du + adj_offset)); ASET (vec, 1, make_number (offsets[j].dv)); /* Based on what ftfont.c does... */ ASET (vec, 2, make_number (advances[j])); LGLYPH_SET_ADJUSTMENT (lglyph, vec); } else - LGLYPH_SET_ADJUSTMENT (lglyph, Qnil); + { + LGLYPH_SET_ADJUSTMENT (lglyph, Qnil); + /* Update the adjustment value to compensate for + the width of the base character. */ + if (items[i].a.fRTL) + adj_offset -= advances[j]; + } } } } ------------------------------------------------------------ revno: 109725 committer: Paul Eggert branch nick: trunk timestamp: Tue 2012-08-21 09:54:50 -0700 message: * dbusbind.c (xd_remove_watch): Do not assume C99 comments. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-21 10:21:04 +0000 +++ src/ChangeLog 2012-08-21 16:54:50 +0000 @@ -1,3 +1,7 @@ +2012-08-21 Paul Eggert + + * dbusbind.c (xd_remove_watch): Do not assume C99 comments. + 2012-08-21 Dmitry Antipov Avoid direct writes to contents member of struct Lisp_Vector. === modified file 'src/dbusbind.c' --- src/dbusbind.c 2012-07-29 08:18:29 +0000 +++ src/dbusbind.c 2012-08-21 16:54:50 +0000 @@ -1039,11 +1039,13 @@ return; /* Unset session environment. */ +#if 0 if (XSYMBOL (QCdbus_session_bus) == data) { - // XD_DEBUG_MESSAGE ("unsetenv DBUS_SESSION_BUS_ADDRESS"); - // unsetenv ("DBUS_SESSION_BUS_ADDRESS"); + XD_DEBUG_MESSAGE ("unsetenv DBUS_SESSION_BUS_ADDRESS"); + unsetenv ("DBUS_SESSION_BUS_ADDRESS"); } +#endif if (flags & DBUS_WATCH_WRITABLE) delete_write_fd (fd); ------------------------------------------------------------ revno: 109724 committer: Paul Eggert branch nick: trunk timestamp: Tue 2012-08-21 07:37:56 -0700 message: Merge from gnulib. diff: === modified file 'ChangeLog' --- ChangeLog 2012-08-20 22:12:35 +0000 +++ ChangeLog 2012-08-21 14:37:56 +0000 @@ -1,3 +1,8 @@ +2012-08-21 Paul Eggert + + Merge from gnulib, incorporating: + 2012-08-20 extern-inline: support old GCC 'inline' + 2012-08-20 Glenn Morris * configure.ac (AC_PROG_LN_S): Test for ln. === modified file 'm4/extern-inline.m4' --- m4/extern-inline.m4 2012-08-14 03:15:52 +0000 +++ m4/extern-inline.m4 2012-08-21 14:37:56 +0000 @@ -21,20 +21,34 @@ #if __GNUC__ ? __GNUC_STDC_INLINE__ : 199901L <= __STDC_VERSION__ # define _GL_INLINE inline # define _GL_EXTERN_INLINE extern inline -# if (__GNUC__ == 4 && 6 <= __GNUC_MINOR__) || 4 < __GNUC__ -# define _GL_INLINE_HEADER_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \ - _Pragma ("GCC diagnostic ignored \"-Wmissing-declarations\"") -# define _GL_INLINE_HEADER_END \ - _Pragma ("GCC diagnostic pop") +#elif 2 < __GNUC__ + (7 <= __GNUC_MINOR__) +# if __GNUC_GNU_INLINE__ + /* __gnu_inline__ suppresses a GCC 4.2 diagnostic. */ +# define _GL_INLINE extern inline __attribute__ ((__gnu_inline__)) +# else +# define _GL_INLINE extern inline # endif +# define _GL_EXTERN_INLINE extern #else # define _GL_INLINE static inline # define _GL_EXTERN_INLINE static inline #endif -#ifndef _GL_INLINE_HEADER_BEGIN +#if 4 < __GNUC__ + (6 <= __GNUC_MINOR__) +# if __GNUC_STDC_INLINE__ +# define _GL_INLINE_HEADER_CONST_PRAGMA +# else +# define _GL_INLINE_HEADER_CONST_PRAGMA \ + _Pragma ("GCC diagnostic ignored \"-Wsuggest-attribute=const\"") +# endif +# define _GL_INLINE_HEADER_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \ + _Pragma ("GCC diagnostic ignored \"-Wmissing-declarations\"") \ + _GL_INLINE_HEADER_CONST_PRAGMA +# define _GL_INLINE_HEADER_END \ + _Pragma ("GCC diagnostic pop") +#else # define _GL_INLINE_HEADER_BEGIN # define _GL_INLINE_HEADER_END #endif]) ------------------------------------------------------------ revno: 109723 committer: Dmitry Antipov branch nick: trunk timestamp: Tue 2012-08-21 14:21:04 +0400 message: Avoid direct writes to contents member of struct Lisp_Vector. * lisp.h (vcopy): New function to copy data into vector. * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET. * fns.c (Ffillarray): Use ASET. * keyboard.c (timer_check_2): Use AREF and ASET. (append_tool_bar_item, Frecent_keys): Use vcopy. * lread.c (read_vector): Use ASET. * msdos.c (Frecent_doskeys): Use vcopy. * xface.c (Finternal_copy_lisp_face): Use vcopy. (Finternal_merge_in_global_face): Use ASET and vcopy. * xfont.c (xfont_list_pattern): Likewise. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-21 09:27:07 +0000 +++ src/ChangeLog 2012-08-21 10:21:04 +0000 @@ -1,3 +1,17 @@ +2012-08-21 Dmitry Antipov + + Avoid direct writes to contents member of struct Lisp_Vector. + * lisp.h (vcopy): New function to copy data into vector. + * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET. + * fns.c (Ffillarray): Use ASET. + * keyboard.c (timer_check_2): Use AREF and ASET. + (append_tool_bar_item, Frecent_keys): Use vcopy. + * lread.c (read_vector): Use ASET. + * msdos.c (Frecent_doskeys): Use vcopy. + * xface.c (Finternal_copy_lisp_face): Use vcopy. + (Finternal_merge_in_global_face): Use ASET and vcopy. + * xfont.c (xfont_list_pattern): Likewise. + 2012-08-21 Martin Rudalics * window.c (Fwindow_point): For the selected window always return === modified file 'src/dispnew.c' --- src/dispnew.c 2012-08-18 01:42:52 +0000 +++ src/dispnew.c 2012-08-21 10:21:04 +0000 @@ -6044,8 +6044,7 @@ (Lisp_Object variable) { Lisp_Object state, tail, frame, buf; - Lisp_Object *vecp, *end; - ptrdiff_t n; + ptrdiff_t n, idx; if (! NILP (variable)) { @@ -6057,18 +6056,16 @@ else state = frame_and_buffer_state; - vecp = XVECTOR (state)->contents; - end = vecp + ASIZE (state); - + idx = 0; FOR_EACH_FRAME (tail, frame) { - if (vecp == end) - goto changed; - if (!EQ (*vecp++, frame)) - goto changed; - if (vecp == end) - goto changed; - if (!EQ (*vecp++, XFRAME (frame)->name)) + if (idx == ASIZE (state)) + goto changed; + if (!EQ (AREF (state, idx++), frame)) + goto changed; + if (idx == ASIZE (state)) + goto changed; + if (!EQ (AREF (state, idx++), XFRAME (frame)->name)) goto changed; } /* Check that the buffer info matches. */ @@ -6078,23 +6075,23 @@ /* Ignore buffers that aren't included in buffer lists. */ if (SREF (BVAR (XBUFFER (buf), name), 0) == ' ') continue; - if (vecp == end) - goto changed; - if (!EQ (*vecp++, buf)) - goto changed; - if (vecp == end) - goto changed; - if (!EQ (*vecp++, BVAR (XBUFFER (buf), read_only))) - goto changed; - if (vecp == end) - goto changed; - if (!EQ (*vecp++, Fbuffer_modified_p (buf))) + if (idx == ASIZE (state)) + goto changed; + if (!EQ (AREF (state, idx++), buf)) + goto changed; + if (idx == ASIZE (state)) + goto changed; + if (!EQ (AREF (state, idx++), BVAR (XBUFFER (buf), read_only))) + goto changed; + if (idx == ASIZE (state)) + goto changed; + if (!EQ (AREF (state, idx++), Fbuffer_modified_p (buf))) goto changed; } - if (vecp == end) + if (idx == ASIZE (state)) goto changed; /* Detect deletion of a buffer at the end of the list. */ - if (EQ (*vecp, Qlambda)) + if (EQ (AREF (state, idx), Qlambda)) return Qnil; /* Come here if we decide the data has changed. */ @@ -6121,11 +6118,13 @@ } /* Record the new data in the (possibly reallocated) vector. */ - vecp = XVECTOR (state)->contents; + idx = 0; FOR_EACH_FRAME (tail, frame) { - *vecp++ = frame; - *vecp++ = XFRAME (frame)->name; + ASET (state, idx, frame); + idx++; + ASET (state, idx, XFRAME (frame)->name); + idx++; } for (tail = Vbuffer_alist; CONSP (tail); tail = XCDR (tail)) { @@ -6133,19 +6132,23 @@ /* Ignore buffers that aren't included in buffer lists. */ if (SREF (BVAR (XBUFFER (buf), name), 0) == ' ') continue; - *vecp++ = buf; - *vecp++ = BVAR (XBUFFER (buf), read_only); - *vecp++ = Fbuffer_modified_p (buf); + ASET (state, idx, buf); + idx++; + ASET (state, idx, BVAR (XBUFFER (buf), read_only)); + idx++; + ASET (state, idx, Fbuffer_modified_p (buf)); + idx++; } /* Fill up the vector with lambdas (always at least one). */ - *vecp++ = Qlambda; - while (vecp - XVECTOR (state)->contents - < ASIZE (state)) - *vecp++ = Qlambda; + ASET (state, idx, Qlambda); + idx++; + while (idx < ASIZE (state)) + { + ASET (state, idx, Qlambda); + idx++; + } /* Make sure we didn't overflow the vector. */ - if (vecp - XVECTOR (state)->contents - > ASIZE (state)) - abort (); + eassert (idx <= ASIZE (state)); return Qt; } === modified file 'src/fns.c' --- src/fns.c 2012-08-20 08:07:38 +0000 +++ src/fns.c 2012-08-21 10:21:04 +0000 @@ -2139,12 +2139,8 @@ register ptrdiff_t size, idx; if (VECTORP (array)) - { - register Lisp_Object *p = XVECTOR (array)->contents; - size = ASIZE (array); - for (idx = 0; idx < size; idx++) - p[idx] = item; - } + for (idx = 0, size = ASIZE (array); idx < size; idx++) + ASET (array, idx, item); else if (CHAR_TABLE_P (array)) { int i; === modified file 'src/keyboard.c' --- src/keyboard.c 2012-08-17 23:38:43 +0000 +++ src/keyboard.c 2012-08-21 10:21:04 +0000 @@ -4419,7 +4419,6 @@ while (CONSP (timers) || CONSP (idle_timers)) { - Lisp_Object *vector; Lisp_Object timer = Qnil, idle_timer = Qnil; EMACS_TIME timer_time, idle_timer_time; EMACS_TIME difference; @@ -4495,15 +4494,14 @@ /* If timer is ripe, run it if it hasn't been run. */ if (ripe) { - vector = XVECTOR (chosen_timer)->contents; - if (NILP (vector[0])) + if (NILP (AREF (chosen_timer, 0))) { ptrdiff_t count = SPECPDL_INDEX (); Lisp_Object old_deactivate_mark = Vdeactivate_mark; /* Mark the timer as triggered to prevent problems if the lisp code fails to reschedule it right. */ - vector[0] = Qt; + ASET (chosen_timer, 0, Qt); specbind (Qinhibit_quit, Qt); @@ -8447,7 +8445,6 @@ static void append_tool_bar_item (void) { - Lisp_Object *to, *from; ptrdiff_t incr = (ntool_bar_items - (ASIZE (tool_bar_items_vector) - TOOL_BAR_ITEM_NSLOTS)); @@ -8459,9 +8456,8 @@ /* Append entries from tool_bar_item_properties to the end of tool_bar_items_vector. */ - to = XVECTOR (tool_bar_items_vector)->contents + ntool_bar_items; - from = XVECTOR (tool_bar_item_properties)->contents; - memcpy (to, from, TOOL_BAR_ITEM_NSLOTS * sizeof *to); + vcopy (tool_bar_items_vector, ntool_bar_items, + XVECTOR (tool_bar_item_properties)->contents, TOOL_BAR_ITEM_NSLOTS); ntool_bar_items += TOOL_BAR_ITEM_NSLOTS; } @@ -10490,10 +10486,10 @@ else { val = Fvector (NUM_RECENT_KEYS, keys); - memcpy (XVECTOR (val)->contents, keys + recent_keys_index, - (NUM_RECENT_KEYS - recent_keys_index) * word_size); - memcpy (XVECTOR (val)->contents + NUM_RECENT_KEYS - recent_keys_index, - keys, recent_keys_index * word_size); + vcopy (val, 0, keys + recent_keys_index, + NUM_RECENT_KEYS - recent_keys_index); + vcopy (val, NUM_RECENT_KEYS - recent_keys_index, + keys, recent_keys_index); return val; } } === modified file 'src/lisp.h' --- src/lisp.h 2012-08-20 08:07:38 +0000 +++ src/lisp.h 2012-08-21 10:21:04 +0000 @@ -2344,6 +2344,20 @@ XVECTOR (array)->contents[idx] = val; } +/* Copy COUNT Lisp_Objects from ARGS to contents of V starting from OFFSET. */ + +LISP_INLINE void +vcopy (Lisp_Object v, ptrdiff_t offset, Lisp_Object *args, ptrdiff_t count) +{ + ptrdiff_t i; + + eassert (offset + count <= ASIZE (v)); + for (i = 0; i < count; i++) + ASET (v, offset + i, args[i]); +} + +/* Functions to modify hash tables. */ + LISP_INLINE void set_hash_key_and_value (struct Lisp_Hash_Table *h, Lisp_Object key_and_value) { === modified file 'src/lread.c' --- src/lread.c 2012-08-17 21:12:11 +0000 +++ src/lread.c 2012-08-21 10:21:04 +0000 @@ -3406,7 +3406,7 @@ /* Delay handling the bytecode slot until we know whether it is lazily-loaded (we can tell by whether the constants slot is nil). */ - ptr[COMPILED_CONSTANTS] = item; + ASET (vector, COMPILED_CONSTANTS, item); item = Qnil; } else if (i == COMPILED_CONSTANTS) @@ -3432,7 +3432,7 @@ } /* Now handle the bytecode slot. */ - ptr[COMPILED_BYTECODE] = bytestr; + ASET (vector, COMPILED_BYTECODE, bytestr); } else if (i == COMPILED_DOC_STRING && STRINGP (item) @@ -3444,7 +3444,7 @@ item = Fstring_as_multibyte (item); } } - ptr[i] = item; + ASET (vector, i, item); otem = XCONS (tem); tem = Fcdr (tem); free_cons (otem); === modified file 'src/msdos.c' --- src/msdos.c 2012-08-17 23:38:43 +0000 +++ src/msdos.c 2012-08-21 10:21:04 +0000 @@ -2434,10 +2434,10 @@ else { val = Fvector (NUM_RECENT_DOSKEYS, keys); - memcpy (XVECTOR (val)->contents, keys + recent_doskeys_index, - (NUM_RECENT_DOSKEYS - recent_doskeys_index) * word_size); - memcpy (XVECTOR (val)->contents + NUM_RECENT_DOSKEYS - recent_doskeys_index, - keys, recent_doskeys_index * word_size); + vcopy (val, 0, keys + recent_doskeys_index, + NUM_RECENT_DOSKEYS - recent_doskeys_index); + vcopy (val, NUM_RECENT_DOSKEYS - recent_doskeys_index, + keys, recent_doskeys_index); return val; } } === modified file 'src/xfaces.c' --- src/xfaces.c 2012-08-17 21:52:15 +0000 +++ src/xfaces.c 2012-08-21 10:21:04 +0000 @@ -2781,8 +2781,7 @@ copy = Finternal_make_lisp_face (to, new_frame); } - memcpy (XVECTOR (copy)->contents, XVECTOR (lface)->contents, - LFACE_VECTOR_SIZE * word_size); + vcopy (copy, 0, XVECTOR (lface)->contents, LFACE_VECTOR_SIZE); /* Changing a named face means that all realized faces depending on that face are invalid. Since we cannot tell which realized faces @@ -3831,9 +3830,9 @@ gvec = XVECTOR (global_lface)->contents; for (i = 1; i < LFACE_VECTOR_SIZE; ++i) if (IGNORE_DEFFACE_P (gvec[i])) - lvec[i] = Qunspecified; + ASET (local_lface, i, Qunspecified); else if (! UNSPECIFIEDP (gvec[i])) - lvec[i] = gvec[i]; + ASET (local_lface, i, AREF (global_lface, i)); /* If the default face was changed, update the face cache and the `font' frame parameter. */ @@ -3850,7 +3849,7 @@ the previously-cached vector. */ memcpy (attrs, oldface->lface, sizeof attrs); merge_face_vectors (f, lvec, attrs, 0); - memcpy (lvec, attrs, sizeof attrs); + vcopy (local_lface, 0, attrs, LFACE_VECTOR_SIZE); newface = realize_face (c, lvec, DEFAULT_FACE_ID); if ((! UNSPECIFIEDP (gvec[LFACE_FAMILY_INDEX]) === modified file 'src/xfont.c' --- src/xfont.c 2012-08-16 06:35:13 +0000 +++ src/xfont.c 2012-08-21 10:21:04 +0000 @@ -390,7 +390,7 @@ Lisp_Object scripts = Qnil; for (i = 0; i < ASIZE (xfont_scratch_props); i++) - props[i] = Qnil; + ASET (xfont_scratch_props, i, Qnil); for (i = 0; i < num_fonts; i++) indices[i] = names[i]; qsort (indices, num_fonts, sizeof (char *), compare_font_names); @@ -467,9 +467,9 @@ word_size * 7) || ! EQ (AREF (entity, FONT_SPACING_INDEX), props[7])) { - memcpy (props, aref_addr (entity, FONT_FOUNDRY_INDEX), - word_size * 7); - props[7] = AREF (entity, FONT_SPACING_INDEX); + vcopy (xfont_scratch_props, 0, + aref_addr (entity, FONT_FOUNDRY_INDEX), 7); + ASET (xfont_scratch_props, 7, AREF (entity, FONT_SPACING_INDEX)); scripts = xfont_supported_scripts (display, indices[i], xfont_scratch_props, encoding); } ------------------------------------------------------------ revno: 109722 committer: Glenn Morris branch nick: trunk timestamp: Tue 2012-08-21 06:17:31 -0400 message: Auto-commit of generated files. diff: === modified file 'autogen/Makefile.in' --- autogen/Makefile.in 2012-08-20 10:17:51 +0000 +++ autogen/Makefile.in 2012-08-21 10:17:31 +0000 @@ -561,6 +561,7 @@ LIB_PTHREAD = @LIB_PTHREAD@ LIB_PTHREAD_SIGMASK = @LIB_PTHREAD_SIGMASK@ LIB_STANDARD = @LIB_STANDARD@ +LN_S = @LN_S@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ M17N_FLT_CFLAGS = @M17N_FLT_CFLAGS@ === modified file 'autogen/configure' --- autogen/configure 2012-08-20 10:17:51 +0000 +++ autogen/configure 2012-08-21 10:17:31 +0000 @@ -1224,6 +1224,7 @@ PAXCTL GZIP_PROG INSTALL_INFO +LN_S GNULIB_WARN_CFLAGS WARN_CFLAGS WERROR_CFLAGS @@ -7758,6 +7759,17 @@ +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } +fi + # Extract the first word of "install-info", so it can be a program name with args. set dummy install-info; ac_word=$2 ------------------------------------------------------------ revno: 109721 committer: martin rudalics branch nick: trunk timestamp: Tue 2012-08-21 11:50:58 +0200 message: Document recent changes for select-window, window-point and set-window-point. * windows.texi (Window Point): Document recent changes in window-point and set-window-point. (Selecting Windows): Document recent change in select-window. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2012-08-10 07:00:40 +0000 +++ doc/lispref/ChangeLog 2012-08-21 09:50:58 +0000 @@ -1,3 +1,9 @@ +2012-08-21 Martin Rudalics + + * windows.texi (Window Point): Document recent changes in + window-point and set-window-point. + (Selecting Windows): Document recent change in select-window. + 2012-08-06 Eli Zaretskii * functions.texi (Closures): Put the main index entry for === modified file 'doc/lispref/windows.texi' --- doc/lispref/windows.texi 2012-06-17 05:13:40 +0000 +++ doc/lispref/windows.texi 2012-08-21 09:50:58 +0000 @@ -1129,16 +1129,15 @@ @defun select-window window &optional norecord This function makes @var{window} the selected window, as well as the -window selected within its frame (@pxref{Basic Windows}). -@var{window} must be a live window. Unless @var{window} already is the -selected window, its buffer becomes the current buffer (@pxref{Buffers -and Windows}). The return value is @var{window}. +window selected within its frame (@pxref{Basic Windows}). @var{window} +must be a live window. This function makes also @var{window}'s buffer +current (@pxref{Buffers and Windows}). The return value is +@var{window}. -By default, this function also moves @var{window}'s selected buffer to -the front of the buffer list (@pxref{The Buffer List}), and makes -@var{window} the most recently selected window. However, if the -optional argument @var{norecord} is non-@code{nil}, these additional -actions are omitted. +By default, this function also moves @var{window}'s buffer to the front +of the buffer list (@pxref{The Buffer List}), and makes @var{window} the +most recently selected window. However, if the optional argument +@var{norecord} is non-@code{nil}, these additional actions are omitted. @end defun @cindex most recently selected windows @@ -2276,19 +2275,18 @@ window's buffer) if that window were selected. The default for @var{window} is the selected window. -When @var{window} is the selected window and its buffer is also the -current buffer, the value returned is the same as point in that buffer. -Strictly speaking, it would be more correct to return the ``top-level'' -value of point, outside of any @code{save-excursion} forms. But that -value is hard to find. +When @var{window} is the selected window, the value returned is the +value of point in that window's buffer. Strictly speaking, it would be +more correct to return the ``top-level'' value of point, outside of any +@code{save-excursion} forms. But that value is hard to find. @end defun @defun set-window-point window position This function positions point in @var{window} at position @var{position} in @var{window}'s buffer. It returns @var{position}. -If @var{window} is selected, and its buffer is current, -this simply does @code{goto-char}. +If @var{window} is selected, this simply does @code{goto-char} in +@var{window}'s buffer. @end defun @defvar window-point-insertion-type ------------------------------------------------------------ revno: 109720 committer: martin rudalics branch nick: trunk timestamp: Tue 2012-08-21 11:27:07 +0200 message: For selected window have (set-)window-point always operate on buffer's point. * window.c (Fwindow_point): For the selected window always return the position of its buffer's point. (Fset_window_point): For the selected window always go in its buffer to the specified position. * window.el (window-point-1, set-window-point-1): Remove. (window-in-direction, record-window-buffer) (set-window-buffer-start-and-point, split-window-below) (window--state-get-1, display-buffer-record-window): Replace calls to window-point-1 and set-window-point-1 by calls to window-point and set-window-point respectively. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-21 07:59:25 +0000 +++ lisp/ChangeLog 2012-08-21 09:27:07 +0000 @@ -1,3 +1,12 @@ +2012-08-21 Martin Rudalics + + * window.el (window-point-1, set-window-point-1): Remove. + (window-in-direction, record-window-buffer) + (set-window-buffer-start-and-point, split-window-below) + (window--state-get-1, display-buffer-record-window): Replace + calls to window-point-1 and set-window-point-1 by calls to + window-point and set-window-point respectively. + 2012-08-21 Glenn Morris * calendar/cal-tex.el (cal-tex-leftday, cal-tex-rightday): === modified file 'lisp/window.el' --- lisp/window.el 2012-08-17 06:01:17 +0000 +++ lisp/window.el 2012-08-21 09:27:07 +0000 @@ -1062,32 +1062,6 @@ (dolist (walk-windows-window (window-list-1 nil minibuf all-frames)) (funcall fun walk-windows-window)))) -(defun window-point-1 (&optional window) - "Return value of WINDOW's point. -WINDOW can be any live window and defaults to the selected one. - -This function is like `window-point' with one exception: If -WINDOW is selected, it returns the value of `point' of WINDOW's -buffer regardless of whether that buffer is current or not." - (setq window (window-normalize-window window t)) - (if (eq window (selected-window)) - (with-current-buffer (window-buffer window) - (point)) - (window-point window))) - -(defun set-window-point-1 (window pos) - "Set value of WINDOW's point to POS. -WINDOW can be any live window and defaults to the selected one. - -This function is like `set-window-point' with one exception: If -WINDOW is selected, it moves `point' of WINDOW's buffer to POS -regardless of whether that buffer is current or not." - (setq window (window-normalize-window window t)) - (if (eq window (selected-window)) - (with-current-buffer (window-buffer window) - (goto-char pos)) - (set-window-point window pos))) - (defun window-at-side-p (&optional window side) "Return t if WINDOW is at SIDE of its containing frame. WINDOW must be a valid window and defaults to the selected one. @@ -1146,7 +1120,7 @@ (last (+ first (if hor (window-total-width window) (window-total-height window)))) - (posn-cons (nth 6 (posn-at-point (window-point-1 window) window))) + (posn-cons (nth 6 (posn-at-point (window-point window) window))) ;; The column / row value of `posn-at-point' can be nil for the ;; mini-window, guard against that. (posn (if hor @@ -2613,7 +2587,7 @@ ;; Add an entry for buffer to WINDOW's previous buffers. (with-current-buffer buffer (let ((start (window-start window)) - (point (window-point-1 window))) + (point (window-point window))) (setq entry (cons buffer (if entry @@ -2657,7 +2631,7 @@ ;; Don't force window-start here (even if POINT is nil). (set-window-start window start t)) (when point - (set-window-point-1 window point)))) + (set-window-point window point)))) (defcustom switch-to-visible-buffer t "If non-nil, allow switching to an already visible buffer. @@ -3393,7 +3367,7 @@ amount of redisplay; this is convenient on slow terminals." (interactive "P") (let ((old-window (selected-window)) - (old-point (window-point-1)) + (old-point (window-point)) (size (and size (prefix-numeric-value size))) moved-by-window-height moved new-window bottom) (when (and size (< size 0) (< (- size) window-min-height)) @@ -3418,7 +3392,7 @@ (setq bottom (point))) (and moved-by-window-height (<= bottom (point)) - (set-window-point-1 old-window (1- bottom))) + (set-window-point old-window (1- bottom))) (and moved-by-window-height (<= (window-start new-window) old-point) (set-window-point new-window old-point) @@ -3727,7 +3701,7 @@ `((parameters . ,list)))) ,@(when buffer ;; All buffer related things go in here. - (let ((point (window-point-1 window)) + (let ((point (window-point window)) (start (window-start window))) `((buffer ,(buffer-name buffer) @@ -4020,7 +3994,7 @@ (list 'other ;; A quadruple of WINDOW's buffer, start, point and height. (list (window-buffer window) (window-start window) - (window-point-1 window) (window-total-size window)) + (window-point window) (window-total-size window)) (selected-window) buffer)))) ((eq type 'window) ;; WINDOW has been created on an existing frame. === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-21 04:46:05 +0000 +++ src/ChangeLog 2012-08-21 09:27:07 +0000 @@ -1,3 +1,10 @@ +2012-08-21 Martin Rudalics + + * window.c (Fwindow_point): For the selected window always return + the position of its buffer's point. + (Fset_window_point): For the selected window always go in its + buffer to the specified position. + 2012-08-21 Dmitry Antipov Setter macros for fontsets. === modified file 'src/window.c' --- src/window.c 2012-08-20 09:28:39 +0000 +++ src/window.c 2012-08-21 09:27:07 +0000 @@ -1407,22 +1407,21 @@ doc: /* Return current value of point in WINDOW. WINDOW must be a live window and defaults to the selected one. -For a nonselected window, this is the value point would have -if that window were selected. +For a nonselected window, this is the value point would have if that +window were selected. -Note that, when WINDOW is the selected window and its buffer -is also currently selected, the value returned is the same as (point). -It would be more strictly correct to return the `top-level' value -of point, outside of any save-excursion forms. -But that is hard to define. */) +Note that, when WINDOW is selected, the value returned is the same as +that returned by `point' for WINDOW's buffer. It would be more strictly +correct to return the `top-level' value of `point', outside of any +`save-excursion' forms. But that is hard to define. */) (Lisp_Object window) { register struct window *w = decode_live_window (window); - if (w == XWINDOW (selected_window) - && current_buffer == XBUFFER (w->buffer)) - return Fpoint (); - return Fmarker_position (w->pointm); + if (w == XWINDOW (selected_window)) + return make_number (BUF_PT (XBUFFER (w->buffer))); + else + return Fmarker_position (w->pointm); } DEFUN ("window-start", Fwindow_start, Swindow_start, 0, 1, 0, @@ -1532,16 +1531,27 @@ register struct window *w = decode_live_window (window); CHECK_NUMBER_COERCE_MARKER (pos); - if (w == XWINDOW (selected_window) - && XBUFFER (w->buffer) == current_buffer) - Fgoto_char (pos); + + if (w == XWINDOW (selected_window)) + { + if (XBUFFER (w->buffer) == current_buffer) + Fgoto_char (pos); + else + { + struct buffer *old_buffer = current_buffer; + + set_buffer_internal (XBUFFER (w->buffer)); + Fgoto_char (pos); + set_buffer_internal (old_buffer); + } + } else - set_marker_restricted (w->pointm, pos, w->buffer); - - /* We have to make sure that redisplay updates the window to show - the new value of point. */ - if (!EQ (window, selected_window)) - ++windows_or_buffers_changed; + { + set_marker_restricted (w->pointm, pos, w->buffer); + /* We have to make sure that redisplay updates the window to show + the new value of point. */ + ++windows_or_buffers_changed; + } return pos; } ------------------------------------------------------------ revno: 109719 committer: Glenn Morris branch nick: trunk timestamp: Tue 2012-08-21 00:59:25 -0700 message: Remove still more cal-tex code duplication * lisp/calendar/cal-tex.el (cal-tex-leftday, cal-tex-rightday): New functions. (cal-tex-cursor-week-at-a-glance, cal-tex-cursor-filofax-2week) (cal-tex-cursor-filofax-week): Use them. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-21 07:46:47 +0000 +++ lisp/ChangeLog 2012-08-21 07:59:25 +0000 @@ -1,5 +1,10 @@ 2012-08-21 Glenn Morris + * calendar/cal-tex.el (cal-tex-leftday, cal-tex-rightday): + New functions. + (cal-tex-cursor-week-at-a-glance, cal-tex-cursor-filofax-2week) + (cal-tex-cursor-filofax-week): Use them. + * calendar/cal-tex.el (cal-tex-lefthead, cal-tex-righthead): New constants. (cal-tex-cursor-week-at-a-glance, cal-tex-cursor-filofax-2week) === modified file 'lisp/calendar/cal-tex.el' --- lisp/calendar/cal-tex.el 2012-08-21 07:46:47 +0000 +++ lisp/calendar/cal-tex.el 2012-08-21 07:59:25 +0000 @@ -370,6 +370,28 @@ \\footskip 0.125in "))) +(defun cal-tex-leftday (height) + "Insert LaTeX code for leftday function." + (insert "\\long\\def\\leftday#1#2#3#4#5{% + \\rule{\\textwidth}{0.3pt}\\\\% + \\hbox to \\textwidth{% + \\vbox to " height "{% + \\vspace*{2pt}% + \\hbox to \\textwidth{\\noindent {\\normalsize \\bf #2} \\small #1 \\hfill #5}% + \\hbox to \\textwidth{\\vbox {\\noindent \\footnotesize \\em #4}}% + \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\}\n")) + +(defun cal-tex-rightday (height) + "Insert LaTeX code for rightday function." + (insert "\\long\\def\\rightday#1#2#3#4#5{% + \\rule{\\textwidth}{0.3pt}\\\\% + \\hbox to \\textwidth{% + \\vbox to " height "{% + \\vspace*{2pt}% + \\hbox to \\textwidth{\\small #5 \\hfill #1 {\\normalsize \\bf #2}}% + \\hbox to \\textwidth{\\vbox {\\raggedleft \\footnotesize \\em #4}}% + \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\}\n")) + ;;;###cal-autoload (defun cal-tex-cursor-filofax-year (&optional n event) "Make a Filofax one page yearly calendar of year indicated by cursor. @@ -1060,15 +1082,8 @@ \\footskip .125in ") (insert cal-tex-righthead) - (insert "\\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 #4}}% - \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\} -") + (cal-tex-rightday "2.75in") + ;; FIXME this is just (cal-tex-rightday "1.8in"). (insert "\\long\\def\\weekend#1#2#3#4#5{% \\rule{\\textwidth}{0.3pt}\\\\% \\hbox to \\textwidth{% @@ -1079,15 +1094,7 @@ \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\} ") (insert cal-tex-lefthead) - (insert "\\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 #4}}% - \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\} -") + (cal-tex-leftday "2.75in") (cal-tex-b-document) (cal-tex-cmd "\\pagestyle" "empty") (dotimes (i n) @@ -1215,25 +1222,9 @@ (cal-tex-preamble "twoside") (cal-tex-filofax-paper) (insert cal-tex-righthead) - (insert "\\long\\def\\rightday#1#2#3#4#5{% - \\rule{\\textwidth}{0.3pt}\\\\% - \\hbox to \\textwidth{% - \\vbox to 0.7in{% - \\vspace*{2pt}% - \\hbox to \\textwidth{\\small #5 \\hfill #1 {\\normalsize \\bf #2}}% - \\hbox to \\textwidth{\\vbox {\\raggedleft \\footnotesize \\em #4}}% - \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\} -") + (cal-tex-rightday "0.7in") (insert cal-tex-lefthead) - (insert "\\long\\def\\leftday#1#2#3#4#5{% - \\rule{\\textwidth}{0.3pt}\\\\% - \\hbox to \\textwidth{% - \\vbox to 0.7in{% - \\vspace*{2pt}% - \\hbox to \\textwidth{\\noindent {\\normalsize \\bf #2} \\small #1 \\hfill #5}% - \\hbox to \\textwidth{\\vbox {\\noindent \\footnotesize \\em #4}}% - \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\} -") + (cal-tex-leftday "0.7in") (cal-tex-b-document) (cal-tex-cmd "\\pagestyle" "empty") (dotimes (i n) @@ -1303,15 +1294,8 @@ (cal-tex-preamble "twoside") (cal-tex-filofax-paper) (insert cal-tex-righthead) - (insert "\\long\\def\\rightday#1#2#3#4#5{% - \\rule{\\textwidth}{0.3pt}\\\\% - \\hbox to \\textwidth{% - \\vbox to 1.85in{% - \\vspace*{2pt}% - \\hbox to \\textwidth{\\small #5 \\hfill #1 {\\normalsize \\bf #2}}% - \\hbox to \\textwidth{\\vbox {\\raggedleft \\footnotesize \\em #4}}% - \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\} -") + (cal-tex-rightday "1.85in") + ;; FIXME this is just (cal-tex-rightday "0.8in"). (insert "\\long\\def\\weekend#1#2#3#4#5{% \\rule{\\textwidth}{0.3pt}\\\\% \\hbox to \\textwidth{% @@ -1322,15 +1306,7 @@ \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\} ") (insert cal-tex-lefthead) - (insert "\\long\\def\\leftday#1#2#3#4#5{% - \\rule{\\textwidth}{0.3pt}\\\\% - \\hbox to \\textwidth{% - \\vbox to 1.85in{% - \\vspace*{2pt}% - \\hbox to \\textwidth{\\noindent {\\normalsize \\bf #2} \\small #1 \\hfill #5}% - \\hbox to \\textwidth{\\vbox {\\noindent \\footnotesize \\em #4}}% - \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\} -") + (cal-tex-leftday "1.85in") (cal-tex-b-document) (cal-tex-cmd "\\pagestyle" "empty") (dotimes (i n) @@ -1437,6 +1413,7 @@ (cal-tex-preamble "twoside") (cal-tex-filofax-paper) (insert cal-tex-righthead) + ;; Not quite cal-tex-rightday. (insert "\\long\\def\\rightday#1#2#3{% \\rule{\\textwidth}{0.3pt}\\\\% \\hbox to \\textwidth{% @@ -1446,6 +1423,7 @@ \\hbox to \\textwidth{\\vbox {\\raggedleft \\em #2}}% \\hbox to \\textwidth{\\vbox {\\noindent \\footnotesize #1}}}}} ") + ;; FIXME this is just \rightday from above. (insert "\\long\\def\\weekend#1#2#3{% \\rule{\\textwidth}{0.3pt}\\\\% \\hbox to \\textwidth{% @@ -1456,6 +1434,7 @@ \\hbox to \\textwidth{\\vbox {\\noindent \\footnotesize #1}}}}} ") (insert cal-tex-lefthead) + ;; Not quite cal-tex-leftday. (insert "\\long\\def\\leftday#1#2#3{% \\rule{\\textwidth}{0.3pt}\\\\% \\hbox to \\textwidth{% ------------------------------------------------------------ revno: 109718 committer: Julien Danjou branch nick: trunk timestamp: Tue 2012-08-21 09:52:42 +0200 message: erc-match: fix erc-match server buffer exclusion * erc-match.el (erc-match-message): Use `erc-match-exclude-server-buffer' not `erc-track-exclude-server-buffer'. diff: === modified file 'lisp/erc/ChangeLog' --- lisp/erc/ChangeLog 2012-08-20 16:08:51 +0000 +++ lisp/erc/ChangeLog 2012-08-21 07:52:42 +0000 @@ -1,3 +1,9 @@ +2012-08-21 Julien Danjou + + * erc-match.el (erc-match-message): Use + `erc-match-exclude-server-buffer' not + `erc-track-exclude-server-buffer'. + 2012-08-20 Josh Feinstein * erc.el (erc-display-message): Abstract message hiding decision === modified file 'lisp/erc/erc-match.el' --- lisp/erc/erc-match.el 2012-08-15 16:29:11 +0000 +++ lisp/erc/erc-match.el 2012-08-21 07:52:42 +0000 @@ -458,7 +458,7 @@ (point-min)) (point-max)))) (when (and vector - (not (and erc-track-exclude-server-buffer + (not (and erc-match-exclude-server-buffer (erc-server-buffer-p)))) (mapc (lambda (match-type) ------------------------------------------------------------ revno: 109717 committer: Glenn Morris branch nick: trunk timestamp: Tue 2012-08-21 00:46:47 -0700 message: Remove more cal-tex code duplication * lisp/calendar/cal-tex.el (cal-tex-lefthead, cal-tex-righthead): New constants. (cal-tex-cursor-week-at-a-glance, cal-tex-cursor-filofax-2week) (cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily): Use them. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-21 07:08:50 +0000 +++ lisp/ChangeLog 2012-08-21 07:46:47 +0000 @@ -1,5 +1,10 @@ 2012-08-21 Glenn Morris + * calendar/cal-tex.el (cal-tex-lefthead, cal-tex-righthead): + New constants. + (cal-tex-cursor-week-at-a-glance, cal-tex-cursor-filofax-2week) + (cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily): Use them. + * calendar/cal-tex.el (cal-tex-preamble): Generate new buffers. (cal-tex-end-document): Don't rely on buffer name. === modified file 'lisp/calendar/cal-tex.el' --- lisp/calendar/cal-tex.el 2012-08-21 07:08:50 +0000 +++ lisp/calendar/cal-tex.el 2012-08-21 07:46:47 +0000 @@ -237,6 +237,14 @@ "LaTeX code to insert one box with date info in calendar. This definition is the heart of the calendar!") +(defconst cal-tex-lefthead + "\\def\\lefthead#1{\\noindent {\\normalsize \\bf #1}\\hfill\\\\[-6pt]}\n" + "LaTeX code for left header.") + +(defconst cal-tex-righthead + "\\def\\righthead#1{\\hfill {\\normalsize \\bf #1}\\\\[-6pt]}\n" + "LaTeX code for right header.") + (autoload 'holiday-in-range "holidays") (define-obsolete-function-alias 'cal-tex-list-holidays 'holiday-in-range "24.3") @@ -1051,8 +1059,8 @@ \\headsep 0.125in \\footskip .125in ") - (insert "\\def\\righthead#1{\\hfill {\\normalsize \\bf #1}\\\\[-6pt]} -\\long\\def\\rightday#1#2#3#4#5{% + (insert cal-tex-righthead) + (insert "\\long\\def\\rightday#1#2#3#4#5{% \\rule{\\textwidth}{0.3pt}\\\\% \\hbox to \\textwidth{% \\vbox to 2.75in{% @@ -1060,7 +1068,8 @@ \\hbox to \\textwidth{\\small #5 \\hfill #1 {\\normalsize \\bf #2}}% \\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{% +") + (insert "\\long\\def\\weekend#1#2#3#4#5{% \\rule{\\textwidth}{0.3pt}\\\\% \\hbox to \\textwidth{% \\vbox to 1.8in{% @@ -1068,8 +1077,9 @@ \\hbox to \\textwidth{\\small #5 \\hfill #1 {\\normalsize \\bf #2}}% \\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{% +") + (insert cal-tex-lefthead) + (insert "\\long\\def\\leftday#1#2#3#4#5{% \\rule{\\textwidth}{0.3pt}\\\\% \\hbox to \\textwidth{% \\vbox to 2.75in{% @@ -1204,8 +1214,8 @@ (cal-tex-list-diary-entries d1 d2)))) (cal-tex-preamble "twoside") (cal-tex-filofax-paper) - (insert "\\def\\righthead#1{\\hfill {\\normalsize \\bf #1}\\\\[-6pt]} -\\long\\def\\rightday#1#2#3#4#5{% + (insert cal-tex-righthead) + (insert "\\long\\def\\rightday#1#2#3#4#5{% \\rule{\\textwidth}{0.3pt}\\\\% \\hbox to \\textwidth{% \\vbox to 0.7in{% @@ -1213,8 +1223,9 @@ \\hbox to \\textwidth{\\small #5 \\hfill #1 {\\normalsize \\bf #2}}% \\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{% +") + (insert cal-tex-lefthead) + (insert "\\long\\def\\leftday#1#2#3#4#5{% \\rule{\\textwidth}{0.3pt}\\\\% \\hbox to \\textwidth{% \\vbox to 0.7in{% @@ -1291,8 +1302,8 @@ (cal-tex-list-diary-entries d1 d2)))) (cal-tex-preamble "twoside") (cal-tex-filofax-paper) - (insert "\\def\\righthead#1{\\hfill {\\normalsize \\bf #1}\\\\[-6pt]} -\\long\\def\\rightday#1#2#3#4#5{% + (insert cal-tex-righthead) + (insert "\\long\\def\\rightday#1#2#3#4#5{% \\rule{\\textwidth}{0.3pt}\\\\% \\hbox to \\textwidth{% \\vbox to 1.85in{% @@ -1300,7 +1311,8 @@ \\hbox to \\textwidth{\\small #5 \\hfill #1 {\\normalsize \\bf #2}}% \\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{% +") + (insert "\\long\\def\\weekend#1#2#3#4#5{% \\rule{\\textwidth}{0.3pt}\\\\% \\hbox to \\textwidth{% \\vbox to .8in{% @@ -1308,8 +1320,9 @@ \\hbox to \\textwidth{\\small #5 \\hfill #1 {\\normalsize \\bf #2}}% \\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{% +") + (insert cal-tex-lefthead) + (insert "\\long\\def\\leftday#1#2#3#4#5{% \\rule{\\textwidth}{0.3pt}\\\\% \\hbox to \\textwidth{% \\vbox to 1.85in{% @@ -1423,8 +1436,8 @@ (cal-tex-list-diary-entries d1 d2)))) (cal-tex-preamble "twoside") (cal-tex-filofax-paper) - (insert "\\def\\righthead#1{\\hfill {\\normalsize \\bf #1}\\\\[-6pt]} -\\long\\def\\rightday#1#2#3{% + (insert cal-tex-righthead) + (insert "\\long\\def\\rightday#1#2#3{% \\rule{\\textwidth}{0.3pt}\\\\% \\hbox to \\textwidth{% \\vbox {% @@ -1432,24 +1445,27 @@ \\hbox to \\textwidth{\\hfill \\small #3 \\hfill}% \\hbox to \\textwidth{\\vbox {\\raggedleft \\em #2}}% \\hbox to \\textwidth{\\vbox {\\noindent \\footnotesize #1}}}}} -\\long\\def\\weekend#1#2#3{% - \\rule{\\textwidth}{0.3pt}\\\\% - \\hbox to \\textwidth{% - \\vbox {% - \\vspace*{2pt}% - \\hbox to \\textwidth{\\hfill \\small #3 \\hfill}% - \\hbox to \\textwidth{\\vbox {\\noindent \\em #2}}% - \\hbox to \\textwidth{\\vbox {\\noindent \\footnotesize #1}}}}} -\\def\\lefthead#1{\\noindent {\\normalsize \\bf #1}\\hfill\\\\[-6pt]} -\\long\\def\\leftday#1#2#3{% - \\rule{\\textwidth}{0.3pt}\\\\% - \\hbox to \\textwidth{% - \\vbox {% - \\vspace*{2pt}% - \\hbox to \\textwidth{\\hfill \\small #3 \\hfill}% - \\hbox to \\textwidth{\\vbox {\\noindent \\em #2}}% - \\hbox to \\textwidth{\\vbox {\\noindent \\footnotesize #1}}}}} -\\newbox\\LineBox +") + (insert "\\long\\def\\weekend#1#2#3{% + \\rule{\\textwidth}{0.3pt}\\\\% + \\hbox to \\textwidth{% + \\vbox {% + \\vspace*{2pt}% + \\hbox to \\textwidth{\\hfill \\small #3 \\hfill}% + \\hbox to \\textwidth{\\vbox {\\noindent \\em #2}}% + \\hbox to \\textwidth{\\vbox {\\noindent \\footnotesize #1}}}}} +") + (insert cal-tex-lefthead) + (insert "\\long\\def\\leftday#1#2#3{% + \\rule{\\textwidth}{0.3pt}\\\\% + \\hbox to \\textwidth{% + \\vbox {% + \\vspace*{2pt}% + \\hbox to \\textwidth{\\hfill \\small #3 \\hfill}% + \\hbox to \\textwidth{\\vbox {\\noindent \\em #2}}% + \\hbox to \\textwidth{\\vbox {\\noindent \\footnotesize #1}}}}} +") + (insert "\\newbox\\LineBox \\setbox\\LineBox=\\hbox to\\textwidth{% \\vrule height.2in width0pt\\leaders\\hrule\\hfill} \\def\\linesfill{\\par\\leaders\\copy\\LineBox\\vfill} ------------------------------------------------------------ revno: 109716 committer: Glenn Morris branch nick: trunk timestamp: Tue 2012-08-21 00:08:50 -0700 message: Allow multiple cal-tex-buffer buffers to exist * lisp/calendar/cal-tex.el (cal-tex-preamble): Generate new buffers. (cal-tex-end-document): Don't rely on buffer name. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-21 07:01:29 +0000 +++ lisp/ChangeLog 2012-08-21 07:08:50 +0000 @@ -1,5 +1,8 @@ 2012-08-21 Glenn Morris + * calendar/cal-tex.el (cal-tex-preamble): Generate new buffers. + (cal-tex-end-document): Don't rely on buffer name. + * 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) === modified file 'lisp/calendar/cal-tex.el' --- lisp/calendar/cal-tex.el 2012-08-21 07:01:29 +0000 +++ lisp/calendar/cal-tex.el 2012-08-21 07:08:50 +0000 @@ -253,8 +253,7 @@ "Insert the LaTeX calendar preamble into `cal-tex-buffer'. Preamble includes initial definitions for various LaTeX commands. Optional string ARGS are included as options for the article document class." - ;; FIXME use generate-new-buffer, and adjust cal-tex-end-document. - (set-buffer (get-buffer-create cal-tex-buffer)) + (set-buffer (generate-new-buffer cal-tex-buffer)) (insert (format "\\documentclass%s{article}\n" (if (stringp args) (format "[%s]" args) @@ -1712,7 +1711,7 @@ ;; FIXME latin1 might not always be right. (insert "\\usepackage[latin1]{inputenc}\n")))) (latex-mode) - (pop-to-buffer cal-tex-buffer) + (pop-to-buffer (current-buffer)) (goto-char (point-min)) ;; FIXME auctex equivalents? (cal-tex-comment ------------------------------------------------------------ revno: 109715 committer: Glenn Morris branch nick: trunk timestamp: Tue 2012-08-21 00:01:29 -0700 message: Use cal-tex-arg more * lisp/calendar/cal-tex.el (cal-tex-scriptsize, cal-tex-huge) (cal-tex-Huge, cal-tex-large): Use cal-tex-arg. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-21 06:50:55 +0000 +++ lisp/ChangeLog 2012-08-21 07:01:29 +0000 @@ -4,6 +4,8 @@ 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. + (cal-tex-scriptsize, cal-tex-huge, cal-tex-Huge, cal-tex-large): + Use cal-tex-arg. * calendar/cal-tex.el (cal-tex-cursor-filofax-year) (cal-tex-cursor-week, cal-tex-cursor-week2) === modified file 'lisp/calendar/cal-tex.el' --- lisp/calendar/cal-tex.el 2012-08-21 06:50:55 +0000 +++ lisp/calendar/cal-tex.el 2012-08-21 07:01:29 +0000 @@ -1928,15 +1928,15 @@ (defun cal-tex-scriptsize (string) "Insert STRING in scriptsize font." - (insert "{\\scriptsize " string "}")) + (cal-tex-arg (concat "\\scriptsize " string))) (defun cal-tex-huge (string) "Insert STRING in huge font." - (insert "{\\huge " string "}")) + (cal-tex-arg (concat "\\huge " string))) (defun cal-tex-Huge (string) "Insert STRING in Huge font." - (insert "{\\Huge " string "}")) + (cal-tex-arg (concat "\\Huge " string))) (defun cal-tex-Huge-bf (string) "Insert STRING in Huge bf font." @@ -1944,7 +1944,7 @@ (defun cal-tex-large (string) "Insert STRING in large font." - (insert "{\\large " string "}")) + (cal-tex-arg (concat "\\large " string))) (defun cal-tex-large-bf (string) "Insert STRING in large bf font." ------------------------------------------------------------ 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)