Using saved parent location: http://bzr.savannah.gnu.org/r/emacs/trunk/ Now on revision 101599. ------------------------------------------------------------ revno: 101599 committer: Juanma Barranquero branch nick: trunk timestamp: Sat 2010-09-25 02:32:09 +0200 message: Fix bug#6781: Use 127.0.0.1 for local hosts, not "localhost". * lisp/server.el (server-start): Revert part of 2010-08-08 change. Using address 127.0.0.1 for local host is now done in Fmake_network_process. * src/process.c (Fmake_network_process): When arg :host is 'local, use address 127.0.0.1, not name "localhost". diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-09-24 03:23:07 +0000 +++ lisp/ChangeLog 2010-09-25 00:32:09 +0000 @@ -1,3 +1,8 @@ +2010-09-25 Juanma Barranquero + + * server.el (server-start): Revert part of 2010-08-08 change. Using + address 127.0.0.1 for local host is now done in Fmake_network_process. + 2010-09-24 Glenn Morris * image-mode.el, progmodes/compile.el, progmodes/gud.el: === modified file 'lisp/server.el' --- lisp/server.el 2010-08-26 13:46:19 +0000 +++ lisp/server.el 2010-09-25 00:32:09 +0000 @@ -565,7 +565,7 @@ (if server-use-tcp (list :family 'ipv4 ;; We're not ready for IPv6 yet :service t - :host (or server-host "127.0.0.1") ;; See bug#6781 + :host (or server-host 'local) :plist '(:authenticated nil)) (list :family 'local :service server-file === modified file 'src/ChangeLog' --- src/ChangeLog 2010-09-24 19:30:13 +0000 +++ src/ChangeLog 2010-09-25 00:32:09 +0000 @@ -1,3 +1,8 @@ +2010-09-25 Juanma Barranquero + + * process.c (Fmake_network_process): When arg :host is 'local, + use address 127.0.0.1, not name "localhost". (Bug#6781) + 2010-09-24 Eli Zaretskii * indent.c (Fcurrent_indentation, indented_beyond_p) === modified file 'src/process.c' --- src/process.c 2010-09-17 15:47:49 +0000 +++ src/process.c 2010-09-25 00:32:09 +0000 @@ -3170,7 +3170,9 @@ if (!NILP (host)) { if (EQ (host, Qlocal)) - host = build_string ("localhost"); + /* Depending on setup, "localhost" may map to different IPv4 and/or + IPv6 addresses, so it's better to be explicit. (Bug#6781) */ + host = build_string ("127.0.0.1"); CHECK_STRING (host); } ------------------------------------------------------------ revno: 101598 author: Gnus developers committer: Katsumi Yamaoka branch nick: trunk timestamp: Fri 2010-09-24 22:33:34 +0000 message: Merge changes made in Gnus trunk. gnus.el (gnus-sloppily-equal-method-parameters): Avoid cl.el convenience functions. nnrss.el (nnrss-retrieve-groups): Change to the group before checking its data structures. nnimap.el (nnimap-split-incoming-mail): Fix paren typo in the 'junk handling. starttls.el: (starttls-open-stream): Add autoload cookie. nnimap.el (nnimap-command): Register the last command time so that we can use it for idling NOOPs. nnimap.el: Implement IMAP keepalive. gnus-cache.el (gnus-cache-braid-heads): When braiding heads, don't use the same article number for all the cached articles. nnimap.el (nnimap-update-info): Protect against nil uidnexts. gnus-group.el: Remove the outdated archive group stuff, which no longer works. gnus-group.el, gnus.el: Remove the outdated charter support. gnus-sum.el, gnus-group.el, gnus.el: Remove outdated support for FAQ fetching. gnus-gravatar.el, gravatar.el: New files. diff: === modified file 'doc/misc/gnus.texi' --- doc/misc/gnus.texi 2010-09-23 23:14:02 +0000 +++ doc/misc/gnus.texi 2010-09-24 22:33:34 +0000 @@ -589,7 +589,7 @@ * Article Buttons:: Click on URLs, Message-IDs, addresses and the like. * Article Button Levels:: Controlling appearance of buttons. * Article Date:: Grumble, UT! -* Article Display:: Display various stuff---X-Face, Picons, Smileys +* Article Display:: Display various stuff---X-Face, Picons, Smileys, Gravatars * Article Signature:: What is a signature? * Article Miscellanea:: Various other stuff. @@ -2616,18 +2616,6 @@ @findex gnus-group-make-help-group Make the Gnus help group (@code{gnus-group-make-help-group}). -@item G a -@kindex G a (Group) -@cindex (ding) archive -@cindex archive group -@findex gnus-group-make-archive-group -@vindex gnus-group-archive-directory -@vindex gnus-group-recent-archive-directory -Make a Gnus archive group (@code{gnus-group-make-archive-group}). By -default a group pointing to the most recent articles will be created -(@code{gnus-group-recent-archive-directory}), but given a prefix, a full -group will be created from @code{gnus-group-archive-directory}. - @item G D @kindex G D (Group) @findex gnus-group-enter-directory @@ -5222,19 +5210,6 @@ If fetching from the first site is unsuccessful, Gnus will attempt to go through @code{gnus-group-faq-directory} and try to open them one by one. -@item H c -@kindex H c (Group) -@findex gnus-group-fetch-charter -@vindex gnus-group-charter-alist -@cindex charter -Try to open the charter for the current group in a web browser -(@code{gnus-group-fetch-charter}). Query for a group if given a -prefix argument. - -Gnus will use @code{gnus-group-charter-alist} to find the location of -the charter. If no location is known, Gnus will fetch the control -messages for the group, which in some cases includes the charter. - @item H C @kindex H C (Group) @findex gnus-group-fetch-control @@ -9255,7 +9230,8 @@ * Article Buttons:: Click on URLs, Message-IDs, addresses and the like. * Article Button Levels:: Controlling appearance of buttons. * Article Date:: Grumble, UT! -* Article Display:: Display various stuff---X-Face, Picons, Smileys +* Article Display:: Display various stuff: + X-Face, Picons, Gravatars, Smileys. * Article Signature:: What is a signature? * Article Miscellanea:: Various other stuff. @end menu @@ -10299,6 +10275,7 @@ @cindex picons @cindex x-face @cindex smileys +@cindex gravatars These commands add various frivolous display gimmicks to the article buffer in Emacs versions that support them. @@ -10315,6 +10292,9 @@ Picons, on the other hand, reside on your own system, and Gnus will try to match the headers to what you have (@pxref{Picons}). +Gravatars reside on-line and are fetched from +@uref{http://www.gravatar.com/} (@pxref{Gravatars}). + All these functions are toggles---if the elements already exist, they'll be removed. @@ -10353,6 +10333,17 @@ Piconify all news headers (i. e., @code{Newsgroups} and @code{Followup-To}) (@code{gnus-treat-newsgroups-picon}). +@item W D g +@kindex W D g (Summary) +@findex gnus-treat-from-gravatar +Gravatarify the @code{From} header (@code{gnus-treat-from-gravatar}). + +@item W D h +@kindex W D h (Summary) +@findex gnus-treat-mail-gravatar +Gravatarify all mail headers (i. e., @code{Cc}, @code{To}) +(@code{gnus-treat-from-gravatar}). + @item W D D @kindex W D D (Summary) @findex gnus-article-remove-images @@ -11561,18 +11552,6 @@ @table @kbd -@item H f -@kindex H f (Summary) -@findex gnus-summary-fetch-faq -@vindex gnus-group-faq-directory -Try to fetch the @acronym{FAQ} (list of frequently asked questions) -for the current group (@code{gnus-summary-fetch-faq}). Gnus will try -to get the @acronym{FAQ} from @code{gnus-group-faq-directory}, which -is usually a directory on a remote machine. This variable can also be -a list of directories. In that case, giving a prefix to this command -will allow you to choose between the various sites. @code{ange-ftp} -or @code{efs} will probably be used for fetching the file. - @item H d @kindex H d (Summary) @findex gnus-summary-describe-group @@ -12631,6 +12610,8 @@ @vindex gnus-treat-from-picon @vindex gnus-treat-mail-picon @vindex gnus-treat-newsgroups-picon +@vindex gnus-treat-from-gravatar +@vindex gnus-treat-mail-gravatar @vindex gnus-treat-display-smileys @vindex gnus-treat-body-boundary @vindex gnus-treat-display-x-face @@ -12697,6 +12678,11 @@ @xref{Picons}. +@item gnus-treat-from-gravatar (head) +@item gnus-treat-mail-gravatar (head) + +@xref{Gravatars}. + @item gnus-treat-display-smileys (t, integer) @item gnus-treat-body-boundary (head) @@ -23709,6 +23695,7 @@ * Face:: Display a funkier, teensier colored image. * Smileys:: Show all those happy faces the way they were meant to be shown. * Picons:: How to display pictures of what you're reading. +* Gravatars:: Display the avatar of people you read. * XVarious:: Other XEmacsy Gnusey variables. @end menu @@ -24037,6 +24024,48 @@ @end table +@node Gravatars +@subsection Gravatars + +@iftex +@iflatex +\include{gravatars} +@end iflatex +@end iftex + +A gravatar is an image registered to an e-mail address. + +You can submit yours on-line at @uref{http://www.gravatar.com}. + +The following variables offer control over how things are displayed. + +@table @code + +@item gnus-gravatar-size +@vindex gnus-gravatar-size +The size in pixels of gravatars. Gravatars are always square, so one +number for the size is enough. + +@item gnus-gravatar-relief +@vindex gnus-gravatar-relief +If non-nil, adds a shadow rectangle around the image. The value, +relief, specifies the width of the shadow lines, in pixels. If relief +is negative, shadows are drawn so that the image appears as a pressed +button; otherwise, it appears as an unpressed button. + +@end table + +If you want to see them in the From field, set: +@lisp +(setq gnus-treat-from-gravatar 'head) +@end lisp + +If you want to see them in the Cc and To fields, set: + +@lisp +(setq gnus-treat-mail-gravatar 'head) +@end lisp + @node XVarious @subsection Various XEmacs Variables === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2010-09-24 07:25:37 +0000 +++ lisp/gnus/ChangeLog 2010-09-24 22:33:34 +0000 @@ -1,3 +1,57 @@ +2010-09-24 Julien Danjou + + * gnus-sum.el: Add support for Gravatars. + + * gnus-art.el: Add support for Gravatars. + + * gnus-gravatar.el: Add this file. + + * gravatar.el: Add this file. + +2010-09-24 Lars Magne Ingebrigtsen + + * gnus-sum.el (gnus-summary-fetch-faq): Removed. + + * gnus-group.el (gnus-group-fetch-faq): Removed. + + * gnus.el (gnus-group-faq-directory): Removed. + + * gnus-group.el (gnus-group-fetch-charter): Removed. + + * gnus.el (gnus-group-charter-alist): Removed. + + * gnus-group.el (gnus-group-archive-directory): Removed. + (gnus-group-recent-archive-directory): Ditto. + (gnus-group-make-archive-group): Removed. + + * nnimap.el (nnimap-update-info): Protect against nil uidnexts. + + * gnus-cache.el (gnus-cache-braid-heads): When braiding heads, don't + use the same article number for all the cached articles. + + * nnimap.el (nnimap-command): Register the last command time so + that we can use it for idling NOOPs. + (nnimap-open-connection): Start the keeplive timer. + (nnimap-make-process-buffer): Store all the process buffers. + (nnimap-keepalive): New function. + + * starttls.el: (starttls-open-stream): Add autoload cookie. + +2010-09-24 Michael Welsh Duggan (tiny change) + + * nnimap.el (nnimap-split-incoming-mail): Fix paren typo in the 'junk + handling. + +2010-09-24 Lars Magne Ingebrigtsen + + * nnrss.el (nnrss-retrieve-groups): Change to the group before checking + its data structures. + + * gnus.el (gnus-sloppily-equal-method-parameters): Use copy-sequence + instead of the cl.el copy-list. + (gnus-sloppily-equal-method-parameters): Use equal instead of the cl + equalp. + 2010-09-24 Katsumi Yamaoka * gmm-utils.el (gmm-tool-bar-from-list): Always use tool-bar-local-item === modified file 'lisp/gnus/gnus-art.el' --- lisp/gnus/gnus-art.el 2010-09-24 07:25:37 +0000 +++ lisp/gnus/gnus-art.el 2010-09-24 22:33:34 +0000 @@ -1529,10 +1529,40 @@ :type gnus-article-treat-head-custom) (put 'gnus-treat-newsgroups-picon 'highlight t) +(defcustom gnus-treat-from-gravatar + (when (display-images-p) 'head) + "Display gravatars in the From header. +Valid values are nil, t, `head', `first', `last', an integer or a +predicate. See Info node `(gnus)Customizing Articles' and Info +node `(gnus)Gravatars' for details." + :version "24.1" + :group 'gnus-article-treat + :group 'gnus-gravatar + :link '(custom-manual "(gnus)Customizing Articles") + :link '(custom-manual "(gnus)Gravatars") + :type gnus-article-treat-head-custom) +(put 'gnus-treat-from-gravatar 'highlight t) + +(defcustom gnus-treat-mail-gravatar + (when (display-images-p) 'head) + "Display gravatars in To and Cc headers. +Valid values are nil, t, `head', `first', `last', an integer or a +predicate. See Info node `(gnus)Customizing Articles' and Info +node `(gnus)Gravatars' for details." + :version "24.1" + :group 'gnus-article-treat + :group 'gnus-gravatar + :link '(custom-manual "(gnus)Customizing Articles") + :link '(custom-manual "(gnus)Gravatars") + :type gnus-article-treat-head-custom) +(put 'gnus-treat-mail-gravatar 'highlight t) + (defcustom gnus-treat-body-boundary (if (or gnus-treat-newsgroups-picon gnus-treat-mail-picon - gnus-treat-from-picon) + gnus-treat-from-picon + gnus-treat-from-gravatar + gnus-treat-mail-gravatar) ;; If there's much decoration, the user might prefer a boundery. 'head nil) @@ -1669,6 +1699,8 @@ (gnus-treat-from-picon gnus-treat-from-picon) (gnus-treat-mail-picon gnus-treat-mail-picon) (gnus-treat-newsgroups-picon gnus-treat-newsgroups-picon) + (gnus-treat-from-gravatar gnus-treat-from-gravatar) + (gnus-treat-mail-gravatar gnus-treat-mail-gravatar) (gnus-treat-highlight-headers gnus-article-highlight-headers) (gnus-treat-highlight-signature gnus-article-highlight-signature) (gnus-treat-strip-trailing-blank-lines === modified file 'lisp/gnus/gnus-cache.el' --- lisp/gnus/gnus-cache.el 2010-09-18 10:02:19 +0000 +++ lisp/gnus/gnus-cache.el 2010-09-24 22:33:34 +0000 @@ -603,7 +603,7 @@ (insert-file-contents (gnus-cache-file-name group entry))) (goto-char (point-min)) (insert "220 ") - (princ (car cached) (current-buffer)) + (princ (pop cached) (current-buffer)) (insert " Article retrieved.\n") (search-forward "\n\n" nil 'move) (delete-region (point) (point-max)) === added file 'lisp/gnus/gnus-gravatar.el' --- lisp/gnus/gnus-gravatar.el 1970-01-01 00:00:00 +0000 +++ lisp/gnus/gnus-gravatar.el 2010-09-24 22:33:34 +0000 @@ -0,0 +1,112 @@ +;;; gnus-gravatar.el --- Gnus Gravatar support + +;; Copyright (C) 2010 Free Software Foundation, Inc. + +;; Author: Julien Danjou +;; Keywords: news + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Commentary: + +;;; Code: + +(require 'gravatar) + +(defgroup gnus-gravatar nil + "Gnus Gravatar." + :group 'gnus-visual) + +(defcustom gnus-gravatar-size 32 + "How big should gravatars be displayed." + :type 'integer + :group 'gnus-gravatar) + +(defcustom gnus-gravatar-relief 1 + "If non-nil, adds a shadow rectangle around the image. The +value, relief, specifies the width of the shadow lines, in +pixels. If relief is negative, shadows are drawn so that the +image appears as a pressed button; otherwise, it appears as an +unpressed button." + :group 'gnus-gravatar) + +(defun gnus-gravatar-transform-address (header category) + (gnus-with-article-headers + (let ((addresses + (mail-header-parse-addresses + ;; mail-header-parse-addresses does not work (reliably) on + ;; decoded headers. + (or + (ignore-errors + (mail-encode-encoded-word-string + (or (mail-fetch-field header) ""))) + (mail-fetch-field header))))) + (dolist (address addresses) + (gravatar-retrieve + (car address) + 'gnus-gravatar-insert + (list header (car address) category)))))) + +(defun gnus-gravatar-insert (gravatar header address category) + "Insert GRAVATAR for ADDRESS in HEADER in current article buffer. +Set image category to CATEGORY." + (unless (eq gravatar 'error) + (gnus-with-article-headers + (gnus-article-goto-header header) + (mail-header-narrow-to-field) + (when (and (search-forward address nil t) + (or (search-backward ", " nil t) + (search-backward ": " nil t))) + (goto-char (1+ (point))) + ;; Do not do anything if there's already a gravatar. This can + ;; happens if the buffer has been regenerated in the mean time, for + ;; example we were fetching someaddress, and then we change to + ;; another mail with the same someaddress. + (unless (memq 'gnus-gravatar (text-properties-at (point))) + (let ((inhibit-read-only t) + (point (point)) + (gravatar (append + gravatar + `(:ascent center :relief ,gnus-gravatar-relief)))) + (gnus-put-image gravatar nil category) + (put-text-property point (point) 'gnus-gravatar address) + (gnus-add-wash-type category) + (gnus-add-image category gravatar))))))) + +;;;###autoload +(defun gnus-treat-from-gravatar () + "Display gravatar in the From header. +If gravatar is already displayed, remove it." + (interactive) + (gnus-with-article-buffer + (if (memq 'from-gravatar gnus-article-wash-types) + (gnus-delete-images 'from-gravatar) + (gnus-gravatar-transform-address "from" 'from-gravatar)))) + +;;;###autoload +(defun gnus-treat-mail-gravatar () + "Display gravatars in the Cc and To headers. +If gravatars are already displayed, remove them." + (interactive) + (gnus-with-article-buffer + (if (memq 'mail-gravatar gnus-article-wash-types) + (gnus-delete-images 'mail-gravatar) + (gnus-gravatar-transform-address "cc" 'mail-gravatar) + (gnus-gravatar-transform-address "to" 'mail-gravatar)))) + +(provide 'gnus-gravatar) + +;;; gnus-gravatar.el ends here === modified file 'lisp/gnus/gnus-group.el' --- lisp/gnus/gnus-group.el 2010-09-24 07:25:37 +0000 +++ lisp/gnus/gnus-group.el 2010-09-24 22:33:34 +0000 @@ -55,18 +55,6 @@ (autoload 'gnus-agent-total-fetched-for "gnus-agent") (autoload 'gnus-cache-total-fetched-for "gnus-cache") -(defcustom gnus-group-archive-directory - "/ftp@ftp.hpc.uh.edu:/pub/emacs/ding-list/" - "*The address of the (ding) archives." - :group 'gnus-group-foreign - :type 'directory) - -(defcustom gnus-group-recent-archive-directory - "/ftp@ftp.hpc.uh.edu:/pub/emacs/ding-list-recent/" - "*The address of the most recent (ding) articles." - :group 'gnus-group-foreign - :type 'directory) - (defcustom gnus-no-groups-message "No Gnus is good news" "*Message displayed by Gnus when no groups are available." :group 'gnus-start @@ -657,7 +645,6 @@ "d" gnus-group-make-directory-group "h" gnus-group-make-help-group "u" gnus-group-make-useful-group - "a" gnus-group-make-archive-group "l" gnus-group-nnimap-edit-acl "m" gnus-group-make-group "E" gnus-group-edit-group @@ -752,10 +739,8 @@ "e" gnus-score-edit-all-score) (gnus-define-keys (gnus-group-help-map "H" gnus-group-mode-map) - "c" gnus-group-fetch-charter "C" gnus-group-fetch-control "d" gnus-group-describe-group - "f" gnus-group-fetch-faq "v" gnus-version) (gnus-define-keys (gnus-group-sub-map "S" gnus-group-mode-map) @@ -821,11 +806,6 @@ ["Describe" gnus-group-describe-group :active (gnus-group-group-name) ,@(if (featurep 'xemacs) nil '(:help "Display description of the current group"))] - ["Fetch FAQ" gnus-group-fetch-faq (gnus-group-group-name)] - ["Fetch charter" gnus-group-fetch-charter - :active (gnus-group-group-name) - ,@(if (featurep 'xemacs) nil - '(:help "Display the charter of the current group"))] ["Fetch control message" gnus-group-fetch-control :active (gnus-group-group-name) ,@(if (featurep 'xemacs) nil @@ -925,7 +905,6 @@ ["Make a foreign group..." gnus-group-make-group t] ["Add a directory group..." gnus-group-make-directory-group t] ["Add the help group" gnus-group-make-help-group t] - ["Add the archive group" gnus-group-make-archive-group t] ["Make a doc group..." gnus-group-make-doc-group t] ["Make a web group..." gnus-group-make-web-group t] ["Make a virtual group..." gnus-group-make-empty-virtual t] @@ -3089,22 +3068,6 @@ (nnrss-save-server-data nil)) (error "No feeds found for %s" url)))) -(defun gnus-group-make-archive-group (&optional all) - "Create the (ding) Gnus archive group of the most recent articles. -Given a prefix, create a full group." - (interactive "P") - (let ((group (gnus-group-prefixed-name - (if all "ding.archives" "ding.recent") '(nndir "")))) - (when (gnus-group-entry group) - (error "Archive group already exists")) - (gnus-group-make-group - (gnus-group-real-name group) - (list 'nndir (if all "hpc" "edu") - (list 'nndir-directory - (if all gnus-group-archive-directory - gnus-group-recent-archive-directory)))) - (gnus-group-add-parameter group (cons 'to-address "ding@gnus.org")))) - (defun gnus-group-make-directory-group (dir) "Create an nndir group. The user will be prompted for a directory. The contents of this @@ -4049,62 +4012,6 @@ (gnus-summary-position-point) ret)) -(defun gnus-group-fetch-faq (group &optional faq-dir) - "Fetch the FAQ for the current group. -If given a prefix argument, prompt for the FAQ dir -to use." - (interactive - (list - (gnus-group-group-name) - (when current-prefix-arg - (completing-read - "FAQ dir: " (and (listp gnus-group-faq-directory) - (mapcar #'list - gnus-group-faq-directory)))))) - (unless group - (error "No group name given")) - (let ((dirs (or faq-dir gnus-group-faq-directory)) - dir found file) - (unless (listp dirs) - (setq dirs (list dirs))) - (while (and (not found) - (setq dir (pop dirs))) - (let ((name (gnus-group-real-name group))) - (setq file (expand-file-name name dir))) - (if (not (file-exists-p file)) - (gnus-message 1 "No such file: %s" file) - (let ((enable-local-variables nil)) - (find-file file) - (setq found t)))))) - -(defun gnus-group-fetch-charter (group) - "Fetch the charter for the current group. -If given a prefix argument, prompt for a group." - (interactive - (list (or (when current-prefix-arg - (gnus-group-completing-read "Group: ")) - (gnus-group-group-name) - gnus-newsgroup-name))) - (unless group - (error "No group name given")) - (require 'mm-url) - (condition-case nil (require 'url-http) (error nil)) - (let ((name (mm-url-form-encode-xwfu (gnus-group-real-name group))) - url hierarchy) - (when (string-match "\\(^[^\\.]+\\)\\..*" name) - (setq hierarchy (match-string 1 name)) - (if (and (setq url (cdr (assoc hierarchy gnus-group-charter-alist))) - (if (fboundp 'url-http-file-exists-p) - (url-http-file-exists-p (eval url)) - t)) - (browse-url (eval url)) - (setq url (concat "http://" hierarchy - ".news-admin.org/charters/" name)) - (if (and (fboundp 'url-http-file-exists-p) - (url-http-file-exists-p url)) - (browse-url url) - (gnus-group-fetch-control group)))))) - (defun gnus-group-fetch-control (group) "Fetch the archived control messages for the current group. If given a prefix argument, prompt for a group." === modified file 'lisp/gnus/gnus-sum.el' --- lisp/gnus/gnus-sum.el 2010-09-24 07:25:37 +0000 +++ lisp/gnus/gnus-sum.el 2010-09-24 22:33:34 +0000 @@ -2124,7 +2124,9 @@ "W" gnus-html-show-images "f" gnus-treat-from-picon "m" gnus-treat-mail-picon - "n" gnus-treat-newsgroups-picon) + "n" gnus-treat-newsgroups-picon + "g" gnus-treat-from-gravatar + "h" gnus-treat-mail-gravatar) (gnus-define-keys (gnus-summary-wash-mime-map "M" gnus-summary-wash-map) "w" gnus-article-decode-mime-words @@ -2154,11 +2156,9 @@ (gnus-define-keys (gnus-summary-help-map "H" gnus-summary-mode-map) "v" gnus-version - "f" gnus-summary-fetch-faq "d" gnus-summary-describe-group "h" gnus-summary-describe-briefly "i" gnus-info-find-node - "c" gnus-group-fetch-charter "C" gnus-group-fetch-control) (gnus-define-keys (gnus-summary-backend-map "B" gnus-summary-mode-map) @@ -2374,6 +2374,8 @@ ["Show picons in From" gnus-treat-from-picon t] ["Show picons in mail headers" gnus-treat-mail-picon t] ["Show picons in news headers" gnus-treat-newsgroups-picon t] + ["Show Gravatars in From" gnus-treat-from-gravatar t] + ["Show Gravatars in mail headers" gnus-treat-mail-gravatar t] ("View as different encoding" ,@(gnus-summary-menu-split (mapcar @@ -2733,11 +2735,7 @@ ["Randomize" gnus-summary-sort-by-random t] ["Original sort" gnus-summary-sort-by-original t]) ("Help" - ["Fetch group FAQ" gnus-summary-fetch-faq t] ["Describe group" gnus-summary-describe-group t] - ["Fetch charter" gnus-group-fetch-charter - ,@(if (featurep 'xemacs) nil - '(:help "Display the charter of the current group"))] ["Fetch control message" gnus-group-fetch-control ,@(if (featurep 'xemacs) nil '(:help "Display the archived control message for the current group"))] @@ -5370,18 +5368,18 @@ (if (= gnus-tmp-lines -1) (setq gnus-tmp-lines "?") (setq gnus-tmp-lines (number-to-string gnus-tmp-lines))) - (gnus-put-text-property - (point) - (progn (eval gnus-summary-line-format-spec) (point)) - 'gnus-number number) - (when gnus-visual-p - (forward-line -1) - (gnus-summary-highlight-line) - (when gnus-summary-update-hook - (gnus-run-hooks 'gnus-summary-update-hook)) - (forward-line 1)) + (gnus-put-text-property + (point) + (progn (eval gnus-summary-line-format-spec) (point)) + 'gnus-number number) + (when gnus-visual-p + (forward-line -1) + (gnus-summary-highlight-line) + (when gnus-summary-update-hook + (gnus-run-hooks 'gnus-summary-update-hook)) + (forward-line 1)) - (setq gnus-tmp-prev-subject simp-subject))) + (setq gnus-tmp-prev-subject simp-subject))) (when (nth 1 thread) (push (list (max 0 gnus-tmp-level) @@ -7324,23 +7322,6 @@ t))) (gnus-message 3 "This dead summary is now alive again")) -;; Suggested by Andrew Eskilsson . -(defun gnus-summary-fetch-faq (&optional faq-dir) - "Fetch the FAQ for the current group. -If FAQ-DIR (the prefix), prompt for a directory to search for the faq -in." - (interactive - (list - (when current-prefix-arg - (completing-read - "FAQ dir: " (and (listp gnus-group-faq-directory) - (mapcar 'list - gnus-group-faq-directory)))))) - (let (gnus-faq-buffer) - (when (setq gnus-faq-buffer - (gnus-group-fetch-faq gnus-newsgroup-name faq-dir)) - (gnus-configure-windows 'summary-faq)))) - ;; Suggested by Per Abrahamsen . (defun gnus-summary-describe-group (&optional force) "Describe the current newsgroup." === modified file 'lisp/gnus/gnus.el' --- lisp/gnus/gnus.el 2010-09-23 00:30:37 +0000 +++ lisp/gnus/gnus.el 2010-09-24 22:33:34 +0000 @@ -1470,75 +1470,6 @@ (nnweb "refer" (nnweb-type google))) gnus-select-method)))) -(defcustom gnus-group-faq-directory - '("/ftp@mirrors.aol.com:/pub/rtfm/usenet/" - "/ftp@sunsite.doc.ic.ac.uk:/pub/usenet/news-faqs/" - "/ftp@src.doc.ic.ac.uk:/usenet/news-FAQS/" - "/ftp@ftp.seas.gwu.edu:/pub/rtfm/" - "/ftp@ftp.pasteur.fr:/pub/FAQ/" - "/ftp@rtfm.mit.edu:/pub/usenet/" - "/ftp@ftp.uni-paderborn.de:/pub/FAQ/" - "/ftp@ftp.sunet.se:/pub/usenet/" - "/ftp@nctuccca.nctu.edu.tw:/pub/Documents/rtfm/usenet-by-group/" - "/ftp@hwarang.postech.ac.kr:/pub/usenet/" - "/ftp@ftp.hk.super.net:/mirror/faqs/") - "*Directory where the group FAQs are stored. -This will most commonly be on a remote machine, and the file will be -fetched by ange-ftp. - -This variable can also be a list of directories. In that case, the -first element in the list will be used by default. The others can -be used when being prompted for a site. - -Note that Gnus uses an aol machine as the default directory. If this -feels fundamentally unclean, just think of it as a way to finally get -something of value back from them. - -If the default site is too slow, try one of these: - - North America: mirrors.aol.com /pub/rtfm/usenet - ftp.seas.gwu.edu /pub/rtfm - rtfm.mit.edu /pub/usenet - Europe: ftp.uni-paderborn.de /pub/FAQ - src.doc.ic.ac.uk /usenet/news-FAQS - ftp.sunet.se /pub/usenet - ftp.pasteur.fr /pub/FAQ - Asia: nctuccca.nctu.edu.tw /pub/Documents/rtfm/usenet-by-group/ - hwarang.postech.ac.kr /pub/usenet - ftp.hk.super.net /mirror/faqs" - :group 'gnus-group-various - :type '(choice directory - (repeat directory))) - -(defcustom gnus-group-charter-alist - '(("no" . (concat "http://no.news-admin.org/charter/" name ".txt")) - ("de" . (concat "http://purl.net/charta/" name ".html")) - ("dk" . (concat "http://www.usenet.dk/grupper.pl?get=" name)) - ("england" . (concat "http://england.news-admin.org/charters/" name)) - ("fr" . (concat "http://www.usenet-fr.net/fur/chartes/" name ".html")) - ("europa" . (concat "http://www.europa.usenet.eu.org/chartas/charta-en-" - (gnus-replace-in-string name "europa\\." "") ".html")) - ("nl" . (concat "http://www.xs4all.nl/~sister/usenet/charters/" name)) - ("aus" . (concat "http://aus.news-admin.org/groupinfo.cgi/" name)) - ("pl" . (concat "http://www.usenet.pl/opisy/" name)) - ("ch" . (concat "http://www.use-net.ch/Usenet/charter.html#" name)) - ("at" . (concat "http://www.usenet.at/chartas/" name "/charta")) - ("uk" . (concat "http://www.usenet.org.uk/" name ".html")) - ("dfw" . (concat "http://www.cirr.com/dfw/charters/" name ".html")) - ("se" . (concat "http://www.usenet-se.net/Reglementen/" - (gnus-replace-in-string name "\\." "_") ".html")) - ("milw" . (concat "http://usenet.mil.wi.us/" - (gnus-replace-in-string name "milw\\." "") "-charter")) - ("ca" . (concat "http://www.sbay.org/ca/charter-" name ".html")) - ("netins" . (concat "http://www.netins.net/usenet/charter/" - (gnus-replace-in-string name "\\." "-") "-charter.html"))) - "*An alist of (HIERARCHY . FORM) pairs used to construct the URL of a charter. -When FORM is evaluated `name' is bound to the name of the group." - :version "22.1" - :group 'gnus-group-various - :type '(repeat (cons (string :tag "Hierarchy") (sexp :tag "Form")))) -(put 'gnus-group-charter-alist 'risky-local-variable t) - (defcustom gnus-group-fetch-control-use-browse-url nil "*Non-nil means that control messages are displayed using `browse-url'. Otherwise they are fetched with ange-ftp and displayed in an ephemeral @@ -3695,8 +3626,8 @@ (defsubst gnus-sloppily-equal-method-parameters (m1 m2) ;; Check parameters for sloppy equalness. - (let ((p1 (copy-list (cddr m1))) - (p2 (copy-list (cddr m2))) + (let ((p1 (copy-sequence (cddr m1))) + (p2 (copy-sequence (cddr m2))) e1 e2) (block nil (while (setq e1 (pop p1)) @@ -3704,7 +3635,7 @@ ;; The parameter doesn't exist in p2. (return nil)) (setq p2 (delq e2 p2)) - (unless (equalp e1 e2) + (unless (equal e1 e2) (if (not (and (stringp (cadr e1)) (stringp (cadr e2)))) (return nil) === added file 'lisp/gnus/gravatar.el' --- lisp/gnus/gravatar.el 1970-01-01 00:00:00 +0000 +++ lisp/gnus/gravatar.el 2010-09-24 22:33:34 +0000 @@ -0,0 +1,123 @@ +;;; gravatar.el --- Get Gravatars + +;; Copyright (C) 2010 Free Software Foundation, Inc. + +;; Author: Julien Danjou +;; Keywords: news + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Commentary: + +;;; Code: + +(require 'image) +(require 'url) +(require 'url-cache) + +(defgroup gravatar nil + "Gravatar." + :group 'comm) + +(defcustom gravatar-automatic-caching t + "Whether cache retrieved gravatar." + :group 'gravatar) + +(defcustom gravatar-cache-ttl (days-to-time 30) + "Time to live for gravatar cache entries." + :group 'gravatar) + +(defcustom gravatar-rating "g" + "Default rating for gravatar." + :group 'gravatar) + +(defcustom gravatar-size 32 + "Default size in pixels for gravatars." + :group 'gravatar) + +(defconst gravatar-base-url + "http://www.gravatar.com/avatar" + "Base URL for getting gravatars.") + +(defun gravatar-hash (mail-address) + "Create an hash from MAIL-ADDRESS." + (md5 (downcase mail-address))) + +(defun gravatar-build-url (mail-address) + "Return an URL to retrieve MAIL-ADDRESS gravatar." + (format "%s/%s?d=404&r=%s&s=%d" + gravatar-base-url + (gravatar-hash mail-address) + gravatar-rating + gravatar-size)) + +(defun gravatar-cache-expired (url) + "Check if URL is cached for more than `gravatar-cache-ttl'." + (cond (url-standalone-mode + (not (file-exists-p (url-cache-create-filename url)))) + (t (let ((cache-time (url-is-cached url))) + (if cache-time + (time-less-p + (time-add + cache-time + gravatar-cache-ttl) + (current-time)) + t))))) + +(defun gravatar-get-data () + "Get data from current buffer." + (when (string-match "^HTTP/.+ 200 OK$" + (buffer-substring (point-min) (line-end-position))) + (when (search-forward "\n\n" nil t) + (buffer-substring (point) (point-max))))) + +(defun gravatar-data->image () + "Get data of current buffer and return an image. +If no image available, return 'error." + (let ((data (gravatar-get-data))) + (if data + (create-image data nil t) + 'error))) + +;;;###autoload +(defun gravatar-retrieve (mail-address cb &optional cbargs) + "Retrieve MAIL-ADDRESS gravatar and call CB on retrieval. +You can provide a list of argument to pass to CB in CBARGS." + (let ((url (gravatar-build-url mail-address))) + (if (gravatar-cache-expired url) + (url-retrieve url + 'gravatar-retrieved + (list cb (when cbargs cbargs))) + (apply cb + (with-temp-buffer + (mm-disable-multibyte) + (url-cache-extract (url-cache-create-filename url)) + (gravatar-data->image)) + cbargs)))) + +(defun gravatar-retrieved (status cb &optional cbargs) + "Callback function used by `gravatar-retrieve'." + ;; Store gravatar? + (when gravatar-automatic-caching + (url-store-in-cache (current-buffer))) + (if (plist-get status :error) + ;; Error happened. + (apply cb 'error cbargs) + (apply cb (gravatar-data->image) cbargs))) + +(provide 'gravatar) + +;;; gravatar.el ends here === modified file 'lisp/gnus/nnimap.el' --- lisp/gnus/nnimap.el 2010-09-23 23:14:02 +0000 +++ lisp/gnus/nnimap.el 2010-09-24 22:33:34 +0000 @@ -90,8 +90,12 @@ (defvar nnimap-split-download-body-default nil "Internal variable with default value for `nnimap-split-download-body'.") +(defvar nnimap-keepalive-timer nil) +(defvar nnimap-process-buffers nil) + (defstruct nnimap - group process commands capabilities select-result newlinep server) + group process commands capabilities select-result newlinep server + last-command-time) (defvar nnimap-object nil) @@ -223,6 +227,7 @@ (set (make-local-variable 'nnimap-object) (make-nnimap :server (nnoo-current-server 'nnimap))) (push (list buffer (current-buffer)) nnimap-connection-alist) + (push (current-buffer) nnimap-process-buffers) (current-buffer))) (defun nnimap-open-shell-stream (name buffer host port) @@ -246,7 +251,25 @@ '("login" "password") address port nil (null ports)))) credentials)) +(defun nnimap-keepalive () + (let ((now (current-time))) + (dolist (buffer nnimap-process-buffers) + (when (buffer-name buffer) + (with-current-buffer buffer + (when (and nnimap-object + (nnimap-last-command-time nnimap-object) + (> (time-to-seconds + (time-subtract + now + (nnimap-last-command-time nnimap-object))) + ;; More than five minutes since the last command. + (* 5 60))) + (nnimap-send-command "NOOP"))))))) + (defun nnimap-open-connection (buffer) + (unless nnimap-keepalive-timer + (setq nnimap-keepalive-timer (run-at-time (* 60 15) (* 60 15) + 'nnimap-keepalive))) (with-current-buffer (nnimap-make-process-buffer buffer) (let* ((coding-system-for-read 'binary) (coding-system-for-write 'binary) @@ -801,12 +824,20 @@ (if (or completep (not (gnus-active group))) (gnus-set-active group - (if (and low high) - (cons low high) + (cond + ((and low high) + (cons low high)) + (uidnext ;; No articles in this group. - (cons uidnext (1- uidnext)))) + (cons uidnext (1- uidnext))) + (start-article + (cons start-article (1- start-article))) + (t + ;; No articles and no uidnext. + nil))) (setcdr (gnus-active group) (or high (1- uidnext)))) - (unless high + (when (and (not high) + uidnext) (setq high (1- uidnext))) ;; Then update the list of read articles. (let* ((unread @@ -986,6 +1017,7 @@ (defun nnimap-command (&rest args) (erase-buffer) + (setf (nnimap-last-command-time nnimap-object) (current-time)) (let* ((sequence (apply #'nnimap-send-command args)) (response (nnimap-get-response sequence))) (if (equal (caar response) "OK") @@ -1154,8 +1186,8 @@ ;; And then mark the successful copy actions as deleted, ;; and possibly expunge them. (nnimap-mark-and-expunge-incoming - (nnimap-parse-copied-articles sequences)) - (nnimap-mark-and-expunge-incoming junk-articles)))))))) + (nnimap-parse-copied-articles sequences))) + (nnimap-mark-and-expunge-incoming junk-articles))))))) (defun nnimap-mark-and-expunge-incoming (range) (when range === modified file 'lisp/gnus/nnrss.el' --- lisp/gnus/nnrss.el 2010-09-18 23:36:29 +0000 +++ lisp/gnus/nnrss.el 2010-09-24 22:33:34 +0000 @@ -391,8 +391,8 @@ t) (deffoo nnrss-retrieve-groups (groups &optional server) - (nnrss-possibly-change-group nil server) (dolist (group groups) + (nnrss-possibly-change-group group server) (nnrss-check-group group server)) (with-current-buffer nntp-server-buffer (erase-buffer) === modified file 'lisp/gnus/starttls.el' --- lisp/gnus/starttls.el 2010-09-18 10:02:19 +0000 +++ lisp/gnus/starttls.el 2010-09-24 22:33:34 +0000 @@ -269,6 +269,7 @@ host port (if done "done" "failed")) process)) +;;;###autoload (defun starttls-open-stream (name buffer host port) "Open a TLS connection for a port to a host. Returns a subprocess object to represent the connection. ------------------------------------------------------------ revno: 101597 committer: Eli Zaretskii branch nick: trunk timestamp: Fri 2010-09-24 15:30:13 -0400 message: Fix int/EMACS_INT in eval.c and indent.c, correct previous changes. indent.c (Fcurrent_indentation, indented_beyond_p) (compute_motion): Use EMACS_INT for buffer position variables. lisp.h (indented_beyond_p): Adjust prototype. buffer.c (overlay_strings): Return EMACS_INT. buffer.h (overlay_strings): Adjust prototype. region-cache.c (pp_cache): Adjust format to arguments. eval.c : Declare EMACS_INT. (call_debugger): Use EMACS_INT for specpdl_size related variables. (verror): Use EMACS_INT for size of allocated buffer. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-09-24 18:04:26 +0000 +++ src/ChangeLog 2010-09-24 19:30:13 +0000 @@ -1,5 +1,20 @@ 2010-09-24 Eli Zaretskii + * indent.c (Fcurrent_indentation, indented_beyond_p) + (compute_motion): Use EMACS_INT for buffer position variables. + + * lisp.h (indented_beyond_p): Adjust prototype. + + * buffer.c (overlay_strings): Return EMACS_INT. + + * buffer.h (overlay_strings): Adjust prototype. + + * region-cache.c (pp_cache): Adjust format to arguments. + + * eval.c : Declare EMACS_INT. + (call_debugger): Use EMACS_INT for specpdl_size related variables. + (verror): Use EMACS_INT for size of allocated buffer. + * keyboard.c (make_lispy_position): Use EMACS_INT for buffer positions. === modified file 'src/buffer.c' --- src/buffer.c 2010-09-24 12:45:09 +0000 +++ src/buffer.c 2010-09-24 19:30:13 +0000 @@ -3134,7 +3134,7 @@ PSTR, if that variable is non-null. The string may be overwritten by subsequent calls. */ -int +EMACS_INT overlay_strings (EMACS_INT pos, struct window *w, unsigned char **pstr) { Lisp_Object overlay, window, str; === modified file 'src/buffer.h' --- src/buffer.h 2010-07-11 18:34:43 +0000 +++ src/buffer.h 2010-09-24 19:30:13 +0000 @@ -865,7 +865,7 @@ EMACS_INT *prev_ptr, int change_req); extern int sort_overlays (Lisp_Object *, int, struct window *); extern void recenter_overlay_lists (struct buffer *, EMACS_INT); -extern int overlay_strings (EMACS_INT, struct window *, unsigned char **); +extern EMACS_INT overlay_strings (EMACS_INT, struct window *, unsigned char **); extern void validate_region (Lisp_Object *, Lisp_Object *); extern void set_buffer_internal (struct buffer *); extern void set_buffer_internal_1 (struct buffer *); === modified file 'src/eval.c' --- src/eval.c 2010-09-24 15:01:03 +0000 +++ src/eval.c 2010-09-24 19:30:13 +0000 @@ -79,7 +79,7 @@ /* Current number of specbindings allocated in specpdl. */ -int specpdl_size; +EMACS_INT specpdl_size; /* Pointer to beginning of specpdl. */ @@ -95,7 +95,7 @@ /* Depth in Lisp evaluations and function calls. */ -int lisp_eval_depth; +EMACS_INT lisp_eval_depth; /* Maximum allowed depth in Lisp evaluations and function calls. */ @@ -216,7 +216,7 @@ int debug_while_redisplaying; int count = SPECPDL_INDEX (); Lisp_Object val; - int old_max = max_specpdl_size; + EMACS_INT old_max = max_specpdl_size; /* Temporarily bump up the stack limits, so the debugger won't run out of stack. */ @@ -1992,7 +1992,7 @@ verror (const char *m, va_list ap) { char buf[200]; - int size = 200; + EMACS_INT size = 200; int mlen; char *buffer = buf; char *args[3]; === modified file 'src/indent.c' --- src/indent.c 2010-09-23 18:35:11 +0000 +++ src/indent.c 2010-09-24 19:30:13 +0000 @@ -865,7 +865,7 @@ (void) { Lisp_Object val; - int opoint = PT, opoint_byte = PT_BYTE; + EMACS_INT opoint = PT, opoint_byte = PT_BYTE; scan_newline (PT, PT_BYTE, BEGV, BEGV_BYTE, -1, 1); @@ -964,10 +964,10 @@ preceding line. */ int -indented_beyond_p (int pos, int pos_byte, double column) +indented_beyond_p (EMACS_INT pos, EMACS_INT pos_byte, double column) { double val; - int opoint = PT, opoint_byte = PT_BYTE; + EMACS_INT opoint = PT, opoint_byte = PT_BYTE; SET_PT_BOTH (pos, pos_byte); while (PT > BEGV && FETCH_BYTE (PT_BYTE) == '\n') @@ -1254,7 +1254,7 @@ to be changed here. */ { unsigned char *ovstr; - int ovlen = overlay_strings (pos, win, &ovstr); + EMACS_INT ovlen = overlay_strings (pos, win, &ovstr); hpos += ((multibyte && ovlen > 0) ? strwidth (ovstr, ovlen) : ovlen); } @@ -1459,7 +1459,7 @@ want to skip over it for some other reason. */ if (common_width != 0) { - int run_end_hpos; + EMACS_INT run_end_hpos; /* Don't go past the final buffer posn the user requested. */ === modified file 'src/lisp.h' --- src/lisp.h 2010-09-24 15:01:03 +0000 +++ src/lisp.h 2010-09-24 19:30:13 +0000 @@ -1877,7 +1877,7 @@ extern struct specbinding *specpdl; extern struct specbinding *specpdl_ptr; -extern int specpdl_size; +extern EMACS_INT specpdl_size; extern EMACS_INT max_specpdl_size; @@ -3241,7 +3241,7 @@ EXFUN (Fmove_to_column, 2); extern double current_column (void); extern void invalidate_current_column (void); -extern int indented_beyond_p (int, int, double); +extern int indented_beyond_p (EMACS_INT, EMACS_INT, double); extern void syms_of_indent (void); /* Defined in frame.c */ === modified file 'src/region-cache.c' --- src/region-cache.c 2010-09-24 15:13:43 +0000 +++ src/region-cache.c 2010-09-24 19:30:13 +0000 @@ -788,9 +788,9 @@ EMACS_INT end_u = c->buffer_end - c->end_unchanged; fprintf (stderr, - "basis: %d..%d modified: %d..%d\n", - c->buffer_beg, c->buffer_end, - beg_u, end_u); + "basis: %ld..%ld modified: %ld..%ld\n", + (long)c->buffer_beg, (long)c->buffer_end, + (long)beg_u, (long)end_u); for (i = 0; i < c->cache_len; i++) { @@ -804,7 +804,7 @@ : (pos == end_u) ? '-' : ' '), stderr); - fprintf (stderr, "%d : %d\n", pos, BOUNDARY_VALUE (c, i)); + fprintf (stderr, "%ld : %d\n", (long)pos, BOUNDARY_VALUE (c, i)); } } ------------------------------------------------------------ revno: 101596 committer: Juanma Barranquero branch nick: trunk timestamp: Fri 2010-09-24 20:04:26 +0200 message: src/ChangeLog: Fix typo and remove duplicate info. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-09-24 17:48:10 +0000 +++ src/ChangeLog 2010-09-24 18:04:26 +0000 @@ -53,7 +53,7 @@ * eval.c (verror): Fix EMACS_INT/int conversion. - * print.c: (PRINTDECLARE, PRINTPREPARE, strout, print_string) + * print.c (PRINTDECLARE, PRINTPREPARE, strout, print_string) (print_preprocess, print_check_string_charset_prop) (print_object): Fix EMACS_INT/int conversion. @@ -61,14 +61,6 @@ 2010-09-24 Eli Zaretskii - * syntax.c (scan_words, update_syntax_table) - (prev_char_comend_first, back_comment, skip_chars): - - * syntax.h (scan_words): Adjust prototype. - - * casefiddle.c (operate_on_word): Use EMACS_INT for buffer - positions. - * callproc.c (Fcall_process): Use EMACS_INT for count of characters read from the subprocess. ------------------------------------------------------------ revno: 101595 committer: Eli Zaretskii branch nick: trunk timestamp: Fri 2010-09-24 13:48:10 -0400 message: Fix int/EMACS_INT use in ccl.c, cmds.c, data.c, dispnew.c. keyboard.c (make_lispy_position): Use EMACS_INT for buffer positions. xdisp.c (redisplay_internal, try_window_id) (set_cursor_from_row, find_first_unchanged_at_end_row): Use EMACS_INT for buffer positions. dispextern.h (set_cursor_from_row, mode_line_string) (marginal_area_string): Adjust prototypes. dispnew.c (increment_matrix_positions) (increment_row_positions, copy_glyph_row_contents) (mode_line_string, marginal_area_string): Use EMACS_INT for buffer positions. dispextern.h (mode_line_string, marginal_area_string) (increment_matrix_positions, increment_row_positions): Adjust prototypes. data.c (Faref, Faset): Use EMACS_INT for string length and positions. cmds.c (internal_self_insert): Use EMACS_INT for the count of characters to insert. ccl.c (Fccl_execute_on_string): Use EMACS_INT for string position and size. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-09-24 15:24:47 +0000 +++ src/ChangeLog 2010-09-24 17:48:10 +0000 @@ -1,5 +1,33 @@ 2010-09-24 Eli Zaretskii + * keyboard.c (make_lispy_position): Use EMACS_INT for buffer + positions. + + * xdisp.c (redisplay_internal, try_window_id) + (set_cursor_from_row, find_first_unchanged_at_end_row): Use + EMACS_INT for buffer positions. + + * dispextern.h (set_cursor_from_row, mode_line_string) + (marginal_area_string): Adjust prototypes. + + * dispnew.c (increment_matrix_positions) + (increment_row_positions, copy_glyph_row_contents) + (mode_line_string, marginal_area_string): Use EMACS_INT for buffer + positions. + + * dispextern.h (mode_line_string, marginal_area_string) + (increment_matrix_positions, increment_row_positions): Adjust + prototypes. + + * data.c (Faref, Faset): Use EMACS_INT for string length and + positions. + + * cmds.c (internal_self_insert): Use EMACS_INT for the count of + characters to insert. + + * ccl.c (Fccl_execute_on_string): Use EMACS_INT for string + position and size. + * syntax.c (scan_words, update_syntax_table) (prev_char_comend_first, back_comment, skip_chars) (skip_syntaxes, Fforward_comment, Fbackward_prefix_chars): Use === modified file 'src/ccl.c' --- src/ccl.c 2010-07-29 05:48:06 +0000 +++ src/ccl.c 2010-09-24 17:48:10 +0000 @@ -2061,10 +2061,10 @@ int i; int outbufsize; unsigned char *outbuf, *outp; - int str_chars, str_bytes; + EMACS_INT str_chars, str_bytes; #define CCL_EXECUTE_BUF_SIZE 1024 int source[CCL_EXECUTE_BUF_SIZE], destination[CCL_EXECUTE_BUF_SIZE]; - int consumed_chars, consumed_bytes, produced_chars; + EMACS_INT consumed_chars, consumed_bytes, produced_chars; if (setup_ccl_program (&ccl, ccl_prog) < 0) error ("Invalid CCL program"); @@ -2128,7 +2128,7 @@ if (outp - outbuf + MAX_MULTIBYTE_LENGTH * ccl.produced > outbufsize) { - int offset = outp - outbuf; + EMACS_INT offset = outp - outbuf; outbufsize += MAX_MULTIBYTE_LENGTH * ccl.produced; outbuf = (unsigned char *) xrealloc (outbuf, outbufsize); outp = outbuf + offset; @@ -2140,7 +2140,7 @@ { if (outp - outbuf + ccl.produced > outbufsize) { - int offset = outp - outbuf; + EMACS_INT offset = outp - outbuf; outbufsize += ccl.produced; outbuf = (unsigned char *) xrealloc (outbuf, outbufsize); outp = outbuf + offset; === modified file 'src/cmds.c' --- src/cmds.c 2010-09-23 20:16:55 +0000 +++ src/cmds.c 2010-09-24 17:48:10 +0000 @@ -37,7 +37,7 @@ /* A possible value for a buffer's overwrite-mode variable. */ Lisp_Object Qoverwrite_mode_binary; -static int internal_self_insert (int, int); +static int internal_self_insert (int, EMACS_INT); DEFUN ("forward-point", Fforward_point, Sforward_point, 1, 1, 0, doc: /* Return buffer position N characters after (before if N negative) point. */) @@ -304,7 +304,7 @@ { int character = translate_char (Vtranslation_table_for_input, (int) XINT (last_command_event)); - int val = internal_self_insert (character, (int) XFASTINT (n)); + int val = internal_self_insert (character, XFASTINT (n)); if (val == 2) nonundocount = 0; frame_make_pointer_invisible (); @@ -323,7 +323,7 @@ static Lisp_Object Qpost_self_insert_hook, Vpost_self_insert_hook; static int -internal_self_insert (int c, int n) +internal_self_insert (int c, EMACS_INT n) { int hairy = 0; Lisp_Object tem; === modified file 'src/data.c' --- src/data.c 2010-08-05 23:34:12 +0000 +++ src/data.c 2010-09-24 17:48:10 +0000 @@ -2082,13 +2082,14 @@ or a byte-code object. IDX starts at 0. */) (register Lisp_Object array, Lisp_Object idx) { - register int idxval; + register EMACS_INT idxval; CHECK_NUMBER (idx); idxval = XINT (idx); if (STRINGP (array)) { - int c, idxval_byte; + int c; + EMACS_INT idxval_byte; if (idxval < 0 || idxval >= SCHARS (array)) args_out_of_range (array, idx); @@ -2136,7 +2137,7 @@ bool-vector. IDX starts at 0. */) (register Lisp_Object array, Lisp_Object idx, Lisp_Object newelt) { - register int idxval; + register EMACS_INT idxval; CHECK_NUMBER (idx); idxval = XINT (idx); @@ -2171,7 +2172,7 @@ } else if (STRING_MULTIBYTE (array)) { - int idxval_byte, prev_bytes, new_bytes, nbytes; + EMACS_INT idxval_byte, prev_bytes, new_bytes, nbytes; unsigned char workbuf[MAX_MULTIBYTE_LENGTH], *p0 = workbuf, *p1; if (idxval < 0 || idxval >= SCHARS (array)) @@ -2187,7 +2188,7 @@ if (prev_bytes != new_bytes) { /* We must relocate the string data. */ - int nchars = SCHARS (array); + EMACS_INT nchars = SCHARS (array); unsigned char *str; USE_SAFE_ALLOCA; === modified file 'src/dispextern.h' --- src/dispextern.h 2010-09-24 12:05:24 +0000 +++ src/dispextern.h 2010-09-24 17:48:10 +0000 @@ -2929,7 +2929,8 @@ void mark_window_display_accurate (Lisp_Object, int); void redisplay_preserve_echo_area (int); int set_cursor_from_row (struct window *, struct glyph_row *, - struct glyph_matrix *, int, int, int, int); + struct glyph_matrix *, EMACS_INT, EMACS_INT, + int, int); void init_iterator (struct it *, struct window *, EMACS_INT, EMACS_INT, struct glyph_row *, enum face_id); void init_iterator_to_row_start (struct it *, struct window *, @@ -3209,11 +3210,11 @@ Lisp_Object *, int *, int *, int *, int *); extern Lisp_Object mode_line_string (struct window *, enum window_part, - int *, int *, int *, + int *, int *, EMACS_INT *, Lisp_Object *, int *, int *, int *, int *); extern Lisp_Object marginal_area_string (struct window *, enum window_part, - int *, int *, int *, + int *, int *, EMACS_INT *, Lisp_Object *, int *, int *, int *, int *); extern void redraw_frame (struct frame *); @@ -3236,9 +3237,9 @@ int, int, int); void rotate_matrix (struct glyph_matrix *, int, int, int); void increment_matrix_positions (struct glyph_matrix *, - int, int, int, int); + int, int, EMACS_INT, EMACS_INT); void blank_row (struct window *, struct glyph_row *, int); -void increment_row_positions (struct glyph_row *, int, int); +void increment_row_positions (struct glyph_row *, EMACS_INT, EMACS_INT); void enable_glyph_matrix_rows (struct glyph_matrix *, int, int, int); void clear_glyph_row (struct glyph_row *); void prepare_desired_row (struct glyph_row *); === modified file 'src/dispnew.c' --- src/dispnew.c 2010-09-22 02:54:58 +0000 +++ src/dispnew.c 2010-09-24 17:48:10 +0000 @@ -849,7 +849,8 @@ DELTA_BYTES. */ void -increment_matrix_positions (struct glyph_matrix *matrix, int start, int end, int delta, int delta_bytes) +increment_matrix_positions (struct glyph_matrix *matrix, int start, int end, + EMACS_INT delta, EMACS_INT delta_bytes) { /* Check that START and END are reasonable values. */ xassert (start >= 0 && start <= matrix->nrows); @@ -1088,7 +1089,8 @@ ends. */ void -increment_row_positions (struct glyph_row *row, int delta, int delta_bytes) +increment_row_positions (struct glyph_row *row, + EMACS_INT delta, EMACS_INT delta_bytes) { int area, i; @@ -1200,7 +1202,8 @@ positions in row TO by DELTA/ DELTA_BYTES. */ void -copy_glyph_row_contents (struct glyph_row *to, struct glyph_row *from, int delta, int delta_bytes) +copy_glyph_row_contents (struct glyph_row *to, struct glyph_row *from, + EMACS_INT delta, EMACS_INT delta_bytes) { int area; @@ -5498,7 +5501,9 @@ *CHARPOS is set to the position in the string returned. */ Lisp_Object -mode_line_string (struct window *w, enum window_part part, int *x, int *y, int *charpos, Lisp_Object *object, int *dx, int *dy, int *width, int *height) +mode_line_string (struct window *w, enum window_part part, + int *x, int *y, EMACS_INT *charpos, Lisp_Object *object, + int *dx, int *dy, int *width, int *height) { struct glyph_row *row; struct glyph *glyph, *end; @@ -5565,7 +5570,9 @@ the string returned. */ Lisp_Object -marginal_area_string (struct window *w, enum window_part part, int *x, int *y, int *charpos, Lisp_Object *object, int *dx, int *dy, int *width, int *height) +marginal_area_string (struct window *w, enum window_part part, + int *x, int *y, EMACS_INT *charpos, Lisp_Object *object, + int *dx, int *dy, int *width, int *height) { struct glyph_row *row = w->current_matrix->rows; struct glyph *glyph, *end; === modified file 'src/keyboard.c' --- src/keyboard.c 2010-09-22 16:03:34 +0000 +++ src/keyboard.c 2010-09-24 17:48:10 +0000 @@ -5281,7 +5281,8 @@ /* It's a click in window window at frame coordinates (x,y) */ struct window *w = XWINDOW (window); Lisp_Object string_info = Qnil; - int textpos = -1, rx = -1, ry = -1; + EMACS_INT textpos = -1; + int rx = -1, ry = -1; int dx = -1, dy = -1; int width = -1, height = -1; Lisp_Object object = Qnil; @@ -5300,7 +5301,7 @@ /* Mode line or header line. Look for a string under the mouse that may have a `local-map' property. */ Lisp_Object string; - int charpos; + EMACS_INT charpos; posn = part == ON_MODE_LINE ? Qmode_line : Qheader_line; rx = wx, ry = wy; @@ -5324,7 +5325,7 @@ else if (part == ON_LEFT_MARGIN || part == ON_RIGHT_MARGIN) { Lisp_Object string; - int charpos; + EMACS_INT charpos; posn = (part == ON_LEFT_MARGIN) ? Qleft_margin : Qright_margin; rx = wx, ry = wy; === modified file 'src/xdisp.c' --- src/xdisp.c 2010-09-24 15:01:03 +0000 +++ src/xdisp.c 2010-09-24 17:48:10 +0000 @@ -11103,7 +11103,7 @@ /* Delta in characters and bytes for try_window_id. */ -int debug_delta, debug_delta_bytes; +EMACS_INT debug_delta, debug_delta_bytes; /* Values of window_end_pos and window_end_vpos at the end of try_window_id. */ @@ -11834,7 +11834,7 @@ { struct glyph_row *row = MATRIX_ROW (w->current_matrix, this_line_vpos + 1); - int delta, delta_bytes; + EMACS_INT delta, delta_bytes; /* We used to distinguish between two cases here, conditioned by Z - CHARPOS (tlendpos) == ZV, for @@ -12463,7 +12463,8 @@ int set_cursor_from_row (struct window *w, struct glyph_row *row, - struct glyph_matrix *matrix, int delta, int delta_bytes, + struct glyph_matrix *matrix, + EMACS_INT delta, EMACS_INT delta_bytes, int dy, int dvpos) { struct glyph *glyph = row->glyphs[TEXT_AREA]; @@ -15056,7 +15057,7 @@ static struct glyph_row *find_last_unchanged_at_beg_row (struct window *); static struct glyph_row *find_first_unchanged_at_end_row (struct window *, - int *, int *); + EMACS_INT *, EMACS_INT *); static struct glyph_row * find_last_row_displaying_text (struct glyph_matrix *, struct it *, struct glyph_row *); @@ -15151,7 +15152,8 @@ changes. */ static struct glyph_row * -find_first_unchanged_at_end_row (struct window *w, int *delta, int *delta_bytes) +find_first_unchanged_at_end_row (struct window *w, + EMACS_INT *delta, EMACS_INT *delta_bytes) { struct glyph_row *row; struct glyph_row *row_found = NULL; @@ -15382,13 +15384,14 @@ struct glyph_row *bottom_row; int bottom_vpos; struct it it; - int delta = 0, delta_bytes = 0, stop_pos, dvpos, dy; + EMACS_INT delta = 0, delta_bytes = 0, stop_pos; + int dvpos, dy; struct text_pos start_pos; struct run run; int first_unchanged_at_end_vpos = 0; struct glyph_row *last_text_row, *last_text_row_at_end; struct text_pos start; - int first_changed_charpos, last_changed_charpos; + EMACS_INT first_changed_charpos, last_changed_charpos; #if GLYPH_DEBUG if (inhibit_try_window_id) @@ -15515,7 +15518,7 @@ || (last_changed_charpos < CHARPOS (start) - 1 && FETCH_BYTE (BYTEPOS (start) - 1) == '\n'))) { - int Z_old, delta, Z_BYTE_old, delta_bytes; + EMACS_INT Z_old, delta, Z_BYTE_old, delta_bytes; struct glyph_row *r0; /* Compute how many chars/bytes have been added to or removed @@ -24167,7 +24170,8 @@ Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f); Cursor cursor = FRAME_X_OUTPUT (f)->nontext_cursor; Lisp_Object pointer = Qnil; - int charpos, dx, dy, width, height; + int dx, dy, width, height; + EMACS_INT charpos; Lisp_Object string, object = Qnil; Lisp_Object pos, help; ------------------------------------------------------------ revno: 101594 committer: Eli Zaretskii branch nick: trunk timestamp: Fri 2010-09-24 11:24:47 -0400 message: Fix int/EMACS_INT use in casefiddle.c and syntax.c. syntax.c (scan_words, update_syntax_table) (prev_char_comend_first, back_comment, skip_chars) (skip_syntaxes, Fforward_comment, Fbackward_prefix_chars): Use EMACS_INT for buffer and string positions. syntax.h (scan_words, update_syntax_table): Adjust prototypes. casefiddle.c (operate_on_word): Use EMACS_INT for buffer positions. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-09-24 15:20:58 +0000 +++ src/ChangeLog 2010-09-24 15:24:47 +0000 @@ -1,3 +1,15 @@ +2010-09-24 Eli Zaretskii + + * syntax.c (scan_words, update_syntax_table) + (prev_char_comend_first, back_comment, skip_chars) + (skip_syntaxes, Fforward_comment, Fbackward_prefix_chars): Use + EMACS_INT for buffer and string positions. + + * syntax.h (scan_words, update_syntax_table): Adjust prototypes. + + * casefiddle.c (operate_on_word): Use EMACS_INT for buffer + positions. + 2010-09-24 Lars Magne Ingebrigtsen * scroll.c (calculate_scrolling, line_ins_del) @@ -21,6 +33,14 @@ 2010-09-24 Eli Zaretskii + * syntax.c (scan_words, update_syntax_table) + (prev_char_comend_first, back_comment, skip_chars): + + * syntax.h (scan_words): Adjust prototype. + + * casefiddle.c (operate_on_word): Use EMACS_INT for buffer + positions. + * callproc.c (Fcall_process): Use EMACS_INT for count of characters read from the subprocess. === modified file 'src/casefiddle.c' --- src/casefiddle.c 2010-08-18 09:27:53 +0000 +++ src/casefiddle.c 2010-09-24 15:24:47 +0000 @@ -352,8 +352,8 @@ operate_on_word (Lisp_Object arg, EMACS_INT *newpoint) { Lisp_Object val; - int farend; - int iarg; + EMACS_INT farend; + EMACS_INT iarg; CHECK_NUMBER (arg); iarg = XINT (arg); === modified file 'src/syntax.c' --- src/syntax.c 2010-09-23 19:00:31 +0000 +++ src/syntax.c 2010-09-24 15:24:47 +0000 @@ -185,7 +185,8 @@ start/end of OBJECT. */ void -update_syntax_table (int charpos, int count, int init, Lisp_Object object) +update_syntax_table (EMACS_INT charpos, int count, int init, + Lisp_Object object) { Lisp_Object tmp_table; int cnt = 0, invalidate = 1; @@ -475,7 +476,7 @@ /* Return the SYNTAX_COMEND_FIRST of the character before POS, POS_BYTE. */ static int -prev_char_comend_first (int pos, int pos_byte) +prev_char_comend_first (EMACS_INT pos, EMACS_INT pos_byte) { int c, val; @@ -557,8 +558,8 @@ that determines quote parity to the comment-end. */ while (from != stop) { - int temp_byte, prev_syntax; - int com2start, com2end; + EMACS_INT temp_byte; + int prev_syntax, com2start, com2end; int comstart; /* Move back and examine a character. */ @@ -595,7 +596,8 @@ have %..\n and %{..}%. */ if (from > stop && (com2end || comstart)) { - int next = from, next_byte = from_byte, next_c, next_syntax; + EMACS_INT next = from, next_byte = from_byte; + int next_c, next_syntax; DEC_BOTH (next, next_byte); UPDATE_SYNTAX_TABLE_BACKWARD (next); next_c = FETCH_CHAR_AS_MULTIBYTE (next_byte); @@ -1242,12 +1244,12 @@ If that many words cannot be found before the end of the buffer, return 0. COUNT negative means scan backward and stop at word beginning. */ -int -scan_words (register int from, register int count) +EMACS_INT +scan_words (register EMACS_INT from, register EMACS_INT count) { - register int beg = BEGV; - register int end = ZV; - register int from_byte = CHAR_TO_BYTE (from); + register EMACS_INT beg = BEGV; + register EMACS_INT end = ZV; + register EMACS_INT from_byte = CHAR_TO_BYTE (from); register enum syntaxcode code; int ch0, ch1; Lisp_Object func, script, pos; @@ -1455,14 +1457,14 @@ int *char_ranges; int n_char_ranges = 0; int negate = 0; - register int i, i_byte; + register EMACS_INT i, i_byte; /* Set to 1 if the current buffer is multibyte and the region contains non-ASCII chars. */ int multibyte; /* Set to 1 if STRING is multibyte and it contains non-ASCII chars. */ int string_multibyte; - int size_byte; + EMACS_INT size_byte; const unsigned char *str; int len; Lisp_Object iso_classes; @@ -1774,9 +1776,9 @@ } { - int start_point = PT; - int pos = PT; - int pos_byte = PT_BYTE; + EMACS_INT start_point = PT; + EMACS_INT pos = PT; + EMACS_INT pos_byte = PT_BYTE; unsigned char *p = PT_ADDR, *endp, *stop; if (forwardp) @@ -1946,9 +1948,9 @@ register unsigned int c; unsigned char fastmap[0400]; int negate = 0; - register int i, i_byte; + register EMACS_INT i, i_byte; int multibyte; - int size_byte; + EMACS_INT size_byte; unsigned char *str; CHECK_STRING (string); @@ -2001,9 +2003,9 @@ fastmap[i] ^= 1; { - int start_point = PT; - int pos = PT; - int pos_byte = PT_BYTE; + EMACS_INT start_point = PT; + EMACS_INT pos = PT; + EMACS_INT pos_byte = PT_BYTE; unsigned char *p = PT_ADDR, *endp, *stop; if (forwardp) @@ -2394,7 +2396,8 @@ if (code == Scomment_fence) { /* Skip until first preceding unquoted comment_fence. */ - int found = 0, ini = from, ini_byte = from_byte; + int found = 0; + EMACS_INT ini = from, ini_byte = from_byte; while (1) { @@ -2910,11 +2913,11 @@ This includes chars with "quote" or "prefix" syntax (' or p). */) (void) { - int beg = BEGV; - int opoint = PT; - int opoint_byte = PT_BYTE; - int pos = PT; - int pos_byte = PT_BYTE; + EMACS_INT beg = BEGV; + EMACS_INT opoint = PT; + EMACS_INT opoint_byte = PT_BYTE; + EMACS_INT pos = PT; + EMACS_INT pos_byte = PT_BYTE; int c; if (pos <= beg) === modified file 'src/syntax.h' --- src/syntax.h 2010-08-12 14:44:16 +0000 +++ src/syntax.h 2010-09-24 15:24:47 +0000 @@ -19,7 +19,7 @@ extern Lisp_Object Qsyntax_table_p; -extern void update_syntax_table (int, int, int, Lisp_Object); +extern void update_syntax_table (EMACS_INT, int, int, Lisp_Object); /* The standard syntax table is stored where it will automatically be used in all new buffers. */ @@ -301,7 +301,7 @@ extern int parse_sexp_lookup_properties; extern INTERVAL interval_of (int, Lisp_Object); -extern int scan_words (int, int); +extern EMACS_INT scan_words (EMACS_INT, EMACS_INT); /* arch-tag: 28833cca-cd73-4741-8c85-a3111166a0e0 (do not change this comment) */ ------------------------------------------------------------ revno: 101593 committer: Lars Magne Ingebrigtsen branch nick: trunk timestamp: Fri 2010-09-24 17:20:58 +0200 message: Fix EMACS_INT/int conversion in scroll.c. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-09-24 15:13:43 +0000 +++ src/ChangeLog 2010-09-24 15:20:58 +0000 @@ -1,5 +1,9 @@ 2010-09-24 Lars Magne Ingebrigtsen + * scroll.c (calculate_scrolling, line_ins_del) + (calculate_direct_scrolling, scroll_cost): Fix EMACS_INT/int + conversion. + * region-cache.c (move_cache_gap, set_cache_region, pp_cache) (region_cache_backward, region_cache_forward) (revalidate_region_cache, set_cache_region): FIX EMACS_INT/int === modified file 'src/scroll.c' --- src/scroll.c 2010-07-12 17:47:17 +0000 +++ src/scroll.c 2010-09-24 15:20:58 +0000 @@ -94,7 +94,7 @@ int free_at_end) { register int i, j; - int frame_lines = FRAME_LINES (frame); + EMACS_INT frame_lines = FRAME_LINES (frame); register struct matrix_elt *p, *p1; register int cost, cost1; @@ -115,7 +115,7 @@ /* Discourage long scrolls on fast lines. Don't scroll nearly a full frame height unless it saves at least 1/4 second. */ - int extra_cost = baud_rate / (10 * 4 * FRAME_LINES (frame)); + int extra_cost = (int) (baud_rate / (10 * 4 * FRAME_LINES (frame))); if (baud_rate <= 0) extra_cost = 1; @@ -428,7 +428,7 @@ int free_at_end) { register int i, j; - int frame_lines = FRAME_LINES (frame); + EMACS_INT frame_lines = FRAME_LINES (frame); register struct matrix_elt *p, *p1; register int cost, cost1, delta; @@ -448,7 +448,7 @@ /* Discourage long scrolls on fast lines. Don't scroll nearly a full frame height unless it saves at least 1/4 second. */ - int extra_cost = baud_rate / (10 * 4 * FRAME_LINES (frame)); + int extra_cost = (int) (baud_rate / (10 * 4 * FRAME_LINES (frame))); if (baud_rate <= 0) extra_cost = 1; @@ -886,9 +886,9 @@ { /* Compute how many lines, at bottom of frame, will not be involved in actual motion. */ - int limit = to; - int offset; - int height = FRAME_LINES (frame); + EMACS_INT limit = to; + EMACS_INT offset; + EMACS_INT height = FRAME_LINES (frame); if (amount == 0) return 0; @@ -921,8 +921,8 @@ static void line_ins_del (FRAME_PTR frame, int ov1, int pf1, int ovn, int pfn, register int *ov, register int *mf) { - register int i; - register int frame_lines = FRAME_LINES (frame); + register EMACS_INT i; + register EMACS_INT frame_lines = FRAME_LINES (frame); register int insert_overhead = ov1 * 10; register int next_insert_cost = ovn * 10; ------------------------------------------------------------ revno: 101592 committer: Lars Magne Ingebrigtsen branch nick: trunk timestamp: Fri 2010-09-24 17:13:43 +0200 message: Fix EMACS_INT/int conversion in region-cache.c. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-09-24 15:01:03 +0000 +++ src/ChangeLog 2010-09-24 15:13:43 +0000 @@ -1,5 +1,10 @@ 2010-09-24 Lars Magne Ingebrigtsen + * region-cache.c (move_cache_gap, set_cache_region, pp_cache) + (region_cache_backward, region_cache_forward) + (revalidate_region_cache, set_cache_region): FIX EMACS_INT/int + conversion. + * xdisp.c (message_dolog): Fix EMACS_INT/int conversion. * eval.c (verror): Fix EMACS_INT/int conversion. === modified file 'src/region-cache.c' --- src/region-cache.c 2010-09-23 18:35:11 +0000 +++ src/region-cache.c 2010-09-24 15:13:43 +0000 @@ -76,7 +76,7 @@ /* The number of elements allocated to boundaries, not including the gap. */ - int cache_len; + EMACS_INT cache_len; /* The areas that haven't changed since the last time we cleaned out invalid entries from the cache. These overlap when the buffer is @@ -172,16 +172,16 @@ This operation should be logarithmic in the number of cache entries. It would be nice if it took advantage of locality of reference, too, by searching entries near the last entry found. */ -static int +static EMACS_INT find_cache_boundary (struct region_cache *c, EMACS_INT pos) { - int low = 0, high = c->cache_len; + EMACS_INT low = 0, high = c->cache_len; while (low + 1 < high) { /* mid is always a valid index, because low < high and ">> 1" rounds down. */ - int mid = (low + high) >> 1; + EMACS_INT mid = (low + high) >> 1; EMACS_INT boundary = BOUNDARY_POS (c, mid); if (pos < boundary) @@ -207,7 +207,7 @@ /* Move the gap of cache C to index POS, and make sure it has space for at least MIN_SIZE boundaries. */ static void -move_cache_gap (struct region_cache *c, EMACS_INT pos, int min_size) +move_cache_gap (struct region_cache *c, EMACS_INT pos, EMACS_INT min_size) { /* Copy these out of the cache and into registers. */ EMACS_INT gap_start = c->gap_start; @@ -292,7 +292,7 @@ /* Insert a new boundary in cache C; it will have cache index INDEX, and have the specified POS and VALUE. */ static void -insert_cache_boundary (struct region_cache *c, int index, EMACS_INT pos, +insert_cache_boundary (struct region_cache *c, EMACS_INT index, EMACS_INT pos, int value) { /* index must be a valid cache index. */ @@ -406,8 +406,8 @@ index of the earliest boundary after the last character in start..end. (This tortured terminology is intended to answer all the "< or <=?" sort of questions.) */ - int start_ix = find_cache_boundary (c, start); - int end_ix = find_cache_boundary (c, end - 1) + 1; + EMACS_INT start_ix = find_cache_boundary (c, start); + EMACS_INT end_ix = find_cache_boundary (c, end - 1) + 1; /* We must remember the value established by the last boundary before end; if that boundary's domain stretches beyond end, @@ -623,7 +623,7 @@ corresponds to the modified region of the buffer. */ else { - int modified_ix; + EMACS_INT modified_ix; /* These positions are correct, relative to both the cache basis and the buffer basis. */ @@ -712,9 +712,9 @@ revalidate_region_cache (buf, c); { - int i = find_cache_boundary (c, pos); + EMACS_INT i = find_cache_boundary (c, pos); int i_value = BOUNDARY_VALUE (c, i); - int j; + EMACS_INT j; /* Beyond the end of the buffer is unknown, by definition. */ if (pos >= BUF_Z (buf)) @@ -756,9 +756,9 @@ } { - int i = find_cache_boundary (c, pos - 1); + EMACS_INT i = find_cache_boundary (c, pos - 1); int i_value = BOUNDARY_VALUE (c, i); - int j; + EMACS_INT j; if (next) { @@ -794,7 +794,7 @@ for (i = 0; i < c->cache_len; i++) { - int pos = BOUNDARY_POS (c, i); + EMACS_INT pos = BOUNDARY_POS (c, i); putc (((pos < beg_u) ? 'v' : (pos == beg_u) ? '-' ------------------------------------------------------------ revno: 101591 committer: Lars Magne Ingebrigtsen branch nick: trunk timestamp: Fri 2010-09-24 17:01:03 +0200 message: Fix all EMACS_INT/int conversion errors in print.c (and related files). diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-09-24 13:32:25 +0000 +++ src/ChangeLog 2010-09-24 15:01:03 +0000 @@ -1,3 +1,15 @@ +2010-09-24 Lars Magne Ingebrigtsen + + * xdisp.c (message_dolog): Fix EMACS_INT/int conversion. + + * eval.c (verror): Fix EMACS_INT/int conversion. + + * print.c: (PRINTDECLARE, PRINTPREPARE, strout, print_string) + (print_preprocess, print_check_string_charset_prop) + (print_object): Fix EMACS_INT/int conversion. + + * xdisp.c (message_dolog): Fix EMACS_INT/int conversion. + 2010-09-24 Eli Zaretskii * callproc.c (Fcall_process): Use EMACS_INT for count of @@ -52,6 +64,8 @@ 2010-09-23 Lars Magne Ingebrigtsen + * eval.c (verror): EMACS_INT/int cleanup. + * lisp.h (SPECPDL_INDEX): Cast to int, since we're not going to unwind_protect more than 2GB worth of functions. === modified file 'src/eval.c' --- src/eval.c 2010-08-22 20:02:16 +0000 +++ src/eval.c 2010-09-24 15:01:03 +0000 @@ -2003,7 +2003,7 @@ while (1) { - int used; + EMACS_INT used; used = doprnt (buffer, size, m, m + mlen, ap); if (used < size) break; === modified file 'src/lisp.h' --- src/lisp.h 2010-09-24 12:45:09 +0000 +++ src/lisp.h 2010-09-24 15:01:03 +0000 @@ -2667,7 +2667,7 @@ extern void message2_nolog (const char *, int, int); extern void message3 (Lisp_Object, int, int); extern void message3_nolog (Lisp_Object, int, int); -extern void message_dolog (const char *, int, int, int); +extern void message_dolog (const char *, EMACS_INT, int, int); extern void message_with_string (const char *, Lisp_Object, int); extern void message_log_maybe_newline (void); extern void update_echo_area (void); === modified file 'src/print.c' --- src/print.c 2010-08-05 23:34:12 +0000 +++ src/print.c 2010-09-24 15:01:03 +0000 @@ -96,11 +96,11 @@ char *print_buffer; /* Size allocated in print_buffer. */ -int print_buffer_size; +EMACS_INT print_buffer_size; /* Chars stored in print_buffer. */ -int print_buffer_pos; +EMACS_INT print_buffer_pos; /* Bytes stored in print_buffer. */ -int print_buffer_pos_byte; +EMACS_INT print_buffer_pos_byte; /* Maximum length of list to print in full; noninteger means effectively infinity */ @@ -177,8 +177,8 @@ #define PRINTDECLARE \ struct buffer *old = current_buffer; \ - int old_point = -1, start_point = -1; \ - int old_point_byte = -1, start_point_byte = -1; \ + EMACS_INT old_point = -1, start_point = -1; \ + EMACS_INT old_point_byte = -1, start_point_byte = -1; \ int specpdl_count = SPECPDL_INDEX (); \ int free_print_buffer = 0; \ int multibyte = !NILP (current_buffer->enable_multibyte_characters); \ @@ -342,8 +342,8 @@ to data in a Lisp string. Otherwise that is not safe. */ static void -strout (const char *ptr, int size, int size_byte, Lisp_Object printcharfun, - int multibyte) +strout (const char *ptr, EMACS_INT size, EMACS_INT size_byte, + Lisp_Object printcharfun, int multibyte) { if (size < 0) size_byte = size = strlen (ptr); @@ -430,7 +430,7 @@ { if (EQ (printcharfun, Qt) || NILP (printcharfun)) { - int chars; + EMACS_INT chars; if (print_escape_nonascii) string = string_escape_byte8 (string); @@ -446,7 +446,7 @@ convert STRING to a multibyte string containing the same character codes. */ Lisp_Object newstr; - int bytes; + EMACS_INT bytes; chars = SBYTES (string); bytes = parse_str_to_multibyte (SDATA (string), chars); @@ -464,7 +464,7 @@ if (EQ (printcharfun, Qt)) { /* Output to echo area. */ - int nbytes = SBYTES (string); + EMACS_INT nbytes = SBYTES (string); char *buffer; /* Copy the string contents so that relocation of STRING by @@ -490,8 +490,8 @@ /* Otherwise, string may be relocated by printing one char. So re-fetch the string address for each character. */ int i; - int size = SCHARS (string); - int size_byte = SBYTES (string); + EMACS_INT size = SCHARS (string); + EMACS_INT size_byte = SBYTES (string); struct gcpro gcpro1; GCPRO1 (string); if (size == size_byte) @@ -868,7 +868,7 @@ (Lisp_Object character) { CHECK_NUMBER (character); - putc (XINT (character), stderr); + putc ((int) XINT (character), stderr); #ifdef WINDOWSNT /* Send the output to a debugger (nothing happens if there isn't one). */ @@ -1430,8 +1430,8 @@ || ! (print_check_string_result & PRINT_STRING_UNSAFE_CHARSET_FOUND)) { int i, c; - int charpos = interval->position; - int bytepos = string_char_to_byte (string, charpos); + EMACS_INT charpos = interval->position; + EMACS_INT bytepos = string_char_to_byte (string, charpos); Lisp_Object charset; charset = XCAR (XCDR (val)); @@ -1566,7 +1566,7 @@ register int i, i_byte; struct gcpro gcpro1; unsigned char *str; - int size_byte; + EMACS_INT size_byte; /* 1 means we must ensure that the next character we output cannot be taken as part of a hex character escape. */ int need_nonhex = 0; @@ -1684,7 +1684,8 @@ register unsigned char *p = SDATA (SYMBOL_NAME (obj)); register unsigned char *end = p + SBYTES (SYMBOL_NAME (obj)); register int c; - int i, i_byte, size_byte; + int i, i_byte; + EMACS_INT size_byte; Lisp_Object name; name = SYMBOL_NAME (obj); @@ -1803,7 +1804,8 @@ } { - int print_length, i; + EMACS_INT print_length; + int i; Lisp_Object halftail = obj; /* Negative values of print-length are invalid in CL. @@ -1898,7 +1900,7 @@ register int i; register unsigned char c; struct gcpro gcpro1; - int size_in_chars + EMACS_INT size_in_chars = ((XBOOL_VECTOR (obj)->size + BOOL_VECTOR_BITS_PER_CHAR - 1) / BOOL_VECTOR_BITS_PER_CHAR); @@ -1984,7 +1986,8 @@ else if (HASH_TABLE_P (obj)) { struct Lisp_Hash_Table *h = XHASH_TABLE (obj); - int i, real_size, size; + int i; + EMACS_INT real_size, size; #if 0 strout ("#test)) @@ -2150,7 +2153,7 @@ { register int i; register Lisp_Object tem; - int real_size = size; + EMACS_INT real_size = size; /* Don't print more elements than the specified maximum. */ if (NATNUMP (Vprint_length) === modified file 'src/xdisp.c' --- src/xdisp.c 2010-09-23 14:32:38 +0000 +++ src/xdisp.c 2010-09-24 15:01:03 +0000 @@ -7990,7 +7990,7 @@ so the buffer M must NOT point to a Lisp string. */ void -message_dolog (const char *m, int nbytes, int nlflag, int multibyte) +message_dolog (const char *m, EMACS_INT nbytes, int nlflag, int multibyte) { if (!NILP (Vmemory_full)) return; ------------------------------------------------------------ revno: 101590 committer: Eli Zaretskii branch nick: trunk timestamp: Fri 2010-09-24 09:32:25 -0400 message: Fix int/EMACS_INT use in callproc.c. callproc.c (Fcall_process): Use EMACS_INT for count of characters read from the subprocess. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-09-24 13:05:24 +0000 +++ src/ChangeLog 2010-09-24 13:32:25 +0000 @@ -1,5 +1,8 @@ 2010-09-24 Eli Zaretskii + * callproc.c (Fcall_process): Use EMACS_INT for count of + characters read from the subprocess. + * bidi.c (struct bidi_paragraph_info): Use EMACS_INT for buffer positions. (bidi_cache_search, bidi_cache_find): Use EMACS_INT for buffer === modified file 'src/callproc.c' --- src/callproc.c 2010-08-22 15:14:37 +0000 +++ src/callproc.c 2010-09-24 13:32:25 +0000 @@ -678,9 +678,9 @@ QUIT; { - register int nread; + register EMACS_INT nread; int first = 1; - int total_read = 0; + EMACS_INT total_read = 0; int carryover = 0; int display_on_the_fly = display_p; struct coding_system saved_coding; ------------------------------------------------------------ revno: 101589 committer: Eli Zaretskii branch nick: trunk timestamp: Fri 2010-09-24 09:05:24 -0400 message: Really fix int/EMACS_INT use in bidi.c. bidi.c (struct bidi_paragraph_info): Use EMACS_INT for buffer positions. (bidi_cache_search, bidi_cache_find): Use EMACS_INT for buffer positions. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-09-24 12:45:09 +0000 +++ src/ChangeLog 2010-09-24 13:05:24 +0000 @@ -1,5 +1,10 @@ 2010-09-24 Eli Zaretskii + * bidi.c (struct bidi_paragraph_info): Use EMACS_INT for buffer + positions. + (bidi_cache_search, bidi_cache_find): Use EMACS_INT for buffer + positions. + * buffer.c (struct sortvec): Use EMACS_INT for buffer positions. (struct sortstrlist, overlay_str_len): Use EMACS_INT for string length. === modified file 'src/bidi.c' --- src/bidi.c 2010-09-18 11:59:53 +0000 +++ src/bidi.c 2010-09-24 13:05:24 +0000 @@ -79,10 +79,10 @@ /* What we need to know about the current paragraph. */ struct bidi_paragraph_info { - int start_bytepos; /* byte position where it begins */ - int end_bytepos; /* byte position where it ends */ - int embedding_level; /* its basic embedding level */ - bidi_dir_t base_dir; /* its base direction */ + EMACS_INT start_bytepos; /* byte position where it begins */ + EMACS_INT end_bytepos; /* byte position where it ends */ + int embedding_level; /* its basic embedding level */ + bidi_dir_t base_dir; /* its base direction */ }; /* Data type for describing the bidirectional character categories. */ @@ -313,7 +313,7 @@ resolved levels in cached states. DIR, if non-zero, means search in that direction from the last cache hit. */ static INLINE int -bidi_cache_search (int charpos, int level, int dir) +bidi_cache_search (EMACS_INT charpos, int level, int dir) { int i, i_start; @@ -462,7 +462,7 @@ } static INLINE bidi_type_t -bidi_cache_find (int charpos, int level, struct bidi_it *bidi_it) +bidi_cache_find (EMACS_INT charpos, int level, struct bidi_it *bidi_it) { int i = bidi_cache_search (charpos, level, bidi_it->scan_dir); ------------------------------------------------------------ revno: 101588 committer: Eli Zaretskii branch nick: trunk timestamp: Fri 2010-09-24 08:45:09 -0400 message: Fix int/EMACS_INT use in buffer.c. buffer.c (struct sortvec): Use EMACS_INT for buffer positions. (struct sortstrlist, overlay_str_len): Use EMACS_INT for string length. (advance_to_char_boundary, Fset_buffer_multibyte) (overlays_at, overlays_in, mouse_face_overlay_overlaps) (overlay_touches_p, record_overlay_string, overlay_strings) (recenter_overlay_lists, fix_start_end_in_overlays) (modify_overlay, Fmove_overlay, report_overlay_modification) (evaporate_overlays): Use EMACS_INT for buffer positions. lisp.h (fix_start_end_in_overlays, overlay_touches_p): Adjust prototypes. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-09-24 12:05:24 +0000 +++ src/ChangeLog 2010-09-24 12:45:09 +0000 @@ -1,5 +1,18 @@ 2010-09-24 Eli Zaretskii + * buffer.c (struct sortvec): Use EMACS_INT for buffer positions. + (struct sortstrlist, overlay_str_len): Use EMACS_INT for string + length. + (advance_to_char_boundary, Fset_buffer_multibyte) + (overlays_at, overlays_in, mouse_face_overlay_overlaps) + (overlay_touches_p, record_overlay_string, overlay_strings) + (recenter_overlay_lists, fix_start_end_in_overlays) + (modify_overlay, Fmove_overlay, report_overlay_modification) + (evaporate_overlays): Use EMACS_INT for buffer positions. + + * lisp.h (fix_start_end_in_overlays, overlay_touches_p): Adjust + prototypes. + * dispextern.h (struct bidi_saved_info): Use EMACS_INT for buffer positions. === modified file 'src/buffer.c' --- src/buffer.c 2010-09-14 20:32:35 +0000 +++ src/buffer.c 2010-09-24 12:45:09 +0000 @@ -2092,7 +2092,7 @@ and return the adjusted position. */ static int -advance_to_char_boundary (int byte_pos) +advance_to_char_boundary (EMACS_INT byte_pos) { int c; @@ -2105,7 +2105,7 @@ { /* We should advance BYTE_POS only when C is a constituent of a multibyte sequence. */ - int orig_byte_pos = byte_pos; + EMACS_INT orig_byte_pos = byte_pos; do { @@ -2273,7 +2273,7 @@ { struct Lisp_Marker *tail, *markers; struct buffer *other; - int begv, zv; + EMACS_INT begv, zv; int narrowed = (BEG != BEGV || Z != ZV); int modified_p = !NILP (Fbuffer_modified_p (Qnil)); Lisp_Object old_undo = current_buffer->undo_list; @@ -2305,7 +2305,7 @@ if (NILP (flag)) { - int pos, stop; + EMACS_INT pos, stop; unsigned char *p; /* Do this first, so it can use CHAR_TO_BYTE @@ -2369,8 +2369,8 @@ } else { - int pt = PT; - int pos, stop; + EMACS_INT pt = PT; + EMACS_INT pos, stop; unsigned char *p, *pend; /* Be sure not to have a multibyte sequence striding over the GAP. @@ -2386,7 +2386,7 @@ while (! CHAR_HEAD_P (*p) && p > BEG_ADDR) p--; if (LEADING_CODE_P (*p)) { - int new_gpt = GPT_BYTE - (GPT_ADDR - p); + EMACS_INT new_gpt = GPT_BYTE - (GPT_ADDR - p); move_gap_both (new_gpt, new_gpt); } @@ -2470,8 +2470,8 @@ ZV = chars_in_text (BEG_ADDR, ZV_BYTE - BEG_BYTE) + BEG; { - int pt_byte = advance_to_char_boundary (PT_BYTE); - int pt; + EMACS_INT pt_byte = advance_to_char_boundary (PT_BYTE); + EMACS_INT pt; if (pt_byte > GPT_BYTE) pt = chars_in_text (GAP_END_ADDR, pt_byte - GPT_BYTE) + GPT; @@ -2642,13 +2642,13 @@ int idx = 0; int len = *len_ptr; Lisp_Object *vec = *vec_ptr; - int next = ZV; - int prev = BEGV; + EMACS_INT next = ZV; + EMACS_INT prev = BEGV; int inhibit_storing = 0; for (tail = current_buffer->overlays_before; tail; tail = tail->next) { - int startpos, endpos; + EMACS_INT startpos, endpos; XSETMISC (overlay, tail); @@ -2699,7 +2699,7 @@ for (tail = current_buffer->overlays_after; tail; tail = tail->next) { - int startpos, endpos; + EMACS_INT startpos, endpos; XSETMISC (overlay, tail); @@ -2773,22 +2773,23 @@ But we still return the total number of overlays. */ static int -overlays_in (int beg, int end, int extend, Lisp_Object **vec_ptr, int *len_ptr, - int *next_ptr, int *prev_ptr) +overlays_in (EMACS_INT beg, EMACS_INT end, int extend, + Lisp_Object **vec_ptr, int *len_ptr, + EMACS_INT *next_ptr, EMACS_INT *prev_ptr) { Lisp_Object overlay, ostart, oend; struct Lisp_Overlay *tail; int idx = 0; int len = *len_ptr; Lisp_Object *vec = *vec_ptr; - int next = ZV; - int prev = BEGV; + EMACS_INT next = ZV; + EMACS_INT prev = BEGV; int inhibit_storing = 0; int end_is_Z = end == Z; for (tail = current_buffer->overlays_before; tail; tail = tail->next) { - int startpos, endpos; + EMACS_INT startpos, endpos; XSETMISC (overlay, tail); @@ -2838,7 +2839,7 @@ for (tail = current_buffer->overlays_after; tail; tail = tail->next) { - int startpos, endpos; + EMACS_INT startpos, endpos; XSETMISC (overlay, tail); @@ -2897,8 +2898,8 @@ int mouse_face_overlay_overlaps (Lisp_Object overlay) { - int start = OVERLAY_POSITION (OVERLAY_START (overlay)); - int end = OVERLAY_POSITION (OVERLAY_END (overlay)); + EMACS_INT start = OVERLAY_POSITION (OVERLAY_START (overlay)); + EMACS_INT end = OVERLAY_POSITION (OVERLAY_END (overlay)); int n, i, size; Lisp_Object *v, tem; @@ -2924,14 +2925,14 @@ /* Fast function to just test if we're at an overlay boundary. */ int -overlay_touches_p (int pos) +overlay_touches_p (EMACS_INT pos) { Lisp_Object overlay; struct Lisp_Overlay *tail; for (tail = current_buffer->overlays_before; tail; tail = tail->next) { - int endpos; + EMACS_INT endpos; XSETMISC (overlay ,tail); if (!OVERLAYP (overlay)) @@ -2946,7 +2947,7 @@ for (tail = current_buffer->overlays_after; tail; tail = tail->next) { - int startpos; + EMACS_INT startpos; XSETMISC (overlay, tail); if (!OVERLAYP (overlay)) @@ -2964,7 +2965,7 @@ struct sortvec { Lisp_Object overlay; - int beg, end; + EMACS_INT beg, end; int priority; }; @@ -3051,7 +3052,7 @@ struct sortstr *buf; /* An array that expands as needed; never freed. */ int size; /* Allocated length of that array. */ int used; /* How much of the array is currently in use. */ - int bytes; /* Total length of the strings in buf. */ + EMACS_INT bytes; /* Total length of the strings in buf. */ }; /* Buffers for storing information about the overlays touching a given @@ -3062,7 +3063,7 @@ static unsigned char *overlay_str_buf; /* Allocated length of overlay_str_buf. */ -static int overlay_str_len; +static EMACS_INT overlay_str_len; /* A comparison function suitable for passing to qsort. */ static int @@ -3080,7 +3081,7 @@ static void record_overlay_string (struct sortstrlist *ssl, Lisp_Object str, Lisp_Object str2, Lisp_Object pri, int size) { - int nbytes; + EMACS_INT nbytes; if (ssl->used == ssl->size) { @@ -3138,7 +3139,7 @@ { Lisp_Object overlay, window, str; struct Lisp_Overlay *ov; - int startpos, endpos; + EMACS_INT startpos, endpos; int multibyte = ! NILP (current_buffer->enable_multibyte_characters); overlay_heads.used = overlay_heads.bytes = 0; @@ -3208,9 +3209,9 @@ if (overlay_heads.bytes || overlay_tails.bytes) { Lisp_Object tem; - int i; + EMACS_INT i; unsigned char *p; - int total = overlay_heads.bytes + overlay_tails.bytes; + EMACS_INT total = overlay_heads.bytes + overlay_tails.bytes; if (total > overlay_str_len) { @@ -3221,7 +3222,7 @@ p = overlay_str_buf; for (i = overlay_tails.used; --i >= 0;) { - int nbytes; + EMACS_INT nbytes; tem = overlay_tails.buf[i].string; nbytes = copy_text (SDATA (tem), p, SBYTES (tem), @@ -3230,7 +3231,7 @@ } for (i = 0; i < overlay_heads.used; ++i) { - int nbytes; + EMACS_INT nbytes; tem = overlay_heads.buf[i].string; nbytes = copy_text (SDATA (tem), p, SBYTES (tem), @@ -3295,7 +3296,7 @@ if (OVERLAY_POSITION (end) > pos) { /* OVERLAY needs to be moved. */ - int where = OVERLAY_POSITION (beg); + EMACS_INT where = OVERLAY_POSITION (beg); struct Lisp_Overlay *other, *other_prev; /* Splice the cons cell TAIL out of overlays_before. */ @@ -3368,7 +3369,7 @@ if (OVERLAY_POSITION (end) <= pos) { /* OVERLAY needs to be moved. */ - int where = OVERLAY_POSITION (end); + EMACS_INT where = OVERLAY_POSITION (end); struct Lisp_Overlay *other, *other_prev; /* Splice the cons cell TAIL out of overlays_after. */ @@ -3440,7 +3441,7 @@ Such an overlay might even have negative size at this point. If so, we'll make the overlay empty. */ void -fix_start_end_in_overlays (register int start, register int end) +fix_start_end_in_overlays (register EMACS_INT start, register EMACS_INT end) { Lisp_Object overlay; struct Lisp_Overlay *before_list, *after_list; @@ -3452,7 +3453,7 @@ current_buffer->overlays_before or overlays_after, depending which loop we're in. */ struct Lisp_Overlay *tail, *parent; - int startpos, endpos; + EMACS_INT startpos, endpos; /* This algorithm shifts links around instead of consing and GCing. The loop invariant is that before_list (resp. after_list) is a @@ -3753,7 +3754,7 @@ { if (start > end) { - int temp = start; + EMACS_INT temp = start; start = end; end = temp; } @@ -3844,8 +3845,8 @@ /* Redisplay where the overlay was. */ if (!NILP (obuffer)) { - int o_beg; - int o_end; + EMACS_INT o_beg; + EMACS_INT o_end; o_beg = OVERLAY_POSITION (OVERLAY_START (overlay)); o_end = OVERLAY_POSITION (OVERLAY_END (overlay)); @@ -3859,7 +3860,7 @@ else /* Redisplay the area the overlay has just left, or just enclosed. */ { - int o_beg, o_end; + EMACS_INT o_beg, o_end; o_beg = OVERLAY_POSITION (OVERLAY_START (overlay)); o_end = OVERLAY_POSITION (OVERLAY_END (overlay)); @@ -4037,7 +4038,7 @@ /* Put all the overlays we want in a vector in overlay_vec. Store the length in len. */ noverlays = overlays_in (XINT (beg), XINT (end), 1, &overlay_vec, &len, - (int *) 0, (int *) 0); + NULL, NULL); /* Make a list of them all. */ result = Flist (noverlays, overlay_vec); @@ -4280,7 +4281,7 @@ last_overlay_modification_hooks_used = 0; for (tail = current_buffer->overlays_before; tail; tail = tail->next) { - int startpos, endpos; + EMACS_INT startpos, endpos; Lisp_Object ostart, oend; XSETMISC (overlay, tail); @@ -4317,7 +4318,7 @@ for (tail = current_buffer->overlays_after; tail; tail = tail->next) { - int startpos, endpos; + EMACS_INT startpos, endpos; Lisp_Object ostart, oend; XSETMISC (overlay, tail); @@ -4409,7 +4410,7 @@ if (pos <= current_buffer->overlay_center) for (tail = current_buffer->overlays_before; tail; tail = tail->next) { - int endpos; + EMACS_INT endpos; XSETMISC (overlay, tail); endpos = OVERLAY_POSITION (OVERLAY_END (overlay)); if (endpos < pos) @@ -4421,7 +4422,7 @@ else for (tail = current_buffer->overlays_after; tail; tail = tail->next) { - int startpos; + EMACS_INT startpos; XSETMISC (overlay, tail); startpos = OVERLAY_POSITION (OVERLAY_START (overlay)); if (startpos > pos) === modified file 'src/lisp.h' --- src/lisp.h 2010-09-24 11:55:44 +0000 +++ src/lisp.h 2010-09-24 12:45:09 +0000 @@ -3015,10 +3015,10 @@ EXFUN (Foverlay_buffer, 1); extern void adjust_overlays_for_insert (EMACS_INT, EMACS_INT); extern void adjust_overlays_for_delete (EMACS_INT, EMACS_INT); -extern void fix_start_end_in_overlays (int, int); +extern void fix_start_end_in_overlays (EMACS_INT, EMACS_INT); extern void report_overlay_modification (Lisp_Object, Lisp_Object, int, Lisp_Object, Lisp_Object, Lisp_Object); -extern int overlay_touches_p (int); +extern int overlay_touches_p (EMACS_INT); extern Lisp_Object Vbuffer_alist, Vinhibit_read_only; EXFUN (Fbuffer_list, 1); EXFUN (Fget_buffer, 1); ------------------------------------------------------------ revno: 101587 committer: Eli Zaretskii branch nick: trunk timestamp: Fri 2010-09-24 08:05:24 -0400 message: Fix int/EMACS_INT in bidi.c. dispextern.h (struct bidi_saved_info): Use EMACS_INT for buffer positions. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-09-24 11:55:44 +0000 +++ src/ChangeLog 2010-09-24 12:05:24 +0000 @@ -1,5 +1,8 @@ 2010-09-24 Eli Zaretskii + * dispextern.h (struct bidi_saved_info): Use EMACS_INT for buffer + positions. + * fns.c (Fcompare_strings, Fstring_lessp, concat) (string_make_unibyte, Fstring_as_unibyte, Fsubstring) (Fsubstring_no_properties, substring_both, Ffillarray) === modified file 'src/dispextern.h' --- src/dispextern.h 2010-09-18 11:59:53 +0000 +++ src/dispextern.h 2010-09-24 12:05:24 +0000 @@ -1770,7 +1770,7 @@ /* Data type for storing information about characters we need to remember. */ struct bidi_saved_info { - int bytepos, charpos; /* character's buffer position */ + EMACS_INT bytepos, charpos; /* character's buffer position */ bidi_type_t type; /* character's resolved bidi type */ bidi_type_t type_after_w1; /* original type of the character, after W1 */ bidi_type_t orig_type; /* type as we found it in the buffer */ ------------------------------------------------------------ revno: 101586 committer: Eli Zaretskii branch nick: trunk timestamp: Fri 2010-09-24 07:55:44 -0400 message: Fix int/EMACS_INT usage in fns.c. fns.c (Fcompare_strings, Fstring_lessp, concat) (string_make_unibyte, Fstring_as_unibyte, Fsubstring) (Fsubstring_no_properties, substring_both, Ffillarray) (Fclear_string, mapcar1, Fmapconcat, Fmapcar, Fmapc) (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1) (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1) (Fmd5): Use EMACS_INT for buffer and string positions and length variables and arguments. : Use EMACS_INT for positions. lisp.h (substring_both): Adjust prototype. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-09-24 03:35:55 +0000 +++ src/ChangeLog 2010-09-24 11:55:44 +0000 @@ -1,3 +1,16 @@ +2010-09-24 Eli Zaretskii + + * fns.c (Fcompare_strings, Fstring_lessp, concat) + (string_make_unibyte, Fstring_as_unibyte, Fsubstring) + (Fsubstring_no_properties, substring_both, Ffillarray) + (Fclear_string, mapcar1, Fmapconcat, Fmapcar, Fmapc) + (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1) + (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1) + (Fmd5): Use EMACS_INT for buffer and string positions and length + variables and arguments. + + * lisp.h (substring_both): Adjust prototype. + 2010-09-24 Juanma Barranquero Remove W32 API function pointer unused since 2005-02-15 (revno 60055). === modified file 'src/fns.c' --- src/fns.c 2010-09-23 12:09:12 +0000 +++ src/fns.c 2010-09-24 11:55:44 +0000 @@ -241,8 +241,8 @@ N - 1 is the number of characters that match at the beginning. */) (Lisp_Object str1, Lisp_Object start1, Lisp_Object end1, Lisp_Object str2, Lisp_Object start2, Lisp_Object end2, Lisp_Object ignore_case) { - register int end1_char, end2_char; - register int i1, i1_byte, i2, i2_byte; + register EMACS_INT end1_char, end2_char; + register EMACS_INT i1, i1_byte, i2, i2_byte; CHECK_STRING (str1); CHECK_STRING (str2); @@ -332,8 +332,8 @@ Symbols are also allowed; their print names are used instead. */) (register Lisp_Object s1, Lisp_Object s2) { - register int end; - register int i1, i1_byte, i2, i2_byte; + register EMACS_INT end; + register EMACS_INT i1, i1_byte, i2, i2_byte; if (SYMBOLP (s1)) s1 = SYMBOL_NAME (s1); @@ -456,8 +456,8 @@ struct textprop_rec { int argnum; /* refer to ARGS (arguments of `concat') */ - int from; /* refer to ARGS[argnum] (argument string) */ - int to; /* refer to VAL (the target string) */ + EMACS_INT from; /* refer to ARGS[argnum] (argument string) */ + EMACS_INT to; /* refer to VAL (the target string) */ }; static Lisp_Object @@ -466,10 +466,10 @@ Lisp_Object val; register Lisp_Object tail; register Lisp_Object this; - int toindex; - int toindex_byte = 0; - register int result_len; - register int result_len_byte; + EMACS_INT toindex; + EMACS_INT toindex_byte = 0; + register EMACS_INT result_len; + register EMACS_INT result_len_byte; register int argnum; Lisp_Object last_tail; Lisp_Object prev; @@ -513,16 +513,16 @@ some_multibyte = 0; for (argnum = 0; argnum < nargs; argnum++) { - int len; + EMACS_INT len; this = args[argnum]; len = XFASTINT (Flength (this)); if (target_type == Lisp_String) { /* We must count the number of bytes needed in the string as well as the number of characters. */ - int i; + EMACS_INT i; Lisp_Object ch; - int this_len_byte; + EMACS_INT this_len_byte; if (VECTORP (this)) for (i = 0; i < len; i++) @@ -594,9 +594,9 @@ for (argnum = 0; argnum < nargs; argnum++) { Lisp_Object thislen; - int thisleni = 0; - register unsigned int thisindex = 0; - register unsigned int thisindex_byte = 0; + EMACS_INT thisleni = 0; + register EMACS_INT thisindex = 0; + register EMACS_INT thisindex_byte = 0; this = args[argnum]; if (!CONSP (this)) @@ -606,7 +606,7 @@ if (STRINGP (this) && STRINGP (val) && STRING_MULTIBYTE (this) == some_multibyte) { - int thislen_byte = SBYTES (this); + EMACS_INT thislen_byte = SBYTES (this); memcpy (SDATA (val) + toindex_byte, SDATA (this), SBYTES (this)); if (! NULL_INTERVAL_P (STRING_INTERVALS (this))) @@ -713,7 +713,7 @@ if (num_textprops > 0) { Lisp_Object props; - int last_to_end = -1; + EMACS_INT last_to_end = -1; for (argnum = 0; argnum < num_textprops; argnum++) { @@ -938,7 +938,7 @@ Lisp_Object string_make_unibyte (Lisp_Object string) { - int nchars; + EMACS_INT nchars; unsigned char *buf; Lisp_Object ret; USE_SAFE_ALLOCA; @@ -1003,7 +1003,7 @@ if (STRING_MULTIBYTE (string)) { - int bytes = SBYTES (string); + EMACS_INT bytes = SBYTES (string); unsigned char *str = (unsigned char *) xmalloc (bytes); memcpy (str, SDATA (string), bytes); @@ -1138,10 +1138,10 @@ (Lisp_Object string, register Lisp_Object from, Lisp_Object to) { Lisp_Object res; - int size; - int size_byte = 0; - int from_char, to_char; - int from_byte = 0, to_byte = 0; + EMACS_INT size; + EMACS_INT size_byte = 0; + EMACS_INT from_char, to_char; + EMACS_INT from_byte = 0, to_byte = 0; CHECK_VECTOR_OR_STRING (string); CHECK_NUMBER (from); @@ -1206,9 +1206,9 @@ With one argument, just copy STRING without its properties. */) (Lisp_Object string, register Lisp_Object from, Lisp_Object to) { - int size, size_byte; - int from_char, to_char; - int from_byte, to_byte; + EMACS_INT size, size_byte; + EMACS_INT from_char, to_char; + EMACS_INT from_byte, to_byte; CHECK_STRING (string); @@ -1256,11 +1256,12 @@ both in characters and in bytes. */ Lisp_Object -substring_both (Lisp_Object string, int from, int from_byte, int to, int to_byte) +substring_both (Lisp_Object string, EMACS_INT from, EMACS_INT from_byte, + EMACS_INT to, EMACS_INT to_byte) { Lisp_Object res; - int size; - int size_byte; + EMACS_INT size; + EMACS_INT size_byte; CHECK_VECTOR_OR_STRING (string); @@ -2147,7 +2148,9 @@ ARRAY is a vector, string, char-table, or bool-vector. */) (Lisp_Object array, Lisp_Object item) { - register int size, index, charval; + register EMACS_INT size, index; + int charval; + if (VECTORP (array)) { register Lisp_Object *p = XVECTOR (array)->contents; @@ -2173,7 +2176,7 @@ { unsigned char str[MAX_MULTIBYTE_LENGTH]; int len = CHAR_STRING (charval, str); - int size_byte = SBYTES (array); + EMACS_INT size_byte = SBYTES (array); unsigned char *p1 = p, *endp = p + size_byte; int i; @@ -2221,7 +2224,7 @@ This makes STRING unibyte and may change its length. */) (Lisp_Object string) { - int len; + EMACS_INT len; CHECK_STRING (string); len = SBYTES (string); memset (SDATA (string), 0, len); @@ -2285,11 +2288,11 @@ LENI is the length of VALS, which should also be the length of SEQ. */ static void -mapcar1 (int leni, Lisp_Object *vals, Lisp_Object fn, Lisp_Object seq) +mapcar1 (EMACS_INT leni, Lisp_Object *vals, Lisp_Object fn, Lisp_Object seq) { register Lisp_Object tail; Lisp_Object dummy; - register int i; + register EMACS_INT i; struct gcpro gcpro1, gcpro2, gcpro3; if (vals) @@ -2331,12 +2334,12 @@ } else if (STRINGP (seq)) { - int i_byte; + EMACS_INT i_byte; for (i = 0, i_byte = 0; i < leni;) { int c; - int i_before = i; + EMACS_INT i_before = i; FETCH_STRING_CHAR_ADVANCE (c, seq, i, i_byte); XSETFASTINT (dummy, c); @@ -2368,10 +2371,10 @@ (Lisp_Object function, Lisp_Object sequence, Lisp_Object separator) { Lisp_Object len; - register int leni; + register EMACS_INT leni; int nargs; register Lisp_Object *args; - register int i; + register EMACS_INT i; struct gcpro gcpro1; Lisp_Object ret; USE_SAFE_ALLOCA; @@ -2408,7 +2411,7 @@ (Lisp_Object function, Lisp_Object sequence) { register Lisp_Object len; - register int leni; + register EMACS_INT leni; register Lisp_Object *args; Lisp_Object ret; USE_SAFE_ALLOCA; @@ -2434,7 +2437,7 @@ SEQUENCE may be a list, a vector, a bool-vector, or a string. */) (Lisp_Object function, Lisp_Object sequence) { - register int leni; + register EMACS_INT leni; leni = XFASTINT (Flength (sequence)); if (CHAR_TABLE_P (sequence)) @@ -2958,8 +2961,9 @@ base64 characters. */ -static int base64_encode_1 (const char *, char *, int, int, int); -static int base64_decode_1 (const char *, char *, int, int, int *); +static EMACS_INT base64_encode_1 (const char *, char *, EMACS_INT, int, int); +static EMACS_INT base64_decode_1 (const char *, char *, EMACS_INT, int, + EMACS_INT *); DEFUN ("base64-encode-region", Fbase64_encode_region, Sbase64_encode_region, 2, 3, "r", @@ -2970,9 +2974,9 @@ (Lisp_Object beg, Lisp_Object end, Lisp_Object no_line_break) { char *encoded; - int allength, length; - int ibeg, iend, encoded_length; - int old_pos = PT; + EMACS_INT allength, length; + EMACS_INT ibeg, iend, encoded_length; + EMACS_INT old_pos = PT; USE_SAFE_ALLOCA; validate_region (&beg, &end); @@ -3028,7 +3032,7 @@ into shorter lines. */) (Lisp_Object string, Lisp_Object no_line_break) { - int allength, length, encoded_length; + EMACS_INT allength, length, encoded_length; char *encoded; Lisp_Object encoded_string; USE_SAFE_ALLOCA; @@ -3064,10 +3068,12 @@ return encoded_string; } -static int -base64_encode_1 (const char *from, char *to, int length, int line_break, int multibyte) +static EMACS_INT +base64_encode_1 (const char *from, char *to, EMACS_INT length, + int line_break, int multibyte) { - int counter = 0, i = 0; + int counter = 0; + EMACS_INT i = 0; char *e = to; int c; unsigned int value; @@ -3166,11 +3172,11 @@ If the region can't be decoded, signal an error and don't modify the buffer. */) (Lisp_Object beg, Lisp_Object end) { - int ibeg, iend, length, allength; + EMACS_INT ibeg, iend, length, allength; char *decoded; - int old_pos = PT; - int decoded_length; - int inserted_chars; + EMACS_INT old_pos = PT; + EMACS_INT decoded_length; + EMACS_INT inserted_chars; int multibyte = !NILP (current_buffer->enable_multibyte_characters); USE_SAFE_ALLOCA; @@ -3227,7 +3233,7 @@ (Lisp_Object string) { char *decoded; - int length, decoded_length; + EMACS_INT length, decoded_length; Lisp_Object decoded_string; USE_SAFE_ALLOCA; @@ -3259,14 +3265,15 @@ form. If NCHARS_RETRUN is not NULL, store the number of produced characters in *NCHARS_RETURN. */ -static int -base64_decode_1 (const char *from, char *to, int length, int multibyte, int *nchars_return) +static EMACS_INT +base64_decode_1 (const char *from, char *to, EMACS_INT length, + int multibyte, EMACS_INT *nchars_return) { - int i = 0; + EMACS_INT i = 0; /* Used inside READ_QUADRUPLET_BYTE */ char *e = to; unsigned char c; unsigned long value; - int nchars = 0; + EMACS_INT nchars = 0; while (1) { @@ -4572,13 +4579,13 @@ unsigned char digest[16]; unsigned char value[33]; int i; - int size; - int size_byte = 0; - int start_char = 0, end_char = 0; - int start_byte = 0, end_byte = 0; - register int b, e; + EMACS_INT size; + EMACS_INT size_byte = 0; + EMACS_INT start_char = 0, end_char = 0; + EMACS_INT start_byte = 0, end_byte = 0; + register EMACS_INT b, e; register struct buffer *bp; - int temp; + EMACS_INT temp; if (STRINGP (object)) { === modified file 'src/lisp.h' --- src/lisp.h 2010-09-23 20:57:48 +0000 +++ src/lisp.h 2010-09-24 11:55:44 +0000 @@ -2495,7 +2495,8 @@ EXFUN (Fstring_to_multibyte, 1); EXFUN (Fstring_to_unibyte, 1); EXFUN (Fsubstring, 3); -extern Lisp_Object substring_both (Lisp_Object, int, int, int, int); +extern Lisp_Object substring_both (Lisp_Object, EMACS_INT, EMACS_INT, + EMACS_INT, EMACS_INT); EXFUN (Fnth, 2); EXFUN (Fnthcdr, 2); EXFUN (Fmemq, 2); ------------------------------------------------------------ revno: 101585 committer: Katsumi Yamaoka branch nick: trunk timestamp: Fri 2010-09-24 07:25:37 +0000 message: Remove Emacs 21 stuff. gmm-utils.el (gmm-tool-bar-from-list): Always use tool-bar-local-item and tool-bar-local-item-from-menu. gnus-agent.el (gnus-agent-make-mode-line-string): Always use mode-line-highlight face for Emacs. gnus-art.el (toplevel): Don't bind recursive-load-depth-limit while loading gnus-sum.elc; don't autoload canlock-verify. gnus-art.el (gnus-article-jump-to-part): Use read-number. gnus-art.el (gnus-insert-mime-button, gnus-insert-mime-security-button): Remove Emacs pre-21 compatible code for help-echo. gnus-art.el (gnus-article-next-page-1): No need to adjust the number of lines. gnus-art.el (gnus-article-describe-bindings): Always use help-buffer. gnus-audio.el (gnus-audio-inline-sound): Comment fix. gnus-cus.el (gnus-custom-mode): Comment fix. gnus-group.el (gnus-group-update-tool-bar): Comment fix. gnus-sum.el (gnus-remove-overlays): Doc fix. gnus-util.el (gnus-select-frame-set-input-focus): Remove Emacs 21 compatible code. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2010-09-24 02:10:54 +0000 +++ lisp/gnus/ChangeLog 2010-09-24 07:25:37 +0000 @@ -1,3 +1,28 @@ +2010-09-24 Katsumi Yamaoka + + * gmm-utils.el (gmm-tool-bar-from-list): Always use tool-bar-local-item + and tool-bar-local-item-from-menu. + + * gnus-agent.el (gnus-agent-make-mode-line-string): Always use + mode-line-highlight face for Emacs. + + * gnus-art.el (toplevel): Don't bind recursive-load-depth-limit while + loading gnus-sum.elc; fix comment for canlock-verify. + (gnus-article-jump-to-part): Use read-number. + (gnus-insert-mime-button, gnus-insert-mime-security-button): Remove + Emacs pre-21 compatible code for help-echo. + (gnus-article-next-page-1): No need to adjust the number of lines. + (gnus-article-describe-bindings): Always use help-buffer. + + * gnus-audio.el (gnus-audio-inline-sound) + * gnus-cus.el (gnus-custom-mode) + * gnus-group.el (gnus-group-update-tool-bar): Comment fix. + + * gnus-sum.el (gnus-remove-overlays): Doc fix. + + * gnus-util.el (gnus-select-frame-set-input-focus): Remove Emacs 21 + compatible code. + 2010-09-24 Glenn Morris * message.el (message-output): Use gnus-output-to-rmail if a buffer is === modified file 'lisp/gnus/gmm-utils.el' --- lisp/gnus/gmm-utils.el 2010-09-02 00:55:51 +0000 +++ lisp/gnus/gmm-utils.el 2010-09-24 07:25:37 +0000 @@ -267,27 +267,16 @@ ;; (tool-bar-add-item ICON DEF KEY &rest PROPS) (apply 'tool-bar-add-item icon nil nil :enable nil props))) ((equal fmap t) ;; Not a menu command - (if (fboundp 'tool-bar-local-item) - (apply 'tool-bar-local-item - icon command - (intern icon) ;; reuse icon or fmap here? - tool-bar-map props) - ;; Emacs 21 compatibility: - (apply 'tool-bar-add-item - icon command - (intern icon) - props))) + (apply 'tool-bar-local-item + icon command + (intern icon) ;; reuse icon or fmap here? + tool-bar-map props)) (t ;; A menu command - (if (fboundp 'tool-bar-local-item-from-menu) - (apply 'tool-bar-local-item-from-menu - ;; (apply 'tool-bar-local-item icon def key - ;; tool-bar-map props) - command icon tool-bar-map (symbol-value fmap) - props) - ;; Emacs 21 compatibility: - (apply 'tool-bar-add-item-from-menu - command icon (symbol-value fmap) - props)))) + (apply 'tool-bar-local-item-from-menu + ;; (apply 'tool-bar-local-item icon def key + ;; tool-bar-map props) + command icon tool-bar-map (symbol-value fmap) + props))) t)) (if (symbolp icon-list) (eval icon-list) === modified file 'lisp/gnus/gnus-agent.el' --- lisp/gnus/gnus-agent.el 2010-09-20 00:36:54 +0000 +++ lisp/gnus/gnus-agent.el 2010-09-24 07:25:37 +0000 @@ -606,16 +606,13 @@ (propertize string 'local-map (make-mode-line-mouse-map mouse-button mouse-func) 'mouse-face - (cond ((and (featurep 'xemacs) - ;; XEmacs' `facep' only checks for a face - ;; object, not for a face name, so it's useless - ;; to check with `facep'. - (find-face 'modeline)) - 'modeline) - ((facep 'mode-line-highlight) ;; Emacs 22 - 'mode-line-highlight) - ((facep 'mode-line) ;; Emacs 21 - 'mode-line)) ) + (if (and (featurep 'xemacs) + ;; XEmacs' `facep' only checks for a face + ;; object, not for a face name, so it's useless + ;; to check with `facep'. + (find-face 'modeline)) + 'modeline + 'mode-line-highlight)) string)) (defun gnus-agent-toggle-plugged (set-to) === modified file 'lisp/gnus/gnus-art.el' --- lisp/gnus/gnus-art.el 2010-09-20 00:36:54 +0000 +++ lisp/gnus/gnus-art.el 2010-09-24 07:25:37 +0000 @@ -34,10 +34,7 @@ (defvar w3m-minor-mode-map) (require 'gnus) -;; Avoid the "Recursive load suspected" error in Emacs 21.1. -(eval-and-compile - (let ((recursive-load-depth-limit 100)) - (require 'gnus-sum))) +(require 'gnus-sum) (require 'gnus-spec) (require 'gnus-int) (require 'gnus-win) @@ -4259,7 +4256,7 @@ (put-text-property (match-end 0) (point-max) 'face eface))))))))) -(autoload 'canlock-verify "canlock" nil t) ;; for Emacs 21. +(autoload 'canlock-verify "canlock" nil t) ;; for XEmacs. (defun article-verify-cancel-lock () "Verify Cancel-Lock header." @@ -4894,10 +4891,7 @@ ;; FIXME: why is it necessary? (sit-for 0) (let ((parts (length gnus-article-mime-handle-alist))) - (or n (setq n - (string-to-number - (read-string ;; Emacs 21 doesn't have `read-number'. - (format "Jump to part (2..%s): " parts))))) + (or n (setq n (read-number (format "Jump to part (2..%s): " parts)))) (unless (and (integerp n) (<= n parts) (>= n 1)) (setq n (progn @@ -5681,7 +5675,7 @@ :action 'gnus-widget-press-button :button-keymap gnus-mime-button-map :help-echo - (lambda (widget/window &optional overlay pos) + (lambda (widget) ;; Needed to properly clear the message due to a bug in ;; wid-edit (XEmacs only). (if (boundp 'help-echo-owns-message) @@ -5689,14 +5683,7 @@ (format "%S: %s the MIME part; %S: more options" (aref gnus-mouse-2 0) - ;; XEmacs will get a single widget arg; Emacs 21 will get - ;; window, overlay, position. - (if (mm-handle-displayed-p - (if overlay - (with-current-buffer (gnus-overlay-buffer overlay) - (widget-get (widget-at (gnus-overlay-start overlay)) - :mime-handle)) - (widget-get widget/window :mime-handle))) + (if (mm-handle-displayed-p (widget-get widget :mime-handle)) "hide" "show") (aref gnus-down-mouse-3 0)))))) @@ -6319,15 +6306,6 @@ 2))))))) (defun gnus-article-next-page-1 (lines) - (unless (featurep 'xemacs) - ;; Protect against the bug that Emacs 21.x hangs up when scrolling up for - ;; too many number of lines if `scroll-margin' is set as two or greater. - (when (and (numberp lines) - (> lines 0) - (> scroll-margin 0)) - (setq lines (min lines - (max 0 (- (count-lines (window-start) (point-max)) - scroll-margin)))))) (condition-case () (let ((scroll-in-place nil)) (scroll-up lines)) @@ -6581,6 +6559,9 @@ (defvar gnus-draft-mode) ;; Calling help-buffer will autoload help-mode. (defvar help-xref-stack-item) +;; Emacs 22 doesn't load it in the batch mode. +(eval-when-compile + (autoload 'help-buffer "help-mode")) (defun gnus-article-describe-bindings (&optional prefix) "Show a list of all defined keys, and their definitions. @@ -6631,9 +6612,7 @@ (with-current-buffer ,(current-buffer) (gnus-article-describe-bindings prefix))) ,prefix))) - (with-current-buffer (if (fboundp 'help-buffer) - (let (help-xref-following) (help-buffer)) - "*Help*") ;; Emacs 21 + (with-current-buffer (let (help-xref-following) (help-buffer)) (setq help-xref-stack-item item))))) (defun gnus-article-reply-with-original (&optional wide) @@ -8702,7 +8681,7 @@ :action 'gnus-widget-press-button :button-keymap gnus-mime-security-button-map :help-echo - (lambda (widget/window &optional overlay pos) + (lambda (widget) ;; Needed to properly clear the message due to a bug in ;; wid-edit (XEmacs only). (when (boundp 'help-echo-owns-message) === modified file 'lisp/gnus/gnus-audio.el' --- lisp/gnus/gnus-audio.el 2010-09-02 00:55:51 +0000 +++ lisp/gnus/gnus-audio.el 2010-09-24 07:25:37 +0000 @@ -39,7 +39,7 @@ (defvar gnus-audio-inline-sound (or (if (fboundp 'device-sound-enabled-p) (device-sound-enabled-p)) ; XEmacs - (fboundp 'play-sound)) ; Emacs 21 + (fboundp 'play-sound)) ; Emacs "Non-nil means try to play sounds without using an external program.") (defcustom gnus-audio-directory (nnheader-find-etc-directory "sounds") === modified file 'lisp/gnus/gnus-cus.el' --- lisp/gnus/gnus-cus.el 2010-09-02 00:55:51 +0000 +++ lisp/gnus/gnus-cus.el 2010-09-24 07:25:37 +0000 @@ -50,7 +50,7 @@ (setq major-mode 'gnus-custom-mode mode-name "Gnus Customize") (use-local-map widget-keymap) - ;; Emacs 21 stuff: + ;; Emacs stuff: (when (and (facep 'custom-button-face) (facep 'custom-button-pressed-face)) (set (make-local-variable 'widget-button-face) === modified file 'lisp/gnus/gnus-group.el' --- lisp/gnus/gnus-group.el 2010-09-23 07:59:12 +0000 +++ lisp/gnus/gnus-group.el 2010-09-24 07:25:37 +0000 @@ -1515,7 +1515,7 @@ (and (not (featurep 'xemacs)) (boundp 'tool-bar-mode) tool-bar-mode - ;; Using `redraw-frame' (see `gnus-tool-bar-update') in Emacs 21 might + ;; Using `redraw-frame' (see `gnus-tool-bar-update') in Emacs might ;; be confusing, so maybe we shouldn't call it by default. (fboundp 'force-window-update)) "Force updating the group buffer tool bar." === modified file 'lisp/gnus/gnus-sum.el' --- lisp/gnus/gnus-sum.el 2010-09-23 23:14:02 +0000 +++ lisp/gnus/gnus-sum.el 2010-09-24 07:25:37 +0000 @@ -11318,7 +11318,7 @@ (defalias 'gnus-remove-overlays 'remove-overlays) (defun gnus-remove-overlays (beg end name val) "Clear BEG and END of overlays whose property NAME has value VAL. -For compatibility with Emacs 21 and XEmacs." +For compatibility with XEmacs." (dolist (ov (gnus-overlays-in beg end)) (when (eq (gnus-overlay-get ov name) val) (gnus-delete-overlay ov)))))) === modified file 'lisp/gnus/gnus-util.el' --- lisp/gnus/gnus-util.el 2010-09-18 10:02:19 +0000 +++ lisp/gnus/gnus-util.el 2010-09-24 07:25:37 +0000 @@ -1661,30 +1661,14 @@ (kill-buffer buf)) tchar)) -(declare-function x-focus-frame "xfns.c" (frame)) -(declare-function w32-focus-frame "../term/w32-win" (frame)) - -(defun gnus-select-frame-set-input-focus (frame) - "Select FRAME, raise it, and set input focus, if possible." - (cond ((featurep 'xemacs) - (if (fboundp 'select-frame-set-input-focus) - (select-frame-set-input-focus frame) - (raise-frame frame) - (select-frame frame) - (focus-frame frame))) - ;; `select-frame-set-input-focus' defined in Emacs 21 will not - ;; set the input focus. - ((>= emacs-major-version 22) - (select-frame-set-input-focus frame)) - (t - (raise-frame frame) - (select-frame frame) - (cond ((memq window-system '(x ns mac)) - (x-focus-frame frame)) - ((eq window-system 'w32) - (w32-focus-frame frame))) - (when focus-follows-mouse - (set-mouse-position frame (1- (frame-width frame)) 0))))) +(if (fboundp 'select-frame-set-input-focus) + (defalias 'gnus-select-frame-set-input-focus 'select-frame-set-input-focus) + ;; XEmacs 21.4, SXEmacs + (defun gnus-select-frame-set-input-focus (frame) + "Select FRAME, raise it, and set input focus, if possible." + (raise-frame frame) + (select-frame frame) + (focus-frame frame))) (defun gnus-frame-or-window-display-name (object) "Given a frame or window, return the associated display name. ------------------------------------------------------------ revno: 101584 author: Julien Danjou committer: Katsumi Yamaoka branch nick: trunk timestamp: Fri 2010-09-24 07:19:38 +0000 message: gnus-start.el (gnus-after-getting-new-news-hook): Add version tag. diff: === modified file 'lisp/gnus/gnus-start.el' --- lisp/gnus/gnus-start.el 2010-09-23 23:14:02 +0000 +++ lisp/gnus/gnus-start.el 2010-09-24 07:19:38 +0000 @@ -428,6 +428,7 @@ (defcustom gnus-after-getting-new-news-hook '(gnus-display-time-event-handler) "*A hook run after Gnus checks for new news when Gnus is already running." + :version "24.1" :group 'gnus-group-new :type 'hook) ------------------------------------------------------------ revno: 101583 committer: Juanma Barranquero branch nick: trunk timestamp: Fri 2010-09-24 05:35:55 +0200 message: Remove W32 API function pointer unused since 2005-02-15 (revno 60055). * w32fns.c (clipboard_sequence_fn): Don't declare. (globals_of_w32fns): Don't initialize it. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-09-24 02:10:54 +0000 +++ src/ChangeLog 2010-09-24 03:35:55 +0000 @@ -1,3 +1,9 @@ +2010-09-24 Juanma Barranquero + + Remove W32 API function pointer unused since 2005-02-15 (revno 60055). + * w32fns.c (clipboard_sequence_fn): Don't declare. + (globals_of_w32fns): Don't initialize it. + 2010-09-23 Stefan Monnier * syntax.c (back_comment): Detect the case where a 1-char comment === modified file 'src/w32fns.c' --- src/w32fns.c 2010-08-19 14:51:09 +0000 +++ src/w32fns.c 2010-09-24 03:35:55 +0000 @@ -262,7 +262,6 @@ (IN HMONITOR monitor, OUT struct MONITOR_INFO* info); TrackMouseEvent_Proc track_mouse_event_fn = NULL; -ClipboardSequence_Proc clipboard_sequence_fn = NULL; ImmGetCompositionString_Proc get_composition_string_fn = NULL; ImmGetContext_Proc get_ime_context_fn = NULL; ImmReleaseContext_Proc release_ime_context_fn = NULL; @@ -7183,9 +7182,6 @@ */ track_mouse_event_fn = (TrackMouseEvent_Proc) GetProcAddress (user32_lib, "TrackMouseEvent"); - /* ditto for GetClipboardSequenceNumber. */ - clipboard_sequence_fn = (ClipboardSequence_Proc) - GetProcAddress (user32_lib, "GetClipboardSequenceNumber"); monitor_from_point_fn = (MonitorFromPoint_Proc) GetProcAddress (user32_lib, "MonitorFromPoint");