Using saved parent location: http://bzr.savannah.gnu.org/r/emacs/trunk/ Now on revision 101688. ------------------------------------------------------------ revno: 101688 committer: Juanma Barranquero branch nick: trunk timestamp: Thu 2010-09-30 04:53:26 +0200 message: lisp/server.el: Use just one way to pass the Emacs PID to emacsclient. * lib-src/emacsclient.c (get_server_config): Don't read Emacs pid from the authentication file. * lisp/server.el (server-start): Don't write pid to the authentication file. (server-create-tty-frame): Don't send pid. (server-process-filter): Send pid at the start of every connection. diff: === modified file 'lib-src/ChangeLog' --- lib-src/ChangeLog 2010-09-29 15:07:34 +0000 +++ lib-src/ChangeLog 2010-09-30 02:53:26 +0000 @@ -1,3 +1,8 @@ +2010-09-30 Juanma Barranquero + + * emacsclient.c (get_server_config): Don't read Emacs pid from + the authentication file. + 2010-09-29 Juanma Barranquero * makefile.w32-in (../src/config.h): Remove target, it is stale. === modified file 'lib-src/emacsclient.c' --- lib-src/emacsclient.c 2010-09-29 08:18:40 +0000 +++ lib-src/emacsclient.c 2010-09-30 02:53:26 +0000 @@ -910,14 +910,13 @@ /* * Read the information needed to set up a TCP comm channel with - * the Emacs server: host, port, pid and authentication string. + * the Emacs server: host, port, and authentication string. */ int get_server_config (struct sockaddr_in *server, char *authentication) { char dotted[32]; char *port; - char *pid; FILE *config = NULL; if (file_name_absolute_p (server_file)) @@ -948,12 +947,8 @@ return FALSE; if (fgets (dotted, sizeof dotted, config) - && (port = strchr (dotted, ':')) - && (pid = strchr (port, ' '))) - { - *port++ = '\0'; - *pid++ = '\0'; - } + && (port = strchr (dotted, ':'))) + *port++ = '\0'; else { message (TRUE, "%s: invalid configuration info\n", progname); @@ -972,8 +967,6 @@ fclose (config); - emacs_pid = atoi (pid); - return TRUE; } === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-09-30 02:18:24 +0000 +++ lisp/ChangeLog 2010-09-30 02:53:26 +0000 @@ -1,3 +1,9 @@ +2010-09-30 Juanma Barranquero + + * server.el (server-start): Don't write pid to the authentication file. + (server-create-tty-frame): Don't send pid. + (server-process-filter): Send pid at the start of every connection. + 2010-09-30 Glenn Morris * calendar/diary-lib.el (view-diary-entries, list-diary-entries) === modified file 'lisp/server.el' --- lisp/server.el 2010-09-25 00:32:09 +0000 +++ lisp/server.el 2010-09-30 02:53:26 +0000 @@ -586,7 +586,6 @@ (setq buffer-file-coding-system 'no-conversion) (insert (format-network-address (process-contact server-process :local)) - " " (int-to-string (emacs-pid)) "\n" auth-key))))))))) ;;;###autoload @@ -706,9 +705,6 @@ ;; Display *scratch* by default. (switch-to-buffer (get-buffer-create "*scratch*") 'norecord) - ;; Reply with our pid. - (server-send-string proc (concat "-emacs-pid " - (number-to-string (emacs-pid)) "\n")) frame)) (defun server-create-window-system-frame (display nowait proc parent-id) @@ -889,6 +885,9 @@ (condition-case err (progn (server-add-client proc) + ;; Send our pid + (server-send-string proc (concat "-emacs-pid " + (number-to-string (emacs-pid)) "\n")) (if (not (string-match "\n" string)) ;; Save for later any partial line that remains. (when (> (length string) 0) ------------------------------------------------------------ revno: 101687 committer: Glenn Morris branch nick: trunk timestamp: Wed 2010-09-29 19:23:25 -0700 message: etc/NEWS updates. diff: === modified file 'etc/NEWS' --- etc/NEWS 2010-09-28 02:41:18 +0000 +++ etc/NEWS 2010-09-30 02:23:25 +0000 @@ -259,6 +259,21 @@ ** mpc.el: Can use pseudo tags of the form tag1|tag2 as a union of two tags. +** Calendar, Diary, and Appt + +--- +*** The obsolete (since Emacs 22.1) method of enabling the appt package +by adding appt-make-list to diary-hook has been removed. Use appt-activate. + +--- +*** Some appt variables (obsolete since Emacs 22.1) have been removed: +appt-issue-message (use the function appt-activate) +appt-visible/appt-msg-window (use the variable appt-display-format) + +--- +*** Some diary function aliases (obsolete since Emacs 22.1) have been removed: +view-diary-entries, list-diary-entries, show-all-diary-entries + ** Customize *** Customize buffers now contain a search field. @@ -569,6 +584,7 @@ FIXME: These should be front-ended by xml.el. +** FIXME GnuTLS ** Isearch ------------------------------------------------------------ revno: 101686 committer: Glenn Morris branch nick: trunk timestamp: Wed 2010-09-29 19:18:24 -0700 message: Remove some diary-lib function aliases, obsolete since 22.1. * lisp/calendar/diary-lib.el (view-diary-entries, list-diary-entries) (show-all-diary-entries): Remove obsolete function aliases. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-09-30 02:15:17 +0000 +++ lisp/ChangeLog 2010-09-30 02:18:24 +0000 @@ -1,5 +1,8 @@ 2010-09-30 Glenn Morris + * calendar/diary-lib.el (view-diary-entries, list-diary-entries) + (show-all-diary-entries): Remove obsolete function aliases. + * calendar/appt.el (appt-issue-message, appt-visible, appt-msg-window): Remove options, obsolete since 22.1. (appt-display-format, appt-display-message): Remove === modified file 'lisp/calendar/diary-lib.el' --- lisp/calendar/diary-lib.el 2010-09-29 04:19:30 +0000 +++ lisp/calendar/diary-lib.el 2010-09-30 02:18:24 +0000 @@ -487,8 +487,6 @@ (diary-check-diary-file) (diary-list-entries (calendar-cursor-to-date t) arg)) -(define-obsolete-function-alias 'view-diary-entries 'diary-view-entries "22.1") - ;;;###cal-autoload (defun diary-view-other-diary-entries (arg dfile) @@ -828,8 +826,6 @@ (or d-incp (message "Preparing diary...done")) diary-entries-list))) -(define-obsolete-function-alias 'list-diary-entries 'diary-list-entries "22.1") - (defun diary-unhide-everything () "Show all invisible text in the diary." (kill-local-variable 'diary-selective-display) @@ -1132,9 +1128,6 @@ (derived-mode-p 'calendar-mode))) (fit-window-to-buffer win))))) -(define-obsolete-function-alias 'show-all-diary-entries - 'diary-show-all-entries "22.1") - ;;;###autoload (defun diary-mail-entries (&optional ndays) "Send a mail message showing diary entries for next NDAYS days. ------------------------------------------------------------ revno: 101685 committer: Glenn Morris branch nick: trunk timestamp: Wed 2010-09-29 19:15:17 -0700 message: Remove some obsolete appt.el code. * lisp/calendar/appt.el (appt-issue-message, appt-visible, appt-msg-window): Remove options, obsolete since 22.1. (appt-display-format, appt-display-message): Remove backwards-compatibility code. (appt-check): No longer check appt-issue-message. (appt-make-list): No longer autoload it. Doc fix. No longer activate the package. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-09-29 13:25:24 +0000 +++ lisp/ChangeLog 2010-09-30 02:15:17 +0000 @@ -1,3 +1,13 @@ +2010-09-30 Glenn Morris + + * calendar/appt.el (appt-issue-message, appt-visible, appt-msg-window): + Remove options, obsolete since 22.1. + (appt-display-format, appt-display-message): Remove + backwards-compatibility code. + (appt-check): No longer check appt-issue-message. + (appt-make-list): No longer autoload it. Doc fix. No longer + activate the package. + 2010-09-29 Lars Magne Ingebrigtsen * net/gnutls.el (starttls-negotiate): Loop a lot longer. === modified file 'lisp/calendar/appt.el' --- lisp/calendar/appt.el 2010-09-29 04:19:30 +0000 +++ lisp/calendar/appt.el 2010-09-30 02:15:17 +0000 @@ -83,17 +83,6 @@ :prefix "appt-" :group 'calendar) -(defcustom appt-issue-message t - "Non-nil means check for appointments in the diary buffer. -To be detected, the diary entry must have the format described in the -documentation of the function `appt-check'." - :type 'boolean - :group 'appt) - -(make-obsolete-variable 'appt-issue-message - "use the function `appt-activate', and the \ -variable `appt-display-format' instead." "22.1") - (defcustom appt-message-warning-time 12 "Time in minutes before an appointment that the warning begins." :type 'integer @@ -104,41 +93,20 @@ :type 'boolean :group 'appt) -(defcustom appt-visible t - "Non-nil means display appointment message in echo area. -This variable is only relevant if `appt-msg-window' is nil." - :type 'boolean - :group 'appt) - -(make-obsolete-variable 'appt-visible 'appt-display-format "22.1") - -(defcustom appt-msg-window t - "Non-nil means display appointment message in another window. -If non-nil, this variable overrides `appt-visible'." - :type 'boolean - :group 'appt) - -(make-obsolete-variable 'appt-msg-window 'appt-display-format "22.1") - ;; TODO - add popup. -(defcustom appt-display-format 'ignore +(defcustom appt-display-format 'window "How appointment reminders should be displayed. The options are: window - use a separate window echo - use the echo area nil - no visible reminder. -See also `appt-audible' and `appt-display-mode-line'. - -The default value is 'ignore, which means to fall back on the value -of the (obsolete) variables `appt-msg-window' and `appt-visible'." +See also `appt-audible' and `appt-display-mode-line'." :type '(choice (const :tag "Separate window" window) (const :tag "Echo-area" echo) - (const :tag "No visible display" nil) - (const :tag "Backwards compatibility setting - choose another value" - ignore)) + (const :tag "No visible display" nil)) :group 'appt - :version "22.1") + :version "24.1") ; no longer inherit from deleted obsolete variables (defcustom appt-display-mode-line t "Non-nil means display minutes to appointment and time on the mode line. @@ -236,25 +204,18 @@ The string STRING describes the appointment, due in integer MINS minutes. The format of the visible reminder is controlled by `appt-display-format'. The variable `appt-audible' controls the audible reminder." - ;; Let-binding for backwards compatibility. Remove when obsolete - ;; vars appt-msg-window and appt-visible are dropped. - (let ((appt-display-format - (if (eq appt-display-format 'ignore) - (cond (appt-msg-window 'window) - (appt-visible 'echo)) - appt-display-format))) - (if appt-audible (beep 1)) - (cond ((eq appt-display-format 'window) - (funcall appt-disp-window-function - (number-to-string mins) - ;; TODO - use calendar-month-abbrev-array rather than %b? - (format-time-string "%a %b %e " (current-time)) - string) - (run-at-time (format "%d sec" appt-display-duration) - nil - appt-delete-window-function)) - ((eq appt-display-format 'echo) - (message "%s" string))))) + (if appt-audible (beep 1)) + (cond ((eq appt-display-format 'window) + (funcall appt-disp-window-function + (number-to-string mins) + ;; TODO - use calendar-month-abbrev-array rather than %b? + (format-time-string "%a %b %e " (current-time)) + string) + (run-at-time (format "%d sec" appt-display-duration) + nil + appt-delete-window-function)) + ((eq appt-display-format 'echo) + (message "%s" string)))) (defun appt-check (&optional force) @@ -348,7 +309,7 @@ ;; If there are entries in the list, and the user wants a ;; message issued, get the first time off of the list and ;; calculate the number of minutes until the appointment. - (when (and appt-issue-message appt-time-msg-list) + (when appt-time-msg-list (setq appt-comp-time (caar (car appt-time-msg-list)) appt-warn-time (or (nth 3 (car appt-time-msg-list)) appt-message-warning-time) @@ -515,8 +476,7 @@ (defvar number) (defvar original-date) (defvar diary-entries-list) -;; Autoload for the old way of using this package. Can be removed sometime. -;;;###autoload + (defun appt-make-list () "Update the appointments list from today's diary buffer. The time must be at the beginning of a line for it to be @@ -525,92 +485,86 @@ NUMBER hold the arguments that `diary-list-entries' received. They specify the range of dates that the diary is being processed for. -Any appointments made with `appt-add' are not affected by this function. - -For backwards compatibility, this function activates the -appointment package (if it is not already active)." - ;; See comments above appt-activate defun. - (if (not appt-timer) - (appt-activate 1) - ;; We have something to do if the range of dates that the diary is - ;; considering includes the current date. - (if (and (not (calendar-date-compare - (list (calendar-current-date)) - (list original-date))) - (calendar-date-compare - (list (calendar-current-date)) - (list (calendar-gregorian-from-absolute - (+ (calendar-absolute-from-gregorian original-date) - number))))) - (save-excursion - ;; Clear the appointments list, then fill it in from the diary. - (dolist (elt appt-time-msg-list) - ;; Delete any entries that were not made with appt-add. - (unless (nth 2 elt) - (setq appt-time-msg-list - (delq elt appt-time-msg-list)))) - (if diary-entries-list - ;; Cycle through the entry-list (diary-entries-list) - ;; looking for entries beginning with a time. If the - ;; entry begins with a time, add it to the - ;; appt-time-msg-list. Then sort the list. - (let ((entry-list diary-entries-list) - (new-time-string "") - time-string) - ;; Below, we assume diary-entries-list was in date - ;; order. It is, unless something on - ;; diary-list-entries-hook has changed it, eg - ;; diary-include-other-files (bug#7019). It must be - ;; in date order if number = 1. - (and diary-list-entries-hook - appt-display-diary - (not (eq diary-number-of-entries 1)) - (not (memq (car (last diary-list-entries-hook)) - '(diary-sort-entries sort-diary-entries))) - (setq entry-list (sort entry-list 'diary-entry-compare))) - ;; Skip diary entries for dates before today. - (while (and entry-list - (calendar-date-compare - (car entry-list) (list (calendar-current-date)))) - (setq entry-list (cdr entry-list))) - ;; Parse the entries for today. - (while (and entry-list - (calendar-date-equal - (calendar-current-date) (caar entry-list))) - (setq time-string (cadr (car entry-list))) - (while (string-match appt-time-regexp time-string) - (let* ((beg (match-beginning 0)) - ;; Get just the time for this appointment. - (only-time (match-string 0 time-string)) - ;; Find the end of this appointment - ;; (the start of the next). - (end (string-match - (concat "\n[ \t]*" appt-time-regexp) - time-string - (match-end 0))) - ;; Get the whole string for this appointment. - (appt-time-string - (substring time-string beg end)) - (appt-time (list (appt-convert-time only-time))) - (time-msg (list appt-time appt-time-string))) - ;; Add this appointment to appt-time-msg-list. - (setq appt-time-msg-list - (nconc appt-time-msg-list (list time-msg)) - ;; Discard this appointment from the string. - time-string - (if end (substring time-string end) "")))) - (setq entry-list (cdr entry-list))))) - (setq appt-time-msg-list (appt-sort-list appt-time-msg-list)) - ;; Convert current time to minutes after midnight (12:01am = 1), - ;; so that elements in the list that are earlier than the - ;; present time can be removed. - (let* ((now (decode-time)) - (cur-comp-time (+ (* 60 (nth 2 now)) (nth 1 now))) - (appt-comp-time (caar (car appt-time-msg-list)))) - (while (and appt-time-msg-list (< appt-comp-time cur-comp-time)) - (setq appt-time-msg-list (cdr appt-time-msg-list)) - (if appt-time-msg-list - (setq appt-comp-time (caar (car appt-time-msg-list)))))))))) +Any appointments made with `appt-add' are not affected by this function." + ;; We have something to do if the range of dates that the diary is + ;; considering includes the current date. + (if (and (not (calendar-date-compare + (list (calendar-current-date)) + (list original-date))) + (calendar-date-compare + (list (calendar-current-date)) + (list (calendar-gregorian-from-absolute + (+ (calendar-absolute-from-gregorian original-date) + number))))) + (save-excursion + ;; Clear the appointments list, then fill it in from the diary. + (dolist (elt appt-time-msg-list) + ;; Delete any entries that were not made with appt-add. + (unless (nth 2 elt) + (setq appt-time-msg-list + (delq elt appt-time-msg-list)))) + (if diary-entries-list + ;; Cycle through the entry-list (diary-entries-list) + ;; looking for entries beginning with a time. If the + ;; entry begins with a time, add it to the + ;; appt-time-msg-list. Then sort the list. + (let ((entry-list diary-entries-list) + (new-time-string "") + time-string) + ;; Below, we assume diary-entries-list was in date + ;; order. It is, unless something on + ;; diary-list-entries-hook has changed it, eg + ;; diary-include-other-files (bug#7019). It must be + ;; in date order if number = 1. + (and diary-list-entries-hook + appt-display-diary + (not (eq diary-number-of-entries 1)) + (not (memq (car (last diary-list-entries-hook)) + '(diary-sort-entries sort-diary-entries))) + (setq entry-list (sort entry-list 'diary-entry-compare))) + ;; Skip diary entries for dates before today. + (while (and entry-list + (calendar-date-compare + (car entry-list) (list (calendar-current-date)))) + (setq entry-list (cdr entry-list))) + ;; Parse the entries for today. + (while (and entry-list + (calendar-date-equal + (calendar-current-date) (caar entry-list))) + (setq time-string (cadr (car entry-list))) + (while (string-match appt-time-regexp time-string) + (let* ((beg (match-beginning 0)) + ;; Get just the time for this appointment. + (only-time (match-string 0 time-string)) + ;; Find the end of this appointment + ;; (the start of the next). + (end (string-match + (concat "\n[ \t]*" appt-time-regexp) + time-string + (match-end 0))) + ;; Get the whole string for this appointment. + (appt-time-string + (substring time-string beg end)) + (appt-time (list (appt-convert-time only-time))) + (time-msg (list appt-time appt-time-string))) + ;; Add this appointment to appt-time-msg-list. + (setq appt-time-msg-list + (nconc appt-time-msg-list (list time-msg)) + ;; Discard this appointment from the string. + time-string + (if end (substring time-string end) "")))) + (setq entry-list (cdr entry-list))))) + (setq appt-time-msg-list (appt-sort-list appt-time-msg-list)) + ;; Convert current time to minutes after midnight (12:01am = 1), + ;; so that elements in the list that are earlier than the + ;; present time can be removed. + (let* ((now (decode-time)) + (cur-comp-time (+ (* 60 (nth 2 now)) (nth 1 now))) + (appt-comp-time (caar (car appt-time-msg-list)))) + (while (and appt-time-msg-list (< appt-comp-time cur-comp-time)) + (setq appt-time-msg-list (cdr appt-time-msg-list)) + (if appt-time-msg-list + (setq appt-comp-time (caar (car appt-time-msg-list))))))))) (defun appt-sort-list (appt-list) @@ -650,30 +604,6 @@ (appt-check t))) nil) -;; In Emacs-21.3, the manual documented the following procedure to -;; activate this package: -;; (display-time) -;; (add-hook 'diary-hook 'appt-make-list) -;; (diary 0) -;; The display-time call was not necessary, AFAICS. -;; What was really needed was to add the hook and load this file. -;; Calling (diary 0) once the hook had been added was in some sense a -;; roundabout way of loading this file. This file used to have code at -;; the top-level that set up the appt-timer and global-mode-string. -;; One way to maintain backwards compatibility would be to call -;; (appt-activate 1) at top-level. However, this goes against the -;; convention that just loading an Emacs package should not activate -;; it. Instead, we make appt-make-list activate the package (after a -;; suggestion from rms). This means that one has to call diary in -;; order to get it to work, but that is in line with the old (weird, -;; IMO) documented behavior for activating the package. -;; Actually, since (diary 0) does not run diary-hook, I don't think -;; the documented behavior in Emacs-21.3 would ever have worked. -;; Oh well, at least with the changes to appt-make-list it will now -;; work as well as it ever did. -;; The new method is just to use (appt-activate 1). -;; -- gmorris - ;;;###autoload (defun appt-activate (&optional arg) "Toggle checking of appointments. ------------------------------------------------------------ revno: 101684 committer: Dan Nicolaescu branch nick: trunk timestamp: Wed 2010-09-29 18:20:51 -0700 message: * src/Makefile.in: ecrt0.c does not exist anymore, do not mention it. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-09-30 00:09:04 +0000 +++ src/ChangeLog 2010-09-30 01:20:51 +0000 @@ -1,3 +1,7 @@ +2010-09-30 Dan Nicolaescu + + * Makefile.in: ecrt0.c does not exist anymore, do not mention it. + 2010-09-30 Juanma Barranquero * w32console.c (vga_stdcolor_name): Remove unused function; === modified file 'src/Makefile.in' --- src/Makefile.in 2010-09-26 06:06:28 +0000 +++ src/Makefile.in 2010-09-30 01:20:51 +0000 @@ -688,9 +688,6 @@ @echo "Please run the `configure' script again." exit 1 -ecrt0.o: ecrt0.c $(config_h) - @$(MKDEPDIR) - $(CC) -c $(ALL_CFLAGS) ${srcdir}/ecrt0.c doc.o: buildobj.h ------------------------------------------------------------ revno: 101683 committer: Juanma Barranquero branch nick: trunk timestamp: Thu 2010-09-30 02:09:04 +0200 message: src/w32console.c (vga_stdcolor_name): Remove unused function. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-09-29 14:30:45 +0000 +++ src/ChangeLog 2010-09-30 00:09:04 +0000 @@ -1,3 +1,8 @@ +2010-09-30 Juanma Barranquero + + * w32console.c (vga_stdcolor_name): Remove unused function; + presumed dead after revno 82799 (2007-11-30). + 2010-09-29 Lars Magne Ingebrigtsen * gnutls.c (emacs_gnutls_handshake): Made into internal function. === modified file 'src/w32console.c' --- src/w32console.c 2010-07-08 21:25:08 +0000 +++ src/w32console.c 2010-09-30 00:09:04 +0000 @@ -585,28 +585,6 @@ return char_attr; } - - -/* Given a color index, return its standard name. */ -Lisp_Object -vga_stdcolor_name (int idx) -{ - /* Standard VGA colors, in the order of their standard numbering - in the default VGA palette. */ - static char *vga_colors[16] = { - "black", "blue", "green", "cyan", "red", "magenta", "brown", - "lightgray", "darkgray", "lightblue", "lightgreen", "lightcyan", - "lightred", "lightmagenta", "yellow", "white" - }; - - extern Lisp_Object Qunspecified; - - if (idx >= 0 && idx < sizeof (vga_colors) / sizeof (vga_colors[0])) - return build_string (vga_colors[idx]); - else - return Qunspecified; /* meaning the default */ -} - void initialize_w32_display (struct terminal *term) { ------------------------------------------------------------ revno: 101682 committer: Romain Francoise branch nick: trunk timestamp: Wed 2010-09-29 20:52:34 +0200 message: configure.in: Don't enable ImageMagick unless HAVE_X11. diff: === modified file 'ChangeLog' --- ChangeLog 2010-09-28 02:22:37 +0000 +++ ChangeLog 2010-09-29 18:52:34 +0000 @@ -1,3 +1,7 @@ +2010-09-29 Romain Francoise + + * configure.in: Don't enable ImageMagick unless HAVE_X11. + 2010-09-28 Glenn Morris * configure.in (HAVE_GNUTLS): Add a description to make autoheader === modified file 'configure' --- configure 2010-09-27 20:53:35 +0000 +++ configure 2010-09-29 18:52:34 +0000 @@ -8639,8 +8639,9 @@ fi HAVE_IMAGEMAGICK=no -if test "${with_imagemagick}" != "no"; then - IMAGEMAGICK_MODULE="Wand" +if test "${HAVE_X11}" = "yes"; then + if test "${with_imagemagick}" != "no"; then + IMAGEMAGICK_MODULE="Wand" succeeded=no @@ -8738,13 +8739,13 @@ - if test $HAVE_IMAGEMAGICK = yes; then + if test $HAVE_IMAGEMAGICK = yes; then $as_echo "#define HAVE_IMAGEMAGICK 1" >>confdefs.h - CFLAGS="$CFLAGS $IMAGEMAGICK_CFLAGS" - LIBS="$IMAGEMAGICK_LIBS $LIBS" - for ac_func in MagickExportImagePixels + CFLAGS="$CFLAGS $IMAGEMAGICK_CFLAGS" + LIBS="$IMAGEMAGICK_LIBS $LIBS" + for ac_func in MagickExportImagePixels do : ac_fn_c_check_func "$LINENO" "MagickExportImagePixels" "ac_cv_func_MagickExportImagePixels" if test "x$ac_cv_func_MagickExportImagePixels" = x""yes; then : @@ -8755,6 +8756,7 @@ fi done + fi fi fi === modified file 'configure.in' --- configure.in 2010-09-28 02:22:37 +0000 +++ configure.in 2010-09-29 18:52:34 +0000 @@ -1840,17 +1840,19 @@ fi HAVE_IMAGEMAGICK=no -if test "${with_imagemagick}" != "no"; then - IMAGEMAGICK_MODULE="Wand" - PKG_CHECK_MODULES(IMAGEMAGICK, $IMAGEMAGICK_MODULE, HAVE_IMAGEMAGICK=yes, :) - AC_SUBST(IMAGEMAGICK_CFLAGS) - AC_SUBST(IMAGEMAGICK_LIBS) - - if test $HAVE_IMAGEMAGICK = yes; then - AC_DEFINE(HAVE_IMAGEMAGICK, 1, [Define to 1 if using imagemagick.]) - CFLAGS="$CFLAGS $IMAGEMAGICK_CFLAGS" - LIBS="$IMAGEMAGICK_LIBS $LIBS" - AC_CHECK_FUNCS(MagickExportImagePixels) +if test "${HAVE_X11}" = "yes"; then + if test "${with_imagemagick}" != "no"; then + IMAGEMAGICK_MODULE="Wand" + PKG_CHECK_MODULES(IMAGEMAGICK, $IMAGEMAGICK_MODULE, HAVE_IMAGEMAGICK=yes, :) + AC_SUBST(IMAGEMAGICK_CFLAGS) + AC_SUBST(IMAGEMAGICK_LIBS) + + if test $HAVE_IMAGEMAGICK = yes; then + AC_DEFINE(HAVE_IMAGEMAGICK, 1, [Define to 1 if using imagemagick.]) + CFLAGS="$CFLAGS $IMAGEMAGICK_CFLAGS" + LIBS="$IMAGEMAGICK_LIBS $LIBS" + AC_CHECK_FUNCS(MagickExportImagePixels) + fi fi fi ------------------------------------------------------------ revno: 101681 committer: Juanma Barranquero branch nick: trunk timestamp: Wed 2010-09-29 17:07:34 +0200 message: lib-src/makefile.w32-in (../src/config.h): Remove target, it is stale. diff: === modified file 'lib-src/ChangeLog' --- lib-src/ChangeLog 2010-09-29 08:18:40 +0000 +++ lib-src/ChangeLog 2010-09-29 15:07:34 +0000 @@ -1,5 +1,7 @@ 2010-09-29 Juanma Barranquero + * makefile.w32-in (../src/config.h): Remove target, it is stale. + * emacsclient.c (main): Remove unused variables. (start_daemon_and_retry_set_socket): Use EXIT_FAILURE. === modified file 'lib-src/makefile.w32-in' --- lib-src/makefile.w32-in 2010-07-12 09:22:20 +0000 +++ lib-src/makefile.w32-in 2010-09-29 15:07:34 +0000 @@ -371,6 +371,7 @@ # Headers we would preprocess if we could. # ../src/config.h: ../nt/$(CONFIG_H) + $(DEL) $@ echo $(CONFIG_H) has changed. Re-run configure.bat. exit -1 ------------------------------------------------------------ revno: 101680 committer: Lars Magne Ingebrigtsen branch nick: trunk timestamp: Wed 2010-09-29 16:30:45 +0200 message: Clean up gnutls.c coding style to conform with the Emacs style. Remove some debugging messages. Cast some parameters to avoid compilation warnings. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-09-29 13:25:24 +0000 +++ src/ChangeLog 2010-09-29 14:30:45 +0000 @@ -3,6 +3,11 @@ * gnutls.c (emacs_gnutls_handshake): Made into internal function. (Fgnutls_boot): Start the handshake. (emacs_gnutls_read): Perform the handshake from the reader loop. + (Fgnutls_boot): Remove some debugging messages. + Change indentation throughout to use the Emacs style. + (emacs_gnutls_handshake): Cast the fds to something that's + possibly the expected length. + (emacs_gnutls_write): Return -1 if we try to write before handshake. * process.h (Lisp_Process): Add a gnutls_p field to Lisp_Process. === modified file 'src/gnutls.c' --- src/gnutls.c 2010-09-29 13:25:24 +0000 +++ src/gnutls.c 2010-09-29 14:30:45 +0000 @@ -42,22 +42,22 @@ return; if (proc->gnutls_initstage < GNUTLS_STAGE_TRANSPORT_POINTERS_SET) - { - /* FIXME: This can't be right: infd and outfd are integers (file handles) - whereas the function expects args of type gnutls_transport_ptr_t. */ - gnutls_transport_set_ptr2 (state, proc->infd, proc->outfd); + { + gnutls_transport_set_ptr2 (state, + (gnutls_transport_ptr_t) (long) proc->infd, + (gnutls_transport_ptr_t) (long) proc->outfd); - proc->gnutls_initstage = GNUTLS_STAGE_TRANSPORT_POINTERS_SET; - } + proc->gnutls_initstage = GNUTLS_STAGE_TRANSPORT_POINTERS_SET; + } ret = gnutls_handshake (state); proc->gnutls_initstage = GNUTLS_STAGE_HANDSHAKE_TRIED; if (ret == GNUTLS_E_SUCCESS) - { - /* here we're finally done. */ - proc->gnutls_initstage = GNUTLS_STAGE_READY; - } + { + /* here we're finally done. */ + proc->gnutls_initstage = GNUTLS_STAGE_READY; + } } int @@ -68,7 +68,7 @@ gnutls_session_t state = proc->gnutls_state; if (proc->gnutls_initstage != GNUTLS_STAGE_READY) - return 0; + return -1; bytes_written = 0; @@ -100,10 +100,11 @@ register int rtnval; gnutls_session_t state = proc->gnutls_state; - if (proc->gnutls_initstage != GNUTLS_STAGE_READY) { - emacs_gnutls_handshake (proc); - return -1; - } + if (proc->gnutls_initstage != GNUTLS_STAGE_READY) + { + emacs_gnutls_handshake (proc); + return -1; + } rtnval = gnutls_read (state, buf, nbyte); if (rtnval >= 0) @@ -119,16 +120,16 @@ Lisp_Object gnutls_make_error (int error) { switch (error) - { - case GNUTLS_E_SUCCESS: - return Qt; - case GNUTLS_E_AGAIN: - return Qgnutls_e_again; - case GNUTLS_E_INTERRUPTED: - return Qgnutls_e_interrupted; - case GNUTLS_E_INVALID_SESSION: - return Qgnutls_e_invalid_session; - } + { + case GNUTLS_E_SUCCESS: + return Qt; + case GNUTLS_E_AGAIN: + return Qgnutls_e_again; + case GNUTLS_E_INTERRUPTED: + return Qgnutls_e_interrupted; + case GNUTLS_E_INVALID_SESSION: + return Qgnutls_e_invalid_session; + } return make_number (error); } @@ -163,17 +164,17 @@ if (EQ (err, Qt)) return Qnil; if (SYMBOLP (err)) - { - code = Fget (err, Qgnutls_code); - if (NUMBERP (code)) - { - err = code; - } - else - { - error ("Symbol has no numeric gnutls-code property"); - } - } + { + code = Fget (err, Qgnutls_code); + if (NUMBERP (code)) + { + err = code; + } + else + { + error ("Symbol has no numeric gnutls-code property"); + } + } if (!NUMBERP (err)) error ("Not an error symbol or code"); @@ -194,17 +195,17 @@ if (EQ (err, Qt)) return build_string ("Not an error"); if (SYMBOLP (err)) - { - code = Fget (err, Qgnutls_code); - if (NUMBERP (code)) - { - err = code; - } - else - { - return build_string ("Symbol has no numeric gnutls-code property"); - } - } + { + code = Fget (err, Qgnutls_code); + if (NUMBERP (code)) + { + err = code; + } + else + { + return build_string ("Symbol has no numeric gnutls-code property"); + } + } if (!NUMBERP (err)) return build_string ("Not an error symbol or code"); @@ -223,10 +224,10 @@ state = XPROCESS (proc)->gnutls_state; if (GNUTLS_INITSTAGE (proc) >= GNUTLS_STAGE_INIT) - { + { gnutls_deinit (state); GNUTLS_INITSTAGE (proc) = GNUTLS_STAGE_INIT - 1; - } + } return Qt; } @@ -314,7 +315,6 @@ if (NUMBERP (loglevel)) { - message ("setting up log level %d", XINT (loglevel)); gnutls_global_set_log_function (gnutls_log_function); gnutls_global_set_log_level (XINT (loglevel)); max_log_level = XINT (loglevel); @@ -328,67 +328,67 @@ /* deinit and free resources. */ if (GNUTLS_INITSTAGE (proc) >= GNUTLS_STAGE_CRED_ALLOC) - { + { GNUTLS_LOG (1, max_log_level, "deallocating credentials"); if (EQ (type, Qgnutls_x509pki)) - { + { GNUTLS_LOG (2, max_log_level, "deallocating x509 credentials"); x509_cred = XPROCESS (proc)->gnutls_x509_cred; gnutls_certificate_free_credentials (x509_cred); - } + } else if (EQ (type, Qgnutls_anon)) - { + { GNUTLS_LOG (2, max_log_level, "deallocating anon credentials"); anon_cred = XPROCESS (proc)->gnutls_anon_cred; gnutls_anon_free_client_credentials (anon_cred); - } + } else - { + { error ("unknown credential type"); ret = GNUTLS_EMACS_ERROR_INVALID_TYPE; - } + } if (GNUTLS_INITSTAGE (proc) >= GNUTLS_STAGE_INIT) - { + { GNUTLS_LOG (1, max_log_level, "deallocating x509 credentials"); Fgnutls_deinit (proc); - } - } + } + } GNUTLS_INITSTAGE (proc) = GNUTLS_STAGE_EMPTY; GNUTLS_LOG (1, max_log_level, "allocating credentials"); if (EQ (type, Qgnutls_x509pki)) - { + { GNUTLS_LOG (2, max_log_level, "allocating x509 credentials"); x509_cred = XPROCESS (proc)->gnutls_x509_cred; if (gnutls_certificate_allocate_credentials (&x509_cred) < 0) memory_full (); - } + } else if (EQ (type, Qgnutls_anon)) - { + { GNUTLS_LOG (2, max_log_level, "allocating anon credentials"); anon_cred = XPROCESS (proc)->gnutls_anon_cred; if (gnutls_anon_allocate_client_credentials (&anon_cred) < 0) memory_full (); - } + } else - { + { error ("unknown credential type"); ret = GNUTLS_EMACS_ERROR_INVALID_TYPE; - } + } if (ret < GNUTLS_E_SUCCESS) - return gnutls_make_error (ret); + return gnutls_make_error (ret); GNUTLS_INITSTAGE (proc) = GNUTLS_STAGE_CRED_ALLOC; if (EQ (type, Qgnutls_x509pki)) - { + { if (STRINGP (trustfile)) - { + { GNUTLS_LOG (1, max_log_level, "setting the trustfile"); ret = gnutls_certificate_set_x509_trust_file (x509_cred, @@ -397,10 +397,10 @@ if (ret < GNUTLS_E_SUCCESS) return gnutls_make_error (ret); - } + } if (STRINGP (keyfile)) - { + { GNUTLS_LOG (1, max_log_level, "setting the keyfile"); ret = gnutls_certificate_set_x509_crl_file (x509_cred, @@ -409,8 +409,8 @@ if (ret < GNUTLS_E_SUCCESS) return gnutls_make_error (ret); - } - } + } + } GNUTLS_INITSTAGE (proc) = GNUTLS_STAGE_FILES; @@ -419,7 +419,7 @@ ret = gnutls_init (&state, GNUTLS_CLIENT); if (ret < GNUTLS_E_SUCCESS) - return gnutls_make_error (ret); + return gnutls_make_error (ret); XPROCESS (proc)->gnutls_state = state; @@ -432,32 +432,26 @@ NULL); if (ret < GNUTLS_E_SUCCESS) - return gnutls_make_error (ret); + return gnutls_make_error (ret); GNUTLS_INITSTAGE (proc) = GNUTLS_STAGE_PRIORITY; - message ("gnutls: setting the credentials"); - if (EQ (type, Qgnutls_x509pki)) - { - message ("gnutls: setting the x509 credentials"); - + { ret = gnutls_cred_set (state, GNUTLS_CRD_CERTIFICATE, x509_cred); - } + } else if (EQ (type, Qgnutls_anon)) - { - message ("gnutls: setting the anon credentials"); - + { ret = gnutls_cred_set (state, GNUTLS_CRD_ANON, anon_cred); - } + } else - { + { error ("unknown credential type"); ret = GNUTLS_EMACS_ERROR_INVALID_TYPE; - } + } if (ret < GNUTLS_E_SUCCESS) - return gnutls_make_error (ret); + return gnutls_make_error (ret); XPROCESS (proc)->gnutls_anon_cred = anon_cred; XPROCESS (proc)->gnutls_x509_cred = x509_cred; ------------------------------------------------------------ revno: 101679 committer: Eli Zaretskii branch nick: trunk timestamp: Wed 2010-09-29 15:58:11 +0200 message: nt/configure.bat: Fix condition for copying paths.h into ../src/epaths.h. diff: === modified file 'nt/ChangeLog' --- nt/ChangeLog 2010-09-28 00:55:08 +0000 +++ nt/ChangeLog 2010-09-29 13:58:11 +0000 @@ -1,3 +1,8 @@ +2010-09-29 Eli Zaretskii + + * configure.bat: Fix the condition for copying paths.h into + ../src/epaths.h. + 2010-09-28 Juanma Barranquero * addpm.c (entry, add_registry, main): === modified file 'nt/configure.bat' --- nt/configure.bat 2010-09-22 23:14:00 +0000 +++ nt/configure.bat 2010-09-29 13:58:11 +0000 @@ -669,7 +669,7 @@ fc /b config.tmp ..\src\config.h >nul 2>&1 if errorlevel 1 goto doCopy fc /b paths.h ..\src\epaths.h >nul 2>&1 -if errorlevel 0 goto dontCopy +if not errorlevel 1 goto dontCopy :doCopy copy config.tmp ..\src\config.h ------------------------------------------------------------ revno: 101678 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2010-09-29 15:38:27 +0200 message: * lisp/gnus/nnmail.el (group, group-art-list, group-art): Remove unneeded directives. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2010-09-29 01:09:50 +0000 +++ lisp/gnus/ChangeLog 2010-09-29 13:38:27 +0000 @@ -1,3 +1,8 @@ +2010-09-29 Stefan Monnier + + * nnmail.el (group, group-art-list, group-art): + Remove unneeded directives. + 2010-09-29 Katsumi Yamaoka * mm-util.el (mm-codepage-iso-8859-list, mm-charset-eval-alist) === modified file 'lisp/gnus/nnmail.el' --- lisp/gnus/nnmail.el 2010-09-27 11:53:44 +0000 +++ lisp/gnus/nnmail.el 2010-09-29 13:38:27 +0000 @@ -1611,10 +1611,6 @@ (setq nnmail-cache-buffer nil) (gnus-kill-buffer (current-buffer))))) -;; Compiler directives. -(defvar group) -(defvar group-art-list) -(defvar group-art) (defun nnmail-cache-insert (id grp &optional subject sender) (when (stringp id) ;; this will handle cases like `B r' where the group is nil ------------------------------------------------------------ revno: 101677 committer: Lars Magne Ingebrigtsen branch nick: trunk timestamp: Wed 2010-09-29 15:25:24 +0200 message: Do the gnutls handshake from the reader loop, instead of looping over the handshake from Emacs Lisp. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-09-29 12:48:29 +0000 +++ lisp/ChangeLog 2010-09-29 13:25:24 +0000 @@ -1,6 +1,8 @@ 2010-09-29 Lars Magne Ingebrigtsen * net/gnutls.el (starttls-negotiate): Loop a lot longer. + (starttls-negotiate): Just call boot, and let the handshake be + triggered from the read loop. 2010-09-29 Glenn Morris === modified file 'lisp/net/gnutls.el' --- lisp/net/gnutls.el 2010-09-29 12:48:29 +0000 +++ lisp/net/gnutls.el 2010-09-29 13:25:24 +0000 @@ -87,17 +87,6 @@ nil nil gnutls-log-level)) "boot: %s") - (when (gnutls-errorp ret) - (error "Could not boot GnuTLS for this process")); - - (let ((ret 'gnutls-e-again) - (n 250000)) - (while (and (not (eq ret t)) - (not (gnutls-error-fatalp ret)) - (> n 0)) - (setq n (1- n)) - (setq ret (gnutls-handshake proc))) - (message "Handshake complete %s." ret)) proc)) (defun starttls-open-stream (name buffer host service) === modified file 'src/ChangeLog' --- src/ChangeLog 2010-09-29 12:48:29 +0000 +++ src/ChangeLog 2010-09-29 13:25:24 +0000 @@ -1,5 +1,9 @@ 2010-09-29 Lars Magne Ingebrigtsen + * gnutls.c (emacs_gnutls_handshake): Made into internal function. + (Fgnutls_boot): Start the handshake. + (emacs_gnutls_read): Perform the handshake from the reader loop. + * process.h (Lisp_Process): Add a gnutls_p field to Lisp_Process. * process.c (make_process): Set the gnutls_p field to zero by === modified file 'src/gnutls.c' --- src/gnutls.c 2010-09-29 12:48:29 +0000 +++ src/gnutls.c 2010-09-29 13:25:24 +0000 @@ -32,6 +32,34 @@ Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake; int global_initialized; +void +emacs_gnutls_handshake (struct Lisp_Process *proc) +{ + gnutls_session_t state = proc->gnutls_state; + int ret; + + if (proc->gnutls_initstage < GNUTLS_STAGE_HANDSHAKE_CANDO) + return; + + if (proc->gnutls_initstage < GNUTLS_STAGE_TRANSPORT_POINTERS_SET) + { + /* FIXME: This can't be right: infd and outfd are integers (file handles) + whereas the function expects args of type gnutls_transport_ptr_t. */ + gnutls_transport_set_ptr2 (state, proc->infd, proc->outfd); + + proc->gnutls_initstage = GNUTLS_STAGE_TRANSPORT_POINTERS_SET; + } + + ret = gnutls_handshake (state); + proc->gnutls_initstage = GNUTLS_STAGE_HANDSHAKE_TRIED; + + if (ret == GNUTLS_E_SUCCESS) + { + /* here we're finally done. */ + proc->gnutls_initstage = GNUTLS_STAGE_READY; + } +} + int emacs_gnutls_write (int fildes, struct Lisp_Process *proc, char *buf, unsigned int nbyte) @@ -72,8 +100,10 @@ register int rtnval; gnutls_session_t state = proc->gnutls_state; - if (proc->gnutls_initstage != GNUTLS_STAGE_READY) - return 0; + if (proc->gnutls_initstage != GNUTLS_STAGE_READY) { + emacs_gnutls_handshake (proc); + return -1; + } rtnval = gnutls_read (state, buf, nbyte); if (rtnval >= 0) @@ -435,6 +465,8 @@ GNUTLS_INITSTAGE (proc) = GNUTLS_STAGE_CRED_SET; + emacs_gnutls_handshake (XPROCESS (proc)); + return gnutls_make_error (GNUTLS_E_SUCCESS); } @@ -467,59 +499,6 @@ return gnutls_make_error (ret); } -DEFUN ("gnutls-handshake", Fgnutls_handshake, - Sgnutls_handshake, 1, 1, 0, - doc: /* Perform GNU TLS handshake for PROCESS. -The identity of the peer is checked automatically. This function will -fail if any problem is encountered, and will return a negative error -code. In case of a client, if it has been asked to resume a session, -but the server didn't, then a full handshake will be performed. - -If the error `gnutls-e-not-ready-for-handshake' is returned, you -didn't call `gnutls-boot' first. - -This function may also return the non-fatal errors `gnutls-e-again', -or `gnutls-e-interrupted'. In that case you may resume the handshake -(by calling this function again). */) - (Lisp_Object proc) -{ - gnutls_session_t state; - int ret; - - CHECK_PROCESS (proc); - state = XPROCESS (proc)->gnutls_state; - - if (GNUTLS_INITSTAGE (proc) < GNUTLS_STAGE_HANDSHAKE_CANDO) - return Qgnutls_e_not_ready_for_handshake; - - - if (GNUTLS_INITSTAGE (proc) < GNUTLS_STAGE_TRANSPORT_POINTERS_SET) - { - /* for a network process in Emacs infd and outfd are the same - but this shows our intent more clearly. */ - message ("gnutls: handshake: setting the transport pointers to %d/%d", - XPROCESS (proc)->infd, XPROCESS (proc)->outfd); - - /* FIXME: This can't be right: infd and outfd are integers (file handles) - whereas the function expects args of type gnutls_transport_ptr_t. */ - gnutls_transport_set_ptr2 (state, XPROCESS (proc)->infd, - XPROCESS (proc)->outfd); - - GNUTLS_INITSTAGE (proc) = GNUTLS_STAGE_TRANSPORT_POINTERS_SET; - } - - ret = gnutls_handshake (state); - GNUTLS_INITSTAGE (proc) = GNUTLS_STAGE_HANDSHAKE_TRIED; - - if (ret == GNUTLS_E_SUCCESS) - { - /* here we're finally done. */ - GNUTLS_INITSTAGE (proc) = GNUTLS_STAGE_READY; - } - - return gnutls_make_error (ret); -} - void syms_of_gnutls (void) { @@ -561,7 +540,6 @@ defsubr (&Sgnutls_error_string); defsubr (&Sgnutls_boot); defsubr (&Sgnutls_deinit); - defsubr (&Sgnutls_handshake); defsubr (&Sgnutls_bye); } #endif ------------------------------------------------------------ revno: 101676 committer: Lars Magne Ingebrigtsen branch nick: trunk timestamp: Wed 2010-09-29 14:48:29 +0200 message: Make sure all reads/writes to gnutls streams go via the gnutls functions. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-09-29 04:19:30 +0000 +++ lisp/ChangeLog 2010-09-29 12:48:29 +0000 @@ -1,3 +1,7 @@ +2010-09-29 Lars Magne Ingebrigtsen + + * net/gnutls.el (starttls-negotiate): Loop a lot longer. + 2010-09-29 Glenn Morris * calendar/diary-lib.el (diary-list-entries): Use temp buffers when === modified file 'lisp/net/gnutls.el' --- lisp/net/gnutls.el 2010-09-27 16:44:31 +0000 +++ lisp/net/gnutls.el 2010-09-29 12:48:29 +0000 @@ -37,7 +37,7 @@ :prefix "gnutls-" :group 'net-utils) -(defcustom gnutls-log-level 2 +(defcustom gnutls-log-level 0 "Logging level to be used by `starttls-negotiate' and GnuTLS." :type 'integer :group 'gnutls) @@ -91,20 +91,14 @@ (error "Could not boot GnuTLS for this process")); (let ((ret 'gnutls-e-again) - (n 25000)) + (n 250000)) (while (and (not (eq ret t)) (not (gnutls-error-fatalp ret)) (> n 0)) (setq n (1- n)) - (setq ret (gnutls-handshake proc)) - ) - (if (gnutls-errorp ret) - (progn - (message "Ouch, error return %s (%s)" - ret (gnutls-error-string ret)) - (setq proc nil)) - (message "Handshake complete %s." ret))) - proc)) + (setq ret (gnutls-handshake proc))) + (message "Handshake complete %s." ret)) + proc)) (defun starttls-open-stream (name buffer host service) "Open a TLS connection for a service to a host. === modified file 'src/ChangeLog' --- src/ChangeLog 2010-09-29 09:52:43 +0000 +++ src/ChangeLog 2010-09-29 12:48:29 +0000 @@ -1,3 +1,17 @@ +2010-09-29 Lars Magne Ingebrigtsen + + * process.h (Lisp_Process): Add a gnutls_p field to Lisp_Process. + + * process.c (make_process): Set the gnutls_p field to zero by + default. + (read_process_output): Always call the gnutls_read function if the + stream is a gnutls stream. + (send_process): Ditto for writes. + + * gnutls.c (emacs_gnutls_write, emacs_gnutls_read): Refuse to read + or write anything until the state is GNUTLS_STAGE_READY. + (Fgnutls_boot): Mark the stream as being a gnutls stream. + 2010-09-29 Eli Zaretskii * xdisp.c (reseat_1): Initialize bidi_it.paragraph_dir to === modified file 'src/gnutls.c' --- src/gnutls.c 2010-09-28 21:55:34 +0000 +++ src/gnutls.c 2010-09-29 12:48:29 +0000 @@ -33,10 +33,14 @@ int global_initialized; int -emacs_gnutls_write (int fildes, gnutls_session_t state, char *buf, +emacs_gnutls_write (int fildes, struct Lisp_Process *proc, char *buf, unsigned int nbyte) { register int rtnval, bytes_written; + gnutls_session_t state = proc->gnutls_state; + + if (proc->gnutls_initstage != GNUTLS_STAGE_READY) + return 0; bytes_written = 0; @@ -62,16 +66,20 @@ } int -emacs_gnutls_read (int fildes, gnutls_session_t state, char *buf, +emacs_gnutls_read (int fildes, struct Lisp_Process *proc, char *buf, unsigned int nbyte) { register int rtnval; + gnutls_session_t state = proc->gnutls_state; + + if (proc->gnutls_initstage != GNUTLS_STAGE_READY) + return 0; rtnval = gnutls_read (state, buf, nbyte); if (rtnval >= 0) return rtnval; else - return -1; + return 0; } /* convert an integer error to a Lisp_Object; it will be either a @@ -272,6 +280,7 @@ CHECK_STRING (priority_string); state = XPROCESS (proc)->gnutls_state; + XPROCESS (proc)->gnutls_p = 1; if (NUMBERP (loglevel)) { @@ -281,7 +290,7 @@ max_log_level = XINT (loglevel); XPROCESS (proc)->gnutls_log_level = max_log_level; } - + /* always initialize globals. */ global_init = gnutls_emacs_global_init (); if (! NILP (Fgnutls_errorp (global_init))) @@ -483,7 +492,7 @@ if (GNUTLS_INITSTAGE (proc) < GNUTLS_STAGE_HANDSHAKE_CANDO) return Qgnutls_e_not_ready_for_handshake; - + if (GNUTLS_INITSTAGE (proc) < GNUTLS_STAGE_TRANSPORT_POINTERS_SET) { /* for a network process in Emacs infd and outfd are the same @@ -502,7 +511,7 @@ ret = gnutls_handshake (state); GNUTLS_INITSTAGE (proc) = GNUTLS_STAGE_HANDSHAKE_TRIED; - if (GNUTLS_E_SUCCESS == ret) + if (ret == GNUTLS_E_SUCCESS) { /* here we're finally done. */ GNUTLS_INITSTAGE (proc) = GNUTLS_STAGE_READY; === modified file 'src/gnutls.h' --- src/gnutls.h 2010-09-27 16:44:31 +0000 +++ src/gnutls.h 2010-09-29 12:48:29 +0000 @@ -49,10 +49,10 @@ #define GNUTLS_LOG(level, max, string) if (level <= max) { gnutls_log_function (level, "(Emacs) " string); } int -emacs_gnutls_write (int fildes, gnutls_session_t state, char *buf, +emacs_gnutls_write (int fildes, struct Lisp_Process *proc, char *buf, unsigned int nbyte); int -emacs_gnutls_read (int fildes, gnutls_session_t state, char *buf, +emacs_gnutls_read (int fildes, struct Lisp_Process *proc, char *buf, unsigned int nbyte); extern void syms_of_gnutls (void); === modified file 'src/process.c' --- src/process.c 2010-09-27 20:43:03 +0000 +++ src/process.c 2010-09-29 12:48:29 +0000 @@ -672,6 +672,7 @@ #ifdef HAVE_GNUTLS p->gnutls_initstage = GNUTLS_STAGE_EMPTY; p->gnutls_log_level = 0; + p->gnutls_p = 0; #endif /* If name is already in use, modify it until it is unused. */ @@ -5203,8 +5204,8 @@ if (proc_buffered_char[channel] < 0) { #ifdef HAVE_GNUTLS - if (NETCONN_P(proc) && GNUTLS_PROCESS_USABLE (proc)) - nbytes = emacs_gnutls_read (channel, XPROCESS (proc)->gnutls_state, + if (XPROCESS (proc)->gnutls_p) + nbytes = emacs_gnutls_read (channel, XPROCESS (proc), chars + carryover, readmax); else #endif @@ -5242,8 +5243,8 @@ chars[carryover] = proc_buffered_char[channel]; proc_buffered_char[channel] = -1; #ifdef HAVE_GNUTLS - if (NETCONN_P(proc) && GNUTLS_PROCESS_USABLE (proc)) - nbytes = emacs_gnutls_read (channel, XPROCESS (proc)->gnutls_state, + if (XPROCESS (proc)->gnutls_p) + nbytes = emacs_gnutls_read (channel, XPROCESS (proc), chars + carryover + 1, readmax - 1); else #endif @@ -5658,9 +5659,9 @@ #endif { #ifdef HAVE_GNUTLS - if (NETCONN_P(proc) && GNUTLS_PROCESS_USABLE (proc)) + if (XPROCESS (proc)->gnutls_p) rv = emacs_gnutls_write (outfd, - XPROCESS (proc)->gnutls_state, + XPROCESS (proc), (char *) buf, this); else #endif === modified file 'src/process.h' --- src/process.h 2010-09-27 16:44:31 +0000 +++ src/process.h 2010-09-29 12:48:29 +0000 @@ -136,6 +136,7 @@ gnutls_certificate_client_credentials gnutls_x509_cred; gnutls_anon_client_credentials_t gnutls_anon_cred; int gnutls_log_level; + int gnutls_p; #endif }; ------------------------------------------------------------ revno: 101675 committer: Eli Zaretskii branch nick: trunk timestamp: Wed 2010-09-29 11:52:43 +0200 message: Fix bug #7128. xdisp.c (reseat_1): Initialize bidi_it.paragraph_dir to NEUTRAL_DIR. (handle_invisible_prop, iterate_out_of_display_property) (next_element_from_buffer): If bidi_it.first_elt is set, call bidi_paragraph_init with NO_DEFAULT_P argument non-zero. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-09-29 09:06:53 +0000 +++ src/ChangeLog 2010-09-29 09:52:43 +0000 @@ -1,5 +1,12 @@ 2010-09-29 Eli Zaretskii + * xdisp.c (reseat_1): Initialize bidi_it.paragraph_dir to + NEUTRAL_DIR. + (handle_invisible_prop, iterate_out_of_display_property) + (next_element_from_buffer): If bidi_it.first_elt is set, call + bidi_paragraph_init with NO_DEFAULT_P argument non-zero. + (Bug#7128) + * print.c (print_object): Fix format string and argument types for printing a Lisp_Misc_Marker. === modified file 'src/xdisp.c' --- src/xdisp.c 2010-09-29 09:11:58 +0000 +++ src/xdisp.c 2010-09-29 09:52:43 +0000 @@ -3831,7 +3831,7 @@ skip any text at the beginning, which resets the FIRST_ELT flag. */ bidi_paragraph_init (it->paragraph_embedding, - &it->bidi_it, 0); + &it->bidi_it, 1); } do { @@ -5152,7 +5152,7 @@ of a new paragraph, next_element_from_buffer may not have a chance to do that. */ if (it->bidi_it.first_elt && it->bidi_it.charpos < ZV) - bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it, 0); + bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it, 1); /* prev_stop can be zero, so check against BEGV as well. */ while (it->bidi_it.charpos >= BEGV && it->prev_stop <= it->bidi_it.charpos @@ -5584,7 +5584,10 @@ it->string_from_display_prop_p = 0; it->face_before_selective_p = 0; if (it->bidi_p) - it->bidi_it.first_elt = 1; + { + it->bidi_it.first_elt = 1; + it->bidi_it.paragraph_dir = NEUTRAL_DIR; + } if (set_stop_p) { @@ -6675,7 +6678,7 @@ { /* If we are at the beginning of a line, we can produce the next element right away. */ - bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it, 0); + bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it, 1); bidi_move_to_visually_next (&it->bidi_it); } else @@ -6689,7 +6692,7 @@ IT_BYTEPOS (*it) = CHAR_TO_BYTE (IT_CHARPOS (*it)); it->bidi_it.charpos = IT_CHARPOS (*it); it->bidi_it.bytepos = IT_BYTEPOS (*it); - bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it, 0); + bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it, 1); do { /* Now return to buffer position where we were asked to ------------------------------------------------------------ revno: 101674 committer: Eli Zaretskii branch nick: trunk timestamp: Wed 2010-09-29 05:11:58 -0400 message: xdisp.c (string_buffer_position): Remove unused variables. diff: === modified file 'src/xdisp.c' --- src/xdisp.c 2010-09-29 09:06:53 +0000 +++ src/xdisp.c 2010-09-29 09:11:58 +0000 @@ -4646,7 +4646,6 @@ EMACS_INT string_buffer_position (struct window *w, Lisp_Object string, EMACS_INT around_charpos) { - Lisp_Object limit, prop, pos; const int MAX_DISTANCE = 1000; EMACS_INT found = string_buffer_position_lim (w, string, around_charpos, around_charpos + MAX_DISTANCE, ------------------------------------------------------------ revno: 101673 committer: Eli Zaretskii branch nick: trunk timestamp: Wed 2010-09-29 05:06:53 -0400 message: Fix int/EMACS_INT use in xdisp.c and print.c. print.c (print_object): Fix format string and argument types for printing a Lisp_Misc_Marker. xdisp.c (pos_visible_p, c_string_pos, number_of_chars) (load_overlay_strings, get_overlay_strings_1) (get_overlay_strings, forward_to_next_line_start) (back_to_previous_visible_line_start, reseat, reseat_to_string) (get_next_display_element, next_element_from_string) (next_element_from_c_string, next_element_from_buffer) (move_it_vertically_backward, move_it_by_lines, add_to_log) (message_dolog, message_log_check_duplicate, message2_nolog) (message3, message3_nolog, vmessage, set_message, set_message_1) (hscroll_window_tree, text_outside_line_unchanged_p) (set_cursor_from_row, set_vertical_scroll_bar, redisplay_window) (find_last_unchanged_at_beg_row) (find_first_unchanged_at_end_row, row_containing_pos) (trailing_whitespace_p, display_mode_element, decode_mode_spec) (display_count_lines, x_produce_glyphs, note_mouse_highlight): Use EMACS_INT for buffer and string positions. dispextern.h (struct it) : Declare EMACS_INT. (row_containing_pos): Adjust prototype. lisp.h (pos_visible_p, message2, message2_nolog, message3) (message2_nolog, set_message): Adjust prototypes. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-09-28 21:55:34 +0000 +++ src/ChangeLog 2010-09-29 09:06:53 +0000 @@ -1,3 +1,31 @@ +2010-09-29 Eli Zaretskii + + * print.c (print_object): Fix format string and argument types for + printing a Lisp_Misc_Marker. + + * xdisp.c (pos_visible_p, c_string_pos, number_of_chars) + (load_overlay_strings, get_overlay_strings_1) + (get_overlay_strings, forward_to_next_line_start) + (back_to_previous_visible_line_start, reseat, reseat_to_string) + (get_next_display_element, next_element_from_string) + (next_element_from_c_string, next_element_from_buffer) + (move_it_vertically_backward, move_it_by_lines, add_to_log) + (message_dolog, message_log_check_duplicate, message2_nolog) + (message3, message3_nolog, vmessage, set_message, set_message_1) + (hscroll_window_tree, text_outside_line_unchanged_p) + (set_cursor_from_row, set_vertical_scroll_bar, redisplay_window) + (find_last_unchanged_at_beg_row) + (find_first_unchanged_at_end_row, row_containing_pos) + (trailing_whitespace_p, display_mode_element, decode_mode_spec) + (display_count_lines, x_produce_glyphs, note_mouse_highlight): Use + EMACS_INT for buffer and string positions. + + * dispextern.h (struct it) : Declare EMACS_INT. + (row_containing_pos): Adjust prototype. + + * lisp.h (pos_visible_p, message2, message2_nolog, message3) + (message2_nolog, set_message): Adjust prototypes. + 2010-09-28 Stefan Monnier * gnutls.c (Fgnutls_boot): Remove unused vars `data' and `srp_cred'. === modified file 'src/dispextern.h' --- src/dispextern.h 2010-09-27 05:42:43 +0000 +++ src/dispextern.h 2010-09-29 09:06:53 +0000 @@ -2067,7 +2067,7 @@ /* Number of characters in the string (s, or it->string) we iterate over. */ - int string_nchars; + EMACS_INT string_nchars; /* Start and end of a visible region; -1 if the region is not visible in the window. */ @@ -2914,7 +2914,7 @@ /* Defined in xdisp.c */ -struct glyph_row *row_containing_pos (struct window *, int, +struct glyph_row *row_containing_pos (struct window *, EMACS_INT, struct glyph_row *, struct glyph_row *, int); EMACS_INT string_buffer_position (struct window *, Lisp_Object, === modified file 'src/lisp.h' --- src/lisp.h 2010-09-27 15:34:04 +0000 +++ src/lisp.h 2010-09-29 09:06:53 +0000 @@ -2657,16 +2657,16 @@ extern void pop_message (void); extern void restore_message (void); extern Lisp_Object current_message (void); -extern void set_message (const char *s, Lisp_Object, int, int); +extern void set_message (const char *s, Lisp_Object, EMACS_INT, int); extern void clear_message (int, int); extern void message (const char *, ...); extern void message_nolog (const char *, ...); extern void message1 (const char *); extern void message1_nolog (const char *); -extern void message2 (const char *, int, int); -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 message2 (const char *, EMACS_INT, int); +extern void message2_nolog (const char *, EMACS_INT, int); +extern void message3 (Lisp_Object, EMACS_INT, int); +extern void message3_nolog (Lisp_Object, EMACS_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); @@ -2682,7 +2682,7 @@ extern void syms_of_xdisp (void); extern void init_xdisp (void); extern Lisp_Object safe_eval (Lisp_Object); -extern int pos_visible_p (struct window *, int, int *, +extern int pos_visible_p (struct window *, EMACS_INT, int *, int *, int *, int *, int *, int *); /* Defined in xsettings.c */ === modified file 'src/print.c' --- src/print.c 2010-09-25 11:55:30 +0000 +++ src/print.c 2010-09-29 09:06:53 +0000 @@ -2185,7 +2185,7 @@ strout ("in no buffer", -1, -1, printcharfun, 0); else { - sprintf (buf, "at %d", marker_position (obj)); + sprintf (buf, "at %ld", (long)marker_position (obj)); strout (buf, -1, -1, printcharfun, 0); strout (" in ", -1, -1, printcharfun, 0); print_string (XMARKER (obj)->buffer->name, printcharfun); @@ -2199,9 +2199,9 @@ strout ("in no buffer", -1, -1, printcharfun, 0); else { - sprintf (buf, "from %d to %d in ", - marker_position (OVERLAY_START (obj)), - marker_position (OVERLAY_END (obj))); + sprintf (buf, "from %ld to %ld in ", + (long)marker_position (OVERLAY_START (obj)), + (long)marker_position (OVERLAY_END (obj))); strout (buf, -1, -1, printcharfun, 0); print_string (XMARKER (OVERLAY_START (obj))->buffer->name, printcharfun); === modified file 'src/xdisp.c' --- src/xdisp.c 2010-09-27 05:42:43 +0000 +++ src/xdisp.c 2010-09-29 09:06:53 +0000 @@ -956,7 +956,8 @@ static struct text_pos run_window_scroll_functions (Lisp_Object, struct text_pos); static void reconsider_clip_changes (struct window *, struct buffer *); -static int text_outside_line_unchanged_p (struct window *, int, int); +static int text_outside_line_unchanged_p (struct window *, + EMACS_INT, EMACS_INT); static void store_mode_line_noprop_char (char); static int store_mode_line_noprop (const unsigned char *, int, int); static void x_consider_frame_title (Lisp_Object); @@ -991,8 +992,9 @@ static int cursor_row_fully_visible_p (struct window *, int, int); static int try_scrolling (Lisp_Object, int, EMACS_INT, EMACS_INT, int, int); static int try_cursor_movement (Lisp_Object, struct text_pos, int *); -static int trailing_whitespace_p (int); -static int message_log_check_duplicate (int, int, int, int); +static int trailing_whitespace_p (EMACS_INT); +static int message_log_check_duplicate (EMACS_INT, EMACS_INT, + EMACS_INT, EMACS_INT); static void push_it (struct it *); static void pop_it (struct it *); static void sync_frame_with_window_matrix_rows (struct window *); @@ -1015,13 +1017,14 @@ static const char *decode_mode_spec (struct window *, int, int, int, Lisp_Object *); static void display_menu_bar (struct window *); -static int display_count_lines (int, int, int, int, int *); +static int display_count_lines (EMACS_INT, EMACS_INT, EMACS_INT, int, + EMACS_INT *); static int display_string (const unsigned char *, Lisp_Object, Lisp_Object, EMACS_INT, EMACS_INT, struct it *, int, int, int, int); static void compute_line_metrics (struct it *); static void run_redisplay_end_trigger_hook (struct it *); -static int get_overlay_strings (struct it *, int); -static int get_overlay_strings_1 (struct it *, int, int); +static int get_overlay_strings (struct it *, EMACS_INT); +static int get_overlay_strings_1 (struct it *, EMACS_INT, int); static void next_overlay_string (struct it *); static void reseat (struct it *, struct text_pos, int); static void reseat_1 (struct it *, struct text_pos, int); @@ -1036,11 +1039,11 @@ static int next_element_from_composition (struct it *); static int next_element_from_image (struct it *); static int next_element_from_stretch (struct it *); -static void load_overlay_strings (struct it *, int); +static void load_overlay_strings (struct it *, EMACS_INT); static int init_from_display_pos (struct it *, struct window *, struct display_pos *); static void reseat_to_string (struct it *, const unsigned char *, - Lisp_Object, int, int, int, int); + Lisp_Object, EMACS_INT, EMACS_INT, int, int); static enum move_it_result move_it_in_display_line_to (struct it *, EMACS_INT, int, enum move_operation_enum); @@ -1054,8 +1057,8 @@ static struct text_pos string_pos_nchars_ahead (struct text_pos, Lisp_Object, EMACS_INT); static struct text_pos string_pos (EMACS_INT, Lisp_Object); -static struct text_pos c_string_pos (int, const unsigned char *, int); -static int number_of_chars (const unsigned char *, int); +static struct text_pos c_string_pos (EMACS_INT, const unsigned char *, int); +static EMACS_INT number_of_chars (const unsigned char *, int); static void compute_stop_pos (struct it *); static void compute_string_pos (struct text_pos *, struct text_pos, Lisp_Object); @@ -1362,7 +1365,7 @@ Set *ROWH and *VPOS to row's visible height and VPOS (row number). */ int -pos_visible_p (struct window *w, int charpos, int *x, int *y, +pos_visible_p (struct window *w, EMACS_INT charpos, int *x, int *y, int *rtop, int *rbot, int *rowh, int *vpos) { struct it it; @@ -1567,7 +1570,7 @@ means recognize multibyte characters. */ static struct text_pos -c_string_pos (int charpos, const unsigned char *s, int multibyte_p) +c_string_pos (EMACS_INT charpos, const unsigned char *s, int multibyte_p) { struct text_pos pos; @@ -1576,7 +1579,8 @@ if (multibyte_p) { - int rest = strlen (s), len; + EMACS_INT rest = strlen (s); + int len; SET_TEXT_POS (pos, 0, 0); while (charpos--) @@ -1598,14 +1602,15 @@ /* Value is the number of characters in C string S. MULTIBYTE_P non-zero means recognize multibyte characters. */ -static int +static EMACS_INT number_of_chars (const unsigned char *s, int multibyte_p) { - int nchars; + EMACS_INT nchars; if (multibyte_p) { - int rest = strlen (s), len; + EMACS_INT rest = strlen (s); + int len; unsigned char *p = (unsigned char *) s; for (nchars = 0; rest > 0; ++nchars) @@ -3624,7 +3629,6 @@ if (STRING_MULTIBYTE (it->string)) { const unsigned char *p = SDATA (it->string) + BYTEPOS (pos); - EMACS_INT rest = SBYTES (it->string) - BYTEPOS (pos); int c, len; struct face *face = FACE_FROM_ID (it->f, face_id); @@ -4873,11 +4877,11 @@ compare_overlay_entries. */ static void -load_overlay_strings (struct it *it, int charpos) +load_overlay_strings (struct it *it, EMACS_INT charpos) { Lisp_Object overlay, window, str, invisible; struct Lisp_Overlay *ov; - int start, end; + EMACS_INT start, end; int size = 20; int n = 0, i, j, invis_p; struct overlay_entry *entries @@ -5023,7 +5027,7 @@ least one overlay string was found. */ static int -get_overlay_strings_1 (struct it *it, int charpos, int compute_stop_p) +get_overlay_strings_1 (struct it *it, EMACS_INT charpos, int compute_stop_p) { /* Get the first OVERLAY_STRING_CHUNK_SIZE overlay strings to process. This fills IT->overlay_strings with strings, and sets @@ -5074,7 +5078,7 @@ } static int -get_overlay_strings (struct it *it, int charpos) +get_overlay_strings (struct it *it, EMACS_INT charpos) { it->string = Qnil; it->method = GET_FROM_BUFFER; @@ -5320,8 +5324,8 @@ short-cut. */ if (!newline_found_p) { - int start = IT_CHARPOS (*it); - int limit = find_next_newline_no_quit (start, 1); + EMACS_INT start = IT_CHARPOS (*it); + EMACS_INT limit = find_next_newline_no_quit (start, 1); Lisp_Object pos; xassert (!STRINGP (it->string)); @@ -5392,7 +5396,7 @@ { struct it it2; - int pos; + EMACS_INT pos; EMACS_INT beg, end; Lisp_Object val, overlay; @@ -5514,7 +5518,7 @@ static void reseat (struct it *it, struct text_pos pos, int force_p) { - int original_pos = IT_CHARPOS (*it); + EMACS_INT original_pos = IT_CHARPOS (*it); reseat_1 (it, pos, 0); @@ -5611,7 +5615,8 @@ static void reseat_to_string (struct it *it, const unsigned char *s, Lisp_Object string, - int charpos, int precision, int field_width, int multibyte) + EMACS_INT charpos, EMACS_INT precision, int field_width, + int multibyte) { /* No region in strings. */ it->region_beg_charpos = it->region_end_charpos = -1; @@ -6014,9 +6019,9 @@ } else { - int pos = (it->s ? -1 - : STRINGP (it->string) ? IT_STRING_CHARPOS (*it) - : IT_CHARPOS (*it)); + EMACS_INT pos = (it->s ? -1 + : STRINGP (it->string) ? IT_STRING_CHARPOS (*it) + : IT_CHARPOS (*it)); it->face_id = FACE_FOR_CHAR (it->f, face, it->char_to_display, pos, it->string); @@ -6449,7 +6454,6 @@ } else if (STRING_MULTIBYTE (it->string)) { - int remaining = SBYTES (it->string) - IT_STRING_BYTEPOS (*it); const unsigned char *s = (SDATA (it->string) + IT_STRING_BYTEPOS (*it)); it->c = string_char_and_length (s, &it->len); @@ -6485,7 +6489,6 @@ } else if (STRING_MULTIBYTE (it->string)) { - int maxlen = SBYTES (it->string) - IT_STRING_BYTEPOS (*it); const unsigned char *s = (SDATA (it->string) + IT_STRING_BYTEPOS (*it)); it->c = string_char_and_length (s, &it->len); @@ -6538,13 +6541,7 @@ BYTEPOS (it->position) = CHARPOS (it->position) = -1; } else if (it->multibyte_p) - { - /* Implementation note: The calls to strlen apparently aren't a - performance problem because there is no noticeable performance - difference between Emacs running in unibyte or multibyte mode. */ - int maxlen = strlen (it->s) - IT_BYTEPOS (*it); - it->c = string_char_and_length (it->s + IT_BYTEPOS (*it), &it->len); - } + it->c = string_char_and_length (it->s + IT_BYTEPOS (*it), &it->len); else it->c = it->s[IT_BYTEPOS (*it)], it->len = 1; @@ -6684,7 +6681,7 @@ } else { - int orig_bytepos = IT_BYTEPOS (*it); + EMACS_INT orig_bytepos = IT_BYTEPOS (*it); /* We need to prime the bidi iterator starting at the line's beginning, before we will be able to produce the next @@ -7668,7 +7665,7 @@ { int nlines, h; struct it it2, it3; - int start_pos; + EMACS_INT start_pos; move_further_back: xassert (dy >= 0); @@ -7829,12 +7826,12 @@ void move_it_by_lines (struct it *it, int dvpos, int need_y_p) { - struct position pos; /* The commented-out optimization uses vmotion on terminals. This gives bad results, because elements like it->what, on which callers such as pos_visible_p rely, aren't updated. */ - /* if (!FRAME_WINDOW_P (it->f)) + /* struct position pos; + if (!FRAME_WINDOW_P (it->f)) { struct text_pos textpos; @@ -7863,7 +7860,7 @@ else { struct it it2; - int start_charpos, i; + EMACS_INT start_charpos, i; /* Start at the beginning of the screen line containing IT's position. This may actually move vertically backwards, @@ -7943,7 +7940,7 @@ Lisp_Object args[3]; Lisp_Object msg, fmt; char *buffer; - int len; + EMACS_INT len; struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; USE_SAFE_ALLOCA; @@ -8002,8 +7999,8 @@ struct buffer *oldbuf; Lisp_Object oldpoint, oldbegv, oldzv; int old_windows_or_buffers_changed = windows_or_buffers_changed; - int point_at_end = 0; - int zv_at_end = 0; + EMACS_INT point_at_end = 0; + EMACS_INT zv_at_end = 0; Lisp_Object old_deactivate_mark, tem; struct gcpro gcpro1; @@ -8036,7 +8033,8 @@ if (multibyte && NILP (current_buffer->enable_multibyte_characters)) { - int i, c, char_bytes; + EMACS_INT i; + int c, char_bytes; unsigned char work[1]; /* Convert a multibyte string to single-byte @@ -8053,7 +8051,8 @@ else if (! multibyte && ! NILP (current_buffer->enable_multibyte_characters)) { - int i, c, char_bytes; + EMACS_INT i; + int c, char_bytes; unsigned char *msg = (unsigned char *) m; unsigned char str[MAX_MULTIBYTE_LENGTH]; /* Convert a single-byte string to multibyte @@ -8071,7 +8070,8 @@ if (nlflag) { - int this_bol, this_bol_byte, prev_bol, prev_bol_byte, dup; + EMACS_INT this_bol, this_bol_byte, prev_bol, prev_bol_byte; + int dup; insert_1 ("\n", 1, 1, 0, 0); scan_newline (Z, Z_BYTE, BEG, BEG_BYTE, -2, 0); @@ -8162,11 +8162,11 @@ value N > 1 if we should also append " [N times]". */ static int -message_log_check_duplicate (int prev_bol, int prev_bol_byte, - int this_bol, int this_bol_byte) +message_log_check_duplicate (EMACS_INT prev_bol, EMACS_INT prev_bol_byte, + EMACS_INT this_bol, EMACS_INT this_bol_byte) { - int i; - int len = Z_BYTE - 1 - this_bol_byte; + EMACS_INT i; + EMACS_INT len = Z_BYTE - 1 - this_bol_byte; int seen_dots = 0; unsigned char *p1 = BUF_BYTE_ADDRESS (current_buffer, prev_bol_byte); unsigned char *p2 = BUF_BYTE_ADDRESS (current_buffer, this_bol_byte); @@ -8201,7 +8201,7 @@ This may GC, so the buffer M must NOT point to a Lisp string. */ void -message2 (const char *m, int nbytes, int multibyte) +message2 (const char *m, EMACS_INT nbytes, int multibyte) { /* First flush out any partial line written with print. */ message_log_maybe_newline (); @@ -8214,7 +8214,7 @@ /* The non-logging counterpart of message2. */ void -message2_nolog (const char *m, int nbytes, int multibyte) +message2_nolog (const char *m, EMACS_INT nbytes, int multibyte) { struct frame *sf = SELECTED_FRAME (); message_enable_multibyte = multibyte; @@ -8276,7 +8276,7 @@ This function cancels echoing. */ void -message3 (Lisp_Object m, int nbytes, int multibyte) +message3 (Lisp_Object m, EMACS_INT nbytes, int multibyte) { struct gcpro gcpro1; @@ -8308,7 +8308,7 @@ and make this cancel echoing. */ void -message3_nolog (Lisp_Object m, int nbytes, int multibyte) +message3_nolog (Lisp_Object m, EMACS_INT nbytes, int multibyte) { struct frame *sf = SELECTED_FRAME (); message_enable_multibyte = multibyte; @@ -8494,7 +8494,7 @@ { if (m) { - int len; + EMACS_INT len; len = doprnt (FRAME_MESSAGE_BUF (f), FRAME_MESSAGE_BUF_SIZE (f), m, (char *)0, ap); @@ -9238,7 +9238,8 @@ */ void -set_message (const char *s, Lisp_Object string, int nbytes, int multibyte_p) +set_message (const char *s, Lisp_Object string, + EMACS_INT nbytes, int multibyte_p) { message_enable_multibyte = ((s && multibyte_p) @@ -9274,7 +9275,7 @@ if (STRINGP (string)) { - int nchars; + EMACS_INT nchars; if (nbytes == 0) nbytes = SBYTES (string); @@ -9293,7 +9294,8 @@ if (multibyte_p && NILP (current_buffer->enable_multibyte_characters)) { /* Convert from multi-byte to single-byte. */ - int i, c, n; + EMACS_INT i; + int c, n; unsigned char work[1]; /* Convert a multibyte string to single-byte. */ @@ -9310,7 +9312,8 @@ && !NILP (current_buffer->enable_multibyte_characters)) { /* Convert from single-byte to multi-byte. */ - int i, c, n; + EMACS_INT i; + int c, n; const unsigned char *msg = (const unsigned char *) s; unsigned char str[MAX_MULTIBYTE_LENGTH]; @@ -10992,7 +10995,7 @@ struct it it; int hscroll; struct buffer *saved_current_buffer; - int pt; + EMACS_INT pt; int wanted_x; /* Find point in a display of infinite width. */ @@ -11157,7 +11160,8 @@ redisplay_internal for display optimization. */ static INLINE int -text_outside_line_unchanged_p (struct window *w, int start, int end) +text_outside_line_unchanged_p (struct window *w, + EMACS_INT start, EMACS_INT end) { int unchanged_p = 1; @@ -12473,7 +12477,7 @@ struct glyph *end = glyph + row->used[TEXT_AREA]; struct glyph *cursor = NULL; /* The last known character position in row. */ - int last_pos = MATRIX_ROW_START_CHARPOS (row) + delta; + EMACS_INT last_pos = MATRIX_ROW_START_CHARPOS (row) + delta; int x = row->x; EMACS_INT pt_old = PT - delta; EMACS_INT pos_before = MATRIX_ROW_START_CHARPOS (row) + delta; @@ -12610,7 +12614,7 @@ else if (STRINGP (glyph->object)) { Lisp_Object chprop; - int glyph_pos = glyph->charpos; + EMACS_INT glyph_pos = glyph->charpos; chprop = Fget_char_property (make_number (glyph_pos), Qcursor, glyph->object); @@ -12677,7 +12681,7 @@ else if (STRINGP (glyph->object)) { Lisp_Object chprop; - int glyph_pos = glyph->charpos; + EMACS_INT glyph_pos = glyph->charpos; chprop = Fget_char_property (make_number (glyph_pos), Qcursor, glyph->object); @@ -12795,7 +12799,7 @@ be a character in the string with the `cursor' property, which means display cursor on that character's glyph. */ - int strpos = glyph->charpos; + EMACS_INT strpos = glyph->charpos; cursor = glyph; for (glyph += incr; @@ -12804,7 +12808,7 @@ glyph += incr) { Lisp_Object cprop; - int gpos = glyph->charpos; + EMACS_INT gpos = glyph->charpos; cprop = Fget_char_property (make_number (gpos), Qcursor, @@ -13694,7 +13698,7 @@ void set_vertical_scroll_bar (struct window *w) { - int start, end, whole; + EMACS_INT start, end, whole; /* Calculate the start and end positions for the current window. At some point, it would be nice to choose between scrollbars @@ -13758,7 +13762,7 @@ int rc; int centering_position = -1; int last_line_misfit = 0; - int beg_unchanged, end_unchanged; + EMACS_INT beg_unchanged, end_unchanged; SET_TEXT_POS (lpoint, PT, PT_BYTE); opoint = lpoint; @@ -13900,8 +13904,8 @@ window, set up appropriate value. */ if (!EQ (window, selected_window)) { - int new_pt = XMARKER (w->pointm)->charpos; - int new_pt_byte = marker_byte_position (w->pointm); + EMACS_INT new_pt = XMARKER (w->pointm)->charpos; + EMACS_INT new_pt_byte = marker_byte_position (w->pointm); if (new_pt < BEGV) { new_pt = BEGV; @@ -15107,7 +15111,7 @@ static struct glyph_row * find_last_unchanged_at_beg_row (struct window *w) { - int first_changed_pos = BEG + BEG_UNCHANGED; + EMACS_INT first_changed_pos = BEG + BEG_UNCHANGED; struct glyph_row *row; struct glyph_row *row_found = NULL; int yb = window_text_bottom_y (w); @@ -15183,9 +15187,11 @@ corresponds to window_end_pos. This allows us to translate buffer positions in the current matrix to current buffer positions for characters not in changed text. */ - int Z_old = MATRIX_ROW_END_CHARPOS (row) + XFASTINT (w->window_end_pos); - int Z_BYTE_old = MATRIX_ROW_END_BYTEPOS (row) + w->window_end_bytepos; - int last_unchanged_pos, last_unchanged_pos_old; + EMACS_INT Z_old = + MATRIX_ROW_END_CHARPOS (row) + XFASTINT (w->window_end_pos); + EMACS_INT Z_BYTE_old = + MATRIX_ROW_END_BYTEPOS (row) + w->window_end_bytepos; + EMACS_INT last_unchanged_pos, last_unchanged_pos_old; struct glyph_row *first_text_row = MATRIX_FIRST_TEXT_ROW (w->current_matrix); @@ -15272,8 +15278,8 @@ containing CHARPOS or null. */ struct glyph_row * -row_containing_pos (struct window *w, int charpos, struct glyph_row *start, - struct glyph_row *end, int dy) +row_containing_pos (struct window *w, EMACS_INT charpos, + struct glyph_row *start, struct glyph_row *end, int dy) { struct glyph_row *row = start; struct glyph_row *best_row = NULL; @@ -16904,9 +16910,9 @@ trailing whitespace. */ static int -trailing_whitespace_p (int charpos) +trailing_whitespace_p (EMACS_INT charpos) { - int bytepos = CHAR_TO_BYTE (charpos); + EMACS_INT bytepos = CHAR_TO_BYTE (charpos); int c = 0; while (bytepos < ZV_BYTE @@ -18556,7 +18562,7 @@ else if (c != 0) { int multibyte; - int bytepos, charpos; + EMACS_INT bytepos, charpos; const unsigned char *spec; Lisp_Object string; @@ -18830,7 +18836,7 @@ store_mode_line_string (const char *string, Lisp_Object lisp_string, int copy_string, int field_width, int precision, Lisp_Object props) { - int len; + EMACS_INT len; int n = 0; if (string != NULL) @@ -19375,22 +19381,23 @@ case 'i': { - int size = ZV - BEGV; + EMACS_INT size = ZV - BEGV; pint2str (decode_mode_spec_buf, field_width, size); return decode_mode_spec_buf; } case 'I': { - int size = ZV - BEGV; + EMACS_INT size = ZV - BEGV; pint2hrstr (decode_mode_spec_buf, field_width, size); return decode_mode_spec_buf; } case 'l': { - int startpos, startpos_byte, line, linepos, linepos_byte; - int topline, nlines, junk, height; + EMACS_INT startpos, startpos_byte, line, linepos, linepos_byte; + int topline, nlines, height; + EMACS_INT junk; /* %c and %l are ignored in `frame-title-format'. */ if (mode_line_target == MODE_LINE_TITLE) @@ -19451,9 +19458,9 @@ else if (nlines < height + 25 || nlines > height * 3 + 50 || linepos == BUF_BEGV (b)) { - int limit = BUF_BEGV (b); - int limit_byte = BUF_BEGV_BYTE (b); - int position; + EMACS_INT limit = BUF_BEGV (b); + EMACS_INT limit_byte = BUF_BEGV_BYTE (b); + EMACS_INT position; int distance = (height * 2 + 30) * line_number_display_limit_width; if (startpos - distance > limit) @@ -19515,8 +19522,8 @@ case 'p': { - int pos = marker_position (w->start); - int total = BUF_ZV (b) - BUF_BEGV (b); + EMACS_INT pos = marker_position (w->start); + EMACS_INT total = BUF_ZV (b) - BUF_BEGV (b); if (XFASTINT (w->window_end_pos) <= BUF_Z (b) - BUF_ZV (b)) { @@ -19538,7 +19545,7 @@ so get us a 2-digit number that is close. */ if (total == 100) total = 99; - sprintf (decode_mode_spec_buf, "%2d%%", total); + sprintf (decode_mode_spec_buf, "%2ld%%", (long)total); return decode_mode_spec_buf; } } @@ -19546,9 +19553,9 @@ /* Display percentage of size above the bottom of the screen. */ case 'P': { - int toppos = marker_position (w->start); - int botpos = BUF_Z (b) - XFASTINT (w->window_end_pos); - int total = BUF_ZV (b) - BUF_BEGV (b); + EMACS_INT toppos = marker_position (w->start); + EMACS_INT botpos = BUF_Z (b) - XFASTINT (w->window_end_pos); + EMACS_INT total = BUF_ZV (b) - BUF_BEGV (b); if (botpos >= BUF_ZV (b)) { @@ -19569,9 +19576,9 @@ if (total == 100) total = 99; if (toppos <= BUF_BEGV (b)) - sprintf (decode_mode_spec_buf, "Top%2d%%", total); + sprintf (decode_mode_spec_buf, "Top%2ld%%", (long)total); else - sprintf (decode_mode_spec_buf, "%2d%%", total); + sprintf (decode_mode_spec_buf, "%2ld%%", (long)total); return decode_mode_spec_buf; } } @@ -19662,8 +19669,9 @@ Set *BYTE_POS_PTR to 1 if we found COUNT lines, 0 if we hit LIMIT. */ static int -display_count_lines (int start, int start_byte, int limit_byte, int count, - int *byte_pos_ptr) +display_count_lines (EMACS_INT start, EMACS_INT start_byte, + EMACS_INT limit_byte, int count, + EMACS_INT *byte_pos_ptr) { register unsigned char *cursor; unsigned char *base; @@ -21920,11 +21928,7 @@ it2 = *it; if (it->multibyte_p) - { - int maxlen = ((IT_BYTEPOS (*it) >= GPT ? ZV : GPT) - - IT_BYTEPOS (*it)); - it2.c = it2.char_to_display = STRING_CHAR_AND_LENGTH (p, it2.len); - } + it2.c = it2.char_to_display = STRING_CHAR_AND_LENGTH (p, it2.len); else { it2.c = it2.char_to_display = *p, it2.len = 1; @@ -22410,7 +22414,7 @@ XChar2b char2b; struct font_metrics *pcm; int font_not_found_p; - int pos; + EMACS_INT pos; for (glyph_len = cmp->glyph_len; glyph_len > 0; glyph_len--) if ((c = COMPOSITION_GLYPH (cmp, glyph_len - 1)) != '\t') @@ -24504,7 +24508,8 @@ Lisp_Object *overlay_vec = NULL; int noverlays; struct buffer *obuf; - int obegv, ozv, same_region; + EMACS_INT obegv, ozv; + int same_region; /* Find the glyph under X/Y. */ glyph = x_y_to_hpos_vpos (w, x, y, &hpos, &vpos, &dx, &dy, &area); @@ -24690,7 +24695,7 @@ /* If we are on a display string with no mouse-face, check if the text under it has one. */ struct glyph_row *r = MATRIX_ROW (w->current_matrix, vpos); - int start = MATRIX_ROW_START_CHARPOS (r); + EMACS_INT start = MATRIX_ROW_START_CHARPOS (r); pos = string_buffer_position (w, object, start); if (pos > 0) { @@ -24769,7 +24774,7 @@ else { Lisp_Object object = glyph->object; - int charpos = glyph->charpos; + EMACS_INT charpos = glyph->charpos; /* Try text properties. */ if (STRINGP (object) @@ -24784,7 +24789,7 @@ see if the buffer text ``under'' it does. */ struct glyph_row *r = MATRIX_ROW (w->current_matrix, vpos); - int start = MATRIX_ROW_START_CHARPOS (r); + EMACS_INT start = MATRIX_ROW_START_CHARPOS (r); EMACS_INT pos = string_buffer_position (w, object, start); if (pos > 0) { @@ -24824,7 +24829,7 @@ if (NILP (pointer)) { Lisp_Object object = glyph->object; - int charpos = glyph->charpos; + EMACS_INT charpos = glyph->charpos; /* Try text properties. */ if (STRINGP (object) @@ -24839,7 +24844,7 @@ see if the buffer text ``under'' it does. */ struct glyph_row *r = MATRIX_ROW (w->current_matrix, vpos); - int start = MATRIX_ROW_START_CHARPOS (r); + EMACS_INT start = MATRIX_ROW_START_CHARPOS (r); EMACS_INT pos = string_buffer_position (w, object, start); if (pos > 0) ------------------------------------------------------------ revno: 101672 committer: Daiki Ueno branch nick: trunk timestamp: Wed 2010-09-29 17:36:38 +0900 message: * epa.texi (Bug Reports): New section. diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2010-09-29 04:25:59 +0000 +++ doc/misc/ChangeLog 2010-09-29 08:36:38 +0000 @@ -1,3 +1,7 @@ +2010-09-29 Daiki Ueno + + * epa.texi (Bug Reports): New section. + 2010-09-29 Glenn Morris * Makefile.in (top_srcdir): Remove unused variable. === modified file 'doc/misc/epa.texi' --- doc/misc/epa.texi 2010-06-24 07:10:51 +0000 +++ doc/misc/epa.texi 2010-09-29 08:36:38 +0000 @@ -65,7 +65,8 @@ @menu * Overview:: * Quick start:: -* Commands:: +* Commands:: +* Bug Reports:: @end menu @node Overview @@ -398,6 +399,28 @@ The default value is @code{t}. @end defvar +@node Bug Reports +@chapter Bug Reports + +Bugs and problems with EasyPG Assistant are actively worked on by the +Emacs development team. Feature requests and suggestions are also +more than welcome. Use @kbd{M-x report-emacs-bug}, @pxref{Bugs, , +Bugs, emacs, Reporting Bugs}. + +When submitting a bug report, please try to describe in excruciating +detail the steps required to reproduce the problem. Also try to +collect necessary information to fix the bug, such as: + +@itemize @bullet +@item the GnuPG version. Send the output of @samp{gpg --version}. +@item the GnuPG configuration. Send the contents of @file{~/.gnupg/gpg.conf}. +@end itemize + +Before reporting the bug, you should set @code{epg-debug} in the +@file{~/.emacs} file and repeat the bug. Then, include the contents +of the @samp{ *epg-debug*} buffer. Note that the first letter of the +buffer name is a whitespace. + @bye @c End: ------------------------------------------------------------ revno: 101671 committer: Juanma Barranquero branch nick: trunk timestamp: Wed 2010-09-29 10:18:40 +0200 message: * emacsclient.c (main): Remove unused variables. (start_daemon_and_retry_set_socket): Use EXIT_FAILURE. diff: === modified file 'lib-src/ChangeLog' --- lib-src/ChangeLog 2010-09-27 10:25:04 +0000 +++ lib-src/ChangeLog 2010-09-29 08:18:40 +0000 @@ -1,3 +1,8 @@ +2010-09-29 Juanma Barranquero + + * emacsclient.c (main): Remove unused variables. + (start_daemon_and_retry_set_socket): Use EXIT_FAILURE. + 2010-09-25 Ulrich Mueller * etags.c (compressors, print_language_names): Support xz compression. === modified file 'lib-src/emacsclient.c' --- lib-src/emacsclient.c 2010-08-11 08:20:34 +0000 +++ lib-src/emacsclient.c 2010-09-29 08:18:40 +0000 @@ -1476,7 +1476,7 @@ else if (dpid < 0) { fprintf (stderr, "Error: Cannot fork!\n"); - exit (1); + exit (EXIT_FAILURE); } else { @@ -1576,8 +1576,6 @@ int i; for (i = 0; environ[i]; i++) { - char *name = xstrdup (environ[i]); - char *value = strchr (name, '='); send_to_emacs (emacs_socket, "-env "); quote_argument (emacs_socket, environ[i]); send_to_emacs (emacs_socket, " "); ------------------------------------------------------------ revno: 101670 committer: Glenn Morris branch nick: trunk timestamp: Tue 2010-09-28 21:25:59 -0700 message: Remove unused variable top_srcdir from doc Makefiles. * doc/emacs/Makefile.in (top_srcdir): Remove unused variable. * doc/misc/Makefile.in (top_srcdir): Remove unused variable. diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2010-09-14 14:41:53 +0000 +++ doc/emacs/ChangeLog 2010-09-29 04:25:59 +0000 @@ -1,3 +1,7 @@ +2010-09-29 Glenn Morris + + * Makefile.in (top_srcdir): Remove unused variable. + 2010-09-14 Glenn Morris * cal-xtra.texi (Fancy Diary Display): Emphasize that sort should be === modified file 'doc/emacs/Makefile.in' --- doc/emacs/Makefile.in 2010-01-13 08:35:10 +0000 +++ doc/emacs/Makefile.in 2010-09-29 04:25:59 +0000 @@ -1,7 +1,8 @@ #### Makefile for the Emacs Manual # Copyright (C) 1994, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, -# 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +# 2004, 2005, 2006, 2007, 2008, 2009, 2010 +# Free Software Foundation, Inc. # This file is part of GNU Emacs. @@ -23,7 +24,6 @@ # subdirectory of the source tree. This is # set by the configure script's `--srcdir' option. srcdir=@srcdir@ -top_srcdir=@top_srcdir@ # Tell make where to find source files; this is needed for the makefiles. VPATH=@srcdir@ === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2010-09-26 23:15:50 +0000 +++ doc/misc/ChangeLog 2010-09-29 04:25:59 +0000 @@ -1,3 +1,7 @@ +2010-09-29 Glenn Morris + + * Makefile.in (top_srcdir): Remove unused variable. + 2010-09-26 Lars Magne Ingebrigtsen * gnus-news.texi: Mention nnimap-inbox. === modified file 'doc/misc/Makefile.in' --- doc/misc/Makefile.in 2010-01-13 08:35:10 +0000 +++ doc/misc/Makefile.in 2010-09-29 04:25:59 +0000 @@ -1,7 +1,8 @@ #### Makefile for documentation other than the Emacs manual. # Copyright (C) 1994, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, -# 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +# 2004, 2005, 2006, 2007, 2008, 2009, 2010 +# Free Software Foundation, Inc. # This file is part of GNU Emacs. @@ -23,7 +24,6 @@ # subdirectory of the source tree. This is # set by the configure script's `--srcdir' option. srcdir=@srcdir@ -top_srcdir=@top_srcdir@ # Tell make where to find source files; this is needed for the makefiles. VPATH=@srcdir@