Using saved parent location: http://bzr.savannah.gnu.org/r/emacs/trunk/ Now on revision 101979. ------------------------------------------------------------ revno: 101979 author: Gnus developers committer: Katsumi Yamaoka branch nick: trunk timestamp: Sat 2010-10-16 01:55:08 +0000 message: Merge changes made in Gnus trunk. nnimap.el: Use nnheader-message throughout. gnus.el: Autoload gnus-html-show-images. mml.el (mml-generate-mime-1): Add `mml-enable-flow' variable to add a possibility to disable format=flow encoding when using hard newlines. gnus-diary.el (gnus-diary-check-message): Fix gnus-completing-read call. gnus-sum.el (gnus-summary-refer-thread): unconditionally ignore duplicates. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2010-10-15 10:24:10 +0000 +++ lisp/gnus/ChangeLog 2010-10-16 01:55:08 +0000 @@ -1,12 +1,30 @@ +2010-10-15 Andrew Cohen + + * gnus-sum.el (gnus-summary-refer-thread): unconditionally ignore + duplicates. + +2010-10-15 Kan-Ru Chen (tiny change) + + * gnus-diary.el (gnus-diary-check-message): Fix gnus-completing-read + call. + 2010-10-15 Lars Magne Ingebrigtsen + * gnus.el: Autoload gnus-html-show-images. + + * nnimap.el: Use nnheader-message throughout. + * shr.el (shr-tag-img): Ignore images with no data. +2010-10-15 Julien Danjou + + * mml.el (mml-generate-mime-1): Add `mml-enable-flow' variable to add a + possibility to disable format=flow encoding when using hard newlines. + 2010-10-15 Katsumi Yamaoka - * shr.el (shr-generic): Remove trailing space. - (shr-insert): Remove space inserted before or after a breakable - character or at the beginning or the end of a line. + * shr.el (shr-insert): Remove space inserted before or after a + breakable character or at the beginning or the end of a line. (shr-find-fill-point): Do kinsoku; find the second best point or give it up if there's no breakable point. === modified file 'lisp/gnus/gnus-diary.el' --- lisp/gnus/gnus-diary.el 2010-09-30 08:39:23 +0000 +++ lisp/gnus/gnus-diary.el 2010-10-16 01:55:08 +0000 @@ -368,7 +368,7 @@ header ": "))) (setq value (if (listp (nth 1 head)) - (gnus-completing-read prompt (cons '("*" nil) (nth 1 head)) + (gnus-completing-read prompt (cons "*" (mapcar 'car (nth 1 head))) t value 'gnus-diary-header-value-history) (read-string prompt value === modified file 'lisp/gnus/gnus-sum.el' --- lisp/gnus/gnus-sum.el 2010-10-14 22:39:54 +0000 +++ lisp/gnus/gnus-sum.el 2010-10-16 01:55:08 +0000 @@ -8830,6 +8830,7 @@ variable." (interactive "P") (let ((id (mail-header-id (gnus-summary-article-header))) + (gnus-summary-ignore-duplicates t) (limit (if limit (prefix-numeric-value limit) gnus-refer-thread-limit))) (if (gnus-check-backend-function 'request-thread gnus-newsgroup-name) === modified file 'lisp/gnus/gnus.el' --- lisp/gnus/gnus.el 2010-10-11 23:29:33 +0000 +++ lisp/gnus/gnus.el 2010-10-16 01:55:08 +0000 @@ -2911,6 +2911,7 @@ gnus-start-date-timer gnus-stop-date-timer gnus-mime-view-all-parts) ("gnus-int" gnus-request-type) + ("gnus-html" gnus-html-show-images) ("gnus-start" gnus-newsrc-parse-options gnus-1 gnus-no-server-1 gnus-dribble-enter gnus-read-init-file gnus-dribble-touch gnus-check-reasonable-setup) === modified file 'lisp/gnus/mml.el' --- lisp/gnus/mml.el 2010-10-11 23:29:33 +0000 +++ lisp/gnus/mml.el 2010-10-16 01:55:08 +0000 @@ -128,6 +128,14 @@ :type 'boolean :group 'message) +(defcustom mml-enable-flowed t + "If non-nil, enable format=flowed usage when encoding a message. +This is only performed when filling on text/plain with hard +newlines in the text." + :version "24.1" + :type 'boolean + :group 'message) + (defvar mml-tweak-type-alist nil "A list of (TYPE . FUNCTION) for tweaking MML parts. TYPE is a string containing a regexp to match the MIME type. FUNCTION @@ -546,7 +554,8 @@ ;; in the mml tag or it says "flowed" and there ;; actually are hard newlines in the text. (let (use-hard-newlines) - (when (and (string= type "text/plain") + (when (and mml-enable-flowed + (string= type "text/plain") (not (string= (cdr (assq 'sign cont)) "pgp")) (or (null (assq 'format cont)) (string= (cdr (assq 'format cont)) === modified file 'lisp/gnus/nnimap.el' --- lisp/gnus/nnimap.el 2010-10-14 22:39:54 +0000 +++ lisp/gnus/nnimap.el 2010-10-16 01:55:08 +0000 @@ -304,7 +304,8 @@ ((or (eq nnimap-stream 'network) (and (eq nnimap-stream 'starttls) (fboundp 'open-gnutls-stream))) - (message "Opening connection to %s..." nnimap-address) + (nnheader-message 7 "Opening connection to %s..." + nnimap-address) (open-network-stream "*nnimap*" (current-buffer) nnimap-address (setq port @@ -314,13 +315,14 @@ "143")))) '("143" "imap")) ((eq nnimap-stream 'shell) - (message "Opening connection to %s via shell..." nnimap-address) + (nnheader-message 7 "Opening connection to %s via shell..." + nnimap-address) (nnimap-open-shell-stream "*nnimap*" (current-buffer) nnimap-address (setq port (or nnimap-server-port "imap"))) '("imap")) ((eq nnimap-stream 'starttls) - (message "Opening connection to %s via starttls..." + (nnheader-message 7 "Opening connection to %s via starttls..." nnimap-address) (let ((tls-program '("openssl s_client -connect %h:%p -no_ssl2 -ign_eof -starttls imap"))) @@ -329,7 +331,8 @@ (setq port (or nnimap-server-port "imap")))) '("imap")) ((memq nnimap-stream '(ssl tls)) - (message "Opening connection to %s via tls..." nnimap-address) + (nnheader-message 7 "Opening connection to %s via tls..." + nnimap-address) (funcall (if (fboundp 'open-gnutls-stream) 'open-gnutls-stream 'open-tls-stream) @@ -734,7 +737,7 @@ ((and force (eq nnmail-expiry-target 'delete)) (unless (nnimap-delete-article (gnus-compress-sequence articles)) - (message "Article marked for deletion, but not expunged.")) + (nnheader-message 7 "Article marked for deletion, but not expunged.")) nil) (t (let ((deletable-articles @@ -760,7 +763,7 @@ (let ((target nnmail-expiry-target)) (with-temp-buffer (when (nnimap-request-article article group server (current-buffer)) - (message "Expiring article %s:%d" group article) + (nnheader-message 7 "Expiring article %s:%d" group article) (when (functionp target) (setq target (funcall target group))) (when (and target @@ -830,7 +833,7 @@ (when (and (nnimap-possibly-change-group nil server) nnimap-inbox nnimap-split-methods) - (message "nnimap %s splitting mail..." server) + (nnheader-message 7 "nnimap %s splitting mail..." server) (nnimap-split-incoming-mail))) (defun nnimap-marks-to-flags (marks) @@ -882,7 +885,7 @@ (let ((result (nnimap-get-response sequence))) (if (not (car result)) (progn - (message "%s" (nnheader-get-report-string 'nnimap)) + (nnheader-message 7 "%s" (nnheader-get-report-string 'nnimap)) nil) (cons group (nnimap-find-article-by-message-id group message-id)))))))) @@ -1431,7 +1434,7 @@ (point-min)) t))) (when messagep - (message "nnimap read %dk" (/ (buffer-size) 1000))) + (nnheader-message 7 "nnimap read %dk" (/ (buffer-size) 1000))) (nnheader-accept-process-output process) (goto-char (point-max))) openp) ------------------------------------------------------------ revno: 101978 committer: Chong Yidong branch nick: trunk timestamp: Fri 2010-10-15 20:16:34 -0400 message: Bugfixes for `customize-create-theme'. * cus-theme.el (customize-create-theme): Delete overlays after erasing. If given a THEME arg, display only the faces of that arg instead of custom-theme--listed-faces. (custom-theme-variable-menu, custom-theme-variable-action) (custom-variable-reset-theme, custom-theme-delete-variable): Deleted. (custom-theme-add-variable, custom-theme-add-face): Apply value from the theme settings, instead of the current value. (custom-theme-add-var-1, custom-theme-add-face-1): New functions. (custom-theme-visit-theme): Allow calling outside theme buffers. (custom-theme-merge-theme): Don't enable the theme when merging. (custom-theme-write-variables, custom-theme-write-faces): Use the :shown-value properties to save buffer values, not global ones. (customize-themes): Display a warning about user customizations. * cus-edit.el (custom-variable-value-create) (custom-face-value-create): Obey new special properties :shown-value and :inhibit-magic. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-10-15 12:07:38 +0000 +++ lisp/ChangeLog 2010-10-16 00:16:34 +0000 @@ -1,3 +1,23 @@ +2010-10-16 Chong Yidong + + * cus-theme.el (customize-create-theme): Delete overlays after + erasing. If given a THEME arg, display only the faces of that arg + instead of custom-theme--listed-faces. + (custom-theme-variable-menu, custom-theme-variable-action) + (custom-variable-reset-theme, custom-theme-delete-variable): Deleted. + (custom-theme-add-variable, custom-theme-add-face): Apply value + from the theme settings, instead of the current value. + (custom-theme-add-var-1, custom-theme-add-face-1): New functions. + (custom-theme-visit-theme): Allow calling outside theme buffers. + (custom-theme-merge-theme): Don't enable the theme when merging. + (custom-theme-write-variables, custom-theme-write-faces): Use the + :shown-value properties to save buffer values, not global ones. + (customize-themes): Display a warning about user customizations. + + * cus-edit.el (custom-variable-value-create) + (custom-face-value-create): Obey new special properties + :shown-value and :inhibit-magic. + 2010-10-15 Michael Albinus * net/tramp-sh.el (tramp-open-connection-setup-interactive-shell): === modified file 'lisp/cus-edit.el' --- lisp/cus-edit.el 2010-10-12 03:10:21 +0000 +++ lisp/cus-edit.el 2010-10-16 00:16:34 +0000 @@ -2460,7 +2460,13 @@ :custom-form should be a symbol describing how to display and edit the variable---either `edit' (using edit widgets), `lisp' (as a Lisp sexp), or `mismatch' (should not happen); - if nil, use the return value of `custom-variable-default-form'." + if nil, use the return value of `custom-variable-default-form'. + +:shown-value, if non-nil, should be a list whose `car' is the + variable value to display in place of the current value. + +:inhibit-magic, if non-nil, inhibits creating the magic + custom-state widget." :format "%v" :help-echo "Set or reset this variable." :documentation-property #'custom-variable-documentation @@ -2512,9 +2518,12 @@ (get (or (get symbol 'custom-get) 'default-value)) (prefix (widget-get widget :custom-prefix)) (last (widget-get widget :custom-last)) - (value (if (default-boundp symbol) - (funcall get symbol) - (widget-get conv :value))) + (value (let ((shown-value (widget-get widget :shown-value))) + (cond (shown-value + (car shown-value)) + ((default-boundp symbol) + (funcall get symbol)) + (t (widget-get conv :value))))) (state (or (widget-get widget :custom-state) (if (memq (custom-variable-state symbol value) (widget-get widget :hidden-states)) @@ -2622,10 +2631,11 @@ (unless (eq (preceding-char) ?\n) (widget-insert "\n")) ;; Create the magic button. - (let ((magic (widget-create-child-and-convert - widget 'custom-magic nil))) - (widget-put widget :custom-magic magic) - (push magic buttons)) + (unless (widget-get widget :inhibit-magic) + (let ((magic (widget-create-child-and-convert + widget 'custom-magic nil))) + (widget-put widget :custom-magic magic) + (push magic buttons))) (widget-put widget :buttons buttons) ;; Insert documentation. (widget-put widget :documentation-indent 3) @@ -3281,12 +3291,17 @@ Lisp sexp), or `mismatch' (should not happen); if nil, use the return value of `custom-face-default-form'. -:display-style, if non-nil, should be a symbol describing the - style of display to use. If the value is `concise', a more - concise interface is shown. - -:sample-indent, if non-nil, should be an integer; this is the -number of columns to which to indent the face sample." +:display-style, if non-nil, describes the style of display to + use. If the value is `concise', a neater interface is shown. + +:sample-indent, if non-nil, is the number of columns to which to + indent the face sample (an integer). + +:shown-value, if non-nil, is the face spec to display as the value + of the widget, instead of the current face spec. + +:inhibit-magic, if non-nil, inhibits creating the magic + custom-state widget." :sample-face 'custom-face-tag :help-echo "Set or reset this face." :documentation-property #'face-doc-string @@ -3429,14 +3444,19 @@ (indent-to-column sample-indent))) (push (widget-create-child-and-convert widget 'item - :format "[%{%t%}]" :sample-face symbol :tag "sample") + :format "[%{%t%}]" + :sample-face (let ((spec (widget-get widget :shown-value))) + (if spec (face-spec-choose spec) symbol)) + :tag "sample") buttons) + (insert "\n") + ;; Magic. - (insert "\n") - (let ((magic (widget-create-child-and-convert - widget 'custom-magic nil))) - (widget-put widget :custom-magic magic) - (push magic buttons)) + (unless (widget-get widget :inhibit-magic) + (let ((magic (widget-create-child-and-convert + widget 'custom-magic nil))) + (widget-put widget :custom-magic magic) + (push magic buttons))) ;; Update buttons. (widget-put widget :buttons buttons) @@ -3465,7 +3485,8 @@ (unless (widget-get widget :custom-form) (widget-put widget :custom-form custom-face-default-form)) - (let* ((spec (custom-face-get-current-spec symbol)) + (let* ((spec (or (widget-get widget :shown-value) + (custom-face-get-current-spec symbol))) (form (widget-get widget :custom-form)) (indent (widget-get widget :indent)) face-alist face-entry spec-default spec-match editor) === modified file 'lisp/cus-theme.el' --- lisp/cus-theme.el 2010-10-12 20:06:20 +0000 +++ lisp/cus-theme.el 2010-10-16 00:16:34 +0000 @@ -79,12 +79,14 @@ (defun customize-create-theme (&optional theme buffer) "Create or edit a custom theme. THEME, if non-nil, should be an existing theme to edit. -BUFFER, if non-nil, should be a buffer to use." +BUFFER, if non-nil, should be a buffer to use; the default is +named *Custom Theme*." (interactive) (switch-to-buffer (get-buffer-create (or buffer "*Custom Theme*"))) - ;; Save current faces (let ((inhibit-read-only t)) - (erase-buffer)) + (erase-buffer) + (dolist (ov (overlays-in (point-min) (point-max))) + (delete-overlay ov))) (custom-new-theme-mode) (make-local-variable 'custom-theme-name) (set (make-local-variable 'custom-theme--save-name) theme) @@ -121,50 +123,59 @@ (widget-create 'push-button :notify (function custom-theme-write) " Save Theme ") - ;; Face widgets - (widget-insert "\n\n Theme faces:\n") - (let (widget) - (dolist (face custom-theme--listed-faces) - (widget-insert " ") - (setq widget (widget-create 'custom-face - :documentation-shown t - :tag (custom-unlispify-tag-name face) - :value face - :display-style 'concise - :custom-state 'hidden - :sample-indent 34)) - (custom-magic-reset widget) - (push (cons face widget) custom-theme-faces))) - (insert " ") - (setq custom-theme-insert-face-marker (point-marker)) - (insert " ") - (widget-create 'push-button - :tag "Insert Additional Face" - :help-echo "Add another face to this theme." - :follow-link 'mouse-face - :button-face 'custom-link - :mouse-face 'highlight - :pressed-face 'highlight - :action (lambda (widget &optional event) - (call-interactively 'custom-theme-add-face))) - (widget-insert "\n\n Theme variables:\n ") - (setq custom-theme-insert-variable-marker (point-marker)) - (widget-insert ?\s) - (widget-create 'push-button - :tag "Insert Variable" - :help-echo "Add another variable to this theme." - :follow-link 'mouse-face - :button-face 'custom-link - :mouse-face 'highlight - :pressed-face 'highlight - :action (lambda (widget &optional event) - (call-interactively 'custom-theme-add-variable))) - (widget-insert ?\n) - (if theme - (custom-theme-merge-theme theme)) - (widget-setup) - (goto-char (point-min)) - (message "")) + + (let (vars values faces face-specs) + + ;; Load the theme settings. + (when theme + (load-theme theme t) + (dolist (setting (get theme 'theme-settings)) + (if (eq (car setting) 'theme-value) + (progn (push (nth 1 setting) vars) + (push (nth 3 setting) values)) + (push (nth 1 setting) faces) + (push (nth 3 setting) face-specs)))) + + ;; If THEME is non-nil, insert all of that theme's faces. + ;; Otherwise, insert those in `custom-theme--listed-faces'. + (widget-insert "\n\n Theme faces:\n ") + (if theme + (while faces + (custom-theme-add-face-1 (pop faces) (pop face-specs))) + (dolist (face custom-theme--listed-faces) + (custom-theme-add-face-1 face nil))) + (setq custom-theme-insert-face-marker (point-marker)) + (widget-insert " ") + (widget-create 'push-button + :tag "Insert Additional Face" + :help-echo "Add another face to this theme." + :follow-link 'mouse-face + :button-face 'custom-link + :mouse-face 'highlight + :pressed-face 'highlight + :action (lambda (widget &optional event) + (call-interactively 'custom-theme-add-face))) + + ;; If THEME is non-nil, insert all of that theme's variables. + (widget-insert "\n\n Theme variables:\n ") + (if theme + (while vars + (custom-theme-add-var-1 (pop vars) (pop values)))) + (setq custom-theme-insert-variable-marker (point-marker)) + (widget-insert " ") + (widget-create 'push-button + :tag "Insert Variable" + :help-echo "Add another variable to this theme." + :follow-link 'mouse-face + :button-face 'custom-link + :mouse-face 'highlight + :pressed-face 'highlight + :action (lambda (widget &optional event) + (call-interactively 'custom-theme-add-variable))) + (widget-insert ?\n) + (widget-setup) + (goto-char (point-min)) + (message ""))) (defun custom-theme-revert (ignore-auto noconfirm) (when (or noconfirm (y-or-n-p "Discard current changes? ")) @@ -172,177 +183,119 @@ ;;; Theme variables -(defun custom-theme-add-variable (symbol) - (interactive "vVariable name: ") - (cond ((assq symbol custom-theme-variables) - (message "%s is already in the theme" (symbol-name symbol))) - ((not (boundp symbol)) - (message "%s is not defined as a variable" (symbol-name symbol))) - ((eq symbol 'custom-enabled-themes) - (message "Custom theme cannot contain `custom-enabled-themes'")) - (t - (save-excursion - (goto-char custom-theme-insert-variable-marker) - (widget-insert " ") - (let ((widget (widget-create 'custom-variable - :tag (custom-unlispify-tag-name symbol) - :custom-level 0 - :action 'custom-theme-variable-action - :custom-state 'unknown - :value symbol))) - (push (cons symbol widget) custom-theme-variables) - (custom-magic-reset widget)) - (widget-insert " ") - (move-marker custom-theme-insert-variable-marker (point)) - (widget-setup))))) - -(defvar custom-theme-variable-menu - `(("Reset to Current" custom-redraw - (lambda (widget) - (and (boundp (widget-value widget)) - (memq (widget-get widget :custom-state) - '(themed modified changed))))) - ("Reset to Theme Value" custom-variable-reset-theme - (lambda (widget) - (let ((theme (intern (widget-value custom-theme-name))) - (symbol (widget-value widget)) - found) - (and (custom-theme-p theme) - (dolist (setting (get theme 'theme-settings) found) - (if (and (eq (cadr setting) symbol) - (eq (car setting) 'theme-value)) - (setq found t))))))) - ("---" ignore ignore) - ("Delete" custom-theme-delete-variable nil)) - "Alist of actions for the `custom-variable' widget in Custom Theme Mode. -See the documentation for `custom-variable'.") - -(defun custom-theme-variable-action (widget &optional event) - "Show the Custom Theme Mode menu for a `custom-variable' widget. -Optional EVENT is the location for the menu." - (let ((custom-variable-menu custom-theme-variable-menu)) - (custom-variable-action widget event))) - -(defun custom-variable-reset-theme (widget) - "Reset WIDGET to its value for the currently edited theme." - (let ((theme (intern (widget-value custom-theme-name))) - (symbol (widget-value widget)) - found) - (dolist (setting (get theme 'theme-settings)) - (if (and (eq (cadr setting) symbol) - (eq (car setting) 'theme-value)) - (setq found setting))) - (widget-value-set (car (widget-get widget :children)) - (nth 3 found))) - (widget-put widget :custom-state 'themed) - (custom-redraw-magic widget) - (widget-setup)) - -(defun custom-theme-delete-variable (widget) - (setq custom-theme-variables - (assq-delete-all (widget-value widget) custom-theme-variables)) - (widget-delete widget)) +(defun custom-theme-add-variable (var value) + "Add a widget for VAR (a symbol) to the *New Custom Theme* buffer. +VALUE should be a value to which to set the widget; when called +interactively, this defaults to the current value of VAR." + (interactive + (let ((v (read-variable "Variable name: "))) + (list v (symbol-value v)))) + (let ((var-and-widget (assq var custom-theme-faces))) + (cond ((null var-and-widget) + ;; If VAR is not yet in the buffer, add it. + (save-excursion + (goto-char custom-theme-insert-variable-marker) + (custom-theme-add-var-1 var value) + (move-marker custom-theme-insert-variable-marker (point)) + (widget-setup))) + ;; Otherwise, alter that var widget. + (t + (let ((widget (cdr var-and-widget))) + (widget-put widget :shown-value (list value)) + (custom-redraw widget)))))) + +(defun custom-theme-add-var-1 (symbol val) + (widget-insert " ") + (push (cons symbol + (widget-create 'custom-variable + :tag (custom-unlispify-tag-name symbol) + :value symbol + :shown-value (list val) + :notify 'ignore + :custom-level 0 + :custom-state 'hidden + :inhibit-magic t)) + custom-theme-variables) + (widget-insert " ")) ;;; Theme faces -(defun custom-theme-add-face (symbol) - (interactive (list (read-face-name "Face name" nil nil))) - (cond ((assq symbol custom-theme-faces) - (message "%s is already in the theme" (symbol-name symbol))) - ((not (facep symbol)) - (message "%s is not defined as a face" (symbol-name symbol))) - (t - (save-excursion - (goto-char custom-theme-insert-face-marker) - (widget-insert " ") - (let ((widget (widget-create 'custom-face - :tag (custom-unlispify-tag-name symbol) - :custom-level 0 - :action 'custom-theme-face-action - :custom-state 'unknown - :display-style 'concise - :sample-indent 34 - :value symbol))) - (push (cons symbol widget) custom-theme-faces) - (custom-magic-reset widget) - (widget-insert " ") +(defun custom-theme-add-face (face &optional spec) + "Add a widget for FACE (a symbol) to the *New Custom Theme* buffer. +SPEC, if non-nil, should be a face spec to which to set the widget." + (interactive (list (read-face-name "Face name" nil nil) nil)) + (unless (or (facep face) spec) + (error "`%s' has no face definition" face)) + (let ((face-and-widget (assq face custom-theme-faces))) + (cond ((null face-and-widget) + ;; If FACE is not yet in the buffer, add it. + (save-excursion + (goto-char custom-theme-insert-face-marker) + (custom-theme-add-face-1 face spec) (move-marker custom-theme-insert-face-marker (point)) - (widget-setup)))))) - -(defvar custom-theme-face-menu - `(("Reset to Theme Value" custom-face-reset-theme - (lambda (widget) - (let ((theme (intern (widget-value custom-theme-name))) - (symbol (widget-value widget)) - found) - (and (custom-theme-p theme) - (dolist (setting (get theme 'theme-settings) found) - (if (and (eq (cadr setting) symbol) - (eq (car setting) 'theme-face)) - (setq found t))))))) - ("---" ignore ignore) - ("Delete" custom-theme-delete-face nil)) - "Alist of actions for the `custom-variable' widget in Custom Theme Mode. -See the documentation for `custom-variable'.") - -(defun custom-theme-face-action (widget &optional event) - "Show the Custom Theme Mode menu for a `custom-face' widget. -Optional EVENT is the location for the menu." - (let ((custom-face-menu custom-theme-face-menu)) - (custom-face-action widget event))) - -(defun custom-face-reset-theme (widget) - "Reset WIDGET to its value for the currently edited theme." - (let ((theme (intern (widget-value custom-theme-name))) - (symbol (widget-value widget)) - found) - (dolist (setting (get theme 'theme-settings)) - (if (and (eq (cadr setting) symbol) - (eq (car setting) 'theme-face)) - (setq found setting))) - (widget-value-set (car (widget-get widget :children)) - (nth 3 found))) - (widget-put widget :custom-state 'themed) - (custom-redraw-magic widget) - (widget-setup)) - -(defun custom-theme-delete-face (widget) - (setq custom-theme-faces - (assq-delete-all (widget-value widget) custom-theme-faces)) - (widget-delete widget)) + (widget-setup))) + ;; Otherwise, if SPEC is supplied, alter that face widget. + (spec + (let ((widget (cdr face-and-widget))) + (widget-put widget :shown-value spec) + (custom-redraw widget))) + ((called-interactively-p 'interactive) + (error "`%s' is already present" face))))) + +(defun custom-theme-add-face-1 (symbol spec) + (widget-insert " ") + (push (cons symbol + (widget-create 'custom-face + :tag (custom-unlispify-tag-name symbol) + :documentation-shown t + :value symbol + :custom-state 'hidden + :display-style 'concise + :shown-value spec + :inhibit-magic t + :sample-indent 34)) + custom-theme-faces) + (widget-insert " ")) ;;; Reading and writing -(defun custom-theme-visit-theme () - (interactive) - (when (and (y-or-n-p "Discard current changes? ") - (progn (revert-buffer) t)) - (let ((theme (call-interactively 'custom-theme-merge-theme))) - (unless (eq theme 'user) - (widget-value-set custom-theme-name (symbol-name theme))) - (widget-value-set custom-theme-description - (or (get theme 'theme-documentation) - (format-time-string "Created %Y-%m-%d."))) - (widget-setup)))) +(defun custom-theme-visit-theme (theme) + "Load the custom theme THEME's settings into the current buffer." + (interactive + (list + (intern (completing-read "Find custom theme: " + (mapcar 'symbol-name + (custom-available-themes)))))) + (unless (custom-theme-name-valid-p theme) + (error "No valid theme named `%s'" theme)) + (cond ((not (eq major-mode 'custom-new-theme-mode)) + (customize-create-theme theme)) + ((y-or-n-p "Discard current changes? ") + (setq custom-theme--save-name theme) + (custom-theme-revert nil t)))) (defun custom-theme-merge-theme (theme) + "Merge the custom theme THEME's settings into the current buffer." (interactive (list (intern (completing-read "Merge custom theme: " (mapcar 'symbol-name (custom-available-themes)))))) - (unless (custom-theme-name-valid-p theme) - (error "Invalid theme name `%s'" theme)) - (load-theme theme) - (let ((settings (get theme 'theme-settings))) + (unless (eq theme 'user) + (unless (custom-theme-name-valid-p theme) + (error "Invalid theme name `%s'" theme)) + (load-theme theme t)) + (let ((settings (reverse (get theme 'theme-settings)))) (dolist (setting settings) - (if (eq (car setting) 'theme-value) - (custom-theme-add-variable (cadr setting)) - (custom-theme-add-face (cadr setting))))) - (disable-theme theme) + (funcall (if (eq (car setting) 'theme-value) + 'custom-theme-add-variable + 'custom-theme-add-face) + (nth 1 setting) + (nth 3 setting)))) theme) (defun custom-theme-write (&rest ignore) + "Write the current custom theme to its theme file." (interactive) (let* ((name (widget-value custom-theme-name)) (doc (widget-value custom-theme-description)) @@ -395,11 +348,12 @@ (princ "\n") (dolist (spec vars) (let* ((symbol (car spec)) - (child (car-safe (widget-get (cdr spec) :children))) + (widget (cdr spec)) + (child (car-safe (widget-get widget :children))) (value (if child (widget-value child) - ;; For hidden widgets, use the standard value - (get symbol 'standard-value)))) + ;; Child is null if the widget is closed (hidden). + (car (widget-get widget :shown-value))))) (when (boundp symbol) (unless (bolp) (princ "\n")) @@ -426,30 +380,18 @@ (dolist (spec faces) (let* ((symbol (car spec)) (widget (cdr spec)) - (child (car-safe (widget-get widget :children))) - (state (if child - (widget-get widget :custom-state) - (custom-face-state symbol))) (value - (cond ((eq state 'standard) - nil) ; do nothing - (child - (custom-face-widget-to-spec widget)) - (t - ;; Widget is closed (hidden), but the face has - ;; a non-standard value. Try to extract that - ;; value and save it. - (custom-face-get-current-spec symbol))))) + (if (car-safe (widget-get widget :children)) + (custom-face-widget-to-spec widget) + ;; Child is null if the widget is closed (hidden). + (widget-get widget :shown-value)))) (when (and (facep symbol) value) - (if (bolp) - (princ " '(") - (princ "\n '(")) + (princ (if (bolp) " '(" "\n '(")) (prin1 symbol) (princ " ") (prin1 value) (princ ")")))) - (if (bolp) - (princ " ")) + (if (bolp) (princ " ")) (princ ")") (unless (looking-at "\n") (princ "\n"))))) @@ -587,6 +529,19 @@ :action (lambda (widget &rest ignore) (describe-variable 'load-path))) (widget-insert "'.\n\n") + + ;; If the user has made customizations, display a warning and + ;; provide buttons to disable or convert them. + (let ((user-settings (get 'user 'theme-settings))) + (unless (or (null user-settings) + (and (null (cdr user-settings)) + (eq (caar user-settings) 'theme-value) + (eq (cadr (car user-settings)) 'custom-enabled-themes))) + (widget-insert "Note: Your custom settings take precedence over theme settings.\n\n") + ;; FIXME: Provide some way to painlessly disable or migrate + ;; these settings. + )) + (widget-create 'push-button :tag " Save Theme Settings " :help-echo "Save the selected themes for future sessions." ------------------------------------------------------------ revno: 101977 [merge] committer: Eli Zaretskii branch nick: trunk timestamp: Fri 2010-10-15 20:45:12 +0200 message: Fix the MSDOS build broken by last revisions. msdos/sed1v2.inp: Use $(..) instead of ${..} in all edit commands. Needed because of changes in revno 101897. msdos/sed6.inp (mkinfodir): Edit to avoid Unix shell-isms. Needed because of changes in revno 101876. src/unexcoff.c (make_hdr): Fix prototype according to changes in revno 101757. diff: === modified file 'msdos/ChangeLog' --- msdos/ChangeLog 2010-10-10 15:35:04 +0000 +++ msdos/ChangeLog 2010-10-15 18:42:54 +0000 @@ -1,3 +1,11 @@ +2010-10-15 Eli Zaretskii + + * sed1v2.inp: Use $(..) instead of ${..} in all edit commands. + Needed because of changes in revno 101897. + + * sed6.inp (mkinfodir): Edit to avoid Unix shell-isms. Needed + because of changes in revno 101876. + 2010-10-10 Dan Nicolaescu * sed1v2.inp (PROFILING_LDFLAGS): === modified file 'msdos/sed1v2.inp' --- msdos/sed1v2.inp 2010-10-10 15:35:04 +0000 +++ msdos/sed1v2.inp 2010-10-15 18:42:54 +0000 @@ -131,12 +131,12 @@ /^M_FILE *=/s!@[^@\n]*@!m/intel386.h! /^S_FILE *=/s!@[^@\n]*@!s/msdos.h! /^@SET_MAKE@$/s/@SET_MAKE@// -/^.\${libsrc}make-docfile.*>/s!make-docfile!make-docfile -o ../etc/DOC! -/^.\${libsrc}make-doc/s!>.*$!! +/^.\$(libsrc)\/make-docfile.*>/s!make-docfile!make-docfile -o ../etc/DOC! +/^.\$(libsrc)\/make-doc/s!>.*$!! /^[ ]*$/d /^ if test -f/,/^ fi$/c\ command.com /c if exist .gdbinit rm -f _gdbinit -/^ if test "\${CANNOT_DUMP}" =/,/^ else /d +/^ if test "\$(CANNOT_DUMP)" =/,/^ else /d /^ fi/d /^ LC_ALL=C \$(RUN_TEMACS)/i\ stubedit temacs.exe minstack=1024k @@ -152,7 +152,7 @@ /^ if test -f/,/^ fi$/c\ command.com /c if exist .gdbinit rm -f _gdbinit /^ #/d -/^ cd.*make-docfile/s!$!; cd ${dot}${dot}/src! +/^ cd.*make-docfile/s!$!; cd ../src! /^ @: /d /^ -\{0,1\} *ln -/s/ln -f/cp -pf/ /^[ ]touch /s/touch/djecho $@ >/ === modified file 'msdos/sed6.inp' --- msdos/sed6.inp 2010-01-13 08:35:10 +0000 +++ msdos/sed6.inp 2010-10-15 18:42:54 +0000 @@ -43,4 +43,6 @@ s/^ for file in $(INFO_TARGETS)\; do rm -f.*$/ rm -f $(INFO_TARGETS)/ } +/^mkinfodir *=/s| @.*$|@command.com /c if not exist ..\\..\\info\\emacs mkdir ..\\..\\info| + # arch-tag: defe1001-f35a-47f7-9635-3f5d33ee5e97 === modified file 'src/ChangeLog' --- src/ChangeLog 2010-10-15 10:10:20 +0000 +++ src/ChangeLog 2010-10-15 18:42:54 +0000 @@ -1,5 +1,8 @@ 2010-10-15 Eli Zaretskii + * unexcoff.c (make_hdr): Fix prototype according to changes in + revno 101757. + * image.c (tiff_load): Cast 3rd argument to avoid compiler warning. 2010-10-15 Tassilo Horn === modified file 'src/unexcoff.c' --- src/unexcoff.c 2010-10-04 17:22:57 +0000 +++ src/unexcoff.c 2010-10-15 18:42:54 +0000 @@ -141,8 +141,7 @@ error (msg, a1, a2); } -static int make_hdr (int, int, unsigned, unsigned, unsigned, - const char *, const char *); +static int make_hdr (int, int, const char *, const char *); static int copy_text_and_data (int, int); static int copy_sym (int, int, const char *, const char *); static void mark_x (const char *); ------------------------------------------------------------ revno: 101976 committer: Eli Zaretskii branch nick: trunk timestamp: Fri 2010-10-15 18:44:01 +0200 message: Fix last change in etc/NEWS. diff: === modified file 'etc/NEWS' --- etc/NEWS 2010-10-15 11:33:17 +0000 +++ etc/NEWS 2010-10-15 16:44:01 +0000 @@ -230,9 +230,9 @@ The default handling of clipboard and primary selections has been changed to conform with other X applications. -The new behavior is that by default Emacs does not put text into the -clipboard, and does not add it to kill-ring, merely because the text -was selected. Only commands that kill text or copy it to the +The new behavior is that by default Emacs does not put selected text +into the clipboard, and does not add it to kill-ring, merely because +the text was selected. Only commands that kill text or copy it to the kill-ring (C-w, M-w, C-k, etc.) put the killed text into the clipboard. Selected text is put into the primary selection (on systems, such as X, that support the primary selection separately from @@ -240,14 +240,15 @@ Similarly, Emacs by default does not retrieve text from the clipboard when the mouse (e.g., mouse-2) is used for pasting text selected in -another application. Text from the clipboard is retrieved only by -C-y, M-y and other commands that yank text from the kill-ring. Mouse -commands that paste text retrieve text from the primary selection, on -systems that support it separately from the clipboard. +another application. Mouse commands that paste text retrieve text +from the primary selection, on systems that support it separately from +the clipboard. Text from the clipboard is retrieved only by C-y, M-y +and other commands that yank text from the kill-ring. In other words, the default behavior is that mouse gestures that -select and paste text work with the primary selection, while keyboard -commands that kill/copy and paste text work with the clipboard. +select and paste text work with the primary selection (on X), while +keyboard commands that kill/copy and paste text work with the +clipboard. This change also means that the "Copy", "Cut", and "Paste" items of the menu-bar "Edit" menu are now exactly equivalent to, respectively @@ -255,9 +256,9 @@ To get back the previous behavior, whereby mouse gestures set the clipboard and retrieve text from there, customize the variables -`mouse-drag-copy-region' and (on X only) `x-select-enable-primary'. -If you don't want Emacs to put the text into the clipboard, only to -the primary selection, additionally customize +`mouse-drag-copy-region' and (on X only) `x-select-enable-primary' to +non-nil values. If you don't want Emacs to put the text into the +clipboard, only to the primary selection, additionally customize `x-select-enable-clipboard' to nil. These changes in the default behavior are reflected in the default @@ -272,7 +273,7 @@ *** `mouse-2' is now bound to `mouse-yank-primary'. Previously, it was bound to `mouse-yank-at-click' (which is now -unbound by default. +unbound by default). *** `x-select-enable-clipboard' now defaults to t on all platforms. Thus, killing and yanking now use the clipboard (in addition to the ------------------------------------------------------------ revno: 101975 committer: Michael Albinus branch nick: trunk timestamp: Fri 2010-10-15 14:07:38 +0200 message: * net/tramp-sh.el (tramp-open-connection-setup-interactive-shell): Suppress expansion of tabs to spaces. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-10-14 14:32:27 +0000 +++ lisp/ChangeLog 2010-10-15 12:07:38 +0000 @@ -1,3 +1,8 @@ +2010-10-15 Michael Albinus + + * net/tramp-sh.el (tramp-open-connection-setup-interactive-shell): + Suppress expansion of tabs to spaces. + 2010-10-14 Kenichi Handa * mail/rmail.el (rmail-show-message-1): Catch an error of === modified file 'lisp/net/tramp-sh.el' --- lisp/net/tramp-sh.el 2010-10-06 12:03:29 +0000 +++ lisp/net/tramp-sh.el 2010-10-15 12:07:38 +0000 @@ -3709,9 +3709,7 @@ ;; because we're running on a non-MULE Emacs. Let's try ;; stty, instead. (tramp-send-command vec "stty -onlcr" t)))) - ;; Dump stty settings in the traces. - (when (>= tramp-verbose 9) - (tramp-send-command vec "stty -a" t)) + (tramp-send-command vec "set +o vi +o emacs" t) ;; Check whether the output of "uname -sr" has been changed. If @@ -3782,12 +3780,21 @@ (when (string-match "^IRIX64" (tramp-get-connection-property vec "uname" "")) (tramp-send-command vec "set +H" t)) + ;; On BSD-like systems, ?\t is expanded to spaces. Suppress this. + (when (string-match "BSD\\|Darwin" + (tramp-get-connection-property vec "uname" "")) + (tramp-send-command vec "stty -oxtabs" t)) + ;; Set `remote-tty' process property. (ignore-errors (let ((tty (tramp-send-command-and-read vec "echo \\\"`tty`\\\""))) (unless (zerop (length tty)) (tramp-compat-process-put proc 'remote-tty tty)))) + ;; Dump stty settings in the traces. + (when (>= tramp-verbose 9) + (tramp-send-command vec "stty -a" t)) + ;; Set the environment. (tramp-message vec 5 "Setting default environment") ------------------------------------------------------------ revno: 101974 committer: Eli Zaretskii branch nick: trunk timestamp: Fri 2010-10-15 13:33:17 +0200 message: Fix bug #7196. NEWS: Expand the entry about "Selection changes". diff: === modified file 'etc/NEWS' --- etc/NEWS 2010-10-15 11:00:57 +0000 +++ etc/NEWS 2010-10-15 11:33:17 +0000 @@ -230,22 +230,62 @@ The default handling of clipboard and primary selections has been changed to conform with other X applications. +The new behavior is that by default Emacs does not put text into the +clipboard, and does not add it to kill-ring, merely because the text +was selected. Only commands that kill text or copy it to the +kill-ring (C-w, M-w, C-k, etc.) put the killed text into the +clipboard. Selected text is put into the primary selection (on +systems, such as X, that support the primary selection separately from +the clipboard). + +Similarly, Emacs by default does not retrieve text from the clipboard +when the mouse (e.g., mouse-2) is used for pasting text selected in +another application. Text from the clipboard is retrieved only by +C-y, M-y and other commands that yank text from the kill-ring. Mouse +commands that paste text retrieve text from the primary selection, on +systems that support it separately from the clipboard. + +In other words, the default behavior is that mouse gestures that +select and paste text work with the primary selection, while keyboard +commands that kill/copy and paste text work with the clipboard. + +This change also means that the "Copy", "Cut", and "Paste" items of +the menu-bar "Edit" menu are now exactly equivalent to, respectively +M-w, C-w, and C-y. + +To get back the previous behavior, whereby mouse gestures set the +clipboard and retrieve text from there, customize the variables +`mouse-drag-copy-region' and (on X only) `x-select-enable-primary'. +If you don't want Emacs to put the text into the clipboard, only to +the primary selection, additionally customize +`x-select-enable-clipboard' to nil. + +These changes in the default behavior are reflected in the default +values of several variables: + *** `select-active-regions' now defaults to t, so active regions set -the primary selection. +the primary selection. It was nil in previous versions. It also accepts a new value, `only', which means to only set the primary selection for temporarily active regions (usually made by mouse-dragging or shift-selection). *** `mouse-2' is now bound to `mouse-yank-primary'. +Previously, it was bound to `mouse-yank-at-click' (which is now +unbound by default. -*** `x-select-enable-clipboard' now defaults to t. +*** `x-select-enable-clipboard' now defaults to t on all platforms. Thus, killing and yanking now use the clipboard (in addition to the -kill ring). +kill ring). Note that this variable was already non-nil by default on +MS-Windows, which does not support the primary selection between +applications. *** `x-select-enable-primary' now defaults to nil. +This variable exists only on X; its default value was t in previous +versions. *** `mouse-drag-copy-region' now defaults to nil. +Its previous default value was t. *** Support for X cut buffers has been removed. ------------------------------------------------------------ revno: 101973 committer: Eli Zaretskii branch nick: trunk timestamp: Fri 2010-10-15 13:00:57 +0200 message: Fix bug #7195 with NEWS entry for of select-active-region'. diff: === modified file 'etc/NEWS' --- etc/NEWS 2010-10-13 14:50:06 +0000 +++ etc/NEWS 2010-10-15 11:00:57 +0000 @@ -233,7 +233,7 @@ *** `select-active-regions' now defaults to t, so active regions set the primary selection. -It also accepts a new value, `lazy', which means to only set the +It also accepts a new value, `only', which means to only set the primary selection for temporarily active regions (usually made by mouse-dragging or shift-selection). ------------------------------------------------------------ revno: 101972 author: Juanma Barranquero committer: Eli Zaretskii branch nick: trunk timestamp: Fri 2010-10-15 12:49:07 +0200 message: Document changes made in revno 101949. os.texi (Dynamic Libraries): New node, with slightly modified text deleted from "Image Formats". (System Interface): Add @menu entry for "Dynamic Libraries". display.texi (Image Formats): Remove description of image-library-alist. (Renamed in revno 101949.) diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2010-10-12 03:52:07 +0000 +++ doc/lispref/ChangeLog 2010-10-15 10:49:07 +0000 @@ -1,3 +1,12 @@ +2010-10-15 Eli Zaretskii + + * os.texi (Dynamic Libraries): New node, with slightly modified + text deleted from "Image Formats". + (System Interface): Add @menu entry for "Dynamic Libraries". + + * display.texi (Image Formats): Remove description of + image-library-alist. (Renamed in revno 101949.) + 2010-10-12 Glenn Morris * book-spine.texinfo: Rename to book-spine.texi. === modified file 'doc/lispref/display.texi' --- doc/lispref/display.texi 2010-09-09 02:18:38 +0000 +++ doc/lispref/display.texi 2010-10-15 10:49:07 +0000 @@ -4055,10 +4055,12 @@ Emacs can display a number of different image formats; some of them are supported only if particular support libraries are installed on -your machine. In some environments, Emacs can load image -libraries on demand; if so, the variable @code{image-library-alist} -can be used to modify the set of known names for these dynamic -libraries (though it is not possible to add new image formats). +your machine. In some environments, Emacs can load support libraries +on demand; if so, the variable @code{dynamic-library-alist} +(@pxref{Dynamic Libraries}) can be used to modify the set of known +names for these dynamic libraries (though it is not possible to add +new image formats). Note that image types @code{pbm} and @code{xbm} +do not depend on external libraries and are always available in Emacs. The supported image formats include XBM, XPM (this requires the libraries @code{libXpm} version 3.4k and @code{libz}), GIF (requiring @@ -4082,24 +4084,6 @@ @code{image-type-available-p}. @end defvar -@defvar image-library-alist -This in an alist of image types vs external libraries needed to -display them. - -Each element is a list @code{(@var{image-type} @var{library}...)}, -where the car is a supported image format from @code{image-types}, and -the rest are strings giving alternate filenames for the corresponding -external libraries to load. - -Emacs tries to load the libraries in the order they appear on the -list; if none is loaded, the running session of Emacs won't support -the image type. @code{pbm} and @code{xbm} don't need to be listed; -they're always supported. - -This variable is ignored if the image libraries are statically linked -into Emacs. -@end defvar - @defun image-type-available-p type This function returns non-@code{nil} if image type @var{type} is available, i.e., if images of this type can be loaded and displayed in === modified file 'doc/lispref/os.texi' --- doc/lispref/os.texi 2010-10-02 02:30:11 +0000 +++ doc/lispref/os.texi 2010-10-15 10:49:07 +0000 @@ -37,6 +37,7 @@ * X11 Keysyms:: Operating on key symbols for X Windows. * Batch Mode:: Running Emacs without terminal interaction. * Session Management:: Saving and restoring state with X Session Management. +* Dynamic Libraries:: On-demand loading of support libraries. @end menu @node Starting Up @@ -2186,6 +2187,57 @@ @end group @end example +@node Dynamic Libraries +@section Dynamically Loaded Libraries +@cindex dynamic libraries + + A @dfn{dynamically loaded library} is a library that is loaded on +demand, when its facilities are first needed. Emacs supports such +on-demand loading of support libraries for some of its features. + +@defvar dynamic-library-alist +This is an alist of dynamic libraries and external library files +implementing them. + +Each element is a list of the form +@w{@code{(@var{library} @var{files}@dots{})}}, where the @code{car} is +a symbol representing a supported external library, and the rest are +strings giving alternate filenames for that library. + +Emacs tries to load the library from the files in the order they +appear in the list; if none is found, the running session of Emacs +won't have access to that library, and the features that depend on the +library will be unavailable. + +Image support on some platforms uses this facility. Here's an example +of setting this variable for supporting images on MS-Windows: + +@lisp +(setq dynamic-library-alist + '((xpm "libxpm.dll" "xpm4.dll" "libXpm-nox4.dll") + (png "libpng12d.dll" "libpng12.dll" "libpng.dll" + "libpng13d.dll" "libpng13.dll") + (jpeg "jpeg62.dll" "libjpeg.dll" "jpeg-62.dll" "jpeg.dll") + (tiff "libtiff3.dll" "libtiff.dll") + (gif "giflib4.dll" "libungif4.dll" "libungif.dll") + (svg "librsvg-2-2.dll") + (gdk-pixbuf "libgdk_pixbuf-2.0-0.dll") + (glib "libglib-2.0-0.dll") + (gobject "libgobject-2.0-0.dll"))) +@end lisp + +Note that image types @code{pbm} and @code{xbm} do not need entries in +this variable because they do not depend on external libraries and are +always available in Emacs. + +Also note that this variable is not meant to be a generic facility for +accessing external libraries; only those already known by Emacs can +be loaded through it. + +This variable is ignored if the given @var{library} is statically +linked into Emacs. +@end defvar + @ignore arch-tag: 8378814a-30d7-467c-9615-74a80b9988a7 @end ignore ------------------------------------------------------------ revno: 101971 committer: Katsumi Yamaoka branch nick: trunk timestamp: Fri 2010-10-15 10:24:10 +0000 message: shr.el (shr-tag-img): Ignore images with no data. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2010-10-15 08:10:56 +0000 +++ lisp/gnus/ChangeLog 2010-10-15 10:24:10 +0000 @@ -1,3 +1,7 @@ +2010-10-15 Lars Magne Ingebrigtsen + + * shr.el (shr-tag-img): Ignore images with no data. + 2010-10-15 Katsumi Yamaoka * shr.el (shr-generic): Remove trailing space. === modified file 'lisp/gnus/shr.el' --- lisp/gnus/shr.el 2010-10-15 08:10:56 +0000 +++ lisp/gnus/shr.el 2010-10-15 10:24:10 +0000 @@ -421,64 +421,65 @@ (browse-url-url-encode-chars url "[)$ ]")) (defun shr-tag-img (cont) - (when (and (> (current-column) 0) - (not (eq shr-state 'image))) - (insert "\n")) - (let ((alt (cdr (assq :alt cont))) - (url (cdr (assq :src cont))) - (width (cdr (assq :width cont)))) - ;; Only respect align if width specified. - (when width - ;; Check that width is not larger than max width, otherwise ignore - ;; align - (let ((max-width (* shr-width (frame-char-width))) - (width (string-to-number width))) - (when (< width max-width) - (let ((align (cdr (assq :align cont)))) - (cond - ((string= align "right") - (insert (propertize - " " 'display - `(space . (:align-to - ,(list (- max-width width))))))) - ((string= align "center") - (insert (propertize - " " 'display - `(space . (:balign-to - ,(list (- (/ max-width 2) width)))))))))))) - (let ((start (point-marker))) - (when (zerop (length alt)) - (setq alt "[img]")) - (cond - ((and (not shr-inhibit-images) - (string-match "\\`cid:" url)) - (let ((url (substring url (match-end 0))) - image) - (if (or (not shr-content-function) - (not (setq image (funcall shr-content-function url)))) - (insert alt) - (shr-put-image image (point) alt)))) - ((or shr-inhibit-images - (and shr-blocked-images - (string-match shr-blocked-images url))) - (setq shr-start (point)) - (let ((shr-state 'space)) - (if (> (length alt) 8) - (shr-insert (substring alt 0 8)) - (shr-insert alt)))) - ((url-is-cached (shr-encode-url url)) - (shr-put-image (shr-get-image-data url) (point) alt)) - (t - (insert alt) - (ignore-errors - (url-retrieve (shr-encode-url url) 'shr-image-fetched - (list (current-buffer) start (point-marker)) - t)))) - (insert " ") - (put-text-property start (point) 'keymap shr-map) - (put-text-property start (point) 'shr-alt alt) - (put-text-property start (point) 'shr-image url) - (setq shr-state 'image)))) + (when cont + (when (and (> (current-column) 0) + (not (eq shr-state 'image))) + (insert "\n")) + (let ((alt (cdr (assq :alt cont))) + (url (cdr (assq :src cont))) + (width (cdr (assq :width cont)))) + ;; Only respect align if width specified. + (when width + ;; Check that width is not larger than max width, otherwise ignore + ;; align + (let ((max-width (* shr-width (frame-char-width))) + (width (string-to-number width))) + (when (< width max-width) + (let ((align (cdr (assq :align cont)))) + (cond + ((string= align "right") + (insert (propertize + " " 'display + `(space . (:align-to + ,(list (- max-width width))))))) + ((string= align "center") + (insert (propertize + " " 'display + `(space . (:balign-to + ,(list (- (/ max-width 2) width)))))))))))) + (let ((start (point-marker))) + (when (zerop (length alt)) + (setq alt "[img]")) + (cond + ((and (not shr-inhibit-images) + (string-match "\\`cid:" url)) + (let ((url (substring url (match-end 0))) + image) + (if (or (not shr-content-function) + (not (setq image (funcall shr-content-function url)))) + (insert alt) + (shr-put-image image (point) alt)))) + ((or shr-inhibit-images + (and shr-blocked-images + (string-match shr-blocked-images url))) + (setq shr-start (point)) + (let ((shr-state 'space)) + (if (> (length alt) 8) + (shr-insert (substring alt 0 8)) + (shr-insert alt)))) + ((url-is-cached (shr-encode-url url)) + (shr-put-image (shr-get-image-data url) (point) alt)) + (t + (insert alt) + (ignore-errors + (url-retrieve (shr-encode-url url) 'shr-image-fetched + (list (current-buffer) start (point-marker)) + t)))) + (insert " ") + (put-text-property start (point) 'keymap shr-map) + (put-text-property start (point) 'shr-alt alt) + (put-text-property start (point) 'shr-image url) + (setq shr-state 'image))))) (defun shr-tag-pre (cont) (let ((shr-folding-mode 'none)) ------------------------------------------------------------ revno: 101970 committer: Eli Zaretskii branch nick: trunk timestamp: Fri 2010-10-15 12:21:03 +0200 message: auth.texi (GnuPG and EasyPG Assistant Configuration): Fix markup. diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2010-10-13 22:21:20 +0000 +++ doc/misc/ChangeLog 2010-10-15 10:21:03 +0000 @@ -1,3 +1,8 @@ +2010-10-15 Eli Zaretskii + + * auth.texi (GnuPG and EasyPG Assistant Configuration): Fix last + change. + 2010-10-13 Lars Magne Ingebrigtsen * auth.texi (GnuPG and EasyPG Assistant Configuration): Fix up the === modified file 'doc/misc/auth.texi' --- doc/misc/auth.texi 2010-10-13 22:21:20 +0000 +++ doc/misc/auth.texi 2010-10-15 10:21:03 +0000 @@ -281,7 +281,7 @@ If you want your GnuPG passwords to be cached, set up @code{gpg-agent} or EasyPG Assitant -@xref{Caching Passphrases, , Caching Passphrases, epa} +(@pxref{Caching Passphrases, , Caching Passphrases, epa}). To quick start, here are some questions: ------------------------------------------------------------ revno: 101969 committer: Eli Zaretskii branch nick: trunk timestamp: Fri 2010-10-15 12:10:20 +0200 message: image.c (tiff_load): Cast 3rd argument to avoid compiler warning. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-10-15 07:46:47 +0000 +++ src/ChangeLog 2010-10-15 10:10:20 +0000 @@ -1,3 +1,7 @@ +2010-10-15 Eli Zaretskii + + * image.c (tiff_load): Cast 3rd argument to avoid compiler warning. + 2010-10-15 Tassilo Horn * Makefile.in (really-oldXMenu): Fix typo in variable name that === modified file 'src/image.c' --- src/image.c 2010-10-13 23:48:09 +0000 +++ src/image.c 2010-10-15 10:10:20 +0000 @@ -6793,8 +6793,9 @@ memsrc.len = SBYTES (specified_data); memsrc.index = 0; - /* Casting return value avoids a GCC warning on W32. */ - tiff = (TIFF *)fn_TIFFClientOpen ("memory_source", "r", &memsrc, + /* Casting arguments return value avoids a GCC warning on W32. */ + tiff = (TIFF *)fn_TIFFClientOpen ("memory_source", "r", + (thandle_t) &memsrc, (TIFFReadWriteProc) tiff_read_from_memory, (TIFFReadWriteProc) tiff_write_from_memory, tiff_seek_in_memory, ------------------------------------------------------------ revno: 101968 committer: Katsumi Yamaoka branch nick: trunk timestamp: Fri 2010-10-15 08:10:56 +0000 message: shr.el (shr-insert): Remove space inserted before or after a breakable character or at the beginning or the end of a line. shr.el (shr-find-fill-point): Do kinsoku; find the second best point or give it up if there's no breakable point. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2010-10-14 22:39:54 +0000 +++ lisp/gnus/ChangeLog 2010-10-15 08:10:56 +0000 @@ -1,3 +1,11 @@ +2010-10-15 Katsumi Yamaoka + + * shr.el (shr-generic): Remove trailing space. + (shr-insert): Remove space inserted before or after a breakable + character or at the beginning or the end of a line. + (shr-find-fill-point): Do kinsoku; find the second best point or give + it up if there's no breakable point. + 2010-10-14 Lars Magne Ingebrigtsen * nnimap.el (nnimap-open-connection): Message when opening connection === modified file 'lisp/gnus/shr.el' --- lisp/gnus/shr.el 2010-10-14 22:39:54 +0000 +++ lisp/gnus/shr.el 2010-10-15 08:10:56 +0000 @@ -218,20 +218,35 @@ ;; starts. (unless shr-start (setq shr-start (point))) + ;; No space is needed before or after a breakable character or + ;; at the beginning of a line. + (when (and (eq (preceding-char) ? ) + (or (= (line-beginning-position) (1- (point))) + (aref fill-find-break-point-function-table + (char-after (- (point) 2))) + (aref fill-find-break-point-function-table + (aref elem 0)))) + (delete-char -1)) (insert elem) (while (> (current-column) shr-width) - (if (not (shr-find-fill-point)) - (insert "\n") - (delete-char 1) - (insert "\n") + (unless (prog1 + (shr-find-fill-point) + (when (eq (preceding-char) ? ) + (delete-char -1)) + (insert "\n")) (put-text-property (1- (point)) (point) 'shr-break t) - (when (> shr-indentation 0) - (shr-indent)) - (end-of-line))) + ;; No space is needed at the beginning of a line. + (if (eq (following-char) ? ) + (delete-char 1))) + (when (> shr-indentation 0) + (shr-indent)) + (end-of-line)) (insert " ")) (unless (string-match "[ \t\n]\\'" text) (delete-char -1)))))) +(eval-and-compile (autoload 'kinsoku-longer "kinsoku")) + (defun shr-find-fill-point () (let ((found nil)) (while (and (not found) @@ -240,10 +255,26 @@ (aref fill-find-break-point-function-table (preceding-char))) (<= (current-column) shr-width)) - (setq found (point))) - (backward-char 1)) - (or found - (end-of-line)))) + (setq found t)) + (backward-char 1) + (when (bolp) + ;; There's no breakable point, so we give it up. + (end-of-line) + (while (aref fill-find-break-point-function-table + (preceding-char)) + (backward-char 1)) + (setq found 'failed))) + (cond ((eq found t) + ;; Don't put kinsoku-bol characters at the beginning of a line. + (or (eobp) + (kinsoku-longer) + (not (aref fill-find-break-point-function-table + (following-char))) + (forward-char 1))) + (found t) + (t + (end-of-line) + nil)))) (defun shr-ensure-newline () (unless (zerop (current-column)) ------------------------------------------------------------ revno: 101967 committer: Tassilo Horn branch nick: trunk timestamp: Fri 2010-10-15 09:46:47 +0200 message: Again, fix a typo in really-oldXMenu target diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-10-15 07:34:26 +0000 +++ src/ChangeLog 2010-10-15 07:46:47 +0000 @@ -2,6 +2,7 @@ * Makefile.in (really-oldXMenu): Fix typo in variable name that made building the X menu fail. + (really-oldXMenu): Fix my previous fix. 2010-10-14 Damyan Pepper === modified file 'src/Makefile.in' --- src/Makefile.in 2010-10-15 07:34:26 +0000 +++ src/Makefile.in 2010-10-15 07:46:47 +0000 @@ -660,7 +660,7 @@ .PHONY: really-lwlib really-oldXMenu: - cd $(oldxMenudir); $(MAKE) $(MFLAGS) \ + cd $(oldXMenudir); $(MAKE) $(MFLAGS) \ CC='$(CC)' CFLAGS='$(CFLAGS)' MAKE='$(MAKE)' @true # make -t should not create really-oldXMenu. .PHONY: really-oldXMenu ------------------------------------------------------------ revno: 101966 committer: Tassilo Horn branch nick: trunk timestamp: Fri 2010-10-15 09:34:26 +0200 message: Fix variable name typo in really-oldXMenu target. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-10-14 14:32:27 +0000 +++ src/ChangeLog 2010-10-15 07:34:26 +0000 @@ -1,3 +1,8 @@ +2010-10-15 Tassilo Horn + + * Makefile.in (really-oldXMenu): Fix typo in variable name that + made building the X menu fail. + 2010-10-14 Damyan Pepper Fix handling of font properties on Windows (bug#6303). === modified file 'src/Makefile.in' --- src/Makefile.in 2010-10-12 14:37:33 +0000 +++ src/Makefile.in 2010-10-15 07:34:26 +0000 @@ -660,7 +660,7 @@ .PHONY: really-lwlib really-oldXMenu: - cd $(oldxmenudir); $(MAKE) $(MFLAGS) \ + cd $(oldxMenudir); $(MAKE) $(MFLAGS) \ CC='$(CC)' CFLAGS='$(CFLAGS)' MAKE='$(MAKE)' @true # make -t should not create really-oldXMenu. .PHONY: really-oldXMenu ------------------------------------------------------------ revno: 101965 author: Gnus developers committer: Katsumi Yamaoka branch nick: trunk timestamp: Thu 2010-10-14 22:39:54 +0000 message: Merge changes made in Gnus trunk. shr.el: Fix defcustom type (char -> character). nnimap.el (nnimap-open-connection): Remove %s from openssl incantation, which is no longer valid. gnus-sum.el (gnus-summary-refer-thread): Implement a version that uses *-request-thread. gnus-int.el (gnus-request-thread): New back end function. nnimap.el (nnimap-request-thread): New back end function. shr.el: Indent. gnus-art.el, shr.el: Have shr switch buffer truncation on if there are big tables. (nnimap-open-connection): Message when opening connection for debugging purposes. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2010-10-14 14:32:27 +0000 +++ lisp/gnus/ChangeLog 2010-10-14 22:39:54 +0000 @@ -1,5 +1,31 @@ 2010-10-14 Lars Magne Ingebrigtsen + * nnimap.el (nnimap-open-connection): Message when opening connection + for debugging purposes. + + * gnus-art.el (gnus-article-setup-buffer): Set article mode truncation + on every setup buffer call to allow this to change from article to + article. + + * shr.el (shr-tag-table): Experimental feature: Truncate lines in + buffers where we have a wide table. + +2010-10-14 Andrew Cohen + + * gnus-sum.el (gnus-summary-refer-thread): Implement a version that + uses *-request-thread. + +2010-10-14 Lars Magne Ingebrigtsen + + * nnimap.el (nnimap-open-connection): Remove %s from openssl + incantation, which is no longer valid. + +2010-10-14 Julien Danjou + + * shr.el: Fix defcustom type (char -> character). + +2010-10-14 Lars Magne Ingebrigtsen + * nnimap.el (nnimap-open-connection): tls-program should be a list of programs. === modified file 'lisp/gnus/gnus-art.el' --- lisp/gnus/gnus-art.el 2010-10-11 23:29:33 +0000 +++ lisp/gnus/gnus-art.el 2010-10-14 22:39:54 +0000 @@ -4474,7 +4474,6 @@ ;; face. (set (make-local-variable 'nobreak-char-display) nil) (setq cursor-in-non-selected-windows nil) - (setq truncate-lines gnus-article-truncate-lines) (gnus-set-default-directory) (buffer-disable-undo) (setq buffer-read-only t @@ -4534,9 +4533,11 @@ (setq gnus-button-marker-list nil) (unless (eq major-mode 'gnus-article-mode) (gnus-article-mode)) + (setq truncate-lines gnus-article-truncate-lines) (current-buffer)) (with-current-buffer (gnus-get-buffer-create name) (gnus-article-mode) + (setq truncate-lines gnus-article-truncate-lines) (make-local-variable 'gnus-summary-buffer) (setq gnus-summary-buffer (gnus-summary-buffer-name gnus-newsgroup-name)) === modified file 'lisp/gnus/gnus-int.el' --- lisp/gnus/gnus-int.el 2010-10-11 10:03:07 +0000 +++ lisp/gnus/gnus-int.el 2010-10-14 22:39:54 +0000 @@ -504,6 +504,12 @@ article (gnus-group-real-name group) (nth 1 gnus-command-method) buffer))) +(defun gnus-request-thread (id) + "Request the thread containing the article specified by Message-ID id." + (let ((gnus-command-method (gnus-find-method-for-group gnus-newsgroup-name))) + (funcall (gnus-get-function gnus-command-method 'request-thread) + id))) + (defun gnus-request-head (article group) "Request the head of ARTICLE in GROUP." (let* ((gnus-command-method (gnus-find-method-for-group group)) === modified file 'lisp/gnus/gnus-sum.el' --- lisp/gnus/gnus-sum.el 2010-10-12 14:17:15 +0000 +++ lisp/gnus/gnus-sum.el 2010-10-14 22:39:54 +0000 @@ -8824,31 +8824,35 @@ (defun gnus-summary-refer-thread (&optional limit) "Fetch all articles in the current thread. -If LIMIT (the numerical prefix), fetch that many old headers instead -of what's specified by the `gnus-refer-thread-limit' variable." +If no backend-specific 'request-thread function is available +fetch LIMIT (the numerical prefix) old headers. If LIMIT is nil +fetch what's specified by the `gnus-refer-thread-limit' +variable." (interactive "P") (let ((id (mail-header-id (gnus-summary-article-header))) (limit (if limit (prefix-numeric-value limit) gnus-refer-thread-limit))) - (unless (eq gnus-fetch-old-headers 'invisible) - (gnus-message 5 "Fetching headers for %s..." gnus-newsgroup-name) - ;; Retrieve the headers and read them in. - (if (eq (if (numberp limit) - (gnus-retrieve-headers - (list (min - (+ (mail-header-number - (gnus-summary-article-header)) - limit) - gnus-newsgroup-end)) - gnus-newsgroup-name (* limit 2)) - ;; gnus-refer-thread-limit is t, i.e. fetch _all_ - ;; headers. - (gnus-retrieve-headers (list gnus-newsgroup-end) - gnus-newsgroup-name limit)) - 'nov) - (gnus-build-all-threads) - (error "Can't fetch thread from back ends that don't support NOV")) - (gnus-message 5 "Fetching headers for %s...done" gnus-newsgroup-name)) + (if (gnus-check-backend-function 'request-thread gnus-newsgroup-name) + (gnus-request-thread id) + (unless (eq gnus-fetch-old-headers 'invisible) + (gnus-message 5 "Fetching headers for %s..." gnus-newsgroup-name) + ;; Retrieve the headers and read them in. + (if (numberp limit) + (gnus-retrieve-headers + (list (min + (+ (mail-header-number + (gnus-summary-article-header)) + limit) + gnus-newsgroup-end)) + gnus-newsgroup-name (* limit 2)) + ;; gnus-refer-thread-limit is t, i.e. fetch _all_ + ;; headers. + (gnus-retrieve-headers (list gnus-newsgroup-end) + gnus-newsgroup-name limit) + (gnus-message 5 "Fetching headers for %s...done" + gnus-newsgroup-name)))) + (when (eq gnus-headers-retrieved-by 'nov) + (gnus-build-all-threads)) (gnus-summary-limit-include-thread id))) (defun gnus-summary-refer-article (message-id) === modified file 'lisp/gnus/nnimap.el' --- lisp/gnus/nnimap.el 2010-10-14 10:16:59 +0000 +++ lisp/gnus/nnimap.el 2010-10-14 22:39:54 +0000 @@ -304,6 +304,7 @@ ((or (eq nnimap-stream 'network) (and (eq nnimap-stream 'starttls) (fboundp 'open-gnutls-stream))) + (message "Opening connection to %s..." nnimap-address) (open-network-stream "*nnimap*" (current-buffer) nnimap-address (setq port @@ -313,18 +314,22 @@ "143")))) '("143" "imap")) ((eq nnimap-stream 'shell) + (message "Opening connection to %s via shell..." nnimap-address) (nnimap-open-shell-stream "*nnimap*" (current-buffer) nnimap-address (setq port (or nnimap-server-port "imap"))) '("imap")) ((eq nnimap-stream 'starttls) + (message "Opening connection to %s via starttls..." + nnimap-address) (let ((tls-program - '("openssl s_client %s -connect %h:%p -no_ssl2 -ign_eof -starttls imap"))) + '("openssl s_client -connect %h:%p -no_ssl2 -ign_eof -starttls imap"))) (open-tls-stream "*nnimap*" (current-buffer) nnimap-address (setq port (or nnimap-server-port "imap")))) '("imap")) ((memq nnimap-stream '(ssl tls)) + (message "Opening connection to %s via tls..." nnimap-address) (funcall (if (fboundp 'open-gnutls-stream) 'open-gnutls-stream 'open-tls-stream) @@ -1311,6 +1316,25 @@ (setq nnimap-status-string "Read-only server") nil) +(deffoo nnimap-request-thread (id) + (let* ((refs (split-string + (or (mail-header-references (gnus-summary-article-header)) + ""))) + (cmd (let ((value + (format + "(OR HEADER REFERENCES %s HEADER Message-Id %s)" + id id))) + (dolist (refid refs value) + (setq value (format + "(OR (OR HEADER Message-Id %s HEADER REFERENCES %s) %s)" + refid refid value))))) + (result + (with-current-buffer (nnimap-buffer) + (nnimap-command "UID SEARCH %s" cmd)))) + (gnus-fetch-headers (and (car result) + (delete 0 (mapcar #'string-to-number + (cdr (assoc "SEARCH" (cdr result))))))))) + (defun nnimap-possibly-change-group (group server) (let ((open-result t)) (when (and server === modified file 'lisp/gnus/shr.el' --- lisp/gnus/shr.el 2010-10-14 13:55:30 +0000 +++ lisp/gnus/shr.el 2010-10-14 22:39:54 +0000 @@ -56,17 +56,17 @@ (defcustom shr-table-line ?- "Character used to draw table line." :group 'shr - :type 'char) + :type 'character) (defcustom shr-table-corner ?+ "Character used to draw table corner." :group 'shr - :type 'char) + :type 'character) (defcustom shr-hr-line ?- "Character used to draw hr line." :group 'shr - :type 'char) + :type 'character) (defcustom shr-width fill-column "Frame width to use for rendering." @@ -404,14 +404,17 @@ (width (string-to-number width))) (when (< width max-width) (let ((align (cdr (assq :align cont)))) - (cond ((string= align "right") - (insert (propertize - " " 'display - `(space . (:align-to ,(list (- max-width width))))))) - ((string= align "center") - (insert (propertize - " " 'display - `(space . (:balign-to ,(list (- (/ max-width 2) width)))))))))))) + (cond + ((string= align "right") + (insert (propertize + " " 'display + `(space . (:align-to + ,(list (- max-width width))))))) + ((string= align "center") + (insert (propertize + " " 'display + `(space . (:balign-to + ,(list (- (/ max-width 2) width)))))))))))) (let ((start (point-marker))) (when (zerop (length alt)) (setq alt "[img]")) @@ -537,6 +540,11 @@ ;; unbreakable text). (sketch (shr-make-table cont suggested-widths)) (sketch-widths (shr-table-widths sketch suggested-widths))) + ;; This probably won't work very well. + (when (> (1+ (loop for width across sketch-widths + summing (1+ width))) + (frame-width)) + (setq truncate-lines t)) ;; Then render the table again with these new "hard" widths. (shr-insert-table (shr-make-table cont sketch-widths t) sketch-widths)) ;; Finally, insert all the images after the table. The Emacs buffer ------------------------------------------------------------ Use --include-merges or -n0 to see merged revisions.