diff options
author | Chong Yidong <cyd@stupidchicken.com> | 2010-07-16 11:42:15 -0400 |
---|---|---|
committer | Chong Yidong <cyd@stupidchicken.com> | 2010-07-16 11:42:15 -0400 |
commit | fea9cabd275c3d5809b824a6e4a1446441a6793e (patch) | |
tree | a5eb69edf85fe28f6b4d5bbc8e3c2c3cfc3d0d37 /lisp | |
parent | 7e4289ad2bbd9f8ed18902f652d3f07380b227bf (diff) | |
parent | f253ef6a8e0dd71cf9fd58e3d9407549d30e091d (diff) | |
download | emacs-fea9cabd275c3d5809b824a6e4a1446441a6793e.tar.gz |
Merge changes from emacs-23 branch.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/ChangeLog | 31 | ||||
-rw-r--r-- | lisp/calendar/cal-tex.el | 80 | ||||
-rw-r--r-- | lisp/calendar/calendar.el | 4 | ||||
-rw-r--r-- | lisp/mail/rmailmm.el | 4 | ||||
-rw-r--r-- | lisp/simple.el | 7 | ||||
-rw-r--r-- | lisp/vc/vc.el | 17 | ||||
-rw-r--r-- | lisp/xt-mouse.el | 4 |
7 files changed, 99 insertions, 48 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 199c8243188..f0ea29a5d89 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,15 @@ +2010-07-16 Reiner Steib <Reiner.Steib@gmx.de> + + * vc.el (vc-coding-system-inherit-eol): New defvar. + (vc-coding-system-for-diff): Use it to decide whether to inherit + from the file the EOL format for reading the diffs of that file. + (Bug#4451) + +2010-07-16 Eli Zaretskii <eliz@gnu.org> + + * mail/rmailmm.el (rmail-mime-save): Make the temp buffer + unibyte, so compressed attachments are not compressed again. + 2010-07-16 Michael Albinus <michael.albinus@gmx.de> * net/tramp.el (tramp-handle-shell-command): Don't use hard-wired @@ -22,6 +34,11 @@ * bookmark.el (bookmark-load-hook): Fix doc string as suggested by Drew Adams (Bug#5504). +2010-07-14 Jan Djärv <jan.h.d@swipnet.se> + + * xt-mouse.el (xterm-mouse-event-read): Fix for characters > 127 + now that unicode is used (Bug#6594). + 2010-07-14 Chong Yidong <cyd@stupidchicken.com> * term/x-win.el (x-select-enable-clipboard): Default to t. @@ -120,6 +137,20 @@ * net/tramp-gvfs.el (tramp-gvfs-handle-copy-file): Do not pass empty argument to gvfs-copy. +2010-07-10 Glenn Morris <rgm@gnu.org> + + * calendar/calendar.el (calendar-week-end-day): New function. + * calendar/cal-tex.el (cal-tex-cursor-month): Remove unused vars. + Respect calendar-week-start-day. (Bug#6606) + (cal-tex-insert-day-names, cal-tex-insert-blank-days) + (cal-tex-insert-blank-days-at-end): Respect calendar-week-start-day. + (cal-tex-first-blank-p, cal-tex-last-blank-p): Simplify, and + respect calendar-week-start-day. + +2010-07-10 Chong Yidong <cyd@stupidchicken.com> + + * simple.el (use-region-p): Doc fix (Bug#6607). + 2010-07-10 Aleksei Gusev <aleksei.gusev@gmail.com> (tiny change) * progmodes/compile.el (compilation-error-regexp-alist-alist): Add diff --git a/lisp/calendar/cal-tex.el b/lisp/calendar/cal-tex.el index bbddc1ff38c..46fb0869787 100644 --- a/lisp/calendar/cal-tex.el +++ b/lisp/calendar/cal-tex.el @@ -1,7 +1,7 @@ ;;; cal-tex.el --- calendar functions for printing calendars with LaTeX -;; Copyright (C) 1995, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 -;; Free Software Foundation, Inc. +;; Copyright (C) 1995, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, +;; 2009, 2010 Free Software Foundation, Inc. ;; Author: Steve Fisk <fisk@bowdoin.edu> ;; Edward M. Reingold <reingold@cs.uiuc.edu> @@ -507,6 +507,7 @@ indicates a buffer position to use instead of point." (year (calendar-extract-year date)) (end-month month) (end-year year) + ;; FIXME -landscape sets cal-tex-which-days? (d1 (calendar-absolute-from-gregorian (list month 1 year))) (d2 (progn (calendar-increment-month end-month end-year (1- n)) @@ -515,8 +516,7 @@ indicates a buffer position to use instead of point." (calendar-last-day-of-month end-month end-year) end-year)))) (diary-list (if cal-tex-diary (cal-tex-list-diary-entries d1 d2))) - (holidays (if cal-tex-holidays (cal-tex-list-holidays d1 d2))) - other-month other-year) + (holidays (if cal-tex-holidays (cal-tex-list-holidays d1 d2)))) (cal-tex-insert-preamble (cal-tex-number-weeks month year n) nil "12pt") (if (> n 1) (cal-tex-cmd cal-tex-cal-multi-month) @@ -526,14 +526,12 @@ indicates a buffer position to use instead of point." (cal-tex-nl ".2cm") (cal-tex-insert-blank-days month year cal-tex-day-prefix) (dotimes (idummy n) - (setq other-month month - other-year year) (cal-tex-insert-days month year diary-list holidays cal-tex-day-prefix) - (when (= 6 (mod (calendar-absolute-from-gregorian - (list month - (calendar-last-day-of-month month year) - year)) - 7)) ; last day of month was Saturday + (when (= (calendar-week-end-day) + (calendar-day-of-week + (list month + (calendar-last-day-of-month month year) + year))) ; last day of month was last day of week (cal-tex-hfill) (cal-tex-nl)) (calendar-increment-month month year 1)) @@ -570,13 +568,14 @@ are included. Each day is formatted using format DAY-FORMAT." (defun cal-tex-insert-day-names () "Insert the names of the days at top of a monthly calendar." - (dotimes (i 7) - (if (memq i cal-tex-which-days) - (insert (format cal-tex-day-name-format - (cal-tex-LaTeXify-string - (aref calendar-day-name-array - (mod (+ calendar-week-start-day i) 7)))))) - (cal-tex-comment))) + (let (j) + (dotimes (i 7) + (if (memq (setq j (mod (+ calendar-week-start-day i) 7)) + cal-tex-which-days) + (insert (format cal-tex-day-name-format + (cal-tex-LaTeXify-string + (aref calendar-day-name-array j))))) + (cal-tex-comment)))) (defun cal-tex-insert-month-header (n month year end-month end-year) "Create a title for a calendar. @@ -603,7 +602,7 @@ blank, no days are inserted." calendar-week-start-day) 7))) (dotimes (i blank-days) - (if (memq i cal-tex-which-days) + (if (memq (mod (+ calendar-week-start-day i) 7) cal-tex-which-days) (insert (format day-format " " " ") "{}{}{}{}%\n")))))) (defun cal-tex-insert-blank-days-at-end (month year day-format) @@ -619,38 +618,37 @@ The entry is formatted using DAY-FORMAT." 7)) (i blank-days)) (while (<= (setq i (1+ i)) 6) - (if (memq i cal-tex-which-days) + (if (memq (mod (+ calendar-week-start-day i) 7) cal-tex-which-days) (insert (format day-format "" "") "{}{}{}{}%\n")))))) (defun cal-tex-first-blank-p (month year) "Determine if any days of the first week will be printed. Return t if there will there be any days of the first week printed in the calendar starting in MONTH YEAR." - (let (any-days the-saturday) ; the day of week of 1st Saturday - (dotimes (i 7) - (if (= 6 (calendar-day-of-week (list month (1+ i) year))) - (setq the-saturday (1+ i)))) - (dotimes (i the-saturday) - (if (memq (calendar-day-of-week (list month (1+ i) year)) - cal-tex-which-days) - (setq any-days t))) - any-days)) + ;; Check days 1-7 of the month, until we find the last day of the week. + (catch 'found + (let (dow) + (dotimes (i 7) + (if (memq (setq dow (calendar-day-of-week (list month (1+ i) year))) + cal-tex-which-days) + (throw 'found t) + (if (= dow (calendar-week-end-day)) (throw 'found nil))))))) (defun cal-tex-last-blank-p (month year) "Determine if any days of the last week will be printed. Return t if there will there be any days of the last week printed in the calendar starting in MONTH YEAR." - (let* ((last-day (calendar-last-day-of-month month year)) - (i (- last-day 7)) - any-days the-sunday) ; the day of week of last Sunday - (while (<= (setq i (1+ i)) last-day) - (if (zerop (calendar-day-of-week (list month i year))) - (setq the-sunday i))) - (setq i (1- the-sunday)) - (while (<= (setq i (1+ i)) last-day) - (if (memq (calendar-day-of-week (list month i year)) cal-tex-which-days) - (setq any-days t))) - any-days)) + ;; Check backwards from the last day of the month, until we find the + ;; start of the last week in the month. + (catch 'found + (let ((last-day (calendar-last-day-of-month month year)) + day dow) + (dotimes (i 7) + (if (memq (setq dow (calendar-day-of-week + (list month (- last-day i) year))) + cal-tex-which-days) + (throw 'found t) + (if (= dow calendar-week-start-day) (throw 'found nil))))))) (defun cal-tex-number-weeks (month year n) "Determine the number of weeks in a range of dates. @@ -1499,7 +1497,7 @@ Optional string COLSEP gives the column separation (default \"1mm\")." (- (calendar-day-of-week (list month 1 year)) calendar-week-start-day) 7)) - (last (calendar-last-day-of-month month year)) + (last( calendar-last-day-of-month month year)) (str (concat "\\def\\" name "{\\hbox to" width "{%\n" "\\vbox to" height "{%\n" "\\vfil \\hbox to" width "{%\n" diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el index d92942d003f..418f740bb83 100644 --- a/lisp/calendar/calendar.el +++ b/lisp/calendar/calendar.el @@ -2226,6 +2226,10 @@ DATE is a list of the form (month day year). A negative year is interpreted as BC; -1 being 1 BC, and so on." (mod (calendar-absolute-from-gregorian date) 7)) +(defun calendar-week-end-day () + "Return the index (0 for Sunday, etc.) of the last day of the week." + (mod (+ calendar-week-start-day 6) 7)) + (defun calendar-unmark () "Delete all diary/holiday marks/highlighting from the calendar." (interactive) diff --git a/lisp/mail/rmailmm.el b/lisp/mail/rmailmm.el index 415bc20cf50..e8ca11ee349 100644 --- a/lisp/mail/rmailmm.el +++ b/lisp/mail/rmailmm.el @@ -112,6 +112,10 @@ automatically display the image in the buffer." (file-name-as-directory filename)))) (with-temp-buffer (set-buffer-file-coding-system 'no-conversion) + ;; Needed e.g. by jka-compr, so if the attachment is a compressed + ;; file, the magic signature compares equal with the unibyte + ;; signature string recorded in jka-compr-compression-info-list. + (set-buffer-multibyte nil) (insert data) (write-region nil nil filename nil nil nil t)))) diff --git a/lisp/simple.el b/lisp/simple.el index 20e109aaafe..939fbfe4e15 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -3761,10 +3761,9 @@ point otherwise." This is used by commands that act specially on the region under Transient Mark mode. -The return value is t provided Transient Mark mode is enabled and -the mark is active; and, when `use-empty-active-region' is -non-nil, provided the region is empty. Otherwise, the return -value is nil. +The return value is t if Transient Mark mode is enabled and the +mark is active; furthermore, if `use-empty-active-region' is nil, +the region must not be empty. Otherwise, the return value is nil. For some commands, it may be appropriate to ignore the value of `use-empty-active-region'; in that case, use `region-active-p'." diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 434c2a10e14..20e56bbd42f 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -1437,6 +1437,16 @@ Runs the normal hooks `vc-before-checkin-hook' and `vc-checkin-hook'." ;; (vc-call-backend ',(vc-backend f) ;; 'diff (list ',f) ',rev1 ',rev2)))))) +(defvar vc-coding-system-inherit-eol t + "When non-nil, inherit the EOL format for reading Diff output from the file. + +Used in `vc-coding-system-for-diff' to determine the EOL format to use +for reading Diff output for a file. If non-nil, the EOL format is +inherited from the file itself. +Set this variable to nil if your Diff tool might use a different +EOL. Then Emacs will auto-detect the EOL format in Diff output, which +gives better results.") ;; Cf. bug#4451. + (defun vc-coding-system-for-diff (file) "Return the coding system for reading diff output for FILE." (or coding-system-for-read @@ -1444,7 +1454,12 @@ Runs the normal hooks `vc-before-checkin-hook' and `vc-checkin-hook'." ;; use the buffer's coding system (let ((buf (find-buffer-visiting file))) (when buf (with-current-buffer buf - buffer-file-coding-system))) + (if vc-coding-system-inherit-eol + buffer-file-coding-system + ;; Don't inherit the EOL part of the coding-system, + ;; because some Diff tools may choose to use + ;; a different one. bug#4451. + (coding-system-base buffer-file-coding-system))))) ;; otherwise, try to find one based on the file name (car (find-operation-coding-system 'insert-file-contents file)) ;; and a final fallback diff --git a/lisp/xt-mouse.el b/lisp/xt-mouse.el index 2d38c6e827c..f802103fbd7 100644 --- a/lisp/xt-mouse.el +++ b/lisp/xt-mouse.el @@ -122,8 +122,8 @@ ;; read xterm sequences above ascii 127 (#x7f) (defun xterm-mouse-event-read () (let ((c (read-char))) - (if (< c 0) - (+ c #x8000000 128) + (if (> c #x3FFF80) + (+ 128 (- c #x3FFF80)) c))) (defun xterm-mouse-truncate-wrap (f) |