changeset 109236:6a29de15d7fb

Merge from mainline.
author Katsumi Yamaoka <katsumi@flagship2>
date Tue, 06 Jul 2010 12:12:41 +0000
parents d53d2e9bef4f (current diff) 3f9a67cdf9f7 (diff)
children 148f49fd0955
files
diffstat 12 files changed, 121 insertions(+), 66 deletions(-) [+]
line wrap: on
line diff
--- a/lib-src/ChangeLog	Mon Jul 05 11:22:19 2010 +0000
+++ b/lib-src/ChangeLog	Tue Jul 06 12:12:41 2010 +0000
@@ -1,3 +1,20 @@
+2010-07-06  Andreas Schwab  <schwab@linux-m68k.org>
+
+	* movemail.c: Add MAIL_USE_POP around prototypes.
+	Include <string.h> if HAVE_STRING_H.
+	(strerror): Only declare if !HAVE_STRERROR.
+	(fatal): Make static.
+	(error): Likewise.
+	(pfatal_with_name): Likewise.
+	(pfatal_and_delete). Likewise.
+	(concat): Likewise.
+	(xmalloc): Likewise.
+	(popmail): Likewise.
+	(pop_retr): Likewise.
+	(mbx_write): Likewise.
+	(mbx_delimit_begin): Likewise.
+	(mbx_delimit_end): Likewise.
+
 2010-07-04  Dan Nicolaescu  <dann@ics.uci.edu>
 
 	* fakemail.c (action): Convert function definitions to standard C.
--- a/lib-src/movemail.c	Mon Jul 05 11:22:19 2010 +0000
+++ b/lib-src/movemail.c	Tue Jul 06 12:12:41 2010 +0000
@@ -69,6 +69,9 @@
 #ifdef HAVE_FCNTL_H
 #include <fcntl.h>
 #endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
 #include "syswait.h"
 #ifdef MAIL_USE_POP
 #include "pop.h"
@@ -140,7 +143,9 @@
 #endif
 #endif
 
+#ifndef HAVE_STRERROR
 char *strerror (int);
+#endif
 #ifdef HAVE_INDEX
 extern char *index (const char *, int);
 #endif
@@ -148,17 +153,19 @@
 extern char *rindex (const char *, int);
 #endif
 
-void fatal (char *s1, char *s2, char *s3);
-void error (char *s1, char *s2, char *s3);
-void pfatal_with_name (char *name);
-void pfatal_and_delete (char *name);
-char *concat (char *s1, char *s2, char *s3);
-long *xmalloc (unsigned int size);
-int popmail (char *mailbox, char *outfile, int preserve, char *password, int reverse_order);
-int pop_retr (popserver server, int msgno, FILE *arg);
-int mbx_write (char *line, int len, FILE *mbf);
-int mbx_delimit_begin (FILE *mbf);
-int mbx_delimit_end (FILE *mbf);
+static void fatal (char *s1, char *s2, char *s3);
+static void error (char *s1, char *s2, char *s3);
+static void pfatal_with_name (char *name);
+static void pfatal_and_delete (char *name);
+static char *concat (char *s1, char *s2, char *s3);
+static long *xmalloc (unsigned int size);
+#ifdef MAIL_USE_POP
+static int popmail (char *mailbox, char *outfile, int preserve, char *password, int reverse_order);
+static int pop_retr (popserver server, int msgno, FILE *arg);
+static int mbx_write (char *line, int len, FILE *mbf);
+static int mbx_delimit_begin (FILE *mbf);
+static int mbx_delimit_end (FILE *mbf);
+#endif
 
 /* Nonzero means this is name of a lock file to delete on fatal error.  */
 char *delete_lockname;
@@ -587,7 +594,7 @@
 
 /* Print error message and exit.  */
 
