Using saved parent location: http://bzr.savannah.gnu.org/r/emacs/trunk/ Now on revision 104151. ------------------------------------------------------------ revno: 104151 fixes bug(s): http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8631 committer: Stefan Monnier branch nick: trunk timestamp: Sat 2011-05-07 01:03:49 -0300 message: Make bytecomp.el understand that defmethod defines functions. * lisp/emacs-lisp/eieio.el (eieio--defalias, eieio--defgeneric-init-form): New functions. (defgeneric, eieio--defmethod): Use them. (eieio-defgeneric): Remove. (defmethod): Call defgeneric in a way visible to the byte-compiler. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-07 01:24:04 +0000 +++ lisp/ChangeLog 2011-05-07 04:03:49 +0000 @@ -1,3 +1,12 @@ +2011-05-07 Stefan Monnier + + Make bytecomp.el understand that defmethod defines funs (bug#8631). + * emacs-lisp/eieio.el (eieio--defalias, eieio--defgeneric-init-form): + New functions. + (defgeneric, eieio--defmethod): Use them. + (eieio-defgeneric): Remove. + (defmethod): Call defgeneric in a way visible to the byte-compiler. + 2011-05-07 Glenn Morris * calendar/timeclock.el (timeclock-log-data): Remove unused local. @@ -17,7 +26,7 @@ 2011-05-06 Stefan Monnier * lpr.el (print-region-1): Echo lpr-program's output, so error messages - and warnings are not silently discarded (e.g. use "-d" instead of "-P"). + and warnings are not silently discarded (e.g. use -d instead of -P). 2011-05-06 Glenn Morris === modified file 'lisp/emacs-lisp/bytecomp.el' --- lisp/emacs-lisp/bytecomp.el 2011-04-15 12:30:15 +0000 +++ lisp/emacs-lisp/bytecomp.el 2011-05-07 04:03:49 +0000 @@ -4173,6 +4173,7 @@ ;; Compile normally, but deal with warnings for the function being defined. (put 'defalias 'byte-hunk-handler 'byte-compile-file-form-defalias) +;; Used for eieio--defalias as well. (defun byte-compile-file-form-defalias (form) (if (and (consp (cdr form)) (consp (nth 1 form)) (eq (car (nth 1 form)) 'quote) === modified file 'lisp/emacs-lisp/eieio.el' --- lisp/emacs-lisp/eieio.el 2011-05-05 03:42:09 +0000 +++ lisp/emacs-lisp/eieio.el 2011-05-07 04:03:49 +0000 @@ -420,6 +420,7 @@ (load-library (car (cdr (symbol-function cname)))))) (defun eieio-defclass (cname superclasses slots options-and-doc) + ;; FIXME: Most of this should be moved to the `defclass' macro. "Define CNAME as a new subclass of SUPERCLASSES. SLOTS are the slots residing in that class definition, and options or documentation OPTIONS-AND-DOC is the toplevel documentation for this class. @@ -1139,6 +1140,17 @@ ;;; CLOS methods and generics ;; + +(put 'eieio--defalias 'byte-hunk-handler + #'byte-compile-file-form-defalias) ;;(get 'defalias 'byte-hunk-handler) +(defun eieio--defalias (name body) + "Like `defalias', but with less side-effects. +More specifically, it has no side-effects at all when the new function +definition is the same (`eq') as the old one." + (unless (and (fboundp name) + (eq (symbol-function name) body)) + (defalias name body))) + (defmacro defgeneric (method args &optional doc-string) "Create a generic function METHOD. DOC-STRING is the base documentation for this class. A generic @@ -1147,7 +1159,21 @@ `defgeneric' for you. With this implementation the ARGS are currently ignored. You can use `defgeneric' to apply specialized top level documentation to a method." - `(eieio-defgeneric (quote ,method) ,doc-string)) + `(eieio--defalias ',method + (eieio--defgeneric-init-form ',method ,doc-string))) + +(defun eieio--defgeneric-init-form (method doc-string) + "Form to use for the initial definition of a generic." + (cond + ((or (not (fboundp method)) + (eq 'autoload (car-safe (symbol-function method)))) + ;; Make sure the method tables are installed. + (eieiomt-install method) + ;; Construct the actual body of this function. + (eieio-defgeneric-form method doc-string)) + ((generic-p method) (symbol-function method)) ;Leave it as-is. + (t (error "You cannot create a generic/method over an existing symbol: %s" + method)))) (defun eieio-defgeneric-form (method doc-string) "The lambda form that would be used as the function defined on METHOD. @@ -1237,26 +1263,6 @@ (cdr entry) )))) -(defun eieio-defgeneric (method doc-string) - "Engine part to `defgeneric' macro defining METHOD with DOC-STRING." - (if (and (fboundp method) (not (generic-p method)) - (or (byte-code-function-p (symbol-function method)) - (not (eq 'autoload (car (symbol-function method))))) - ) - (error "You cannot create a generic/method over an existing symbol: %s" - method)) - ;; Don't do this over and over. - (unless (fboundp 'method) - ;; This defun tells emacs where the first definition of this - ;; method is defined. - `(defun ,method nil) - ;; Make sure the method tables are installed. - (eieiomt-install method) - ;; Apply the actual body of this function. - (fset method (eieio-defgeneric-form method doc-string)) - ;; Return the method - 'method)) - (defun eieio-unbind-method-implementations (method) "Make the generic method METHOD have no implementations. It will leave the original generic function in place, @@ -1292,12 +1298,17 @@ (let* ((key (if (keywordp (car args)) (pop args))) (params (car args)) (arg1 (car params)) - (class (if (consp arg1) (nth 1 arg1)))) - `(eieio--defmethod ',method ',key ',class - (lambda ,(if (consp arg1) - (cons (car arg1) (cdr params)) - params) - ,@(cdr args))))) + (args (if (consp arg1) + (cons (car arg1) (cdr params)) + params)) + (class (if (consp arg1) (nth 1 arg1))) + (code `(lambda ,args ,@(cdr args)))) + `(progn + ;; Make sure there is a generic and the byte-compiler sees it. + (defgeneric ,method ,args + ,(or (documentation code) + (format "Generically created method `%s'." method))) + (eieio--defmethod ',method ',key ',class ',code)))) (defun eieio--defmethod (method kind argclass code) "Work part of the `defmethod' macro defining METHOD with ARGS." @@ -1317,11 +1328,11 @@ method-static) ;; Primary key (t method-primary)))) - ;; make sure there is a generic - (eieio-defgeneric - method - (or (documentation code) - (format "Generically created method `%s'." method))) + ;; Make sure there is a generic (when called from defclass). + (eieio--defalias + method (eieio--defgeneric-init-form + method (or (documentation code) + (format "Generically created method `%s'." method)))) ;; create symbol for property to bind to. If the first arg is of ;; the form (varname vartype) and `vartype' is a class, then ;; that class will be the type symbol. If not, then it will fall ------------------------------------------------------------ revno: 104150 committer: Ben Key branch nick: trunk timestamp: Fri 2011-05-06 23:00:12 -0500 message: * nt/configure.bat: Renamed the fusercflags variable to escusercflags so that the variable name better matches its purpose, to be identical to usercflags with the exception that all quotes are escaped by the \ character. Renamed the fuserldflags variable to escuserldflags so that the variable name better matches its purpose, to be identical to userldflags with the exception that all quotes are escaped by the \ character. A new ESC_USER_CFLAGS variable is written to config.settings. This variable has the same value as the escusercflags variable. * nt/gmake.defs, nt/nmake.defs: Added the variable ESC_CFLAGS. This variable is identical to the CFLAGS variable except that it includes the new ESC_USER_CFLAGS variable instead of USER_CFLAGS. * src/makefile.w32-in: The bootstrap-temacs rule now makes use of one of two shell specific rules, either bootstrap-temacs-CMD or bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical to the previous implementation of the bootstrap-temacs rule. The bootstrap-temacs-CMD rule is similar to the previous implementation of the bootstrap-temacs rule except that it makes use of the ESC_CFLAGS variable instead of the CFLAGS variable. These changes are required to extend my earlier fix to add support for --cflags and --ldflags options that include quotes so that it works whether make uses cmd or sh as the shell. diff: === modified file 'nt/ChangeLog' --- nt/ChangeLog 2011-05-06 12:09:08 +0000 +++ nt/ChangeLog 2011-05-07 04:00:12 +0000 @@ -1,3 +1,27 @@ +2011-05-07 Ben Key + + * configure.bat: Renamed the fusercflags variable to escusercflags + so that the variable name better matches its purpose, to be + identical to usercflags with the exception that all quotes are + escaped by the \ character. + + Renamed the fuserldflags variable to escuserldflags so that the + variable name better matches its purpose, to be identical to + userldflags with the exception that all quotes are escaped by + the \ character. + + A new ESC_USER_CFLAGS variable is written to config.settings. + This variable has the same value as the escusercflags variable. + + * gmake.defs, nmake.defs: Added the variable ESC_CFLAGS. This + variable is identical to the CFLAGS variable except that it + includes the new ESC_USER_CFLAGS variable instead of USER_CFLAGS. + + These changes, along with some changes to src/makefile.w32-in, + are required to extend my earlier fix to add support for + --cflags and --ldflags options that include quotes so that it + works whether make uses cmd or sh as the shell. + 2011-05-06 Eli Zaretskii * inc/inttypes.h [!__MINGW32__]: Include stdint.h. Move the === modified file 'nt/configure.bat' --- nt/configure.bat 2011-05-05 02:56:16 +0000 +++ nt/configure.bat 2011-05-07 04:00:12 +0000 @@ -97,10 +97,10 @@ set nocygwin=N set COMPILER= set usercflags= -set fusercflags= +set escusercflags= set docflags= set userldflags= -set fuserldflags= +set escuserldflags= set extrauserlibs= set doldflags= set doextralibs= @@ -240,7 +240,7 @@ :ucflagex shift set usercflags=%usercflags%%sep1%%~1 -set fusercflags=%usercflags:"=\"% +set escusercflags=%usercflags:"=\"% set sep1= %nothing% shift goto again @@ -248,7 +248,7 @@ :ucflagne shift set usercflags=%usercflags%%sep1%%1 -set fusercflags=%usercflags% +set escusercflags=%usercflags% set sep1= %nothing% shift goto again @@ -270,7 +270,7 @@ :ulflagex shift set userldflags=%userldflags%%sep2%%~1 -set fuserldflags=%userldflags:"=\"% +set escuserldflags=%userldflags:"=\"% set sep2= %nothing% shift goto again @@ -278,7 +278,7 @@ :ulflagne shift set userldflags=%userldflags%%sep2%%1 -set fuserldflags=%userldflags% +set escuserldflags=%userldflags% set sep2= %nothing% shift goto again @@ -443,7 +443,7 @@ :chkuser rm -f junk.o echo int main (int argc, char *argv[]) {>junk.c -echo char *usercflags = "%fusercflags%";>>junk.c +echo char *usercflags = "%escusercflags%";>>junk.c echo }>>junk.c echo gcc -Werror -c junk.c >>config.log gcc -Werror -c junk.c >>config.log 2>&1 @@ -739,6 +739,7 @@ rem and the if command cannot cope with this for %%v in (%usercflags%) do if not (%%v)==() set docflags=Y if (%docflags%)==(Y) echo USER_CFLAGS=%usercflags%>>config.settings +if (%docflags%)==(Y) echo ESC_USER_CFLAGS=%escusercflags%>>config.settings for %%v in (%userldflags%) do if not (%%v)==() set doldflags=Y if (%doldflags%)==(Y) echo USER_LDFLAGS=%userldflags%>>config.settings for %%v in (%extrauserlibs%) do if not (%%v)==() set doextralibs=Y @@ -751,8 +752,8 @@ echo /* Start of settings from configure.bat. */ >>config.tmp rem We write USER_CFLAGS and USER_LDFLAGS starting with a space to simplify rem processing of compiler options in w32.c:get_emacs_configuration_options -if (%docflags%) == (Y) echo #define USER_CFLAGS " %fusercflags%">>config.tmp -if (%doldflags%) == (Y) echo #define USER_LDFLAGS " %fuserldflags%">>config.tmp +if (%docflags%) == (Y) echo #define USER_CFLAGS " %escusercflags%">>config.tmp +if (%doldflags%) == (Y) echo #define USER_LDFLAGS " %escuserldflags%">>config.tmp if (%profile%) == (Y) echo #define PROFILING 1 >>config.tmp if not "(%HAVE_PNG%)" == "()" echo #define HAVE_PNG 1 >>config.tmp if not "(%HAVE_GNUTLS%)" == "()" echo #define HAVE_GNUTLS 1 >>config.tmp === modified file 'nt/gmake.defs' --- nt/gmake.defs 2011-04-28 20:43:23 +0000 +++ nt/gmake.defs 2011-05-07 04:00:12 +0000 @@ -206,6 +206,7 @@ endif CFLAGS = -I. $(ARCH_CFLAGS) $(DEBUG_CFLAGS) $(CHECKING_CFLAGS) $(PROFILE_CFLAGS) $(USER_CFLAGS) $(LOCAL_FLAGS) +ESC_CFLAGS = -I. $(ARCH_CFLAGS) $(DEBUG_CFLAGS) $(CHECKING_CFLAGS) $(PROFILE_CFLAGS) $(ESC_USER_CFLAGS) $(LOCAL_FLAGS) EMACS_EXTRA_C_FLAGS = -DUSE_CRT_DLL=1 ifdef PROFILE === modified file 'nt/nmake.defs' --- nt/nmake.defs 2011-01-25 04:08:28 +0000 +++ nt/nmake.defs 2011-05-07 04:00:12 +0000 @@ -144,6 +144,8 @@ CFLAGS = -I. $(ARCH_CFLAGS) \ $(DEBUG_CFLAGS) $(CHECKING_CFLAGS) $(USER_CFLAGS) $(LOCAL_FLAGS) +ESC_CFLAGS = -I. $(ARCH_CFLAGS) \ + $(DEBUG_CFLAGS) $(CHECKING_CFLAGS) $(ESC_USER_CFLAGS) $(LOCAL_FLAGS) EMACS_EXTRA_C_FLAGS = SYS_LDFLAGS = -nologo -release -incremental:no -version:3.10 -swaprun:cd -swaprun:net setargv.obj === modified file 'src/ChangeLog' --- src/ChangeLog 2011-05-06 22:12:31 +0000 +++ src/ChangeLog 2011-05-07 04:00:12 +0000 @@ -1,3 +1,20 @@ +2011-05-07 Ben Key + + * makefile.w32-in: The bootstrap-temacs rule now makes use of + one of two shell specific rules, either bootstrap-temacs-CMD or + bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical + to the previous implementation of the bootstrap-temacs rule. + The bootstrap-temacs-CMD rule is similar to the previous + implementation of the bootstrap-temacs rule except that it + makes use of the ESC_CFLAGS variable instead of the CFLAGS + variable. + + These changes, along with some changes to nt/configure.bat, + nt/gmake.defs, and nt/nmake.defs, are required to extend my + earlier fix to add support for --cflags and --ldflags options + that include quotes so that it works whether make uses cmd or + sh as the shell. + 2011-05-06 Michael Albinus * dbusbind.c (QCdbus_type_unix_fd): Declare static. === modified file 'src/makefile.w32-in' --- src/makefile.w32-in 2011-05-06 15:37:11 +0000 +++ src/makefile.w32-in 2011-05-07 04:00:12 +0000 @@ -244,8 +244,14 @@ # # WARNING: Do NOT split the part inside $(ARGQUOTE)s into multiple lines as # this can break with GNU Make 3.81 and later if sh.exe is used. +bootstrap-temacs-CMD: + $(MAKE) $(MFLAGS) $(XMFLAGS) temacs CFLAGS=$(ARGQUOTE)$(ESC_CFLAGS) -DPURESIZE=5000000$(ARGQUOTE) + +bootstrap-temacs-SH: + $(MAKE) $(MFLAGS) $(XMFLAGS) temacs CFLAGS=$(ARGQUOTE)$(CFLAGS) -DPURESIZE=5000000$(ARGQUOTE) + bootstrap-temacs: - $(MAKE) $(MFLAGS) $(XMFLAGS) temacs CFLAGS=$(ARGQUOTE)$(CFLAGS) -DPURESIZE=5000000$(ARGQUOTE) + $(MAKE) $(MFLAGS) bootstrap-temacs-$(SHELLTYPE) # # Dump an Emacs executable named bootstrap-emacs containing the ------------------------------------------------------------ revno: 104149 committer: Glenn Morris branch nick: trunk timestamp: Fri 2011-05-06 18:24:04 -0700 message: timeclock.el trivia. * lisp/calendar/timeclock.el (timeclock-log-data): Remove unused local. Use let rather than let*. (timeclock-find-discrep): Remove unused local. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-07 01:20:47 +0000 +++ lisp/ChangeLog 2011-05-07 01:24:04 +0000 @@ -1,5 +1,9 @@ 2011-05-07 Glenn Morris + * calendar/timeclock.el (timeclock-log-data): Remove unused local. + Use let rather than let*. + (timeclock-find-discrep): Remove unused local. + * calendar/diary-lib.el (diary-comment-start): Doc fix. * calendar/appt.el (appt-time-msg-list): Doc fix. === modified file 'lisp/calendar/timeclock.el' --- lisp/calendar/timeclock.el 2011-01-25 04:08:28 +0000 +++ lisp/calendar/timeclock.el 2011-05-07 01:24:04 +0000 @@ -1025,11 +1025,10 @@ timeclock-current-debt LOG-DATA See the documentation for the given function if more info is needed." - (let* ((log-data (list 0.0 nil nil)) - (now (current-time)) - (todays-date (timeclock-time-to-date now)) - last-date-limited last-date-seconds last-date - (line 0) last beg day entry event) + (let ((log-data (list 0.0 nil nil)) + (now (current-time)) + last-date-limited last-date-seconds last-date + (line 0) last beg day entry event) (with-temp-buffer (insert-file-contents (or filename timeclock-file)) (when recent-only @@ -1115,7 +1114,7 @@ (let* ((now (current-time)) (todays-date (timeclock-time-to-date now)) (first t) (accum 0) (elapsed 0) - event beg last-date avg + event beg last-date last-date-limited last-date-seconds) (unless timeclock-discrepancy (when (file-readable-p timeclock-file) ------------------------------------------------------------ revno: 104148 committer: Glenn Morris branch nick: trunk timestamp: Fri 2011-05-06 18:22:01 -0700 message: * doc/emacs/cal-xtra.texi (Sexp Diary Entries): Mention diary-hebrew-birthday. diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2011-05-06 07:14:30 +0000 +++ doc/emacs/ChangeLog 2011-05-07 01:22:01 +0000 @@ -1,3 +1,7 @@ +2011-05-07 Glenn Morris + + * cal-xtra.texi (Sexp Diary Entries): Mention diary-hebrew-birthday. + 2011-05-06 Glenn Morris * calendar.texi (Appointments): Mention appt-warning-time-regexp. === modified file 'doc/emacs/cal-xtra.texi' --- doc/emacs/cal-xtra.texi 2011-05-06 04:28:53 +0000 +++ doc/emacs/cal-xtra.texi 2011-05-07 01:22:01 +0000 @@ -890,6 +890,7 @@ @findex diary-hebrew-omer @cindex yahrzeits @findex diary-hebrew-yahrzeit +@findex diary-hebrew-birthday @table @code @item %%(diary-hebrew-rosh-hodesh) Make a diary entry that tells the occurrence and ritual announcement of each @@ -907,6 +908,8 @@ on the proper Hebrew calendar anniversary and on the day before. (The order of the parameters changes according to the calendar date style; for example in the European style to @var{day}, @var{month}, @var{year}.) +@item %%(diary-hebrew-birthday @var{month} @var{day} @var{year}) +Make a diary entry for a birthday on the Hebrew calendar. @end table All the functions documented above take an optional argument === modified file 'etc/NEWS' --- etc/NEWS 2011-05-06 07:14:30 +0000 +++ etc/NEWS 2011-05-07 01:22:01 +0000 @@ -455,6 +455,7 @@ *** Appointments can specify their individual warning times. See the variable `appt-warning-time-regexp'. ++++ *** New function `diary-hebrew-birthday'. --- ------------------------------------------------------------ revno: 104147 committer: Glenn Morris branch nick: trunk timestamp: Fri 2011-05-06 18:20:47 -0700 message: * lisp/calendar/diary-lib.el (diary-comment-start): Doc fix. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-07 01:19:27 +0000 +++ lisp/ChangeLog 2011-05-07 01:20:47 +0000 @@ -1,5 +1,7 @@ 2011-05-07 Glenn Morris + * calendar/diary-lib.el (diary-comment-start): Doc fix. + * calendar/appt.el (appt-time-msg-list): Doc fix. 2011-05-06 Noah Friedman === modified file 'lisp/calendar/diary-lib.el' --- lisp/calendar/diary-lib.el 2011-05-06 07:30:20 +0000 +++ lisp/calendar/diary-lib.el 2011-05-07 01:20:47 +0000 @@ -147,7 +147,8 @@ Nil means there are no comments. The diary does not display parts of entries that are inside comments. You can use comments for whatever you like, e.g. for meta-data that packages such as -`appt.el' can use. +`appt.el' can use. Comments may not span mutliple lines, and there +can be only one comment on any line. See also `diary-comment-end'." :version "24.1" :type '(choice (const :tag "No comment" nil) string) @@ -650,6 +651,8 @@ string)) ;; Preserve the value with the comments. (or literal (setq literal string)) + ;; Handles multiple comments per entry, so long as each is on + ;; a single line, and each line has no more than one comment. (setq string (replace-regexp-in-string (format "%s.*%s" cstart (regexp-quote diary-comment-end)) "" string))) ------------------------------------------------------------ revno: 104146 committer: Glenn Morris branch nick: trunk timestamp: Fri 2011-05-06 18:19:27 -0700 message: * lisp/calendar/appt.el (appt-time-msg-list): Doc fix. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-06 19:59:17 +0000 +++ lisp/ChangeLog 2011-05-07 01:19:27 +0000 @@ -1,3 +1,7 @@ +2011-05-07 Glenn Morris + + * calendar/appt.el (appt-time-msg-list): Doc fix. + 2011-05-06 Noah Friedman * apropos.el (apropos-print-doc): Only use === modified file 'lisp/calendar/appt.el' --- lisp/calendar/appt.el 2011-05-06 07:14:30 +0000 +++ lisp/calendar/appt.el 2011-05-07 01:19:27 +0000 @@ -179,11 +179,10 @@ \(MINUTES STRING [FLAG] [WARNTIME]) where MINUTES is the time in minutes of the appointment after midnight, and STRING is the description of the appointment. -FLAG and WARNTIME can only be present if the element was made -with `appt-add'. A non-nil FLAG indicates that the element was made -with `appt-add', so calling `appt-make-list' again should preserve it. -If WARNTIME is non-nil, it is an integer to use in place -of `appt-message-warning-time'.") +FLAG and WARNTIME are not always present. A non-nil FLAG +indicates that the element was made with `appt-add', so calling +`appt-make-list' again should preserve it. If WARNTIME is non-nil, +it is an integer to use in place of `appt-message-warning-time'.") (defconst appt-max-time (1- (* 24 60)) "11:59pm in minutes - number of minutes in a day minus 1.") ------------------------------------------------------------ revno: 104145 author: Teodor Zlatanov committer: Katsumi Yamaoka branch nick: trunk timestamp: Fri 2011-05-06 23:33:12 +0000 message: shr.el (shr-urlify, shr-link): Fix shr-link face. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2011-05-05 22:12:41 +0000 +++ lisp/gnus/ChangeLog 2011-05-06 23:33:12 +0000 @@ -1,3 +1,7 @@ +2011-05-06 Teodor Zlatanov + + * shr.el (shr-urlify, shr-link): Fix shr-link face. + 2011-05-05 Teodor Zlatanov * shr.el (shr-urlify, shr-link): Still broken but at least doesn't === modified file 'lisp/gnus/shr.el' --- lisp/gnus/shr.el 2011-05-05 22:12:41 +0000 +++ lisp/gnus/shr.el 2011-05-06 23:33:12 +0000 @@ -91,9 +91,8 @@ "Font for elements." :group 'shr) -(defface shr-link '((t (:underline t) - (:foreground "yellow") - (:background "black"))) +(defface shr-link + '((t (:underline t :foreground "yellow" :background "black"))) "Font for link elements." :group 'shr) @@ -597,7 +596,7 @@ :help-echo (if title (format "%s (%s)" url title) url) :keymap shr-map url) - (put-text-property start (point) 'face '(shr-link)) + (put-text-property start (point) 'face 'shr-link) (put-text-property start (point) 'shr-url url)) (defun shr-encode-url (url) ------------------------------------------------------------ revno: 104144 committer: Michael Albinus branch nick: trunk timestamp: Sat 2011-05-07 00:12:31 +0200 message: * dbusbind.c (QCdbus_type_unix_fd): Declare static. (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it is a constant. (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or a string. Handle both cases. (Fdbus_call_method_asynchronously, Fdbus_register_signal) (Fdbus_register_method): Use Qinvalid_function. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-05-06 15:37:11 +0000 +++ src/ChangeLog 2011-05-06 22:12:31 +0000 @@ -1,3 +1,13 @@ +2011-05-06 Michael Albinus + + * dbusbind.c (QCdbus_type_unix_fd): Declare static. + (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it + is a constant. + (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or + a string. Handle both cases. + (Fdbus_call_method_asynchronously, Fdbus_register_signal) + (Fdbus_register_method): Use Qinvalid_function. + 2011-05-06 Juanma Barranquero * makefile.w32-in: Update dependencies. === modified file 'src/dbusbind.c' --- src/dbusbind.c 2011-04-30 01:06:41 +0000 +++ src/dbusbind.c 2011-05-06 22:12:31 +0000 @@ -70,7 +70,7 @@ static Lisp_Object QCdbus_type_double, QCdbus_type_string; static Lisp_Object QCdbus_type_object_path, QCdbus_type_signature; #ifdef DBUS_TYPE_UNIX_FD -Lisp_Object QCdbus_type_unix_fd; +static Lisp_Object QCdbus_type_unix_fd; #endif static Lisp_Object QCdbus_type_array, QCdbus_type_variant; static Lisp_Object QCdbus_type_struct, QCdbus_type_dict_entry; @@ -892,7 +892,7 @@ return; /* Unset session environment. */ - if (SYMBOLP (QCdbus_session_bus) && XSYMBOL (QCdbus_session_bus) == data) + if (XSYMBOL (QCdbus_session_bus) == data) { XD_DEBUG_MESSAGE ("unsetenv DBUS_SESSION_BUS_ADDRESS"); unsetenv ("DBUS_SESSION_BUS_ADDRESS"); @@ -919,8 +919,15 @@ (Lisp_Object bus) { DBusConnection *connection; + void *busp; - CHECK_SYMBOL (bus); + /* Check parameter. */ + if (SYMBOLP (bus)) + busp = XSYMBOL (bus); + else if (STRINGP (bus)) + busp = XSTRING (bus); + else + wrong_type_argument (intern ("D-Bus"), bus); /* Open a connection to the bus. */ connection = xd_initialize (bus, TRUE); @@ -931,7 +938,7 @@ xd_add_watch, xd_remove_watch, xd_toggle_watch, - XSYMBOL (bus), NULL)) + busp, NULL)) XD_SIGNAL1 (build_string ("Cannot add watch functions")); /* Add bus to list of registered buses. */ @@ -1261,7 +1268,7 @@ CHECK_STRING (interface); CHECK_STRING (method); if (!NILP (handler) && !FUNCTIONP (handler)) - wrong_type_argument (intern ("functionp"), handler); + wrong_type_argument (Qinvalid_function, handler); GCPRO6 (bus, service, path, interface, method, handler); XD_DEBUG_MESSAGE ("%s %s %s %s", @@ -1758,8 +1765,8 @@ EVENT_INIT (event); event.kind = DBUS_EVENT; event.frame_or_window = Qnil; - event.arg = Fcons (CAR_SAFE (CDR_SAFE (CDR_SAFE (CDR_SAFE (key)))), - args); + event.arg + = Fcons (CAR_SAFE (CDR_SAFE (CDR_SAFE (CDR_SAFE (key)))), args); break; } value = CDR_SAFE (value); @@ -1826,7 +1833,8 @@ if (data != NULL) while (!NILP (busp)) { - if (SYMBOLP (CAR_SAFE (busp)) && XSYMBOL (CAR_SAFE (busp)) == data) + if ((SYMBOLP (CAR_SAFE (busp)) && XSYMBOL (CAR_SAFE (busp)) == data) + || (STRINGP (CAR_SAFE (busp)) && XSTRING (CAR_SAFE (busp)) == data)) bus = CAR_SAFE (busp); busp = CDR_SAFE (busp); } @@ -2011,7 +2019,7 @@ CHECK_STRING (interface); CHECK_STRING (signal); if (!FUNCTIONP (handler)) - wrong_type_argument (intern ("functionp"), handler); + wrong_type_argument (Qinvalid_function, handler); GCPRO6 (bus, service, path, interface, signal, handler); /* Retrieve unique name of service. If service is a known name, we @@ -2132,7 +2140,7 @@ CHECK_STRING (interface); CHECK_STRING (method); if (!FUNCTIONP (handler)) - wrong_type_argument (intern ("functionp"), handler); + wrong_type_argument (Qinvalid_function, handler); /* TODO: We must check for a valid service name, otherwise there is a segmentation fault. */ @@ -2174,11 +2182,13 @@ staticpro (&Qdbus_call_method); defsubr (&Sdbus_call_method); - Qdbus_call_method_asynchronously = intern_c_string ("dbus-call-method-asynchronously"); + Qdbus_call_method_asynchronously + = intern_c_string ("dbus-call-method-asynchronously"); staticpro (&Qdbus_call_method_asynchronously); defsubr (&Sdbus_call_method_asynchronously); - Qdbus_method_return_internal = intern_c_string ("dbus-method-return-internal"); + Qdbus_method_return_internal + = intern_c_string ("dbus-method-return-internal"); staticpro (&Qdbus_method_return_internal); defsubr (&Sdbus_method_return_internal); @@ -2215,7 +2225,8 @@ QCdbus_session_bus = intern_c_string (":session"); staticpro (&QCdbus_session_bus); - QCdbus_request_name_allow_replacement = intern_c_string (":allow-replacement"); + QCdbus_request_name_allow_replacement + = intern_c_string (":allow-replacement"); staticpro (&QCdbus_request_name_allow_replacement); QCdbus_request_name_replace_existing = intern_c_string (":replace-existing"); ------------------------------------------------------------ revno: 104143 committer: Noah Friedman branch nick: trunk timestamp: Fri 2011-05-06 12:59:17 -0700 message: apropos.el (apropos-print-doc): Only use emacs-lisp-docstring-fill-column when it is bound to an integer, per that variable's documentation. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-06 16:38:02 +0000 +++ lisp/ChangeLog 2011-05-06 19:59:17 +0000 @@ -1,3 +1,9 @@ +2011-05-06 Noah Friedman + + * apropos.el (apropos-print-doc): Only use + emacs-lisp-docstring-fill-column when it is bound to an integer, + per that variable's documentation. + 2011-05-06 Stefan Monnier * lpr.el (print-region-1): Echo lpr-program's output, so error messages === modified file 'lisp/apropos.el' --- lisp/apropos.el 2011-04-24 00:15:26 +0000 +++ lisp/apropos.el 2011-05-06 19:59:17 +0000 @@ -1133,7 +1133,9 @@ (put-text-property opoint (point) 'font-lock-face 'shadow)) ;; The labeling buttons might make the line too long, so fill it if ;; necessary. - (let ((fill-column (+ 5 emacs-lisp-docstring-fill-column)) + (let ((fill-column (+ 5 (if (integerp emacs-lisp-docstring-fill-column) + emacs-lisp-docstring-fill-column + fill-column))) (fill-prefix (make-string ocol ?\s))) (fill-region opoint (point) nil t))) (or (bolp) (terpri))))) ------------------------------------------------------------ revno: 104142 committer: Stefan Monnier branch nick: trunk timestamp: Fri 2011-05-06 13:38:02 -0300 message: * lisp/lpr.el (print-region-1): Echo lpr-program's output, so error messages and warnings are not silently discarded (e.g. use "-d" instead of "-P"). diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-06 07:14:30 +0000 +++ lisp/ChangeLog 2011-05-06 16:38:02 +0000 @@ -1,3 +1,8 @@ +2011-05-06 Stefan Monnier + + * lpr.el (print-region-1): Echo lpr-program's output, so error messages + and warnings are not silently discarded (e.g. use "-d" instead of "-P"). + 2011-05-06 Glenn Morris * calendar/appt.el (appt-message-warning-time): Doc fix. === modified file 'lisp/lpr.el' --- lisp/lpr.el 2011-01-26 08:36:39 +0000 +++ lisp/lpr.el 2011-05-06 16:38:02 +0000 @@ -29,6 +29,8 @@ ;;; Code: +(eval-when-compile (require 'cl)) + ;;;###autoload (defvar lpr-windows-system (memq system-type '(ms-dos windows-nt))) @@ -258,21 +260,30 @@ lpr-page-header-switches))) (setq start (point-min) end (point-max)))) - (apply (or print-region-function 'call-process-region) - (nconc (list start end lpr-command - nil nil nil) - (and lpr-add-switches - (list "-J" name)) - ;; These belong in pr if we are using that. - (and lpr-add-switches lpr-headers-switches - (list "-T" title)) - (and (stringp printer-name) - (list (concat lpr-printer-switch - printer-name))) - nswitches)) - (if (markerp end) - (set-marker end nil)) - (message "Spooling%s...done" switch-string)))) + (let ((buf (current-buffer))) + (with-temp-buffer + (let ((tempbuf (current-buffer))) + (with-current-buffer buf + (apply (or print-region-function 'call-process-region) + (nconc (list start end lpr-command + nil tempbuf nil) + (and lpr-add-switches + (list "-J" name)) + ;; These belong in pr if we are using that. + (and lpr-add-switches lpr-headers-switches + (list "-T" title)) + (and (stringp printer-name) + (list (concat lpr-printer-switch + printer-name))) + nswitches)))) + (if (markerp end) + (set-marker end nil)) + (message "Spooling%s...done%s%s" switch-string + (case (count-lines (point-min) (point-max)) + (0 "") + (1 ": ") + (t ":\n")) + (buffer-string))))))) ;; This function copies the text between start and end ;; into a new buffer, makes that buffer current. ------------------------------------------------------------ revno: 104141 committer: Juanma Barranquero branch nick: trunk timestamp: Fri 2011-05-06 17:37:11 +0200 message: src/makefile.w32-in: Update dependencies. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-05-06 11:26:45 +0000 +++ src/ChangeLog 2011-05-06 15:37:11 +0000 @@ -1,3 +1,9 @@ +2011-05-06 Juanma Barranquero + + * makefile.w32-in: Update dependencies. + (LISP_H): Add inttypes.h and stdin.h. + (PROCESS_H): Add unistd.h. + 2011-05-06 Eli Zaretskii * lread.c: Include limits.h (fixes the MS-Windows build broken by === modified file 'src/makefile.w32-in' --- src/makefile.w32-in 2011-05-05 00:20:44 +0000 +++ src/makefile.w32-in 2011-05-06 15:37:11 +0000 @@ -380,13 +380,17 @@ $(EMACS_ROOT)/src/m/intel386.h \ $(EMACS_ROOT)/src/config.h \ $(EMACS_ROOT)/nt/inc/sys/stat.h -LISP_H = $(SRC)/lisp.h $(SRC)/globals.h -PROCESS_H = $(SRC)/process.h $(SRC)/gnutls.h +LISP_H = $(SRC)/lisp.h \ + $(SRC)/globals.h \ + $(EMACS_ROOT)/nt/inc/inttypes.h \ + $(EMACS_ROOT)/nt/inc/stdint.h +PROCESS_H = $(SRC)/process.h \ + $(EMACS_ROOT)/nt/inc/unistd.h \ + $(SRC)/gnutls.h $(BLD)/alloc.$(O) : \ $(SRC)/alloc.c \ $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/unistd.h \ $(EMACS_ROOT)/nt/inc/sys/time.h \ $(LISP_H) \ $(PROCESS_H) \ @@ -486,7 +490,6 @@ $(BLD)/callproc.$(O) : \ $(SRC)/callproc.c \ $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/unistd.h \ $(EMACS_ROOT)/nt/inc/sys/file.h \ $(EMACS_ROOT)/nt/inc/sys/ioctl.h \ $(EMACS_ROOT)/nt/inc/sys/time.h \ @@ -675,7 +678,6 @@ $(BLD)/dispnew.$(O) : \ $(SRC)/dispnew.c \ $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/unistd.h \ $(EMACS_ROOT)/nt/inc/sys/time.h \ $(LISP_H) \ $(PROCESS_H) \ @@ -750,7 +752,6 @@ $(BLD)/emacs.$(O) : \ $(SRC)/emacs.c \ $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/unistd.h \ $(EMACS_ROOT)/nt/inc/sys/file.h \ $(EMACS_ROOT)/nt/inc/sys/ioctl.h \ $(EMACS_ROOT)/nt/inc/sys/time.h \ @@ -843,7 +844,6 @@ $(CONFIG_H) \ $(EMACS_ROOT)/nt/inc/langinfo.h \ $(EMACS_ROOT)/nt/inc/nl_types.h \ - $(EMACS_ROOT)/nt/inc/stdint.h \ $(EMACS_ROOT)/nt/inc/unistd.h \ $(EMACS_ROOT)/nt/inc/sys/time.h \ $(EMACS_ROOT)/lib/md5.h \ @@ -955,7 +955,6 @@ $(BLD)/gnutls.$(O) : \ $(SRC)/gnutls.c \ $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/unistd.h \ $(LISP_H) \ $(PROCESS_H) \ $(SRC)/w32.h @@ -1043,7 +1042,6 @@ $(BLD)/keyboard.$(O) : \ $(SRC)/keyboard.c \ $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/unistd.h \ $(EMACS_ROOT)/nt/inc/sys/ioctl.h \ $(EMACS_ROOT)/nt/inc/sys/time.h \ $(LISP_H) \ @@ -1104,8 +1102,6 @@ $(BLD)/lread.$(O) : \ $(SRC)/lread.c \ $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/inttypes.h \ - $(EMACS_ROOT)/nt/inc/stdint.h \ $(EMACS_ROOT)/nt/inc/unistd.h \ $(EMACS_ROOT)/nt/inc/sys/file.h \ $(EMACS_ROOT)/nt/inc/sys/time.h \ @@ -1196,7 +1192,6 @@ $(CONFIG_H) \ $(EMACS_ROOT)/nt/inc/grp.h \ $(EMACS_ROOT)/nt/inc/pwd.h \ - $(EMACS_ROOT)/nt/inc/unistd.h \ $(EMACS_ROOT)/nt/inc/sys/file.h \ $(EMACS_ROOT)/nt/inc/sys/socket.h \ $(EMACS_ROOT)/nt/inc/sys/time.h \ @@ -1242,7 +1237,6 @@ $(CONFIG_H) \ $(EMACS_ROOT)/nt/inc/langinfo.h \ $(EMACS_ROOT)/nt/inc/nl_types.h \ - $(EMACS_ROOT)/nt/inc/unistd.h \ $(EMACS_ROOT)/nt/inc/sys/file.h \ $(EMACS_ROOT)/nt/inc/sys/time.h \ $(LISP_H) \ @@ -1277,7 +1271,6 @@ $(BLD)/print.$(O) : \ $(SRC)/print.c \ $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/unistd.h \ $(EMACS_ROOT)/nt/inc/sys/time.h \ $(EMACS_ROOT)/lib/ftoastr.h \ $(EMACS_ROOT)/lib/intprops.h \ @@ -1305,10 +1298,7 @@ $(BLD)/process.$(O) : \ $(SRC)/process.c \ $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/inttypes.h \ $(EMACS_ROOT)/nt/inc/netdb.h \ - $(EMACS_ROOT)/nt/inc/stdint.h \ - $(EMACS_ROOT)/nt/inc/unistd.h \ $(EMACS_ROOT)/nt/inc/arpa/inet.h \ $(EMACS_ROOT)/nt/inc/netinet/in.h \ $(EMACS_ROOT)/nt/inc/sys/file.h \ @@ -1437,7 +1427,6 @@ $(EMACS_ROOT)/nt/inc/grp.h \ $(EMACS_ROOT)/nt/inc/netdb.h \ $(EMACS_ROOT)/nt/inc/pwd.h \ - $(EMACS_ROOT)/nt/inc/unistd.h \ $(EMACS_ROOT)/nt/inc/sys/file.h \ $(EMACS_ROOT)/nt/inc/sys/ioctl.h \ $(EMACS_ROOT)/nt/inc/sys/socket.h \ @@ -1582,7 +1571,6 @@ $(BLD)/xdisp.$(O) : \ $(SRC)/xdisp.c \ $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/unistd.h \ $(EMACS_ROOT)/nt/inc/sys/time.h \ $(LISP_H) \ $(PROCESS_H) \ @@ -1695,7 +1683,6 @@ $(BLD)/w32term.$(O) : \ $(SRC)/w32term.c \ $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/unistd.h \ $(EMACS_ROOT)/nt/inc/sys/ioctl.h \ $(EMACS_ROOT)/nt/inc/sys/time.h \ $(LISP_H) \ ------------------------------------------------------------ revno: 104140 committer: Eli Zaretskii branch nick: trunk timestamp: Fri 2011-05-06 15:09:08 +0300 message: Adapt Windows include files to latest changes. nt/inc/inttypes.h [!__MINGW32__]: Include stdint.h. Move the definition of uintmax_t from here... nt/inc/stdint.h (uintmax_t): ...to here. (intptr_t) [!__GNUC__]: New typedef. diff: === modified file 'nt/ChangeLog' --- nt/ChangeLog 2011-05-06 05:55:01 +0000 +++ nt/ChangeLog 2011-05-06 12:09:08 +0000 @@ -1,3 +1,10 @@ +2011-05-06 Eli Zaretskii + + * inc/inttypes.h [!__MINGW32__]: Include stdint.h. Move the + definition of uintmax_t from here... + * inc/stdint.h (uintmax_t): ...to here. + (intptr_t) [!__GNUC__]: New typedef. + 2011-05-06 Paul Eggert * config.nt: Prepare to configure 64-bit integers for older compilers. === modified file 'nt/inc/inttypes.h' --- nt/inc/inttypes.h 2011-04-27 21:14:34 +0000 +++ nt/inc/inttypes.h 2011-05-06 12:09:08 +0000 @@ -23,7 +23,7 @@ #ifdef __MINGW32__ #include_next #else /* !__MINGW32__ */ -#define uintmax_t unsigned __int64 +#include "stdint.h" #define strtoumax _strtoui64 #endif /* !__MINGW32__ */ === modified file 'nt/inc/stdint.h' --- nt/inc/stdint.h 2011-02-21 20:16:43 +0000 +++ nt/inc/stdint.h 2011-05-06 12:09:08 +0000 @@ -29,6 +29,14 @@ typedef unsigned int uint32_t; +#ifdef _WIN64 + typedef __int64 intptr_t; +#else + typedef int intptr_t; +#endif + +#define uintmax_t unsigned __int64 + #endif /* !__GNUC__ */ #endif /* _NT_STDINT_H_ */ ------------------------------------------------------------ revno: 104139 committer: Eli Zaretskii branch nick: trunk timestamp: Fri 2011-05-06 14:26:45 +0300 message: Fix the MS-Windows build broken by revision 104134. src/lread.c: Include limits.h. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-05-06 06:30:56 +0000 +++ src/ChangeLog 2011-05-06 11:26:45 +0000 @@ -1,3 +1,8 @@ +2011-05-06 Eli Zaretskii + + * lread.c: Include limits.h (fixes the MS-Windows build broken by + revision 104134). + 2011-05-06 Paul Eggert * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local. === modified file 'src/lread.c' --- src/lread.c 2011-05-06 06:30:56 +0000 +++ src/lread.c 2011-05-06 11:26:45 +0000 @@ -24,6 +24,7 @@ #include #include #include +#include /* for CHAR_BIT */ #include #include "lisp.h" #include "intervals.h" ------------------------------------------------------------ revno: 104138 committer: Glenn Morris branch nick: trunk timestamp: Fri 2011-05-06 06:19:05 -0400 message: Auto-commit of generated files. diff: === modified file 'autogen/Makefile.in' --- autogen/Makefile.in 2011-04-27 06:48:35 +0000 +++ autogen/Makefile.in 2011-05-06 10:19:05 +0000 @@ -24,7 +24,7 @@ # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. -# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=. --makefile-name=gnulib.mk --no-libtool --macro-prefix=gl --no-vc-files careadlinkat crypto/md5 dtoastr filemode getloadavg getopt-gnu ignore-value intprops lstat mktime readlink socklen stdio strftime strtoumax symlink sys_stat +# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=. --makefile-name=gnulib.mk --no-libtool --macro-prefix=gl --no-vc-files careadlinkat crypto/md5 dtoastr filemode getloadavg getopt-gnu ignore-value intprops lstat mktime readlink socklen stdarg stdio strftime strtoumax symlink sys_stat VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ @@ -47,6 +47,8 @@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/gnulib.mk COPYING +@gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36_TRUE@am__append_1 = gettext.h +@gl_GNULIB_ENABLED_verify_TRUE@am__append_2 = verify.h subdir = lib ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ @@ -60,14 +62,15 @@ $(top_srcdir)/m4/multiarch.m4 $(top_srcdir)/m4/readlink.m4 \ $(top_srcdir)/m4/socklen.m4 $(top_srcdir)/m4/ssize_t.m4 \ $(top_srcdir)/m4/st_dm_mode.m4 $(top_srcdir)/m4/stat.m4 \ - $(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/stddef_h.m4 \ - $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdio_h.m4 \ - $(top_srcdir)/m4/stdlib_h.m4 $(top_srcdir)/m4/strftime.m4 \ - $(top_srcdir)/m4/strtoull.m4 $(top_srcdir)/m4/strtoumax.m4 \ - $(top_srcdir)/m4/symlink.m4 $(top_srcdir)/m4/sys_stat_h.m4 \ - $(top_srcdir)/m4/time_h.m4 $(top_srcdir)/m4/time_r.m4 \ - $(top_srcdir)/m4/tm_gmtoff.m4 $(top_srcdir)/m4/unistd_h.m4 \ - $(top_srcdir)/m4/wchar_t.m4 $(top_srcdir)/configure.in + $(top_srcdir)/m4/stdarg.m4 $(top_srcdir)/m4/stdbool.m4 \ + $(top_srcdir)/m4/stddef_h.m4 $(top_srcdir)/m4/stdint.m4 \ + $(top_srcdir)/m4/stdio_h.m4 $(top_srcdir)/m4/stdlib_h.m4 \ + $(top_srcdir)/m4/strftime.m4 $(top_srcdir)/m4/strtoull.m4 \ + $(top_srcdir)/m4/strtoumax.m4 $(top_srcdir)/m4/symlink.m4 \ + $(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/time_h.m4 \ + $(top_srcdir)/m4/time_r.m4 $(top_srcdir)/m4/tm_gmtoff.m4 \ + $(top_srcdir)/m4/unistd_h.m4 $(top_srcdir)/m4/wchar_t.m4 \ + $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -79,8 +82,11 @@ ARFLAGS = cru libgnu_a_AR = $(AR) $(ARFLAGS) am__DEPENDENCIES_1 = +am__libgnu_a_SOURCES_DIST = allocator.c careadlinkat.c dtoastr.c \ + gettext.h ignore-value.h verify.h +am__objects_1 = am_libgnu_a_OBJECTS = allocator.$(OBJEXT) careadlinkat.$(OBJEXT) \ - dtoastr.$(OBJEXT) + dtoastr.$(OBJEXT) $(am__objects_1) $(am__objects_1) libgnu_a_OBJECTS = $(am_libgnu_a_OBJECTS) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @@ -90,7 +96,7 @@ CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libgnu_a_SOURCES) $(EXTRA_libgnu_a_SOURCES) -DIST_SOURCES = $(libgnu_a_SOURCES) $(EXTRA_libgnu_a_SOURCES) +DIST_SOURCES = $(am__libgnu_a_SOURCES_DIST) $(EXTRA_libgnu_a_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -478,6 +484,7 @@ M_FILE = @M_FILE@ NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@ NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@ +NEXT_AS_FIRST_DIRECTIVE_STDARG_H = @NEXT_AS_FIRST_DIRECTIVE_STDARG_H@ NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@ NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@ NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@ @@ -487,6 +494,7 @@ NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@ NEXT_GETOPT_H = @NEXT_GETOPT_H@ NEXT_INTTYPES_H = @NEXT_INTTYPES_H@ +NEXT_STDARG_H = @NEXT_STDARG_H@ NEXT_STDDEF_H = @NEXT_STDDEF_H@ NEXT_STDINT_H = @NEXT_STDINT_H@ NEXT_STDIO_H = @NEXT_STDIO_H@ @@ -612,6 +620,7 @@ SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ START_FILES = @START_FILES@ +STDARG_H = @STDARG_H@ STDBOOL_H = @STDBOOL_H@ STDDEF_H = @STDDEF_H@ STDINT_H = @STDINT_H@ @@ -723,28 +732,29 @@ # present in all Makefile.am that need it. This is ensured by the applicability # 'all' defined above. BUILT_SOURCES = arg-nonnull.h c++defs.h $(GETOPT_H) inttypes.h \ - $(STDBOOL_H) $(STDDEF_H) $(STDINT_H) stdio.h stdlib.h \ - sys/stat.h time.h unistd.h warn-on-use.h + $(STDARG_H) $(STDBOOL_H) $(STDDEF_H) $(STDINT_H) stdio.h \ + stdlib.h sys/stat.h time.h unistd.h warn-on-use.h EXTRA_DIST = allocator.h $(top_srcdir)/./arg-nonnull.h \ $(top_srcdir)/./c++defs.h careadlinkat.h md5.c md5.h dosname.h \ ftoastr.c ftoastr.h filemode.c filemode.h getloadavg.c \ getopt.c getopt.in.h getopt1.c getopt_int.h intprops.h \ inttypes.in.h lstat.c mktime-internal.h mktime.c readlink.c \ - stat.c stdbool.in.h stddef.in.h stdint.in.h stdio.in.h \ - stdlib.in.h strftime.c strftime.h strtol.c strtoul.c \ - strtoull.c strtoimax.c strtoumax.c symlink.c sys_stat.in.h \ - time.in.h time_r.c unistd.in.h $(top_srcdir)/./warn-on-use.h + stat.c stdarg.in.h stdbool.in.h stddef.in.h stdint.in.h \ + stdio.in.h stdlib.in.h strftime.c strftime.h strtol.c \ + strtoul.c strtoull.c strtoimax.c strtoumax.c symlink.c \ + sys_stat.in.h time.in.h time_r.c unistd.in.h \ + $(top_srcdir)/./warn-on-use.h MOSTLYCLEANDIRS = sys MOSTLYCLEANFILES = core *.stackdump arg-nonnull.h arg-nonnull.h-t \ c++defs.h c++defs.h-t getopt.h getopt.h-t inttypes.h \ - inttypes.h-t stdbool.h stdbool.h-t stddef.h stddef.h-t \ - stdint.h stdint.h-t stdio.h stdio.h-t stdlib.h stdlib.h-t \ - sys/stat.h sys/stat.h-t time.h time.h-t unistd.h unistd.h-t \ - warn-on-use.h warn-on-use.h-t + inttypes.h-t stdarg.h stdarg.h-t stdbool.h stdbool.h-t \ + stddef.h stddef.h-t stdint.h stdint.h-t stdio.h stdio.h-t \ + stdlib.h stdlib.h-t sys/stat.h sys/stat.h-t time.h time.h-t \ + unistd.h unistd.h-t warn-on-use.h warn-on-use.h-t noinst_LIBRARIES = libgnu.a DEFAULT_INCLUDES = -I. -I../src -I$(top_srcdir)/src -libgnu_a_SOURCES = allocator.c careadlinkat.c dtoastr.c gettext.h \ - ignore-value.h verify.h +libgnu_a_SOURCES = allocator.c careadlinkat.c dtoastr.c \ + $(am__append_1) ignore-value.h $(am__append_2) libgnu_a_LIBADD = $(gl_LIBOBJS) libgnu_a_DEPENDENCIES = $(gl_LIBOBJS) EXTRA_libgnu_a_SOURCES = md5.c ftoastr.c filemode.c getloadavg.c \ @@ -1104,6 +1114,21 @@ } > $@-t && \ mv $@-t $@ +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +@GL_GENERATE_STDARG_H_TRUE@stdarg.h: stdarg.in.h $(top_builddir)/config.status +@GL_GENERATE_STDARG_H_TRUE@ $(AM_V_GEN)rm -f $@-t $@ && \ +@GL_GENERATE_STDARG_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ +@GL_GENERATE_STDARG_H_TRUE@ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ +@GL_GENERATE_STDARG_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ +@GL_GENERATE_STDARG_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ +@GL_GENERATE_STDARG_H_TRUE@ -e 's|@''NEXT_STDARG_H''@|$(NEXT_STDARG_H)|g' \ +@GL_GENERATE_STDARG_H_TRUE@ < $(srcdir)/stdarg.in.h; \ +@GL_GENERATE_STDARG_H_TRUE@ } > $@-t && \ +@GL_GENERATE_STDARG_H_TRUE@ mv $@-t $@ +@GL_GENERATE_STDARG_H_FALSE@stdarg.h: $(top_builddir)/config.status +@GL_GENERATE_STDARG_H_FALSE@ rm -f $@ + # We need the following in order to create when the system # doesn't have one that works. @GL_GENERATE_STDBOOL_H_TRUE@stdbool.h: stdbool.in.h $(top_builddir)/config.status === modified file 'autogen/aclocal.m4' --- autogen/aclocal.m4 2011-04-27 06:48:35 +0000 +++ autogen/aclocal.m4 2011-05-06 10:19:05 +0000 @@ -1004,6 +1004,7 @@ m4_include([m4/ssize_t.m4]) m4_include([m4/st_dm_mode.m4]) m4_include([m4/stat.m4]) +m4_include([m4/stdarg.m4]) m4_include([m4/stdbool.m4]) m4_include([m4/stddef_h.m4]) m4_include([m4/stdint.m4]) === modified file 'autogen/config.in' --- autogen/config.in 2011-04-27 06:48:35 +0000 +++ autogen/config.in 2011-05-06 10:19:05 +0000 @@ -1195,6 +1195,9 @@ /* Define to empty if `const' does not conform to ANSI C. */ #undef const +/* A replacement for va_copy, if needed. */ +#define gl_va_copy(a,b) ((a) = (b)) + /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus @@ -1259,6 +1262,9 @@ #define _UNUSED_PARAMETER_ _GL_UNUSED +/* Define as a macro for copying va_list variables. */ +#undef va_copy + /* Define as `fork' if `vfork' does not work. */ #undef vfork @@ -1319,7 +1325,8 @@ #endif /* These default definitions are good for almost all machines. - The exceptions override them in m/MACHINE.h. */ + Any exceptions should override them in m/MACHINE.h. + They must be usable in preprocessor conditionals. */ #ifndef BITS_PER_CHAR #define BITS_PER_CHAR 8 @@ -1329,9 +1336,6 @@ #define BITS_PER_SHORT 16 #endif -/* Note that lisp.h uses this in a preprocessor conditional, so it - would not work to use sizeof. That being so, we do all of them - without sizeof, for uniformity's sake. */ #ifndef BITS_PER_INT #define BITS_PER_INT 32 #endif @@ -1344,6 +1348,10 @@ #endif #endif +#if !defined BITS_PER_LONG_LONG && HAVE_LONG_LONG_INT +#define BITS_PER_LONG_LONG 64 +#endif + /* Define if the compiler supports function prototypes. It may do so but not define __STDC__ (e.g. DEC C by default) or may define it as zero. */ #undef PROTOTYPES === modified file 'autogen/configure' --- autogen/configure 2011-04-27 06:48:35 +0000 +++ autogen/configure 2011-05-06 10:19:05 +0000 @@ -661,6 +661,18 @@ LIBGNU_LTLIBDEPS LIBGNU_LIBDEPS gltests_WITNESS +gl_GNULIB_ENABLED_verify_FALSE +gl_GNULIB_ENABLED_verify_TRUE +gl_GNULIB_ENABLED_strtoull_FALSE +gl_GNULIB_ENABLED_strtoull_TRUE +gl_GNULIB_ENABLED_stat_FALSE +gl_GNULIB_ENABLED_stat_TRUE +gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36_FALSE +gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36_TRUE +gl_GNULIB_ENABLED_dosname_FALSE +gl_GNULIB_ENABLED_dosname_TRUE +LTLIBINTL +LIBINTL HAVE_UNISTD_H NEXT_AS_FIRST_DIRECTIVE_UNISTD_H NEXT_UNISTD_H @@ -783,6 +795,11 @@ GL_GENERATE_STDBOOL_H_FALSE GL_GENERATE_STDBOOL_H_TRUE STDBOOL_H +GL_GENERATE_STDARG_H_FALSE +GL_GENERATE_STDARG_H_TRUE +STDARG_H +NEXT_AS_FIRST_DIRECTIVE_STDARG_H +NEXT_STDARG_H REPLACE_TIMEGM REPLACE_NANOSLEEP REPLACE_MKTIME @@ -871,8 +888,6 @@ HAVE_WCHAR_H HAVE_UNSIGNED_LONG_LONG_INT HAVE_LONG_LONG_INT -LTLIBINTL -LIBINTL GETOPT_H HAVE_GETOPT_H NEXT_AS_FIRST_DIRECTIVE_GETOPT_H @@ -6226,6 +6241,299 @@ + case $ac_cv_prog_cc_stdc in #( + no) : + ac_cv_prog_cc_c99=no; ac_cv_prog_cc_c89=no ;; #( + *) : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5 +$as_echo_n "checking for $CC option to accept ISO C99... " >&6; } +if test "${ac_cv_prog_cc_c99+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include +#include + +// Check varargs macros. These examples are taken from C99 6.10.3.5. +#define debug(...) fprintf (stderr, __VA_ARGS__) +#define showlist(...) puts (#__VA_ARGS__) +#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) +static void +test_varargs_macros (void) +{ + int x = 1234; + int y = 5678; + debug ("Flag"); + debug ("X = %d\n", x); + showlist (The first, second, and third items.); + report (x>y, "x is %d but y is %d", x, y); +} + +// Check long long types. +#define BIG64 18446744073709551615ull +#define BIG32 4294967295ul +#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) +#if !BIG_OK + your preprocessor is broken; +#endif +#if BIG_OK +#else + your preprocessor is broken; +#endif +static long long int bignum = -9223372036854775807LL; +static unsigned long long int ubignum = BIG64; + +struct incomplete_array +{ + int datasize; + double data[]; +}; + +struct named_init { + int number; + const wchar_t *name; + double average; +}; + +typedef const char *ccp; + +static inline int +test_restrict (ccp restrict text) +{ + // See if C++-style comments work. + // Iterate through items via the restricted pointer. + // Also check for declarations in for loops. + for (unsigned int i = 0; *(text+i) != '\0'; ++i) + continue; + return 0; +} + +// Check varargs and va_copy. +static void +test_varargs (const char *format, ...) +{ + va_list args; + va_start (args, format); + va_list args_copy; + va_copy (args_copy, args); + + const char *str; + int number; + float fnumber; + + while (*format) + { + switch (*format++) + { + case 's': // string + str = va_arg (args_copy, const char *); + break; + case 'd': // int + number = va_arg (args_copy, int); + break; + case 'f': // float + fnumber = va_arg (args_copy, double); + break; + default: + break; + } + } + va_end (args_copy); + va_end (args); +} + +int +main () +{ + + // Check bool. + _Bool success = false; + + // Check restrict. + if (test_restrict ("String literal") == 0) + success = true; + char *restrict newvar = "Another string"; + + // Check varargs. + test_varargs ("s, d' f .", "string", 65, 34.234); + test_varargs_macros (); + + // Check flexible array members. + struct incomplete_array *ia = + malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); + ia->datasize = 10; + for (int i = 0; i < ia->datasize; ++i) + ia->data[i] = i * 1.234; + + // Check named initializers. + struct named_init ni = { + .number = 34, + .name = L"Test wide string", + .average = 543.34343, + }; + + ni.number = 58; + + int dynamic_array[ni.number]; + dynamic_array[ni.number - 1] = 543; + + // work around unused variable warnings + return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' + || dynamic_array[ni.number - 1] != 543); + + ; + return 0; +} +_ACEOF +for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -xc99=all -qlanglvl=extc99 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c99=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c99" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c99" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c99" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +$as_echo "$ac_cv_prog_cc_c99" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c99" != xno; then : + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 +else + ac_cv_prog_cc_stdc=no +fi + +fi + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO Standard C" >&5 +$as_echo_n "checking for $CC option to accept ISO Standard C... " >&6; } + if test "${ac_cv_prog_cc_stdc+set}" = set; then : + $as_echo_n "(cached) " >&6 +fi + + case $ac_cv_prog_cc_stdc in #( + no) : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; #( + '') : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; #( + *) : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_stdc" >&5 +$as_echo "$ac_cv_prog_cc_stdc" >&6; } ;; +esac + # Code from module allocator: @@ -6253,6 +6561,8 @@ # Code from module socklen: # Code from module ssize_t: # Code from module stat: + # Code from module stdarg: + # Code from module stdbool: # Code from module stddef: # Code from module stdint: @@ -16286,12 +16596,7 @@ gl_source_base='lib' - # Code from module allocator: - # Code from module arg-nonnull: - # Code from module c++defs: - # Code from module careadlinkat: - # Code from module crypto/md5: @@ -16308,11 +16613,7 @@ : - # Code from module dosname: - # Code from module dtoastr: - # Code from module extensions: - # Code from module filemode: @@ -16327,7 +16628,6 @@ - # Code from module getloadavg: # Persuade glibc to declare getloadavg(). @@ -16857,14 +17157,12 @@ - # Code from module getopt-gnu: - - - - - - - # Code from module getopt-posix: + + + + + + @@ -16909,14 +17207,7 @@ fi - # Code from module gettext-h: - - - # Code from module ignore-value: - - # Code from module include_next: - # Code from module intprops: - # Code from module inttypes-incomplete: + @@ -16992,7 +17283,6 @@ - # Code from module lstat: @@ -17014,7 +17304,6 @@ - # Code from module mktime: @@ -17269,9 +17558,7 @@ - # Code from module multiarch: - # Code from module readlink: @@ -17392,8 +17679,7 @@ - # Code from module socklen: - ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" " + ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" " /* is not needed according to POSIX, but the in i386-unknown-freebsd4.10 and powerpc-apple-darwin5.5 required it. */ @@ -17456,7 +17742,6 @@ fi - # Code from module ssize_t: { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ssize_t" >&5 $as_echo_n "checking for ssize_t... " >&6; } @@ -17490,126 +17775,171 @@ fi - # Code from module stat: - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat handles trailing slashes on directories" >&5 -$as_echo_n "checking whether stat handles trailing slashes on directories... " >&6; } -if test "${gl_cv_func_stat_dir_slash+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - case $host_os in - mingw*) gl_cv_func_stat_dir_slash="guessing no";; - *) gl_cv_func_stat_dir_slash="guessing yes";; - esac -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -int -main () -{ -struct stat st; return stat (".", &st) != stat ("./", &st); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - gl_cv_func_stat_dir_slash=yes -else - gl_cv_func_stat_dir_slash=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_stat_dir_slash" >&5 -$as_echo "$gl_cv_func_stat_dir_slash" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat handles trailing slashes on files" >&5 -$as_echo_n "checking whether stat handles trailing slashes on files... " >&6; } -if test "${gl_cv_func_stat_file_slash+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - touch conftest.tmp - # Assume that if we have lstat, we can also check symlinks. - if test $ac_cv_func_lstat = yes; then - ln -s conftest.tmp conftest.lnk - fi - if test "$cross_compiling" = yes; then : - gl_cv_func_stat_file_slash="guessing no" -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -int -main () -{ -int result = 0; - struct stat st; - if (!stat ("conftest.tmp/", &st)) - result |= 1; -#if HAVE_LSTAT - if (!stat ("conftest.lnk/", &st)) - result |= 2; -#endif - return result; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - gl_cv_func_stat_file_slash=yes -else - gl_cv_func_stat_file_slash=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - rm -f conftest.tmp conftest.lnk -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_stat_file_slash" >&5 -$as_echo "$gl_cv_func_stat_file_slash" >&6; } - case $gl_cv_func_stat_dir_slash in - *no) REPLACE_STAT=1 - -$as_echo "#define REPLACE_FUNC_STAT_DIR 1" >>confdefs.h -;; - esac - case $gl_cv_func_stat_file_slash in - *no) REPLACE_STAT=1 - -$as_echo "#define REPLACE_FUNC_STAT_FILE 1" >>confdefs.h -;; - esac - if test $REPLACE_STAT = 1; then - - - - - - - - - gl_LIBOBJS="$gl_LIBOBJS stat.$ac_objext" - - + + STDARG_H='' + NEXT_STDARG_H='' + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for va_copy" >&5 +$as_echo_n "checking for va_copy... " >&6; } + if test "${gl_cv_func_va_copy+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ + +#ifndef va_copy +void (*func) (va_list, va_list) = va_copy; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_func_va_copy=yes +else + gl_cv_func_va_copy=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_va_copy" >&5 +$as_echo "$gl_cv_func_va_copy" >&6; } + if test $gl_cv_func_va_copy = no; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined _AIX && !defined __GNUC__ + AIX vaccine + #endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "vaccine" >/dev/null 2>&1; then : + gl_aixcc=yes +else + gl_aixcc=no +fi +rm -f conftest* + + if test $gl_aixcc = yes; then + STDARG_H=stdarg.h + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_stdarg_h='<'stdarg.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +$as_echo_n "checking absolute name of ... " >&6; } +if test "${gl_cv_next_stdarg_h+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_stdarg_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/stdarg.h#{ + s#.*"\(.*/stdarg.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdarg_h" >&5 +$as_echo "$gl_cv_next_stdarg_h" >&6; } + fi + NEXT_STDARG_H=$gl_cv_next_stdarg_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'stdarg.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_stdarg_h + fi + NEXT_AS_FIRST_DIRECTIVE_STDARG_H=$gl_next_as_first_directive + + + + + if test "$gl_cv_next_stdarg_h" = '""'; then + gl_cv_next_stdarg_h='"///usr/include/stdarg.h"' + NEXT_STDARG_H="$gl_cv_next_stdarg_h" + fi + else + + saved_as_echo_n="$as_echo_n" + as_echo_n=':' + if test "${gl_cv_func___va_copy+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ + +#ifndef __va_copy +error, bail out +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_func___va_copy=yes +else + gl_cv_func___va_copy=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + + as_echo_n="$saved_as_echo_n" + + if test $gl_cv_func___va_copy = yes; then + +$as_echo "#define va_copy __va_copy" >>confdefs.h + + else + + +$as_echo "#define va_copy gl_va_copy" >>confdefs.h + + fi + fi fi - - - - GNULIB_STAT=1 - - - - # Code from module stdbool: + if test -n "$STDARG_H"; then + GL_GENERATE_STDARG_H_TRUE= + GL_GENERATE_STDARG_H_FALSE='#' +else + GL_GENERATE_STDARG_H_TRUE='#' + GL_GENERATE_STDARG_H_FALSE= +fi + + + @@ -17637,7 +17967,6 @@ fi - # Code from module stddef: @@ -17742,7 +18071,6 @@ fi - # Code from module stdint: @@ -18455,7 +18783,6 @@ fi - # Code from module stdio: @@ -18515,8 +18842,6 @@ GNULIB_FSCANF=1 GNULIB_SCANF=1 - GNULIB_VFSCANF=1 - GNULIB_VSCANF=1 GNULIB_FGETC=1 GNULIB_GETC=1 GNULIB_GETCHAR=1 @@ -18540,7 +18865,6 @@ - # Code from module stdlib: @@ -18599,7 +18923,6 @@ - # Code from module strftime: @@ -18625,51 +18948,6 @@ - # Code from module strtoull: - - - - if test "$ac_cv_type_unsigned_long_long_int" = yes; then - - - - - - - - - for ac_func in strtoull -do : - ac_fn_c_check_func "$LINENO" "strtoull" "ac_cv_func_strtoull" -if test "x$ac_cv_func_strtoull" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_STRTOULL 1 -_ACEOF - -else - - gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" - -fi -done - - - if test $ac_cv_func_strtoull = no; then - HAVE_STRTOULL=0 - - : - - fi - fi - - - - - GNULIB_STRTOULL=1 - - - - # Code from module strtoumax: @@ -18725,7 +19003,6 @@ GNULIB_STRTOUMAX=1 - # Code from module symlink: @@ -18805,7 +19082,6 @@ - # Code from module sys_stat: @@ -18889,11 +19165,9 @@ - # Code from module time: - - - - # Code from module time_r: + + + @@ -18973,7 +19247,6 @@ - # Code from module unistd: @@ -19047,8 +19320,266 @@ - # Code from module verify: - # Code from module warn-on-use: + gl_gnulib_enabled_dosname=false + gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36=false + gl_gnulib_enabled_stat=false + gl_gnulib_enabled_strtoull=false + gl_gnulib_enabled_verify=false + func_gl_gnulib_m4code_dosname () + { + if ! $gl_gnulib_enabled_dosname; then + gl_gnulib_enabled_dosname=true + fi + } + func_gl_gnulib_m4code_be453cec5eecf5731a274f2de7f2db36 () + { + if ! $gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36; then + + + gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36=true + fi + } + func_gl_gnulib_m4code_stat () + { + if ! $gl_gnulib_enabled_stat; then + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat handles trailing slashes on directories" >&5 +$as_echo_n "checking whether stat handles trailing slashes on directories... " >&6; } +if test "${gl_cv_func_stat_dir_slash+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + case $host_os in + mingw*) gl_cv_func_stat_dir_slash="guessing no";; + *) gl_cv_func_stat_dir_slash="guessing yes";; + esac +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +struct stat st; return stat (".", &st) != stat ("./", &st); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_stat_dir_slash=yes +else + gl_cv_func_stat_dir_slash=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_stat_dir_slash" >&5 +$as_echo "$gl_cv_func_stat_dir_slash" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat handles trailing slashes on files" >&5 +$as_echo_n "checking whether stat handles trailing slashes on files... " >&6; } +if test "${gl_cv_func_stat_file_slash+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + touch conftest.tmp + # Assume that if we have lstat, we can also check symlinks. + if test $ac_cv_func_lstat = yes; then + ln -s conftest.tmp conftest.lnk + fi + if test "$cross_compiling" = yes; then : + gl_cv_func_stat_file_slash="guessing no" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +int result = 0; + struct stat st; + if (!stat ("conftest.tmp/", &st)) + result |= 1; +#if HAVE_LSTAT + if (!stat ("conftest.lnk/", &st)) + result |= 2; +#endif + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_stat_file_slash=yes +else + gl_cv_func_stat_file_slash=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + rm -f conftest.tmp conftest.lnk +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_stat_file_slash" >&5 +$as_echo "$gl_cv_func_stat_file_slash" >&6; } + case $gl_cv_func_stat_dir_slash in + *no) REPLACE_STAT=1 + +$as_echo "#define REPLACE_FUNC_STAT_DIR 1" >>confdefs.h +;; + esac + case $gl_cv_func_stat_file_slash in + *no) REPLACE_STAT=1 + +$as_echo "#define REPLACE_FUNC_STAT_FILE 1" >>confdefs.h +;; + esac + if test $REPLACE_STAT = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS stat.$ac_objext" + + + fi + + + + + GNULIB_STAT=1 + + + + gl_gnulib_enabled_stat=true + if $condition; then + func_gl_gnulib_m4code_dosname + fi + fi + } + func_gl_gnulib_m4code_strtoull () + { + if ! $gl_gnulib_enabled_strtoull; then + + + + if test "$ac_cv_type_unsigned_long_long_int" = yes; then + + + + + + + + + for ac_func in strtoull +do : + ac_fn_c_check_func "$LINENO" "strtoull" "ac_cv_func_strtoull" +if test "x$ac_cv_func_strtoull" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STRTOULL 1 +_ACEOF + +else + + gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + +fi +done + + + if test $ac_cv_func_strtoull = no; then + HAVE_STRTOULL=0 + + : + + fi + fi + + + + + GNULIB_STRTOULL=1 + + + + gl_gnulib_enabled_strtoull=true + fi + } + func_gl_gnulib_m4code_verify () + { + if ! $gl_gnulib_enabled_verify; then + gl_gnulib_enabled_verify=true + fi + } + if test $GNULIB_UNISTD_H_GETOPT = 1; then + func_gl_gnulib_m4code_be453cec5eecf5731a274f2de7f2db36 + fi + if test $REPLACE_LSTAT = 1; then + func_gl_gnulib_m4code_dosname + fi + if test $REPLACE_LSTAT = 1; then + func_gl_gnulib_m4code_stat + fi + if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then + func_gl_gnulib_m4code_stat + fi + if test "$ac_cv_have_decl_strtoumax" != yes && test $ac_cv_func_strtoumax = no; then + func_gl_gnulib_m4code_verify + fi + if test "$ac_cv_have_decl_strtoumax" != yes && test $ac_cv_func_strtoumax = no && test $ac_cv_type_unsigned_long_long_int = yes; then + func_gl_gnulib_m4code_strtoull + fi + + if $gl_gnulib_enabled_dosname; then + gl_GNULIB_ENABLED_dosname_TRUE= + gl_GNULIB_ENABLED_dosname_FALSE='#' +else + gl_GNULIB_ENABLED_dosname_TRUE='#' + gl_GNULIB_ENABLED_dosname_FALSE= +fi + + if $gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36; then + gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36_TRUE= + gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36_FALSE='#' +else + gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36_TRUE='#' + gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36_FALSE= +fi + + if $gl_gnulib_enabled_stat; then + gl_GNULIB_ENABLED_stat_TRUE= + gl_GNULIB_ENABLED_stat_FALSE='#' +else + gl_GNULIB_ENABLED_stat_TRUE='#' + gl_GNULIB_ENABLED_stat_FALSE= +fi + + if $gl_gnulib_enabled_strtoull; then + gl_GNULIB_ENABLED_strtoull_TRUE= + gl_GNULIB_ENABLED_strtoull_FALSE='#' +else + gl_GNULIB_ENABLED_strtoull_TRUE='#' + gl_GNULIB_ENABLED_strtoull_FALSE= +fi + + if $gl_gnulib_enabled_verify; then + gl_GNULIB_ENABLED_verify_TRUE= + gl_GNULIB_ENABLED_verify_FALSE='#' +else + gl_GNULIB_ENABLED_verify_TRUE='#' + gl_GNULIB_ENABLED_verify_FALSE= +fi + # End of code from modules @@ -19083,6 +19614,7 @@ + LIBGNU_LIBDEPS="$gl_libdeps" LIBGNU_LTLIBDEPS="$gl_ltlibdeps" @@ -21232,6 +21764,10 @@ as_fn_error "conditional \"GL_GENERATE_STDINT_H\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${GL_GENERATE_STDARG_H_TRUE}" && test -z "${GL_GENERATE_STDARG_H_FALSE}"; then + as_fn_error "conditional \"GL_GENERATE_STDARG_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${GL_GENERATE_STDBOOL_H_TRUE}" && test -z "${GL_GENERATE_STDBOOL_H_FALSE}"; then as_fn_error "conditional \"GL_GENERATE_STDBOOL_H\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -21244,6 +21780,26 @@ as_fn_error "conditional \"GL_GENERATE_STDINT_H\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${gl_GNULIB_ENABLED_dosname_TRUE}" && test -z "${gl_GNULIB_ENABLED_dosname_FALSE}"; then + as_fn_error "conditional \"gl_GNULIB_ENABLED_dosname\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36_TRUE}" && test -z "${gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36_FALSE}"; then + as_fn_error "conditional \"gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${gl_GNULIB_ENABLED_stat_TRUE}" && test -z "${gl_GNULIB_ENABLED_stat_FALSE}"; then + as_fn_error "conditional \"gl_GNULIB_ENABLED_stat\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${gl_GNULIB_ENABLED_strtoull_TRUE}" && test -z "${gl_GNULIB_ENABLED_strtoull_FALSE}"; then + as_fn_error "conditional \"gl_GNULIB_ENABLED_strtoull\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${gl_GNULIB_ENABLED_verify_TRUE}" && test -z "${gl_GNULIB_ENABLED_verify_FALSE}"; then + as_fn_error "conditional \"gl_GNULIB_ENABLED_verify\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi gl_libobjs= gl_ltlibobjs= ------------------------------------------------------------ revno: 104137 committer: Glenn Morris branch nick: trunk timestamp: Fri 2011-05-06 00:30:20 -0700 message: * lisp/calendar/diary-lib.el (diary-add-to-list): Simplify previous change. diff: === modified file 'lisp/calendar/diary-lib.el' --- lisp/calendar/diary-lib.el 2011-05-06 04:28:53 +0000 +++ lisp/calendar/diary-lib.el 2011-05-06 07:30:20 +0000 @@ -651,9 +651,7 @@ ;; Preserve the value with the comments. (or literal (setq literal string)) (setq string (replace-regexp-in-string - (format "%s.*%s" cstart - (if (zerop (length diary-comment-end)) "$" - (regexp-quote diary-comment-end))) + (format "%s.*%s" cstart (regexp-quote diary-comment-end)) "" string))) (setq diary-entries-list (append diary-entries-list ------------------------------------------------------------ revno: 104136 committer: Glenn Morris branch nick: trunk timestamp: Fri 2011-05-06 00:20:17 -0700 message: ChangeLog format fixes. diff: === modified file 'lisp/ChangeLog.5' --- lisp/ChangeLog.5 2011-01-25 04:08:28 +0000 +++ lisp/ChangeLog.5 2011-05-06 07:20:17 +0000 @@ -5484,12 +5484,12 @@ 1994-10-27 Francesco Potortì (pot@cnuce.cnr.it) * man.el (Man-fontify-manpage-flag): defvar put at outer level. - (manual-program, Man-untabify-command, Man-untabify-command-args, - Man-sed-command, Man-awk-command, Man-mode-line-format, - Man-mode-map, Man-mode-hook, Man-cooked-hook, Man-name-regexp, - Man-section-regexp, Man-page-header-regexp, Man-heading-regexp, - Man-see-also-regexp, Man-first-heading-regexp, - Man-reference-regexp, Man-switches, Man-specified-section-option): + (manual-program, Man-untabify-command, Man-untabify-command-args) + (Man-sed-command, Man-awk-command, Man-mode-line-format) + (Man-mode-map, Man-mode-hook, Man-cooked-hook, Man-name-regexp) + (Man-section-regexp, Man-page-header-regexp, Man-heading-regexp) + (Man-see-also-regexp, Man-first-heading-regexp) + (Man-reference-regexp, Man-switches, Man-specified-section-option): Make them normal defvars, no more user options. (Man-overstrike-face, Man-underline-face): New user options. (Man-init-defvars): Man-fontify-manpage-flag removed from here. @@ -6228,10 +6228,10 @@ 1994-10-05 Francesco Potortì (pot@cnuce.cnr.it) - * man.el (Man-notify, Man-current-page, Man-page-list, - Man-filter-list, Man-original-frame, Man-arguments, - Man-fontify-manpage-flag, Man-sections-alist, Man-refpages-alist, - Man-uses-untabify-flag, Man-page-mode-string, Man-sed-script): + * man.el (Man-notify, Man-current-page, Man-page-list) + (Man-filter-list, Man-original-frame, Man-arguments) + (Man-fontify-manpage-flag, Man-sections-alist, Man-refpages-alist) + (Man-uses-untabify-flag, Man-page-mode-string, Man-sed-script): Added defvar's to keep the compiler quiet. (Man-getpage-in-background): Start buffer name with "*Man ". instead of "*man " to avoid conflict with "*mail*". @@ -6425,8 +6425,7 @@ 1994-09-29 Francesco Potortì (pot@cnuce.cnr.it) - * man.el - (Man-init-defvars, Man-cleanup-manpage, Man-fontify-manpage): + * man.el (Man-init-defvars, Man-cleanup-manpage, Man-fontify-manpage): added support for the big cross present in the ksh manpage. 1994-09-29 Richard Stallman @@ -6884,8 +6883,8 @@ (Man-bgproc-sentinel): Cleanup, call Man-fontify-manpage and Man-cleanup-page when necessary. (Man-mode): Call Man-strip-page-headers and Man-unindent. - (Man-build-section-alist, Man-build-references-alist, - Man-build-page-list): substs instead of functions. + (Man-build-section-alist, Man-build-references-alist) + (Man-build-page-list): substs instead of functions. (Man-build-references-alist): Cleanup. (Man-build-page-list): New algorithm. (Man-strip-page-headers, Man-unindent): New substs. ------------------------------------------------------------ revno: 104135 committer: Glenn Morris branch nick: trunk timestamp: Fri 2011-05-06 00:14:30 -0700 message: Allow per-appointment warning times. * lisp/calendar/appt.el (appt-message-warning-time): Doc fix. (appt-warning-time-regexp): New option. (appt-make-list): Respect appt-message-warning-time. * doc/emacs/calendar.texi (Appointments): Mention appt-warning-time-regexp. * etc/NEWS: Mention this. diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2011-05-06 04:28:53 +0000 +++ doc/emacs/ChangeLog 2011-05-06 07:14:30 +0000 @@ -1,5 +1,7 @@ 2011-05-06 Glenn Morris + * calendar.texi (Appointments): Mention appt-warning-time-regexp. + * cal-xtra.texi (Fancy Diary Display): Mention diary comments. 2011-05-02 Lars Magne Ingebrigtsen === modified file 'doc/emacs/calendar.texi' --- doc/emacs/calendar.texi 2011-01-25 04:08:28 +0000 +++ doc/emacs/calendar.texi 2011-05-06 07:14:30 +0000 @@ -1489,11 +1489,15 @@ @end example @vindex appt-message-warning-time +@vindex appt-warning-time-regexp @noindent Then on Mondays, you will be reminded at around 9:20am about your coffee break and at around 11:50am about lunch. The variable @code{appt-message-warning-time} specifies how many minutes (default 12) -in advance to warn you. +in advance to warn you. This is a default warning time. Each +appointment can specify a different warning time by adding a piece +matching @code{appt-warning-time-regexp} (see that variable's +documentation for details). You can write times in am/pm style (with @samp{12:00am} standing for midnight and @samp{12:00pm} standing for noon), or 24-hour === modified file 'etc/NEWS' --- etc/NEWS 2011-05-06 06:30:56 +0000 +++ etc/NEWS 2011-05-06 07:14:30 +0000 @@ -451,6 +451,10 @@ *** Diary entries can contain non-printing `comments'. See the variable `diary-comment-start'. ++++ +*** Appointments can specify their individual warning times. +See the variable `appt-warning-time-regexp'. + *** New function `diary-hebrew-birthday'. --- === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-06 04:28:53 +0000 +++ lisp/ChangeLog 2011-05-06 07:14:30 +0000 @@ -1,5 +1,9 @@ 2011-05-06 Glenn Morris + * calendar/appt.el (appt-message-warning-time): Doc fix. + (appt-warning-time-regexp): New option. + (appt-make-list): Respect appt-message-warning-time. + * calendar/diary-lib.el (diary-comment-start, diary-comment-end): New options. (diary-add-to-list): Strip comments from the displayed string. === modified file 'lisp/calendar/appt.el' --- lisp/calendar/appt.el 2011-04-19 04:11:01 +0000 +++ lisp/calendar/appt.el 2011-05-06 07:14:30 +0000 @@ -84,10 +84,22 @@ :group 'calendar) (defcustom appt-message-warning-time 12 - "Time in minutes before an appointment that the warning begins." + "Default time in minutes before an appointment that the warning begins." :type 'integer :group 'appt) +(defcustom appt-warning-time-regexp "warntime \\([0-9]+\\)" + "Regexp matching a string giving the warning time for an appointment. +The first subexpression matches the time in minutes (an integer). +This overrides the default `appt-message-warning-time'. +You may want to put this inside a diary comment (see `diary-comment-start'). +For example, to be warned 30 minutes in advance of an appointment: + 2011/06/01 12:00 Do something ## warntime 30 +" + :version "24.1" + :type 'regexp + :group 'appt) + (defcustom appt-audible t "Non-nil means beep to indicate appointment." :type 'boolean @@ -509,7 +521,7 @@ ;; entry begins with a time, add it to the ;; appt-time-msg-list. Then sort the list. (let ((entry-list diary-entries-list) - time-string) + time-string literal) ;; Below, we assume diary-entries-list was in date ;; order. It is, unless something on ;; diary-list-entries-hook has changed it, eg @@ -530,7 +542,10 @@ (while (and entry-list (calendar-date-equal (calendar-current-date) (caar entry-list))) - (setq time-string (cadr (car entry-list))) + (setq time-string (cadr (car entry-list)) + ;; Including any comments. + literal (or (nth 2 (nth 3 (car entry-list))) + time-string)) (while (string-match appt-time-regexp time-string) (let* ((beg (match-beginning 0)) ;; Get just the time for this appointment. @@ -541,17 +556,30 @@ (concat "\n[ \t]*" appt-time-regexp) time-string (match-end 0))) + (warntime + (if (string-match appt-warning-time-regexp literal) + (string-to-number (match-string 1 literal)))) ;; 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))) + (time-msg (append + (list appt-time appt-time-string) + (if warntime (list nil warntime))))) ;; 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. + ;; (This allows for multiple appts per entry.) time-string - (if end (substring time-string end) "")))) + (if end (substring time-string end) "")) + ;; Similarly, discard the start of literal. + (and (> (length time-string) 0) + (string-match appt-time-regexp literal) + (setq end (string-match + (concat "\n[ \t]*" appt-time-regexp) + literal (match-end 0))) + (setq literal (substring literal 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), ------------------------------------------------------------ revno: 104134 [merge] fixes bug(s): http://debbugs.gnu.org/8545 http://debbugs.gnu.org/8601 http://debbugs.gnu.org/8600 http://debbugs.gnu.org/8602 committer: Paul Eggert branch nick: trunk timestamp: Fri 2011-05-06 00:13:19 -0700 message: Do not assume EMACS_INT is the same width as a pointer. This prepares for a future patch that will prefer 64-bit EMACS_INT if available. That patch can be tried now, by compiling with -DWIDE_EMACS_INT, but it is temporarily not the default so that it can be further tested. Also, install some other fixes for problems discovered by the static checking of GCC 4.6.0. diff: === modified file 'ChangeLog' --- ChangeLog 2011-05-05 03:30:03 +0000 +++ ChangeLog 2011-05-06 07:13:19 +0000 @@ -1,3 +1,15 @@ +2011-05-06 Paul Eggert + + Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux. + * Makefile.in (GNULIB_MODULES): Add stdarg, for va_copy. + * lib/stdarg.in.h, m4/stdarg.m4: New files, from gnulib. + + * Makefile.in (GNULIB_TOOL_FLAG): Add --conditional-dependencies. + This new gnulib-tool option saves 'configure' the trouble of + checking for strtoull when strtoumax exists. + + * configure.in (BITS_PER_LONG_LONG): New macro. + 2011-05-05 Glenn Morris * Makefile.in (bootstrap-clean): Save config.log. (Bug#765) === modified file 'Makefile.in' --- Makefile.in 2011-05-05 06:04:38 +0000 +++ Makefile.in 2011-05-06 06:30:56 +0000 @@ -333,9 +333,10 @@ GNULIB_MODULES = \ careadlinkat crypto/md5 dtoastr filemode getloadavg getopt-gnu \ ignore-value intprops lstat mktime readlink \ - socklen stdio strftime strtoumax symlink sys_stat + socklen stdarg stdio strftime strtoumax symlink sys_stat GNULIB_TOOL_FLAGS = \ - --import --no-changelog --no-vc-files --makefile-name=gnulib.mk + --conditional-dependencies --import --no-changelog --no-vc-files \ + --makefile-name=gnulib.mk sync-from-gnulib: $(gnulib_srcdir) -cd $(srcdir)/m4 && cp $(DOS_gnulib_comp.m4) gnulib-comp.m4 cd $(srcdir) && \ === modified file 'configure.in' --- configure.in 2011-04-27 02:17:44 +0000 +++ configure.in 2011-04-29 07:55:57 +0000 @@ -3518,7 +3518,8 @@ #endif /* These default definitions are good for almost all machines. - The exceptions override them in m/MACHINE.h. */ + Any exceptions should override them in m/MACHINE.h. + They must be usable in preprocessor conditionals. */ #ifndef BITS_PER_CHAR #define BITS_PER_CHAR 8 @@ -3528,9 +3529,6 @@ #define BITS_PER_SHORT 16 #endif -/* Note that lisp.h uses this in a preprocessor conditional, so it - would not work to use sizeof. That being so, we do all of them - without sizeof, for uniformity's sake. */ #ifndef BITS_PER_INT #define BITS_PER_INT 32 #endif @@ -3543,6 +3541,10 @@ #endif #endif +#if !defined BITS_PER_LONG_LONG && HAVE_LONG_LONG_INT +#define BITS_PER_LONG_LONG 64 +#endif + /* Define if the compiler supports function prototypes. It may do so but not define __STDC__ (e.g. DEC C by default) or may define it as zero. */ #undef PROTOTYPES === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2011-05-01 00:04:17 +0000 +++ doc/lispref/ChangeLog 2011-05-06 07:13:19 +0000 @@ -1,3 +1,7 @@ +2011-05-06 Paul Eggert + + * numbers.texi (Integer Basics): Large integers are treated as floats. + 2011-04-30 Lars Magne Ingebrigtsen * processes.texi (Synchronous Processes): Document the (:file === modified file 'doc/lispref/numbers.texi' --- doc/lispref/numbers.texi 2011-01-25 04:08:28 +0000 +++ doc/lispref/numbers.texi 2011-05-05 06:31:14 +0000 @@ -55,14 +55,15 @@ @cindex overflow The Lisp reader reads an integer as a sequence of digits with optional -initial sign and optional final period. +initial sign and optional final period. An integer that is out of the +Emacs range is treated as a floating-point number. @example 1 ; @r{The integer 1.} 1. ; @r{The integer 1.} +1 ; @r{Also the integer 1.} -1 ; @r{The integer @minus{}1.} - 1073741825 ; @r{Also the integer 1, due to overflow.} + 1073741825 ; @r{The floating point number 1073741825.0.} 0 ; @r{The integer 0.} -0 ; @r{The integer 0.} @end example @@ -195,7 +196,7 @@ @samp{1.0e+INF} @item negative infinity @samp{-1.0e+INF} -@item Not-a-number +@item Not-a-number @samp{0.0e+NaN} or @samp{-0.0e+NaN}. @end table === modified file 'lib/gnulib.mk' --- lib/gnulib.mk 2011-04-26 19:29:47 +0000 +++ lib/gnulib.mk 2011-05-04 07:19:21 +0000 @@ -9,7 +9,7 @@ # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. -# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=. --makefile-name=gnulib.mk --no-libtool --macro-prefix=gl --no-vc-files careadlinkat crypto/md5 dtoastr filemode getloadavg getopt-gnu ignore-value intprops lstat mktime readlink socklen stdio strftime strtoumax symlink sys_stat +# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=. --makefile-name=gnulib.mk --no-libtool --macro-prefix=gl --no-vc-files careadlinkat crypto/md5 dtoastr filemode getloadavg getopt-gnu ignore-value intprops lstat mktime readlink socklen stdarg stdio strftime strtoumax symlink sys_stat MOSTLYCLEANFILES += core *.stackdump @@ -96,7 +96,9 @@ ## begin gnulib module dosname +if gl_GNULIB_ENABLED_dosname +endif EXTRA_DIST += dosname.h ## end gnulib module dosname @@ -157,8 +159,10 @@ ## begin gnulib module gettext-h +if gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36 libgnu_a_SOURCES += gettext.h +endif ## end gnulib module gettext-h ## begin gnulib module ignore-value @@ -245,13 +249,42 @@ ## begin gnulib module stat +if gl_GNULIB_ENABLED_stat +endif EXTRA_DIST += stat.c EXTRA_libgnu_a_SOURCES += stat.c ## end gnulib module stat +## begin gnulib module stdarg + +BUILT_SOURCES += $(STDARG_H) + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +if GL_GENERATE_STDARG_H +stdarg.h: stdarg.in.h $(top_builddir)/config.status + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_STDARG_H''@|$(NEXT_STDARG_H)|g' \ + < $(srcdir)/stdarg.in.h; \ + } > $@-t && \ + mv $@-t $@ +else +stdarg.h: $(top_builddir)/config.status + rm -f $@ +endif +MOSTLYCLEANFILES += stdarg.h stdarg.h-t + +EXTRA_DIST += stdarg.in.h + +## end gnulib module stdarg + ## begin gnulib module stdbool BUILT_SOURCES += $(STDBOOL_H) @@ -576,7 +609,9 @@ ## begin gnulib module strtoull +if gl_GNULIB_ENABLED_strtoull +endif EXTRA_DIST += strtol.c strtoul.c strtoull.c EXTRA_libgnu_a_SOURCES += strtol.c strtoul.c strtoull.c @@ -847,8 +882,10 @@ ## begin gnulib module verify +if gl_GNULIB_ENABLED_verify libgnu_a_SOURCES += verify.h +endif ## end gnulib module verify ## begin gnulib module warn-on-use === added file 'lib/stdarg.in.h' --- lib/stdarg.in.h 1970-01-01 00:00:00 +0000 +++ lib/stdarg.in.h 2011-05-04 07:19:21 +0000 @@ -0,0 +1,36 @@ +/* Substitute for and wrapper around . + Copyright (C) 2008-2011 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +#ifndef _GL_STDARG_H + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif +@PRAGMA_COLUMNS@ + +/* The include_next requires a split double-inclusion guard. */ +#@INCLUDE_NEXT@ @NEXT_STDARG_H@ + +#ifndef _GL_STDARG_H +#define _GL_STDARG_H + +#ifndef va_copy +# define va_copy(a,b) ((a) = (b)) +#endif + +#endif /* _GL_STDARG_H */ +#endif /* _GL_STDARG_H */ === modified file 'lib/stdlib.in.h' --- lib/stdlib.in.h 2011-04-08 21:53:30 +0000 +++ lib/stdlib.in.h 2011-05-04 06:11:49 +0000 @@ -81,8 +81,9 @@ # endif #endif -#if (@GNULIB_MKSTEMP@ || @GNULIB_GETSUBOPT@ || defined GNULIB_POSIXCHECK) && ! defined __GLIBC__ && !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) +#if (@GNULIB_MKSTEMP@ || @GNULIB_MKSTEMPS@ || @GNULIB_GETSUBOPT@ || defined GNULIB_POSIXCHECK) && ! defined __GLIBC__ && !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) /* On MacOS X 10.3, only declares mkstemp. */ +/* On MacOS X 10.5, only declares mkstemps. */ /* On Cygwin 1.7.1, only declares getsubopt. */ /* But avoid namespace pollution on glibc systems and native Windows. */ # include === modified file 'lib/verify.h' --- lib/verify.h 2011-04-21 19:12:13 +0000 +++ lib/verify.h 2011-05-06 06:03:30 +0000 @@ -17,42 +17,37 @@ /* Written by Paul Eggert, Bruno Haible, and Jim Meyering. */ -#ifndef VERIFY_H -# define VERIFY_H 1 - -/* Define HAVE__STATIC_ASSERT to 1 if _Static_assert works as per the +#ifndef _GL_VERIFY_H +# define _GL_VERIFY_H + + +/* Define _GL_HAVE__STATIC_ASSERT to 1 if _Static_assert works as per the C1X draft N1548 section 6.7.10. This is supported by GCC 4.6.0 and later, in C mode, and its use here generates easier-to-read diagnostics when verify (R) fails. - Define HAVE_STATIC_ASSERT to 1 if static_assert works as per the - C1X draft N1548 section 7.2 or the C++0X draft N3242 section 7.(4). + Define _GL_HAVE_STATIC_ASSERT to 1 if static_assert works as per the + C++0X draft N3242 section 7.(4). This will likely be supported by future GCC versions, in C++ mode. - For now, use this only with GCC. Eventually whether _Static_assert - and static_assert works should be determined by 'configure'. */ + Use this only with GCC. If we were willing to slow 'configure' + down we could also use it with other compilers, but since this + affects only the quality of diagnostics, why bother? */ # if (4 < __GNUC__ || (__GNUC__ == 4 && 6 <= __GNUC_MINOR__)) && !defined __cplusplus -# define HAVE__STATIC_ASSERT 1 +# define _GL_HAVE__STATIC_ASSERT 1 # endif /* The condition (99 < __GNUC__) is temporary, until we know about the first G++ release that supports static_assert. */ # if (99 < __GNUC__) && defined __cplusplus -# define HAVE_STATIC_ASSERT 1 +# define _GL_HAVE_STATIC_ASSERT 1 # endif /* Each of these macros verifies that its argument R is nonzero. To be portable, R should be an integer constant expression. Unlike assert (R), there is no run-time overhead. - There are two macros, since no single macro can be used in all - contexts in C. verify_true (R) is for scalar contexts, including - integer constant expression contexts. verify (R) is for declaration - contexts, e.g., the top level. - - Symbols ending in "__" are private to this header. - If _Static_assert works, verify (R) uses it directly. Similarly, - verify_true (R) works by packaging a _Static_assert inside a struct + _GL_VERIFY_TRUE works by packaging a _Static_assert inside a struct that is an operand of sizeof. The code below uses several ideas for C++ compilers, and for C @@ -64,7 +59,9 @@ constant and nonnegative. * Next this expression W is wrapped in a type - struct verify_type__ { unsigned int verify_error_if_negative_size__: W; }. + struct _gl_verify_type { + unsigned int _gl_verify_error_if_negative: W; + }. If W is negative, this yields a compile-time error. No compiler can deal with a bit-field of negative size. @@ -78,7 +75,7 @@ void function (int n) { verify (n < 0); } - * For the verify macro, the struct verify_type__ will need to + * For the verify macro, the struct _gl_verify_type will need to somehow be embedded into a declaration. To be portable, this declaration must declare an object, a constant, a function, or a typedef name. If the declared entity uses the type directly, @@ -116,11 +113,11 @@ Which of the following alternatives can be used? extern int dummy [sizeof (struct {...})]; - extern int dummy [sizeof (struct verify_type__ {...})]; + extern int dummy [sizeof (struct _gl_verify_type {...})]; extern void dummy (int [sizeof (struct {...})]); - extern void dummy (int [sizeof (struct verify_type__ {...})]); + extern void dummy (int [sizeof (struct _gl_verify_type {...})]); extern int (*dummy (void)) [sizeof (struct {...})]; - extern int (*dummy (void)) [sizeof (struct verify_type__ {...})]; + extern int (*dummy (void)) [sizeof (struct _gl_verify_type {...})]; In the second and sixth case, the struct type is exported to the outer scope; two such declarations therefore collide. GCC warns @@ -159,44 +156,75 @@ possible. */ # define _GL_GENSYM(prefix) _GL_CONCAT (prefix, _GL_COUNTER) +/* Verify requirement R at compile-time, as an integer constant expression + that returns 1. If R is false, fail at compile-time, preferably + with a diagnostic that includes the string-literal DIAGNOSTIC. */ + +# define _GL_VERIFY_TRUE(R, DIAGNOSTIC) \ + (!!sizeof (_GL_VERIFY_TYPE (R, DIAGNOSTIC))) + +# ifdef __cplusplus +template + struct _gl_verify_type { + unsigned int _gl_verify_error_if_negative: w; + }; +# define _GL_VERIFY_TYPE(R, DIAGNOSTIC) \ + _gl_verify_type<(R) ? 1 : -1> +# elif defined _GL_HAVE__STATIC_ASSERT +# define _GL_VERIFY_TYPE(R, DIAGNOSTIC) \ + struct { \ + _Static_assert (R, DIAGNOSTIC); \ + int _gl_dummy; \ + } +# else +# define _GL_VERIFY_TYPE(R, DIAGNOSTIC) \ + struct { unsigned int _gl_verify_error_if_negative: (R) ? 1 : -1; } +# endif + +/* Verify requirement R at compile-time, as a declaration without a + trailing ';'. If R is false, fail at compile-time, preferably + with a diagnostic that includes the string-literal DIAGNOSTIC. + + Unfortunately, unlike C1X, this implementation must appear as an + ordinary declaration, and cannot appear inside struct { ... }. */ + +# ifdef _GL_HAVE__STATIC_ASSERT +# define _GL_VERIFY _Static_assert +# else +# define _GL_VERIFY(R, DIAGNOSTIC) \ + extern int (*_GL_GENSYM (_gl_verify_function) (void)) \ + [_GL_VERIFY_TRUE (R, DIAGNOSTIC)] +# endif + +/* _GL_STATIC_ASSERT_H is defined if this code is copied into assert.h. */ +# ifdef _GL_STATIC_ASSERT_H +# if !defined _GL_HAVE__STATIC_ASSERT && !defined _Static_assert +# define _Static_assert(R, DIAGNOSTIC) _GL_VERIFY (R, DIAGNOSTIC) +# endif +# if !defined _GL_HAVE_STATIC_ASSERT && !defined static_assert +# define static_assert _Static_assert /* Draft C1X requires this #define. */ +# endif +# else + +/* Each of these macros verifies that its argument R is nonzero. To + be portable, R should be an integer constant expression. Unlike + assert (R), there is no run-time overhead. + + There are two macros, since no single macro can be used in all + contexts in C. verify_true (R) is for scalar contexts, including + integer constant expression contexts. verify (R) is for declaration + contexts, e.g., the top level. */ + /* Verify requirement R at compile-time, as an integer constant expression. Return 1. */ -# ifdef __cplusplus -template - struct verify_type__ { unsigned int verify_error_if_negative_size__: w; }; -# define verify_true(R) \ - (!!sizeof (verify_type__<(R) ? 1 : -1>)) -# elif HAVE__STATIC_ASSERT -# define verify_true(R) \ - (!!sizeof \ - (struct { \ - _Static_assert (R, "verify_true (" #R ")"); \ - int verify_dummy__; \ - })) -# elif HAVE_STATIC_ASSERT -# define verify_true(R) \ - (!!sizeof \ - (struct { \ - static_assert (R, "verify_true (" #R ")"); \ - int verify_dummy__; \ - })) -# else -# define verify_true(R) \ - (!!sizeof \ - (struct { unsigned int verify_error_if_negative_size__: (R) ? 1 : -1; })) -# endif +# define verify_true(R) _GL_VERIFY_TRUE (R, "verify_true (" #R ")") /* Verify requirement R at compile-time, as a declaration without a trailing ';'. */ -# if HAVE__STATIC_ASSERT -# define verify(R) _Static_assert (R, "verify (" #R ")") -# elif HAVE_STATIC_ASSERT -# define verify(R) static_assert (R, "verify (" #R ")") -# else -# define verify(R) \ - extern int (* _GL_GENSYM (verify_function) (void)) [verify_true (R)] +# define verify(R) _GL_VERIFY (R, "verify (" #R ")") + # endif #endif === modified file 'm4/gl-comp.m4' --- m4/gl-comp.m4 2011-04-26 19:29:47 +0000 +++ m4/gl-comp.m4 2011-05-04 07:19:21 +0000 @@ -51,6 +51,12 @@ # Code from module socklen: # Code from module ssize_t: # Code from module stat: + # Code from module stdarg: + dnl Some compilers (e.g., AIX 5.3 cc) need to be in c99 mode + dnl for the builtin va_copy to work. With Autoconf 2.60 or later, + dnl AC_PROG_CC_STDC arranges for this. With older Autoconf AC_PROG_CC_STDC + dnl shouldn't hurt, though installers are on their own to set c99 mode. + AC_REQUIRE([AC_PROG_CC_STDC]) # Code from module stdbool: # Code from module stddef: # Code from module stdint: @@ -84,87 +90,111 @@ m4_pushdef([gl_LIBSOURCES_DIR], []) gl_COMMON gl_source_base='lib' - # Code from module allocator: - # Code from module arg-nonnull: - # Code from module c++defs: - # Code from module careadlinkat: - AC_CHECK_FUNCS_ONCE([readlinkat]) - # Code from module crypto/md5: - gl_MD5 - # Code from module dosname: - # Code from module dtoastr: - AC_REQUIRE([gl_C99_STRTOLD]) - # Code from module extensions: - # Code from module filemode: - gl_FILEMODE - # Code from module getloadavg: - gl_GETLOADAVG([$gl_source_base]) - gl_STDLIB_MODULE_INDICATOR([getloadavg]) - # Code from module getopt-gnu: - gl_FUNC_GETOPT_GNU - gl_MODULE_INDICATOR_FOR_TESTS([getopt-gnu]) - # Code from module getopt-posix: - gl_FUNC_GETOPT_POSIX - # Code from module gettext-h: - AC_SUBST([LIBINTL]) - AC_SUBST([LTLIBINTL]) - # Code from module ignore-value: - AC_REQUIRE([AC_C_INLINE]) - # Code from module include_next: - # Code from module intprops: - # Code from module inttypes-incomplete: - gl_INTTYPES_INCOMPLETE - # Code from module lstat: - gl_FUNC_LSTAT - gl_SYS_STAT_MODULE_INDICATOR([lstat]) - # Code from module mktime: - gl_FUNC_MKTIME - gl_TIME_MODULE_INDICATOR([mktime]) - # Code from module multiarch: - gl_MULTIARCH - # Code from module readlink: - gl_FUNC_READLINK - gl_UNISTD_MODULE_INDICATOR([readlink]) - # Code from module socklen: - gl_TYPE_SOCKLEN_T - # Code from module ssize_t: - gt_TYPE_SSIZE_T - # Code from module stat: - gl_FUNC_STAT - gl_SYS_STAT_MODULE_INDICATOR([stat]) - # Code from module stdbool: - AM_STDBOOL_H - # Code from module stddef: - gl_STDDEF_H - # Code from module stdint: - gl_STDINT_H - # Code from module stdio: - gl_STDIO_H - # Code from module stdlib: - gl_STDLIB_H - # Code from module strftime: - gl_FUNC_GNU_STRFTIME - # Code from module strtoull: - gl_FUNC_STRTOULL - gl_STDLIB_MODULE_INDICATOR([strtoull]) - # Code from module strtoumax: - gl_FUNC_STRTOUMAX - gl_INTTYPES_MODULE_INDICATOR([strtoumax]) - # Code from module symlink: - gl_FUNC_SYMLINK - gl_UNISTD_MODULE_INDICATOR([symlink]) - # Code from module sys_stat: - gl_HEADER_SYS_STAT_H - AC_PROG_MKDIR_P - # Code from module time: - gl_HEADER_TIME_H - # Code from module time_r: - gl_TIME_R - gl_TIME_MODULE_INDICATOR([time_r]) - # Code from module unistd: - gl_UNISTD_H - # Code from module verify: - # Code from module warn-on-use: +AC_CHECK_FUNCS_ONCE([readlinkat]) +gl_MD5 +AC_REQUIRE([gl_C99_STRTOLD]) +gl_FILEMODE +gl_GETLOADAVG([$gl_source_base]) +gl_STDLIB_MODULE_INDICATOR([getloadavg]) +gl_FUNC_GETOPT_GNU +gl_MODULE_INDICATOR_FOR_TESTS([getopt-gnu]) +gl_FUNC_GETOPT_POSIX +AC_REQUIRE([AC_C_INLINE]) +gl_INTTYPES_INCOMPLETE +gl_FUNC_LSTAT +gl_SYS_STAT_MODULE_INDICATOR([lstat]) +gl_FUNC_MKTIME +gl_TIME_MODULE_INDICATOR([mktime]) +gl_MULTIARCH +gl_FUNC_READLINK +gl_UNISTD_MODULE_INDICATOR([readlink]) +gl_TYPE_SOCKLEN_T +gt_TYPE_SSIZE_T +gl_STDARG_H +AM_STDBOOL_H +gl_STDDEF_H +gl_STDINT_H +gl_STDIO_H +gl_STDLIB_H +gl_FUNC_GNU_STRFTIME +gl_FUNC_STRTOUMAX +gl_INTTYPES_MODULE_INDICATOR([strtoumax]) +gl_FUNC_SYMLINK +gl_UNISTD_MODULE_INDICATOR([symlink]) +gl_HEADER_SYS_STAT_H +AC_PROG_MKDIR_P +gl_HEADER_TIME_H +gl_TIME_R +gl_TIME_MODULE_INDICATOR([time_r]) +gl_UNISTD_H + gl_gnulib_enabled_dosname=false + gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36=false + gl_gnulib_enabled_stat=false + gl_gnulib_enabled_strtoull=false + gl_gnulib_enabled_verify=false + func_gl_gnulib_m4code_dosname () + { + if ! $gl_gnulib_enabled_dosname; then + gl_gnulib_enabled_dosname=true + fi + } + func_gl_gnulib_m4code_be453cec5eecf5731a274f2de7f2db36 () + { + if ! $gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36; then +AC_SUBST([LIBINTL]) +AC_SUBST([LTLIBINTL]) + gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36=true + fi + } + func_gl_gnulib_m4code_stat () + { + if ! $gl_gnulib_enabled_stat; then +gl_FUNC_STAT +gl_SYS_STAT_MODULE_INDICATOR([stat]) + gl_gnulib_enabled_stat=true + if $condition; then + func_gl_gnulib_m4code_dosname + fi + fi + } + func_gl_gnulib_m4code_strtoull () + { + if ! $gl_gnulib_enabled_strtoull; then +gl_FUNC_STRTOULL +gl_STDLIB_MODULE_INDICATOR([strtoull]) + gl_gnulib_enabled_strtoull=true + fi + } + func_gl_gnulib_m4code_verify () + { + if ! $gl_gnulib_enabled_verify; then + gl_gnulib_enabled_verify=true + fi + } + if test $GNULIB_UNISTD_H_GETOPT = 1; then + func_gl_gnulib_m4code_be453cec5eecf5731a274f2de7f2db36 + fi + if test $REPLACE_LSTAT = 1; then + func_gl_gnulib_m4code_dosname + fi + if test $REPLACE_LSTAT = 1; then + func_gl_gnulib_m4code_stat + fi + if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then + func_gl_gnulib_m4code_stat + fi + if test "$ac_cv_have_decl_strtoumax" != yes && test $ac_cv_func_strtoumax = no; then + func_gl_gnulib_m4code_verify + fi + if test "$ac_cv_have_decl_strtoumax" != yes && test $ac_cv_func_strtoumax = no && test $ac_cv_type_unsigned_long_long_int = yes; then + func_gl_gnulib_m4code_strtoull + fi + m4_pattern_allow([^gl_GNULIB_ENABLED_]) + AM_CONDITIONAL([gl_GNULIB_ENABLED_dosname], [$gl_gnulib_enabled_dosname]) + AM_CONDITIONAL([gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36], [$gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36]) + AM_CONDITIONAL([gl_GNULIB_ENABLED_stat], [$gl_gnulib_enabled_stat]) + AM_CONDITIONAL([gl_GNULIB_ENABLED_strtoull], [$gl_gnulib_enabled_strtoull]) + AM_CONDITIONAL([gl_GNULIB_ENABLED_verify], [$gl_gnulib_enabled_verify]) # End of code from modules m4_ifval(gl_LIBSOURCES_LIST, [ m4_syscmd([test ! -d ]m4_defn([gl_LIBSOURCES_DIR])[ || @@ -211,6 +241,7 @@ AC_SUBST([gltests_WITNESS]) gl_module_indicator_condition=$gltests_WITNESS m4_pushdef([gl_MODULE_INDICATOR_CONDITION], [$gl_module_indicator_condition]) + m4_pattern_allow([^gl_GNULIB_ENABLED_]) m4_popdef([gl_MODULE_INDICATOR_CONDITION]) m4_ifval(gltests_LIBSOURCES_LIST, [ m4_syscmd([test ! -d ]m4_defn([gltests_LIBSOURCES_DIR])[ || @@ -334,6 +365,7 @@ lib/mktime.c lib/readlink.c lib/stat.c + lib/stdarg.in.h lib/stdbool.in.h lib/stddef.in.h lib/stdint.in.h @@ -371,6 +403,7 @@ m4/ssize_t.m4 m4/st_dm_mode.m4 m4/stat.m4 + m4/stdarg.m4 m4/stdbool.m4 m4/stddef_h.m4 m4/stdint.m4 === added file 'm4/stdarg.m4' --- m4/stdarg.m4 1970-01-01 00:00:00 +0000 +++ m4/stdarg.m4 2011-05-04 07:19:21 +0000 @@ -0,0 +1,78 @@ +# stdarg.m4 serial 6 +dnl Copyright (C) 2006, 2008-2011 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Bruno Haible. +dnl Provide a working va_copy in combination with . + +AC_DEFUN([gl_STDARG_H], +[ + STDARG_H='' + NEXT_STDARG_H='' + AC_MSG_CHECKING([for va_copy]) + AC_CACHE_VAL([gl_cv_func_va_copy], [ + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include ]], + [[ +#ifndef va_copy +void (*func) (va_list, va_list) = va_copy; +#endif + ]])], + [gl_cv_func_va_copy=yes], + [gl_cv_func_va_copy=no])]) + AC_MSG_RESULT([$gl_cv_func_va_copy]) + if test $gl_cv_func_va_copy = no; then + dnl Provide a substitute. + dnl Usually a simple definition in is enough. Not so on AIX 5 + dnl with some versions of the /usr/vac/bin/cc compiler. It has an + dnl which does '#undef va_copy', leading to a missing va_copy symbol. For + dnl this platform, we use an substitute. But we cannot use this + dnl approach on other platforms, because often defines only + dnl preprocessor macros and gl_ABSOLUTE_HEADER, gl_CHECK_NEXT_HEADERS do + dnl not work in this situation. + AC_EGREP_CPP([vaccine], + [#if defined _AIX && !defined __GNUC__ + AIX vaccine + #endif + ], [gl_aixcc=yes], [gl_aixcc=no]) + if test $gl_aixcc = yes; then + dnl Provide a substitute file. + STDARG_H=stdarg.h + gl_NEXT_HEADERS([stdarg.h]) + dnl Fallback for the case when contains only macro definitions. + if test "$gl_cv_next_stdarg_h" = '""'; then + gl_cv_next_stdarg_h='"///usr/include/stdarg.h"' + NEXT_STDARG_H="$gl_cv_next_stdarg_h" + fi + else + dnl Provide a substitute in , either __va_copy or as a simple + dnl assignment. + gl_CACHE_VAL_SILENT([gl_cv_func___va_copy], [ + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include ]], + [[ +#ifndef __va_copy +error, bail out +#endif + ]])], + [gl_cv_func___va_copy=yes], + [gl_cv_func___va_copy=no])]) + if test $gl_cv_func___va_copy = yes; then + AC_DEFINE([va_copy], [__va_copy], + [Define as a macro for copying va_list variables.]) + else + AH_VERBATIM([gl_VA_COPY], [/* A replacement for va_copy, if needed. */ +#define gl_va_copy(a,b) ((a) = (b))]) + AC_DEFINE([va_copy], [gl_va_copy], + [Define as a macro for copying va_list variables.]) + fi + fi + fi + AC_SUBST([STDARG_H]) + AM_CONDITIONAL([GL_GENERATE_STDARG_H], [test -n "$STDARG_H"]) + AC_SUBST([NEXT_STDARG_H]) +]) === modified file 'm4/stdio_h.m4' --- m4/stdio_h.m4 2011-04-18 04:03:18 +0000 +++ m4/stdio_h.m4 2011-05-04 06:11:49 +0000 @@ -1,4 +1,4 @@ -# stdio_h.m4 serial 36 +# stdio_h.m4 serial 37 dnl Copyright (C) 2007-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -14,8 +14,6 @@ dnl likely needs them. GNULIB_FSCANF=1 GNULIB_SCANF=1 - GNULIB_VFSCANF=1 - GNULIB_VSCANF=1 GNULIB_FGETC=1 GNULIB_GETC=1 GNULIB_GETCHAR=1 === modified file 'nt/ChangeLog' --- nt/ChangeLog 2011-05-05 02:56:16 +0000 +++ nt/ChangeLog 2011-05-06 05:55:01 +0000 @@ -1,3 +1,11 @@ +2011-05-06 Paul Eggert + + * config.nt: Prepare to configure 64-bit integers for older compilers. + However, temporarily disable this change unless the temporary + symbol WIDE_EMACS_INT is defined. + (EMACS_INT, BITS_PER_EMACS_INT, pI): Define these if __int64 and + "%I64d" work but long long and "%lld" do not. + 2011-05-05 Ben Key * configure.bat: Added support for --cflags and --ldflags @@ -2082,4 +2090,3 @@ You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see . - === modified file 'nt/config.nt' --- nt/config.nt 2011-04-30 09:14:30 +0000 +++ nt/config.nt 2011-05-06 05:55:01 +0000 @@ -478,7 +478,22 @@ /* Define to 1 if the system has the type `unsigned long long int'. */ # define HAVE_UNSIGNED_LONG_LONG_INT 1 -#endif /* __MINGW32__ || _MSC_VER >= 1400 */ +#elif _MSC_VER >= 1200 + +/* Temporarily disable wider-than-pointer integers until they're tested more. + Build with CFLAGS='-DWIDE_EMACS_INT' to try them out. */ +/* #undef WIDE_EMACS_INT */ + +# ifdef WIDE_EMACS_INT + +/* Use pre-C99-style 64-bit integers. */ +# define EMACS_INT __int64 +# define BITS_PER_EMACS_INT 64 +# define pI "I64" + +# endif + +#endif #ifndef POINTER_TYPE #define POINTER_TYPE void @@ -518,4 +533,3 @@ /* Make a leaner executable. */ #define WIN32_LEAN_AND_MEAN 1 - === modified file 'src/ChangeLog' --- src/ChangeLog 2011-05-06 01:05:25 +0000 +++ src/ChangeLog 2011-05-06 06:30:56 +0000 @@ -1,3 +1,118 @@ +2011-05-06 Paul Eggert + + * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local. + + * term.c (vfatal): Remove stray call to va_end. + It's not needed and the C Standard doesn't allow it here anyway. + + Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux. + * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545) + + * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM + bytes. + + * term.c: Don't include , as does that. + + * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering. + + * process.c (Fformat_network_address): Fix typo: args2 -> *args2. + + * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times). + + * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601). + + * charset.h (struct charset.code_space): Now has 15 elements, not 16. + * charset.c (Fdefine_charset_internal): Don't initialize + charset.code_space[15]. The value was garbage, on hosts with + 32-bit int (Bug#8600). + + * lread.c (read_integer): Be more consistent with string-to-number. + Use string_to_number to do the actual conversion; this avoids + rounding errors and fixes some other screwups. Without this fix, + for example, #x1fffffffffffffff was misread as -2305843009213693952. + (digit_to_number): Move earlier, for benefit of read_integer. + Return -1 if the digit is out of range for the base, -2 if it is + not a digit in any supported base. (Bug#8602) + + * doprnt.c (doprnt): Support arbitrary pI values, such as "I64". + + * dispnew.c (scrolling_window): Return 1 if we scrolled, + to match comment at start of function. This also removes a + GCC warning about overflow in a 32+64-bit port. + + * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify. + + * dbusbind.c: Do not use XPNTR on a value that may be an integer. + Reported by Stefan Monnier in + . + (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages): Use + SYMBOLP-guarded XSYMBOL, not XPNTR. + + * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t. + (EMACS_UINTPTR): Likewise, with uintptr_t. + + * lisp.h: Prefer 64-bit EMACS_INT if available. + (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit + on 32-bit hosts that have 64-bit int, so that they can access + large files. + However, temporarily disable this change unless the temporary + symbol WIDE_EMACS_INT is defined. + + * lread.c, process.c: Do not include ; lisp.h does it now. + + Prefer intptr_t/uintptr_t for integers the same widths as pointers. + This removes an assumption that EMACS_INT and long are the same + width as pointers. The assumption is true for Emacs porting targets + now, but we want to make other targets possible. + * lisp.h: Include , for INTPTR_MAX, UINTPTR_MAX. + (EMACS_INTPTR, EMACS_UINTPTR): New macros. + In the rest of the code, change types of integers that hold casted + pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically + replacing EMACS_INT, long, EMACS_UINT, and unsigned long. + (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed. + (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here. + No need to cast type when ORing. + (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR. + * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast. + * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to + assume EMACS_INT is the same width as char *. + * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb): + (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item): + Remove no-longer-needed casts. + (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback): + (xg_tool_bar_help_callback, xg_make_tool_item): + Use EMACS_INTPTR to hold an integer + that will be cast to void *; this can avoid a GCC warning + if EMACS_INT is not the same width as void *. + * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast. + * xdisp.c (display_echo_area_1, resize_mini_window_1): + (current_message_1, set_message_1): + Use a local to convert to proper width without a cast. + * xmenu.c (dialog_selection_callback): Likewise. + + * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long. + Also, don't assume VALBITS / RAND_BITS is less than 5, + and don't rely on undefined behavior when shifting a 1 left into + the sign bit. + * lisp.h (get_random): Change signature to match. + + * lread.c (hash_string): Use size_t, not int, for hash computation. + Normally we prefer signed values; but hashing is special, because + it's better to use unsigned division on hash table sizes so that + the remainder is nonnegative. Also, size_t is the natural width + for hashing into memory. The previous code used 'int', which doesn't + retain enough info to hash well into very large tables. + (oblookup, oblookup_last_bucket_number, Funintern): Likewise. + + * dbusbind.c: Don't possibly lose pointer info when converting. + (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages): + Use XPNTR rather than XHASH, so that the high-order bits of + the pointer aren't lost when converting through void *. + + * eval.c (Fautoload): Don't double-shift a pointer. + + * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long. + 2011-05-06 Juanma Barranquero * gnutls.c (DEF_GNUTLS_FN): === modified file 'src/alloc.c' --- src/alloc.c 2011-04-26 06:17:52 +0000 +++ src/alloc.c 2011-04-29 17:56:27 +0000 @@ -438,7 +438,7 @@ ALIGNMENT must be a power of 2. */ #define ALIGN(ptr, ALIGNMENT) \ - ((POINTER_TYPE *) ((((EMACS_UINT)(ptr)) + (ALIGNMENT) - 1) \ + ((POINTER_TYPE *) ((((uintptr_t) (ptr)) + (ALIGNMENT) - 1) \ & ~((ALIGNMENT) - 1))) @@ -876,7 +876,7 @@ #define ABLOCKS_BYTES (sizeof (struct ablocks) - BLOCK_PADDING) #define ABLOCK_ABASE(block) \ - (((unsigned long) (block)->abase) <= (1 + 2 * ABLOCKS_SIZE) \ + (((uintptr_t) (block)->abase) <= (1 + 2 * ABLOCKS_SIZE) \ ? (struct ablocks *)(block) \ : (block)->abase) @@ -888,7 +888,7 @@ #define ABLOCKS_BASE(abase) (abase) #else #define ABLOCKS_BASE(abase) \ - (1 & (long) ABLOCKS_BUSY (abase) ? abase : ((void**)abase)[-1]) + (1 & (intptr_t) ABLOCKS_BUSY (abase) ? abase : ((void**)abase)[-1]) #endif /* The list of free ablock. */ @@ -914,7 +914,7 @@ if (!free_ablock) { int i; - EMACS_INT aligned; /* int gets warning casting to 64-bit pointer. */ + intptr_t aligned; /* int gets warning casting to 64-bit pointer. */ #ifdef DOUG_LEA_MALLOC /* Prevent mmap'ing the chunk. Lisp data may not be mmap'ed @@ -977,17 +977,18 @@ abase->blocks[i].x.next_free = free_ablock; free_ablock = &abase->blocks[i]; } - ABLOCKS_BUSY (abase) = (struct ablocks *) (long) aligned; + ABLOCKS_BUSY (abase) = (struct ablocks *) aligned; - eassert (0 == ((EMACS_UINT)abase) % BLOCK_ALIGN); + eassert (0 == ((uintptr_t) abase) % BLOCK_ALIGN); eassert (ABLOCK_ABASE (&abase->blocks[3]) == abase); /* 3 is arbitrary */ eassert (ABLOCK_ABASE (&abase->blocks[0]) == abase); eassert (ABLOCKS_BASE (abase) == base); - eassert (aligned == (long) ABLOCKS_BUSY (abase)); + eassert (aligned == (intptr_t) ABLOCKS_BUSY (abase)); } abase = ABLOCK_ABASE (free_ablock); - ABLOCKS_BUSY (abase) = (struct ablocks *) (2 + (long) ABLOCKS_BUSY (abase)); + ABLOCKS_BUSY (abase) = + (struct ablocks *) (2 + (intptr_t) ABLOCKS_BUSY (abase)); val = free_ablock; free_ablock = free_ablock->x.next_free; @@ -1000,7 +1001,7 @@ if (!val && nbytes) memory_full (); - eassert (0 == ((EMACS_UINT)val) % BLOCK_ALIGN); + eassert (0 == ((uintptr_t) val) % BLOCK_ALIGN); return val; } @@ -1018,11 +1019,12 @@ ablock->x.next_free = free_ablock; free_ablock = ablock; /* Update busy count. */ - ABLOCKS_BUSY (abase) = (struct ablocks *) (-2 + (long) ABLOCKS_BUSY (abase)); + ABLOCKS_BUSY (abase) = + (struct ablocks *) (-2 + (intptr_t) ABLOCKS_BUSY (abase)); - if (2 > (long) ABLOCKS_BUSY (abase)) + if (2 > (intptr_t) ABLOCKS_BUSY (abase)) { /* All the blocks are free. */ - int i = 0, aligned = (long) ABLOCKS_BUSY (abase); + int i = 0, aligned = (intptr_t) ABLOCKS_BUSY (abase); struct ablock **tem = &free_ablock; struct ablock *atop = &abase->blocks[aligned ? ABLOCKS_SIZE : ABLOCKS_SIZE - 1]; @@ -1039,7 +1041,7 @@ eassert ((aligned & 1) == aligned); eassert (i == (aligned ? ABLOCKS_SIZE : ABLOCKS_SIZE - 1)); #ifdef USE_POSIX_MEMALIGN - eassert ((unsigned long)ABLOCKS_BASE (abase) % BLOCK_ALIGN == 0); + eassert ((uintptr_t) ABLOCKS_BASE (abase) % BLOCK_ALIGN == 0); #endif free (ABLOCKS_BASE (abase)); } @@ -1772,7 +1774,7 @@ s = string_free_list; while (s != NULL) { - if ((unsigned long)s < 1024) + if ((uintptr_t) s < 1024) abort(); s = NEXT_FREE_LISP_STRING (s); } @@ -2432,10 +2434,10 @@ &= ~(1 << ((n) % (sizeof(int) * CHAR_BIT))) #define FLOAT_BLOCK(fptr) \ - ((struct float_block *)(((EMACS_UINT)(fptr)) & ~(BLOCK_ALIGN - 1))) + ((struct float_block *) (((uintptr_t) (fptr)) & ~(BLOCK_ALIGN - 1))) #define FLOAT_INDEX(fptr) \ - ((((EMACS_UINT)(fptr)) & (BLOCK_ALIGN - 1)) / sizeof (struct Lisp_Float)) + ((((uintptr_t) (fptr)) & (BLOCK_ALIGN - 1)) / sizeof (struct Lisp_Float)) struct float_block { @@ -2544,10 +2546,10 @@ / (sizeof (struct Lisp_Cons) * CHAR_BIT + 1)) #define CONS_BLOCK(fptr) \ - ((struct cons_block *)(((EMACS_UINT)(fptr)) & ~(BLOCK_ALIGN - 1))) + ((struct cons_block *) ((uintptr_t) (fptr) & ~(BLOCK_ALIGN - 1))) #define CONS_INDEX(fptr) \ - ((((EMACS_UINT)(fptr)) & (BLOCK_ALIGN - 1)) / sizeof (struct Lisp_Cons)) + (((uintptr_t) (fptr) & (BLOCK_ALIGN - 1)) / sizeof (struct Lisp_Cons)) struct cons_block { @@ -4021,7 +4023,7 @@ struct mem_node *m; /* Quickly rule out some values which can't point to Lisp data. */ - if ((EMACS_INT) p % + if ((intptr_t) p % #ifdef USE_LSB_TAG 8 /* USE_LSB_TAG needs Lisp data to be aligned on multiples of 8. */ #else @@ -6072,7 +6074,7 @@ { Lisp_Object end; - XSETINT (end, (EMACS_INT) (char *) sbrk (0) / 1024); + XSETINT (end, (intptr_t) (char *) sbrk (0) / 1024); return end; } === modified file 'src/callproc.c' --- src/callproc.c 2011-05-04 14:03:16 +0000 +++ src/callproc.c 2011-05-06 07:13:19 +0000 @@ -193,7 +193,6 @@ int count = SPECPDL_INDEX (); volatile USE_SAFE_ALLOCA; - const unsigned char **volatile new_argv_volatile; register const unsigned char **new_argv; /* File to use for stderr in the child. t means use same as standard output. */ @@ -416,7 +415,6 @@ SAFE_ALLOCA (new_argv, const unsigned char **, (nargs > 4 ? nargs - 2 : 2) * sizeof *new_argv); - new_argv_volatile = new_argv; if (nargs > 4) { register size_t i; @@ -591,9 +589,20 @@ BLOCK_INPUT; - pid = vfork (); - - new_argv = new_argv_volatile; + /* vfork, and prevent local vars from being clobbered by the vfork. */ + { + int volatile fd_error_volatile = fd_error; + int volatile fd_output_volatile = fd_output; + int volatile output_to_buffer_volatile = output_to_buffer; + unsigned char const **volatile new_argv_volatile = new_argv; + + pid = vfork (); + + fd_error = fd_error_volatile; + fd_output = fd_output_volatile; + output_to_buffer = output_to_buffer_volatile; + new_argv = new_argv_volatile; + } if (pid == 0) { === modified file 'src/charset.c' --- src/charset.c 2011-04-26 06:17:52 +0000 +++ src/charset.c 2011-05-01 16:27:34 +0000 @@ -869,7 +869,7 @@ ASET (attrs, charset_name, args[charset_arg_name]); val = args[charset_arg_code_space]; - for (i = 0, dimension = 0, nchars = 1; i < 4; i++) + for (i = 0, dimension = 0, nchars = 1; ; i++) { int min_byte, max_byte; @@ -880,10 +880,12 @@ charset.code_space[i * 4] = min_byte; charset.code_space[i * 4 + 1] = max_byte; charset.code_space[i * 4 + 2] = max_byte - min_byte + 1; + if (max_byte > 0) + dimension = i + 1; + if (i == 3) + break; nchars *= charset.code_space[i * 4 + 2]; charset.code_space[i * 4 + 3] = nchars; - if (max_byte > 0) - dimension = i + 1; } val = args[charset_arg_dimension]; === modified file 'src/charset.h' --- src/charset.h 2011-04-11 06:48:18 +0000 +++ src/charset.h 2011-05-01 16:27:34 +0000 @@ -155,10 +155,11 @@ byte code of the (N+1)th dimension, [4N+1] is a maximum byte code of the (N+1)th dimension, [4N+2] is ([4N+1] - [4N] + 1), [4N+3] - is a number of characters containd in the first to (N+1)th - dismesions. We get `char-index' of a `code-point' from this + is the number of characters contained in the first through (N+1)th + dimensions, except that there is no [15]. + We get `char-index' of a `code-point' from this information. */ - int code_space[16]; + int code_space[15]; /* If B is a byte of Nth dimension of a code-point, the (N-1)th bit of code_space_mask[B] is set. This array is used to quickly === modified file 'src/coding.c' --- src/coding.c 2011-04-29 19:47:29 +0000 +++ src/coding.c 2011-05-01 23:37:08 +0000 @@ -5368,8 +5368,8 @@ if (src == src_end) goto too_short; ONE_MORE_BYTE (c); - if (c < charset->code_space[(dim - 1 - idx) * 2] - || c > charset->code_space[(dim - 1 - idx) * 2 + 1]) + if (c < charset->code_space[(dim - 1 - idx) * 4] + || c > charset->code_space[(dim - 1 - idx) * 4 + 1]) break; } if (idx < dim) === modified file 'src/dbusbind.c' --- src/dbusbind.c 2011-04-19 00:34:42 +0000 +++ src/dbusbind.c 2011-04-30 01:06:41 +0000 @@ -892,7 +892,7 @@ return; /* Unset session environment. */ - if (data != NULL && data == (void*) XHASH (QCdbus_session_bus)) + if (SYMBOLP (QCdbus_session_bus) && XSYMBOL (QCdbus_session_bus) == data) { XD_DEBUG_MESSAGE ("unsetenv DBUS_SESSION_BUS_ADDRESS"); unsetenv ("DBUS_SESSION_BUS_ADDRESS"); @@ -920,6 +920,8 @@ { DBusConnection *connection; + CHECK_SYMBOL (bus); + /* Open a connection to the bus. */ connection = xd_initialize (bus, TRUE); @@ -929,7 +931,7 @@ xd_add_watch, xd_remove_watch, xd_toggle_watch, - (void*) XHASH (bus), NULL)) + XSYMBOL (bus), NULL)) XD_SIGNAL1 (build_string ("Cannot add watch functions")); /* Add bus to list of registered buses. */ @@ -1824,7 +1826,7 @@ if (data != NULL) while (!NILP (busp)) { - if (data == (void*) XHASH (CAR_SAFE (busp))) + if (SYMBOLP (CAR_SAFE (busp)) && XSYMBOL (CAR_SAFE (busp)) == data) bus = CAR_SAFE (busp); busp = CDR_SAFE (busp); } === modified file 'src/dispnew.c' --- src/dispnew.c 2011-04-25 21:34:39 +0000 +++ src/dispnew.c 2011-04-30 15:40:06 +0000 @@ -4576,8 +4576,8 @@ for (i = 0; i < row_entry_idx; ++i) row_table[row_entry_pool[i].bucket] = NULL; - /* Value is > 0 to indicate that we scrolled the display. */ - return nruns; + /* Value is 1 to indicate that we scrolled the display. */ + return 0 < nruns; } === modified file 'src/doc.c' --- src/doc.c 2011-04-27 19:05:21 +0000 +++ src/doc.c 2011-05-06 07:13:19 +0000 @@ -349,10 +349,10 @@ return Qnil; /* FIXME: This is not portable, as it assumes that string pointers have the top bit clear. */ - else if ((EMACS_INT) XSUBR (fun)->doc >= 0) + else if ((intptr_t) XSUBR (fun)->doc >= 0) doc = build_string (XSUBR (fun)->doc); else - doc = make_number ((EMACS_INT) XSUBR (fun)->doc); + doc = make_number ((intptr_t) XSUBR (fun)->doc); } else if (COMPILEDP (fun)) { @@ -507,7 +507,10 @@ /* Lisp_Subrs have a slot for it. */ if (SUBRP (fun)) - XSUBR (fun)->doc = (char *) - offset; + { + intptr_t negative_offset = - offset; + XSUBR (fun)->doc = (char *) negative_offset; + } /* If it's a lisp form, stick it in the form. */ else if (CONSP (fun)) === modified file 'src/doprnt.c' --- src/doprnt.c 2011-04-29 19:34:06 +0000 +++ src/doprnt.c 2011-04-30 20:05:43 +0000 @@ -70,9 +70,9 @@ %character where flags is [+ -0], width is [0-9]+, precision is .[0-9]+, and length - is empty or l or ll. Also, %% in a format stands for a single % in the - output. A % that does not introduce a valid %-sequence causes - undefined behavior. + is empty or l or the value of the pI macro. Also, %% in a format + stands for a single % in the output. A % that does not introduce a + valid %-sequence causes undefined behavior. The + flag character inserts a + before any positive number, while a space inserts a space before any positive number; these flags only affect %d, %o, @@ -85,11 +85,8 @@ modifier: it is supported for %d, %o, and %x conversions of integral arguments, must immediately precede the conversion specifier, and means that the respective argument is to be treated as `long int' or `unsigned long - int'. Similarly, ll (two letter ells) means to use `long long int' or - `unsigned long long int'; this can be used only on hosts that have - these two types. The empty length modifier means to use `int' or - `unsigned int'. EMACS_INT arguments should use the pI macro, which - expands to whatever length modifier is needed for the target host. + int'. Similarly, the value of the pI macro means to use EMACS_INT or + EMACS_UINT and the empty length modifier means `int' or `unsigned int'. The width specifier supplies a lower limit for the length of the printed representation. The padding, if any, normally goes on the left, but it goes @@ -186,6 +183,7 @@ size_t size_bound = 0; EMACS_INT width; /* Columns occupied by STRING on display. */ int long_flag = 0; + int pIlen = sizeof pI - 1; fmt++; /* Copy this one %-spec into fmtcpy. */ @@ -201,7 +199,7 @@ %1.1000f and %1000.1f both might need 1000+ bytes. Parse the width or precision, checking for overflow. */ size_t n = *fmt - '0'; - while (fmt < format_end + while (fmt + 1 < format_end && '0' <= fmt[1] && fmt[1] <= '9') { /* Avoid size_t overflow. Avoid int overflow too, as @@ -218,20 +216,25 @@ if (size_bound < n) size_bound = n; } - else if (*fmt == '-' || *fmt == ' ' || *fmt == '.' || *fmt == '+') - ; - else if (*fmt == 'l') - { - long_flag = 1 + (fmt + 1 < format_end && fmt[1] == 'l'); - fmt += long_flag; - break; - } - else + else if (! (*fmt == '-' || *fmt == ' ' || *fmt == '.' + || *fmt == '+')) break; fmt++; } - if (fmt > format_end) - fmt = format_end; + + if (0 < pIlen && pIlen <= format_end - fmt + && memcmp (fmt, pI, pIlen) == 0) + { + long_flag = 2; + memcpy (string, fmt + 1, pIlen); + string += pIlen; + fmt += pIlen; + } + else if (fmt < format_end && *fmt == 'l') + { + long_flag = 1; + *string++ = *++fmt; + } *string = 0; /* Make the size bound large enough to handle floating point formats @@ -253,8 +256,7 @@ switch (*fmt++) { default: - error ("Invalid format operation %%%s%c", - "ll" + 2 - long_flag, fmt[-1]); + error ("Invalid format operation %s", fmtcpy); /* case 'b': */ case 'l': @@ -265,12 +267,8 @@ if (1 < long_flag) { -#ifdef HAVE_LONG_LONG_INT - long long ll = va_arg (ap, long long); + EMACS_INT ll = va_arg (ap, EMACS_INT); sprintf (sprintf_buffer, fmtcpy, ll); -#else - error ("Invalid format operation %%ll%c", fmt[-1]); -#endif } else if (long_flag) { @@ -295,12 +293,8 @@ if (1 < long_flag) { -#ifdef HAVE_UNSIGNED_LONG_LONG_INT - unsigned long long ull = va_arg (ap, unsigned long long); + EMACS_UINT ull = va_arg (ap, EMACS_UINT); sprintf (sprintf_buffer, fmtcpy, ull); -#else - error ("Invalid format operation %%ll%c", fmt[-1]); -#endif } else if (long_flag) { === modified file 'src/eval.c' --- src/eval.c 2011-04-29 11:01:11 +0000 +++ src/eval.c 2011-05-04 07:19:21 +0000 @@ -1994,7 +1994,7 @@ { char buf[4000]; size_t size = sizeof buf; - size_t size_max = min (MOST_POSITIVE_FIXNUM, SIZE_MAX); + size_t size_max = min (MOST_POSITIVE_FIXNUM + 1, SIZE_MAX); size_t mlen = strlen (m); char *buffer = buf; size_t used; @@ -2002,7 +2002,10 @@ while (1) { - used = doprnt (buffer, size, m, m + mlen, ap); + va_list ap_copy; + va_copy (ap_copy, ap); + used = doprnt (buffer, size, m, m + mlen, ap_copy); + va_end (ap_copy); /* Note: the -1 below is because `doprnt' returns the number of bytes excluding the terminating null byte, and it always terminates with a @@ -2144,7 +2147,7 @@ We used to use 0 here, but that leads to accidental sharing in purecopy's hash-consing, so we use a (hopefully) unique integer instead. */ - docstring = make_number (XHASH (function)); + docstring = make_number (XPNTR (function)); return Ffset (function, Fpurecopy (list5 (Qautoload, file, docstring, interactive, type))); === modified file 'src/fns.c' --- src/fns.c 2011-04-25 07:14:46 +0000 +++ src/fns.c 2011-04-28 00:43:18 +0000 @@ -75,7 +75,7 @@ { EMACS_INT val; Lisp_Object lispy_val; - unsigned long denominator; + EMACS_UINT denominator; if (EQ (limit, Qt)) seed_random (getpid () + time (NULL)); @@ -88,7 +88,7 @@ it's possible to get a quotient larger than n; discarding these values eliminates the bias that would otherwise appear when using a large n. */ - denominator = ((unsigned long)1 << VALBITS) / XFASTINT (limit); + denominator = ((EMACS_UINT) 1 << VALBITS) / XFASTINT (limit); do val = get_random () / denominator; while (val >= XFASTINT (limit)); === modified file 'src/gtkutil.c' --- src/gtkutil.c 2011-04-19 07:10:55 +0000 +++ src/gtkutil.c 2011-04-29 17:56:27 +0000 @@ -3354,7 +3354,7 @@ static void xg_gtk_scroll_destroy (GtkWidget *widget, gpointer data) { - int id = (int) (EMACS_INT) data; /* The EMACS_INT cast avoids a warning. */ + int id = (intptr_t) data; xg_remove_widget_from_map (id); } @@ -3375,7 +3375,7 @@ { GtkWidget *wscroll; GtkWidget *webox; - int scroll_id; + intptr_t scroll_id; #ifdef HAVE_GTK3 GtkAdjustment *vadj; #else @@ -3397,11 +3397,10 @@ scroll_id = xg_store_widget_in_map (wscroll); - /* The EMACS_INT cast avoids a warning. */ g_signal_connect (G_OBJECT (wscroll), "destroy", G_CALLBACK (xg_gtk_scroll_destroy), - (gpointer) (EMACS_INT) scroll_id); + (gpointer) scroll_id); g_signal_connect (G_OBJECT (wscroll), "change-value", scroll_callback, @@ -3663,8 +3662,8 @@ GdkEventButton *event, gpointer user_data) { - /* Casts to avoid warnings when gpointer is 64 bits and int is 32 bits */ - gpointer ptr = (gpointer) (EMACS_INT) event->state; + intptr_t state = event->state; + gpointer ptr = (gpointer) state; g_object_set_data (G_OBJECT (widget), XG_TOOL_BAR_LAST_MODIFIER, ptr); return FALSE; } @@ -3678,10 +3677,9 @@ static void xg_tool_bar_callback (GtkWidget *w, gpointer client_data) { - /* The EMACS_INT cast avoids a warning. */ - int idx = (int) (EMACS_INT) client_data; + intptr_t idx = (intptr_t) client_data; gpointer gmod = g_object_get_data (G_OBJECT (w), XG_TOOL_BAR_LAST_MODIFIER); - int mod = (int) (EMACS_INT) gmod; + intptr_t mod = (intptr_t) gmod; FRAME_PTR f = (FRAME_PTR) g_object_get_data (G_OBJECT (w), XG_FRAME_DATA); Lisp_Object key, frame; @@ -3960,8 +3958,7 @@ GdkEventCrossing *event, gpointer client_data) { - /* The EMACS_INT cast avoids a warning. */ - int idx = (int) (EMACS_INT) client_data; + intptr_t idx = (intptr_t) client_data; FRAME_PTR f = (FRAME_PTR) g_object_get_data (G_OBJECT (w), XG_FRAME_DATA); Lisp_Object help, frame; @@ -4155,14 +4152,16 @@ if (wimage) { - /* The EMACS_INT cast avoids a warning. */ + intptr_t ii = i; + gpointer gi = (gpointer) ii; + g_signal_connect (G_OBJECT (ti), "create-menu-proxy", G_CALLBACK (xg_tool_bar_menu_proxy), - (gpointer) (EMACS_INT) i); + gi); g_signal_connect (G_OBJECT (wb), "clicked", G_CALLBACK (xg_tool_bar_callback), - (gpointer) (EMACS_INT) i); + gi); g_object_set_data (G_OBJECT (weventbox), XG_FRAME_DATA, (gpointer)f); @@ -4193,11 +4192,11 @@ g_signal_connect (G_OBJECT (weventbox), "enter-notify-event", G_CALLBACK (xg_tool_bar_help_callback), - (gpointer) (EMACS_INT) i); + gi); g_signal_connect (G_OBJECT (weventbox), "leave-notify-event", G_CALLBACK (xg_tool_bar_help_callback), - (gpointer) (EMACS_INT) i); + gi); } if (wbutton) *wbutton = wb; === modified file 'src/image.c' --- src/image.c 2011-05-06 01:05:25 +0000 +++ src/image.c 2011-05-06 06:30:56 +0000 @@ -8602,11 +8602,9 @@ of `dynamic-library-alist', which see). */) (Lisp_Object type, Lisp_Object libraries) { - Lisp_Object tested; - #ifdef HAVE_NTGUI /* Don't try to reload the library. */ - tested = Fassq (type, Vlibrary_cache); + Lisp_Object tested = Fassq (type, Vlibrary_cache); if (CONSP (tested)) return XCDR (tested); #endif === modified file 'src/lisp.h' --- src/lisp.h 2011-05-01 00:04:17 +0000 +++ src/lisp.h 2011-05-06 05:55:01 +0000 @@ -22,6 +22,7 @@ #include #include +#include /* Use the configure flag --enable-checking[=LIST] to enable various types of run time checks for Lisp objects. */ @@ -33,25 +34,28 @@ #define CHECK_CONS_LIST() ((void) 0) #endif +/* Temporarily disable wider-than-pointer integers until they're tested more. + Build with CFLAGS='-DWIDE_EMACS_INT' to try them out. */ +/* #undef WIDE_EMACS_INT */ + /* These are default choices for the types to use. */ -#ifdef _LP64 -#ifndef EMACS_INT -#define EMACS_INT long -#define BITS_PER_EMACS_INT BITS_PER_LONG -#define pI "l" -#endif -#ifndef EMACS_UINT -#define EMACS_UINT unsigned long -#endif -#else /* not _LP64 */ -#ifndef EMACS_INT -#define EMACS_INT int -#define BITS_PER_EMACS_INT BITS_PER_INT -#define pI "" -#endif -#ifndef EMACS_UINT -#define EMACS_UINT unsigned int -#endif +#ifndef EMACS_INT +# if BITS_PER_LONG < BITS_PER_LONG_LONG && defined WIDE_EMACS_INT +# define EMACS_INT long long +# define BITS_PER_EMACS_INT BITS_PER_LONG_LONG +# define pI "ll" +# elif BITS_PER_INT < BITS_PER_LONG +# define EMACS_INT long +# define BITS_PER_EMACS_INT BITS_PER_LONG +# define pI "l" +# else +# define EMACS_INT int +# define BITS_PER_EMACS_INT BITS_PER_INT +# define pI "" +# endif +#endif +#ifndef EMACS_UINT +# define EMACS_UINT unsigned EMACS_INT #endif /* Extra internal type checking? */ @@ -398,7 +402,7 @@ #ifdef USE_LSB_TAG #define TYPEMASK ((((EMACS_INT) 1) << GCTYPEBITS) - 1) -#define XTYPE(a) ((enum Lisp_Type) (((EMACS_UINT) (a)) & TYPEMASK)) +#define XTYPE(a) ((enum Lisp_Type) ((a) & TYPEMASK)) #ifdef USE_2_TAGS_FOR_INTS # define XINT(a) (((EMACS_INT) (a)) >> (GCTYPEBITS - 1)) # define XUINT(a) (((EMACS_UINT) (a)) >> (GCTYPEBITS - 1)) @@ -408,11 +412,11 @@ # define XUINT(a) (((EMACS_UINT) (a)) >> GCTYPEBITS) # define make_number(N) (((EMACS_INT) (N)) << GCTYPEBITS) #endif -#define XSET(var, type, ptr) \ - (eassert (XTYPE (ptr) == 0), /* Check alignment. */ \ - (var) = ((EMACS_INT) (type)) | ((EMACS_INT) (ptr))) +#define XSET(var, type, ptr) \ + (eassert (XTYPE ((intptr_t) (ptr)) == 0), /* Check alignment. */ \ + (var) = (type) | (intptr_t) (ptr)) -#define XPNTR(a) ((EMACS_INT) ((a) & ~TYPEMASK)) +#define XPNTR(a) ((intptr_t) ((a) & ~TYPEMASK)) #else /* not USE_LSB_TAG */ @@ -446,14 +450,14 @@ #define XSET(var, type, ptr) \ ((var) = ((EMACS_INT) ((EMACS_UINT) (type) << VALBITS) \ - + ((EMACS_INT) (ptr) & VALMASK))) + + ((intptr_t) (ptr) & VALMASK))) #ifdef DATA_SEG_BITS /* DATA_SEG_BITS forces extra bits to be or'd in with any pointers which were stored in a Lisp_Object */ -#define XPNTR(a) ((EMACS_UINT) (((a) & VALMASK) | DATA_SEG_BITS)) +#define XPNTR(a) ((uintptr_t) (((a) & VALMASK)) | DATA_SEG_BITS)) #else -#define XPNTR(a) ((EMACS_UINT) ((a) & VALMASK)) +#define XPNTR(a) ((uintptr_t) ((a) & VALMASK)) #endif #endif /* not USE_LSB_TAG */ @@ -479,7 +483,7 @@ /* Some versions of gcc seem to consider the bitfield width when issuing the "cast to pointer from integer of different size" warning, so the cast is here to widen the value back to its natural size. */ -# define XPNTR(v) ((EMACS_INT)((v).s.val) << GCTYPEBITS) +# define XPNTR(v) ((intptr_t) (v).s.val << GCTYPEBITS) #else /* !USE_LSB_TAG */ @@ -495,9 +499,9 @@ #ifdef DATA_SEG_BITS /* DATA_SEG_BITS forces extra bits to be or'd in with any pointers which were stored in a Lisp_Object */ -#define XPNTR(a) (XUINT (a) | DATA_SEG_BITS) +#define XPNTR(a) ((intptr_t) (XUINT (a) | DATA_SEG_BITS)) #else -#define XPNTR(a) ((EMACS_INT) XUINT (a)) +#define XPNTR(a) ((intptr_t) XUINT (a)) #endif #endif /* !USE_LSB_TAG */ @@ -1814,8 +1818,8 @@ XSETCDR ((x), tmp); \ } while (0) -/* Cast pointers to this type to compare them. Some machines want int. */ -#define PNTR_COMPARISON_TYPE EMACS_UINT +/* Cast pointers to this type to compare them. */ +#define PNTR_COMPARISON_TYPE uintptr_t /* Define a built-in function for calling from Lisp. `lname' should be the name to give the function in Lisp, @@ -3354,7 +3358,7 @@ extern void child_setup_tty (int); extern void setup_pty (int); extern int set_window_size (int, int, int); -extern long get_random (void); +extern EMACS_INT get_random (void); extern void seed_random (long); extern int emacs_open (const char *, int, int); extern int emacs_close (int); === modified file 'src/lread.c' --- src/lread.c 2011-05-05 16:56:39 +0000 +++ src/lread.c 2011-05-06 06:30:56 +0000 @@ -19,7 +19,6 @@ #include -#include #include #include #include @@ -2250,6 +2249,26 @@ } } +/* Return the digit that CHARACTER stands for in the given BASE. + Return -1 if CHARACTER is out of range for BASE, + and -2 if CHARACTER is not valid for any supported BASE. */ +static inline int +digit_to_number (int character, int base) +{ + int digit; + + if ('0' <= character && character <= '9') + digit = character - '0'; + else if ('a' <= character && character <= 'z') + digit = character - 'a' + 10; + else if ('A' <= character && character <= 'Z') + digit = character - 'A' + 10; + else + return -2; + + return digit < base ? digit : -1; +} + /* Read an integer in radix RADIX using READCHARFUN to read characters. RADIX must be in the interval [2..36]; if it isn't, a read error is signaled . Value is the integer read. Signals an @@ -2259,59 +2278,64 @@ static Lisp_Object read_integer (Lisp_Object readcharfun, int radix) { - int ndigits = 0, invalid_p, c, sign = 0; - /* We use a floating point number because */ - double number = 0; + /* Room for sign, leading 0, other digits, trailing null byte. */ + char buf[1 + 1 + sizeof (uintmax_t) * CHAR_BIT + 1]; + + int valid = -1; /* 1 if valid, 0 if not, -1 if incomplete. */ if (radix < 2 || radix > 36) - invalid_p = 1; + valid = 0; else { - number = ndigits = invalid_p = 0; - sign = 1; + char *p = buf; + int c, digit; c = READCHAR; - if (c == '-') + if (c == '-' || c == '+') { + *p++ = c; c = READCHAR; - sign = -1; - } - else if (c == '+') - c = READCHAR; - - while (c >= 0) - { - int digit; - - if (c >= '0' && c <= '9') - digit = c - '0'; - else if (c >= 'a' && c <= 'z') - digit = c - 'a' + 10; - else if (c >= 'A' && c <= 'Z') - digit = c - 'A' + 10; + } + + if (c == '0') + { + *p++ = c; + valid = 1; + + /* Ignore redundant leading zeros, so the buffer doesn't + fill up with them. */ + do + c = READCHAR; + while (c == '0'); + } + + while (-1 <= (digit = digit_to_number (c, radix))) + { + if (digit == -1) + valid = 0; + if (valid < 0) + valid = 1; + + if (p < buf + sizeof buf - 1) + *p++ = c; else - { - UNREAD (c); - break; - } - - if (digit < 0 || digit >= radix) - invalid_p = 1; - - number = radix * number + digit; - ++ndigits; + valid = 0; + c = READCHAR; } + + if (c >= 0) + UNREAD (c); + *p = '\0'; } - if (ndigits == 0 || invalid_p) + if (! valid) { - char buf[50]; sprintf (buf, "integer, radix %d", radix); invalid_syntax (buf, 0); } - return make_fixnum_or_float (sign * number); + return string_to_number (buf, radix, 0); } @@ -3170,23 +3194,6 @@ } -static inline int -digit_to_number (int character, int base) -{ - int digit; - - if ('0' <= character && character <= '9') - digit = character - '0'; - else if ('a' <= character && character <= 'z') - digit = character - 'a' + 10; - else if ('A' <= character && character <= 'Z') - digit = character - 'A' + 10; - else - return -1; - - return digit < base ? digit : -1; -} - #define LEAD_INT 1 #define DOT_CHAR 2 #define TRAIL_INT 4 @@ -3615,9 +3622,9 @@ /* oblookup stores the bucket number here, for the sake of Funintern. */ -static int oblookup_last_bucket_number; +static size_t oblookup_last_bucket_number; -static int hash_string (const char *ptr, int len); +static size_t hash_string (const char *ptr, size_t len); /* Get an error if OBARRAY is not an obarray. If it is one, return it. */ @@ -3759,7 +3766,7 @@ (Lisp_Object name, Lisp_Object obarray) { register Lisp_Object string, tem; - int hash; + size_t hash; if (NILP (obarray)) obarray = Vobarray; obarray = check_obarray (obarray); @@ -3828,8 +3835,8 @@ Lisp_Object oblookup (Lisp_Object obarray, register const char *ptr, EMACS_INT size, EMACS_INT size_byte) { - int hash; - int obsize; + size_t hash; + size_t obsize; register Lisp_Object tail; Lisp_Object bucket, tem; @@ -3862,21 +3869,21 @@ return tem; } -static int -hash_string (const char *ptr, int len) +static size_t +hash_string (const char *ptr, size_t len) { register const char *p = ptr; register const char *end = p + len; register unsigned char c; - register int hash = 0; + register size_t hash = 0; while (p != end) { c = *p++; if (c >= 0140) c -= 40; - hash = ((hash<<3) + (hash>>28) + c); + hash = (hash << 3) + (hash >> (CHAR_BIT * sizeof hash - 4)) + c; } - return hash & 07777777777; + return hash; } void === modified file 'src/menu.c' --- src/menu.c 2011-04-16 15:11:41 +0000 +++ src/menu.c 2011-04-29 17:56:27 +0000 @@ -800,9 +800,9 @@ if (!NILP (descrip)) wv->lkey = descrip; wv->value = 0; - /* The EMACS_INT cast avoids a warning. There's no problem + /* The intptr_t cast avoids a warning. There's no problem as long as pointers have enough bits to hold small integers. */ - wv->call_data = (!NILP (def) ? (void *) (EMACS_INT) i : 0); + wv->call_data = (!NILP (def) ? (void *) (intptr_t) i : 0); wv->enabled = !NILP (enable); if (NILP (type)) @@ -911,9 +911,9 @@ else { entry = XVECTOR (vector)->contents[i + MENU_ITEMS_ITEM_VALUE]; - /* The EMACS_INT cast avoids a warning. There's no problem + /* Treat the pointer as an integer. There's no problem as long as pointers have enough bits to hold small integers. */ - if ((int) (EMACS_INT) client_data == i) + if ((intptr_t) client_data == i) { int j; struct input_event buf; === modified file 'src/process.c' --- src/process.c 2011-05-04 23:56:09 +0000 +++ src/process.c 2011-05-05 05:31:24 +0000 @@ -28,7 +28,6 @@ #include #include #include -#include #include #include @@ -1386,7 +1385,7 @@ { if (EQ (coding_systems, Qt)) { - args2 = (Lisp_Object *) alloca ((nargs + 1) * sizeof args2); + args2 = (Lisp_Object *) alloca ((nargs + 1) * sizeof *args2); args2[0] = Qstart_process; for (i = 0; i < nargs; i++) args2[i + 1] = args[i]; GCPRO2 (proc, current_dir); === modified file 'src/sysdep.c' --- src/sysdep.c 2011-05-02 03:57:02 +0000 +++ src/sysdep.c 2011-05-03 05:47:50 +0000 @@ -1786,23 +1786,14 @@ * Build a full Emacs-sized word out of whatever we've got. * This suffices even for a 64-bit architecture with a 15-bit rand. */ -long +EMACS_INT get_random (void) { - long val = random (); -#if VALBITS > RAND_BITS - val = (val << RAND_BITS) ^ random (); -#if VALBITS > 2*RAND_BITS - val = (val << RAND_BITS) ^ random (); -#if VALBITS > 3*RAND_BITS - val = (val << RAND_BITS) ^ random (); -#if VALBITS > 4*RAND_BITS - val = (val << RAND_BITS) ^ random (); -#endif /* need at least 5 */ -#endif /* need at least 4 */ -#endif /* need at least 3 */ -#endif /* need at least 2 */ - return val & ((1L << VALBITS) - 1); + EMACS_UINT val = 0; + int i; + for (i = 0; i < (VALBITS + RAND_BITS - 1) / RAND_BITS; i++) + val = (val << RAND_BITS) ^ random (); + return val & (((EMACS_INT) 1 << VALBITS) - 1); } #ifndef HAVE_STRERROR === modified file 'src/term.c' --- src/term.c 2011-04-24 09:00:03 +0000 +++ src/term.c 2011-05-04 07:20:46 +0000 @@ -26,7 +26,6 @@ #include #include #include -#include #include #include "lisp.h" @@ -3619,7 +3618,6 @@ vfprintf (stderr, str, ap); if (!(strlen (str) > 0 && str[strlen (str) - 1] == '\n')) fprintf (stderr, "\n"); - va_end (ap); fflush (stderr); exit (1); } === modified file 'src/xdisp.c' --- src/xdisp.c 2011-04-26 06:17:52 +0000 +++ src/xdisp.c 2011-04-29 17:56:27 +0000 @@ -8737,7 +8737,7 @@ window_height_changed_p = with_echo_area_buffer (w, display_last_displayed_message_p, display_echo_area_1, - (EMACS_INT) w, Qnil, 0, 0); + (intptr_t) w, Qnil, 0, 0); if (no_message_p) echo_area_buffer[i] = Qnil; @@ -8756,7 +8756,8 @@ static int display_echo_area_1 (EMACS_INT a1, Lisp_Object a2, EMACS_INT a3, EMACS_INT a4) { - struct window *w = (struct window *) a1; + intptr_t i1 = a1; + struct window *w = (struct window *) i1; Lisp_Object window; struct text_pos start; int window_height_changed_p = 0; @@ -8798,7 +8799,8 @@ resize_exactly = Qnil; resized_p = with_echo_area_buffer (w, 0, resize_mini_window_1, - (EMACS_INT) w, resize_exactly, 0, 0); + (intptr_t) w, resize_exactly, + 0, 0); if (resized_p) { ++windows_or_buffers_changed; @@ -8818,7 +8820,8 @@ static int resize_mini_window_1 (EMACS_INT a1, Lisp_Object exactly, EMACS_INT a3, EMACS_INT a4) { - return resize_mini_window ((struct window *) a1, !NILP (exactly)); + intptr_t i1 = a1; + return resize_mini_window ((struct window *) i1, !NILP (exactly)); } @@ -8984,7 +8987,7 @@ else { with_echo_area_buffer (0, 0, current_message_1, - (EMACS_INT) &msg, Qnil, 0, 0); + (intptr_t) &msg, Qnil, 0, 0); if (NILP (msg)) echo_area_buffer[0] = Qnil; } @@ -8996,7 +8999,8 @@ static int current_message_1 (EMACS_INT a1, Lisp_Object a2, EMACS_INT a3, EMACS_INT a4) { - Lisp_Object *msg = (Lisp_Object *) a1; + intptr_t i1 = a1; + Lisp_Object *msg = (Lisp_Object *) i1; if (Z > BEG) *msg = make_buffer_string (BEG, Z, 1); @@ -9127,7 +9131,7 @@ || (STRINGP (string) && STRING_MULTIBYTE (string))); with_echo_area_buffer (0, -1, set_message_1, - (EMACS_INT) s, string, nbytes, multibyte_p); + (intptr_t) s, string, nbytes, multibyte_p); message_buf_print = 0; help_echo_showing_p = 0; } @@ -9141,7 +9145,8 @@ static int set_message_1 (EMACS_INT a1, Lisp_Object a2, EMACS_INT nbytes, EMACS_INT multibyte_p) { - const char *s = (const char *) a1; + intptr_t i1 = a1; + const char *s = (const char *) i1; const unsigned char *msg = (const unsigned char *) s; Lisp_Object string = a2; === modified file 'src/xmenu.c' --- src/xmenu.c 2011-04-25 21:34:39 +0000 +++ src/xmenu.c 2011-05-03 06:12:50 +0000 @@ -1012,10 +1012,10 @@ menu_items = f->menu_bar_vector; menu_items_allocated = VECTORP (menu_items) ? ASIZE (menu_items) : 0; subitems = ASIZE (items) / 4; - submenu_start = (int *) alloca (subitems * sizeof (int *)); - submenu_end = (int *) alloca (subitems * sizeof (int *)); + submenu_start = (int *) alloca (subitems * sizeof (int)); + submenu_end = (int *) alloca (subitems * sizeof (int)); submenu_n_panes = (int *) alloca (subitems * sizeof (int)); - submenu_top_level_items = (int *) alloca (subitems * sizeof (int *)); + submenu_top_level_items = (int *) alloca (subitems * sizeof (int)); init_menu_items (); for (i = 0; i < subitems; i++) { @@ -1139,9 +1139,9 @@ wv->help = Qnil; /* This prevents lwlib from assuming this menu item is really supposed to be empty. */ - /* The EMACS_INT cast avoids a warning. + /* The intptr_t cast avoids a warning. This value just has to be different from small integers. */ - wv->call_data = (void *) (EMACS_INT) (-1); + wv->call_data = (void *) (intptr_t) (-1); if (prev_wv) prev_wv->next = wv; @@ -1876,9 +1876,9 @@ static void dialog_selection_callback (GtkWidget *widget, gpointer client_data) { - /* The EMACS_INT cast avoids a warning. There's no problem + /* Treat the pointer as an integer. There's no problem as long as pointers have enough bits to hold small integers. */ - if ((int) (EMACS_INT) client_data != -1) + if ((intptr_t) client_data != -1) menu_item_selection = (Lisp_Object *) client_data; popup_activated_flag = 0; ------------------------------------------------------------ revno: 104133 committer: Glenn Morris branch nick: trunk timestamp: Thu 2011-05-05 21:28:53 -0700 message: Add diary comments feature. * lisp/calendar/diary-lib.el (diary-comment-start, diary-comment-end): New options. (diary-add-to-list): Strip comments from the displayed string. (diary-mode): Set comment-start and comment-end. * doc/emacs/cal-xtra.texi (Fancy Diary Display): Mention diary comments. * etc/NEWS: Mention this. diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2011-05-02 02:06:53 +0000 +++ doc/emacs/ChangeLog 2011-05-06 04:28:53 +0000 @@ -1,3 +1,7 @@ +2011-05-06 Glenn Morris + + * cal-xtra.texi (Fancy Diary Display): Mention diary comments. + 2011-05-02 Lars Magne Ingebrigtsen * misc.texi (Emacs Server): Document `server-eval-at'. === modified file 'doc/emacs/cal-xtra.texi' --- doc/emacs/cal-xtra.texi 2011-01-26 08:36:39 +0000 +++ doc/emacs/cal-xtra.texi 2011-05-06 04:28:53 +0000 @@ -616,6 +616,20 @@ of the hook list, in case earlier members of the list change the order of the diary entries, or add items. +@vindex diary-comment-start + You can write @samp{comments} in diary entries, by setting the +variables @code{diary-comment-start} and @code{diary-comment-end} to +strings that delimit comments. The fancy display does not print +comments. You might want to put meta-data for the use of other packages +(e.g. the appointment package, +@iftex +@pxref{Appointments,,,emacs, the Emacs Manual}) +@end iftex +@ifnottex +@pxref{Appointments}) +@end ifnottex +inside comments. + @vindex diary-include-string Your main diary file can include other files. This permits a group of people to share a diary file for events that apply to all of them. === modified file 'etc/NEWS' --- etc/NEWS 2011-05-03 03:34:26 +0000 +++ etc/NEWS 2011-05-06 04:28:53 +0000 @@ -447,6 +447,10 @@ ** Calendar, Diary, and Appt ++++ +*** Diary entries can contain non-printing `comments'. +See the variable `diary-comment-start'. + *** New function `diary-hebrew-birthday'. --- === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-06 04:07:47 +0000 +++ lisp/ChangeLog 2011-05-06 04:28:53 +0000 @@ -1,5 +1,10 @@ 2011-05-06 Glenn Morris + * calendar/diary-lib.el (diary-comment-start, diary-comment-end): + New options. + (diary-add-to-list): Strip comments from the displayed string. + (diary-mode): Set comment-start and comment-end. + * vc/diff-mode.el (smerge-refine-subst): Declare. (diff-refine-hunk): Don't require smerge-mode when compiling. === modified file 'lisp/calendar/diary-lib.el' --- lisp/calendar/diary-lib.el 2011-05-04 02:06:28 +0000 +++ lisp/calendar/diary-lib.el 2011-05-06 04:28:53 +0000 @@ -142,6 +142,25 @@ :type 'string :group 'diary) +(defcustom diary-comment-start nil + "String marking the start of a comment in the diary, or nil. +Nil means there are no comments. The diary does not display +parts of entries that are inside comments. You can use comments +for whatever you like, e.g. for meta-data that packages such as +`appt.el' can use. +See also `diary-comment-end'." + :version "24.1" + :type '(choice (const :tag "No comment" nil) string) + :group 'diary) + +(defcustom diary-comment-end "" + "String marking the end of a comment in the diary. +The empty string means comments finish at the end of a line. +See also `diary-comment-start'." + :version "24.1" + :type 'string + :group 'diary) + (defcustom diary-hook nil "List of functions called after the display of the diary. Used for example by the appointment package - see `appt-activate'." @@ -610,10 +629,15 @@ The entry is added to the list as (DATE STRING SPECIFIER LOCATOR GLOBCOLOR), where LOCATOR has the form (MARKER FILENAME LITERAL), -FILENAME being the file containing the diary entry." +FILENAME being the file containing the diary entry. + +Modifies STRING using `diary-modify-entry-list-string-function', if non-nil. +Also removes the region between `diary-comment-start' and +`diary-comment-end', if the former is non-nil." (when (and date string) ;; b-f-n is nil if we are visiting an include file in a temp-buffer. - (let ((dfile (or (buffer-file-name) diary-file))) + (let ((dfile (or (buffer-file-name) diary-file)) + cstart) (if diary-file-name-prefix (let ((prefix (funcall diary-file-name-prefix-function dfile))) (or (string-equal prefix "") @@ -621,6 +645,16 @@ (and diary-modify-entry-list-string-function (setq string (funcall diary-modify-entry-list-string-function string))) + (when (and diary-comment-start + (string-match (setq cstart (regexp-quote diary-comment-start)) + string)) + ;; Preserve the value with the comments. + (or literal (setq literal string)) + (setq string (replace-regexp-in-string + (format "%s.*%s" cstart + (if (zerop (length diary-comment-end)) "$" + (regexp-quote diary-comment-end))) + "" string))) (setq diary-entries-list (append diary-entries-list (list (list date string specifier @@ -2353,6 +2387,8 @@ "Major mode for editing the diary file." (set (make-local-variable 'font-lock-defaults) '(diary-font-lock-keywords t)) + (set (make-local-variable 'comment-start) diary-comment-start) + (set (make-local-variable 'comment-end) diary-comment-end) (add-to-invisibility-spec '(diary . nil)) (add-hook 'after-save-hook 'diary-redraw-calendar nil t) ;; In case the file was modified externally, refresh the calendar ------------------------------------------------------------ Use --include-merges or -n0 to see merged revisions.