-void
+static void
 fatal (char *s1, char *s2, char *s3)
 {
   if (delete_lockname)
@@ -599,7 +606,7 @@
 /* Print error message.  `s1' is printf control string, `s2' and `s3'
    are args for it or null. */
 
-void
+static void
 error (char *s1, char *s2, char *s3)
 {
   fprintf (stderr, "movemail: ");
@@ -612,13 +619,13 @@
   fprintf (stderr, "\n");
 }
 
-void
+static void
 pfatal_with_name (char *name)
 {
   fatal ("%s for %s", strerror (errno), name);
 }
 
-void
+static void
 pfatal_and_delete (char *name)
 {
   char *s = strerror (errno);
@@ -628,7 +635,7 @@
 
 /* Return a newly-allocated string whose contents concatenate those of s1, s2, s3.  */
 
-char *
+static char *
 concat (char *s1, char *s2, char *s3)
 {
   int len1 = strlen (s1), len2 = strlen (s2), len3 = strlen (s3);
@@ -644,7 +651,7 @@
 
 /* Like malloc but get fatal error if memory is exhausted.  */
 
-long *
+static long *
 xmalloc (unsigned int size)
 {
   long *result = (long *) malloc (size);
@@ -694,7 +701,7 @@
  * Return a value suitable for passing to `exit'.
  */
 
-int
+static int
 popmail (char *mailbox, char *outfile, int preserve, char *password, int reverse_order)
 {
   int nmsgs, nbytes;
@@ -820,10 +827,9 @@
   return EXIT_SUCCESS;
 }
 
-int
+static int
 pop_retr (popserver server, int msgno, FILE *arg)
 {
-  extern char *strerror (int);
   char *line;
   int ret;
 
@@ -868,7 +874,7 @@
 			 && (a[3] == 'm') \
 			 && (a[4] == ' '))
 
-int
+static int
 mbx_write (char *line, int len, FILE *mbf)
 {
 #ifdef MOVEMAIL_QUOTE_POP_FROM_LINES
@@ -892,7 +898,7 @@
   return (OK);
 }
 
-int
+static int
 mbx_delimit_begin (FILE *mbf)
 {
   time_t now;
@@ -909,7 +915,7 @@
   return (OK);
 }
 
-int
+static int
 mbx_delimit_end (FILE *mbf)
 {
   if (putc ('\n', mbf) == EOF)
--- a/lisp/ChangeLog	Mon Jul 05 11:22:19 2010 +0000
+++ b/lisp/ChangeLog	Tue Jul 06 12:12:41 2010 +0000
@@ -1,3 +1,12 @@
+2010-07-05  Chong Yidong  <cyd@stupidchicken.com>
+
+	* menu-bar.el (menu-bar-mode):
+	* tool-bar.el (tool-bar-mode): Replace default-frame-alist element
+	if it has been set.
+
+	* mouse.el (mouse-drag-track): Call mouse-start-end to handle
+	word/line selection (Bug#6565).
+
 2010-07-04  Juanma Barranquero  <lekktu@gmail.com>
 
 	* net/dbus.el (dbus-send-signal): Declare function.
--- a/lisp/menu-bar.el	Mon Jul 05 11:22:19 2010 +0000
+++ b/lisp/menu-bar.el	Tue Jul 06 12:12:41 2010 +0000
@@ -1937,15 +1937,20 @@
   ;; Turn the menu-bars on all frames on or off.
   (let ((val (if menu-bar-mode 1 0)))
     (dolist (frame (frame-list))
-      (set-frame-parameter frame 'menu-bar-lines val)))
-
+      (set-frame-parameter frame 'menu-bar-lines val))
+    ;; If the user has given `default-frame-alist' a `menu-bar-lines'
+    ;; parameter, replace it.
+    (if (assq 'menu-bar-lines default-frame-alist)
+	(setq default-frame-alist
+	      (cons (cons 'menu-bar-lines val)
+		    (assq-delete-all 'menu-bar-lines
+				     default-frame-alist)))))
   ;; Make the message appear when Emacs is idle.  We can not call message
   ;; directly.  The minor-mode message "Menu-bar mode disabled" comes
   ;; after this function returns, overwriting any message we do here.
   (when (and (called-interactively-p 'interactive) (not menu-bar-mode))
     (run-with-idle-timer 0 nil 'message
-			 "Menu-bar mode disabled.  Use M-x menu-bar-mode to make the menu bar appear."))
-  menu-bar-mode)
+			 "Menu-bar mode disabled.  Use M-x menu-bar-mode to make the menu bar appear.")))
 
 (defun toggle-menu-bar-mode-from-frame (&optional arg)
   "Toggle menu bar on or off, based on the status of the current frame.
--- a/lisp/mouse.el	Mon Jul 05 11:22:19 2010 +0000
+++ b/lisp/mouse.el	Tue Jul 06 12:12:41 2010 +0000
@@ -936,25 +936,30 @@
                        ;; treatment, in case we click on a link inside an
                        ;; intangible text.
                        (mouse-on-link-p start-posn)))
+	 (click-count (1- (event-click-count start-event)))
 	 ;; Suppress automatic hscrolling, because that is a nuisance
 	 ;; when setting point near the right fringe (but see below).
 	 (automatic-hscrolling-saved automatic-hscrolling)
 	 (automatic-hscrolling nil)
 	 event end end-point)
 
-    (setq mouse-selection-click-count (1- (event-click-count start-event)))
+    (setq mouse-selection-click-count click-count)
     ;; In case the down click is in the middle of some intangible text,
     ;; use the end of that text, and put it in START-POINT.
     (if (< (point) start-point)
 	(goto-char start-point))
     (setq start-point (point))
 
-    ;; Activate the mark.
+    ;; Activate the region, using `mouse-start-end' to determine where
+    ;; to put point and mark (e.g., double-click will select a word).
     (setq transient-mark-mode
 	  (if (eq transient-mark-mode 'lambda)
 	      '(only)
 	    (cons 'only transient-mark-mode)))
-    (push-mark nil nil t)
+    (let ((range (mouse-start-end start-point start-point click-count)))
+      (goto-char (nth 0 range))
+      (push-mark nil nil t)
+      (goto-char (nth 1 range)))
 
     ;; Track the mouse until we get a non-movement event.
     (track-mouse
@@ -1017,8 +1022,9 @@
 		     (copy-region-as-kill (mark) (point)))))
 	  ;; If point hasn't moved, run the binding of the
 	  ;; terminating up-event.
-	  (if do-multi-click (goto-char start-point))
-	  (deactivate-mark)
+	  (if do-multi-click
+	      (goto-char start-point)
+	    (deactivate-mark))
 	  (when (and (functionp fun)
 		     (= start-hscroll (window-hscroll start-window))
 		     ;; Don't run the up-event handler if the window
--- a/lisp/tool-bar.el	Mon Jul 05 11:22:19 2010 +0000
+++ b/lisp/tool-bar.el	Tue Jul 06 12:12:41 2010 +0000
@@ -52,13 +52,19 @@
   :global t
   :group 'mouse
   :group 'frames
-  ;; Make tool-bar even if terminal is non-graphical (Bug#1754).
   (let ((val (if tool-bar-mode 1 0)))
     (dolist (frame (frame-list))
-      (set-frame-parameter frame 'tool-bar-lines val)))
-  (when tool-bar-mode
-    (if (= 1 (length (default-value 'tool-bar-map))) ; not yet setup
-	(tool-bar-setup))))
+      (set-frame-parameter frame 'tool-bar-lines val))
+    ;; If the user has given `default-frame-alist' a `tool-bar-lines'
+    ;; parameter, replace it.
+    (if (assq 'tool-bar-lines default-frame-alist)
+	(setq default-frame-alist
+	      (cons (cons 'tool-bar-lines val)
+		    (assq-delete-all 'tool-bar-lines
+				     default-frame-alist)))))
+  (and tool-bar-mode
+       (= 1 (length (default-value 'tool-bar-map))) ; not yet setup
+       (tool-bar-setup)))
 
 ;;;###autoload
 ;; Used in the Show/Hide menu, to have the toggle reflect the current frame.
--- a/src/ChangeLog	Mon Jul 05 11:22:19 2010 +0000
+++ b/src/ChangeLog	Tue Jul 06 12:12:41 2010 +0000
@@ -1,5 +1,17 @@
+2010-07-06  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	* ecrt0.c: Revert conversion to standard C.
+
 2010-07-05  Dan Nicolaescu  <dann@ics.uci.edu>
-            Juanma Barranquero  <lekktu@gmail.com>
+
+	* vm-limit.c (memory_warnings):
+	* keyboard.c (modify_event_symbol):
+	* floatfns.c (rounding_driver, ceiling2, floor2, truncate2)
+	(round2, emacs_rint):
+	* process.c (send_process, old_sigpipe): Convert function
+	definitions and declarations to standard C.
+
+2010-07-05  Juanma Barranquero  <lekktu@gmail.com>
 
 	* buffer.c, cm.c, eval.c, keyboard.c, process.c, term.c, vm-limit.c,
 	* xdisp.c: Convert function definitions to standard C.
--- a/src/ecrt0.c	Mon Jul 05 11:22:19 2010 +0000
+++ b/src/ecrt0.c	Tue Jul 06 12:12:41 2010 +0000
@@ -61,21 +61,23 @@
 
 char **environ;
 
-static start1 (int bogus_fp, int argc, char *xargv);
+static start1 ();
 
 /* Define symbol "start": here; some systems want that symbol.  */
 asm("	.text		");
 asm("	.globl start	");
 asm("	start:		");
 
-_start (void)
+_start ()
 {
 /* On vax, nothing is pushed here  */
   start1 ();
 }
 
 static
-start1 (int bogus_fp, int argc, char *xargv)
+start1 (bogus_fp, argc, xargv)
+     int argc;
+     char *xargv;
 {
   register char **argv = &xargv;
   environ = argv + argc + 1;
--- a/src/floatfns.c	Mon Jul 05 11:22:19 2010 +0000
+++ b/src/floatfns.c	Tue Jul 06 12:12:41 2010 +0000
@@ -70,7 +70,7 @@
 
 /* This declaration is omitted on some systems, like Ultrix.  */
 #if !defined (HPUX) && defined (HAVE_LOGB) && !defined (logb)
-extern double logb ();
+extern double logb (double);
 #endif /* not HPUX and HAVE_LOGB and no logb macro */
 
 #if defined(DOMAIN) && defined(SING) && defined(OVERFLOW)
@@ -778,11 +778,10 @@
 /* the rounding functions  */
 
 static Lisp_Object
-rounding_driver (arg, divisor, double_round, int_round2, name)
-     register Lisp_Object arg, divisor;
-     double (*double_round) ();
-     EMACS_INT (*int_round2) ();
-     char *name;
+rounding_driver (Lisp_Object arg, Lisp_Object divisor,
+		 double (*double_round) (double),
+		 EMACS_INT (*int_round2) (EMACS_INT, EMACS_INT),
+		 char *name)
 {
   CHECK_NUMBER_OR_FLOAT (arg);
 
@@ -832,8 +831,7 @@
    integer functions.  */
 
 static EMACS_INT
-ceiling2 (i1, i2)
-     EMACS_INT i1, i2;
+ceiling2 (EMACS_INT i1, EMACS_INT i2)
 {
   return (i2 < 0
 	  ? (i1 < 0  ?  ((-1 - i1) / -i2) + 1  :  - (i1 / -i2))
@@ -841,8 +839,7 @@
 }
 
 static EMACS_INT
-floor2 (i1, i2)
-     EMACS_INT i1, i2;
+floor2 (EMACS_INT i1, EMACS_INT i2)
 {
   return (i2 < 0
 	  ? (i1 <= 0  ?  -i1 / -i2  :  -1 - ((i1 - 1) / -i2))
@@ -850,8 +847,7 @@
 }
 
 static EMACS_INT
-truncate2 (i1, i2)
-     EMACS_INT i1, i2;
+truncate2 (EMACS_INT i1, EMACS_INT i2)
 {
   return (i2 < 0
 	  ? (i1 < 0  ?  -i1 / -i2  :  - (i1 / -i2))
@@ -859,8 +855,7 @@
 }
 
 static EMACS_INT
-round2 (i1, i2)
-     EMACS_INT i1, i2;
+round2 (EMACS_INT i1, EMACS_INT i2)
 {
   /* The C language's division operator gives us one remainder R, but
      we want the remainder R1 on the other side of 0 if R1 is closer
@@ -880,16 +875,14 @@
 #define emacs_rint rint
 #else
 static double
-emacs_rint (d)
-     double d;
+emacs_rint (double d)
 {
   return floor (d + 0.5);
 }
 #endif
 
 static double
-double_identity (d)
-     double d;
+double_identity (double d)
 {
   return d;
 }
--- a/src/keyboard.c	Mon Jul 05 11:22:19 2010 +0000
+++ b/src/keyboard.c	Tue Jul 06 12:12:41 2010 +0000
@@ -528,8 +528,6 @@
 
 extern Lisp_Object Vhistory_length, Vtranslation_table_for_input;
 
-extern char *x_get_keysym_name ();
-
 static void record_menu_key (Lisp_Object c);
 static int echo_length (void);
 
@@ -611,7 +609,7 @@
 #define READABLE_EVENTS_IGNORE_SQUEEZABLES	(1 << 2)
 
 /* Function for init_keyboard to call with no args (if nonzero).  */
-void (*keyboard_init_hook) ();
+void (*keyboard_init_hook) (void);
 
 static int read_avail_input (int);
 static void get_input_pending (int *, int);
@@ -6583,6 +6581,7 @@
 #ifdef HAVE_WINDOW_SYSTEM
       if (NILP (value))
 	{
+	  extern char *x_get_keysym_name (KeySym keysym);
 	  char *name = x_get_keysym_name (symbol_num);
 	  if (name)
 	    value = intern (name);
--- a/src/process.c	Mon Jul 05 11:22:19 2010 +0000
+++ b/src/process.c	Tue Jul 06 12:12:41 2010 +0000
@@ -182,7 +182,7 @@
 
 #include "syswait.h"
 
-extern char *get_operating_system_release ();
+extern char *get_operating_system_release (void);
 
 /* Serial processes require termios or Windows.  */
 #if defined (HAVE_TERMIOS) || defined (WINDOWSNT)
@@ -5606,7 +5606,7 @@
   int rv;
   struct coding_system *coding;
   struct gcpro gcpro1;
-  SIGTYPE (*volatile old_sigpipe) ();
+  SIGTYPE (*volatile old_sigpipe) (int);
 
   GCPRO1 (object);
 
@@ -5719,7 +5719,7 @@
 	  while (this > 0)
 	    {
 	      int outfd = p->outfd;
-	      old_sigpipe = (SIGTYPE (*) ()) signal (SIGPIPE, send_process_trap);
+	      old_sigpipe = (SIGTYPE (*) (int)) signal (SIGPIPE, send_process_trap);
 #ifdef DATAGRAM_SOCKETS
 	      if (DATAGRAM_CHAN_P (outfd))
 		{
--- a/src/vm-limit.c	Mon Jul 05 11:22:19 2010 +0000
+++ b/src/vm-limit.c	Tue Jul 06 12:12:41 2010 +0000
@@ -251,7 +251,7 @@
 void
 memory_warnings (POINTER start, void (*warnfun) (char *))
 {
-  extern void (* __after_morecore_hook) ();     /* From gmalloc.c */
+  extern void (* __after_morecore_hook) (void);     /* From gmalloc.c */
 
   if (start)
     data_space_start = start;