Using saved parent location: http://bzr.savannah.gnu.org/r/emacs/trunk/ Now on revision 104125. ------------------------------------------------------------ revno: 104125 committer: Glenn Morris branch nick: trunk timestamp: Wed 2011-05-04 23:56:54 -0700 message: * lisp/gnus/gnus-start.el (gnus-propagate-marks): Declare. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2011-05-04 11:28:46 +0000 +++ lisp/gnus/ChangeLog 2011-05-05 06:56:54 +0000 @@ -1,3 +1,7 @@ +2011-05-05 Glenn Morris + + * gnus-start.el (gnus-propagate-marks): Declare. + 2011-05-04 Teodor Zlatanov * registry.el (registry-reindex): Fix percentage message. === modified file 'lisp/gnus/gnus-start.el' --- lisp/gnus/gnus-start.el 2011-04-12 22:18:02 +0000 +++ lisp/gnus/gnus-start.el 2011-05-05 06:56:54 +0000 @@ -1491,6 +1491,8 @@ ;; Return the new active info. active))))) +(defvar gnus-propagate-marks) ; gnus-sum + (defun gnus-get-unread-articles-in-group (info active &optional update) (when (and info active) ;; Allow the backend to update the info in the group. ------------------------------------------------------------ revno: 104124 committer: Glenn Morris branch nick: trunk timestamp: Wed 2011-05-04 23:53:29 -0700 message: * allout-widgets.el (allout-widgets-mode-inhibit): Declare before use. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-05 06:50:24 +0000 +++ lisp/ChangeLog 2011-05-05 06:53:29 +0000 @@ -1,5 +1,7 @@ 2011-05-05 Glenn Morris + * allout-widgets.el (allout-widgets-mode-inhibit): Declare before use. + * simple.el (shell-dynamic-complete-functions) (comint-dynamic-complete-functions): Declare. === modified file 'lisp/allout-widgets.el' --- lisp/allout-widgets.el 2011-03-29 18:26:01 +0000 +++ lisp/allout-widgets.el 2011-05-05 06:53:29 +0000 @@ -246,6 +246,7 @@ The table contents will be out of sync if any widgets are created or deleted while this variable is nil.") (make-variable-buffer-local 'allout-widgets-tally) +(defvar allout-widgets-mode-inhibit) ; defined below ;;;_ > allout-widgets-tally-string (defun allout-widgets-tally-string () "Return a string giving the number of tracked widgets, or empty string if not tracking. ------------------------------------------------------------ revno: 104123 committer: Glenn Morris branch nick: trunk timestamp: Wed 2011-05-04 23:50:24 -0700 message: Declarations in simple.el. * lisp/simple.el (shell-dynamic-complete-functions) (comint-dynamic-complete-functions): Declare. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-05 06:35:41 +0000 +++ lisp/ChangeLog 2011-05-05 06:50:24 +0000 @@ -1,5 +1,8 @@ 2011-05-05 Glenn Morris + * simple.el (shell-dynamic-complete-functions) + (comint-dynamic-complete-functions): Declare. + * net/network-stream.el (gnutls-negotiate): * simple.el (tabulated-list-print): Fix declarations. === modified file 'lisp/simple.el' --- lisp/simple.el 2011-05-05 06:35:41 +0000 +++ lisp/simple.el 2011-05-05 06:50:24 +0000 @@ -2170,6 +2170,9 @@ (defvar shell-delimiter-argument-list) (defvar shell-file-name-chars) (defvar shell-file-name-quote-list) +(defvar shell-dynamic-complete-functions) +;; shell requires comint. +(defvar comint-dynamic-complete-functions) (defvar minibuffer-local-shell-command-map (let ((map (make-sparse-keymap))) ------------------------------------------------------------ revno: 104122 committer: Glenn Morris branch nick: trunk timestamp: Wed 2011-05-04 23:35:41 -0700 message: Declaration fixes. * lisp/net/network-stream.el (gnutls-negotiate): Fix declaration. * lisp/simple.el (tabulated-list-print): Fix declaration. * lisp/progmodes/gud.el (syntax-symbol, syntax-point): Remove unnecessary and incorrect declarations. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-05 06:27:24 +0000 +++ lisp/ChangeLog 2011-05-05 06:35:41 +0000 @@ -1,5 +1,11 @@ 2011-05-05 Glenn Morris + * net/network-stream.el (gnutls-negotiate): + * simple.el (tabulated-list-print): Fix declarations. + + * progmodes/gud.el (syntax-symbol, syntax-point): + Remove unnecessary and incorrect declarations. + * emacs-lisp/check-declare.el (check-declare-scan): Handle byte-compile-initial-macro-environment in bytecomp.el === modified file 'lisp/net/network-stream.el' --- lisp/net/network-stream.el 2011-05-04 01:44:58 +0000 +++ lisp/net/network-stream.el 2011-05-05 06:35:41 +0000 @@ -45,7 +45,7 @@ (require 'tls) (require 'starttls) -(declare-function gnutls-negotiate "gnutls" (&rest spec)) +(declare-function gnutls-negotiate "gnutls" t t) ; defun* ;;;###autoload (defun open-network-stream (name buffer host service &rest parameters) === modified file 'lisp/progmodes/gud.el' --- lisp/progmodes/gud.el 2011-04-22 18:44:26 +0000 +++ lisp/progmodes/gud.el 2011-05-05 06:35:41 +0000 @@ -3042,8 +3042,6 @@ (declare-function c-langelem-sym "cc-defs" (langelem)) (declare-function c-langelem-pos "cc-defs" (langelem)) -(declare-function syntax-symbol "gud" (x)) -(declare-function syntax-point "gud" (x)) (defun gud-find-class (f _line) "Find fully qualified class in file F at line LINE. === modified file 'lisp/simple.el' --- lisp/simple.el 2011-05-03 01:52:52 +0000 +++ lisp/simple.el 2011-05-05 06:35:41 +0000 @@ -2707,7 +2707,8 @@ (defvar tabulated-list-entries) (defvar tabulated-list-sort-key) (declare-function tabulated-list-init-header "tabulated-list" ()) -(declare-function tabulated-list-print "tabulated-list" ()) +(declare-function tabulated-list-print "tabulated-list" + (&optional remember-pos)) (defvar process-menu-query-only nil) ------------------------------------------------------------ revno: 104121 committer: Glenn Morris branch nick: trunk timestamp: Wed 2011-05-04 23:27:24 -0700 message: Small check-declare fix. * lisp/emacs-lisp/check-declare.el (check-declare-scan): Handle byte-compile-initial-macro-environment in bytecomp.el diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-05 06:25:24 +0000 +++ lisp/ChangeLog 2011-05-05 06:27:24 +0000 @@ -1,3 +1,8 @@ +2011-05-05 Glenn Morris + + * emacs-lisp/check-declare.el (check-declare-scan): + Handle byte-compile-initial-macro-environment in bytecomp.el + 2011-05-05 Stefan Monnier Fix earlier half-done eieio-defmethod change (bug#8338). === modified file 'lisp/emacs-lisp/check-declare.el' --- lisp/emacs-lisp/check-declare.el 2011-01-25 04:08:28 +0000 +++ lisp/emacs-lisp/check-declare.el 2011-05-05 06:27:24 +0000 @@ -88,9 +88,11 @@ ;; FIXME we could theoretically be inside a string. (while (re-search-forward "^[ \t]*\\((declare-function\\)[ \t\n]" nil t) (goto-char (match-beginning 1)) - (if (and (setq form (ignore-errors (read (current-buffer))) - len (length form)) - (> len 2) (< len 6) + (if (and (setq form (ignore-errors (read (current-buffer)))) + ;; Exclude element of byte-compile-initial-macro-environment. + (or (listp (cdr form)) (setq form nil)) + (> (setq len (length form)) 2) + (< len 6) (symbolp (setq fn (cadr form))) (setq fn (symbol-name fn)) ; later we use as a search string (stringp (setq fnfile (nth 2 form))) @@ -104,7 +106,7 @@ (symbolp (setq fileonly (nth 4 form)))) (setq alist (cons (list fnfile fn arglist fileonly) alist)) ;; FIXME make this more noticeable. - (message "Malformed declaration for `%s'" (cadr form))))) + (if form (message "Malformed declaration for `%s'" (cadr form)))))) (message "%sdone" m) alist)) ------------------------------------------------------------ revno: 104120 committer: Glenn Morris branch nick: trunk timestamp: Wed 2011-05-04 23:25:24 -0700 message: ChangeLog merge fix, grumble. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-05 04:00:38 +0000 +++ lisp/ChangeLog 2011-05-05 06:25:24 +0000 @@ -1,8 +1,3 @@ -2011-05-05 Daniel Colascione - - * progmodes/cc-engine.el (c-forward-decl-or-cast-1): Use - correct match group (bug#8438). - 2011-05-05 Stefan Monnier Fix earlier half-done eieio-defmethod change (bug#8338). ------------------------------------------------------------ revno: 104119 committer: Glenn Morris branch nick: trunk timestamp: Wed 2011-05-04 23:04:38 -0700 message: Comment typo. diff: === modified file 'Makefile.in' --- Makefile.in 2011-05-05 03:30:03 +0000 +++ Makefile.in 2011-05-05 06:04:38 +0000 @@ -930,7 +930,7 @@ .PHONY: bootstrap -## configure; make boostrap replaces the real config.log from configure +## configure; make bootstrap replaces the real config.log from configure ## with the truncated one from config.status. The former is more useful. bootstrap: bootstrap-clean FRC if [ -x ./config.status ]; then \ ------------------------------------------------------------ revno: 104118 [merge] committer: Glenn Morris branch nick: trunk timestamp: Wed 2011-05-04 21:00:38 -0700 message: Merge from emacs-23; up to r100567. diff: === modified file 'etc/NEWS.23' --- etc/NEWS.23 2011-04-08 18:53:26 +0000 +++ etc/NEWS.23 2011-05-05 04:00:38 +0000 @@ -15,11 +15,7 @@ with a prefix argument or by typing C-u C-h C-n. -* Installation Changes in Emacs 23.3 - -** New configure option --with-crt-dir specifies the location of your -crt*.o files, if they are in a non-standard location. This is only -used on x86-64 and s390x GNU/Linux architectures. +* Installation Changes in Emacs 23.4 ** The MS-Windows build prefers libpng version 1.14 or later. Versions of libpng before 1.14 had security issues, so we now @@ -28,6 +24,21 @@ details and pointers to URLs where the latest libpng can be downloaded. + +* Changes in Emacs 23.4 on non-free operating systems + +** The MS-Windows port can now use more than 500MB of heap. +Depending on the available virtual memory, Emacs on Windows can now +have up to 2GB of heap space. This allows, e.g., to visit several +large (> 256MB) files in the same session. + + +* Installation Changes in Emacs 23.3 + +** New configure option --with-crt-dir specifies the location of your +crt*.o files, if they are in a non-standard location. This is only +used on x86-64 and s390x GNU/Linux architectures. + * Changes in Emacs 23.3 ** The last-resort backup file `%backup%~' is now written to === modified file 'leim/ChangeLog' --- leim/ChangeLog 2011-04-06 12:18:10 +0000 +++ leim/ChangeLog 2011-05-05 04:00:38 +0000 @@ -1,3 +1,11 @@ +2011-05-05 Eli Zaretskii + + * quail/latin-ltx.el <\beth, \gimel, \daleth>: Produce + corresponding symbols rather than Hebrew letters. (Bug#8563) + + * quail/latin-ltx.el <\aleph>: Produce ALEF SYMBOL instead of + HEBREW LETTER ALEF. (Bug#8563) + 2011-03-23 Glenn Morris * Makefile.in (install): Use `install-sh -d' rather than mkinstalldirs. === modified file 'leim/quail/latin-ltx.el' --- leim/quail/latin-ltx.el 2011-01-26 08:36:39 +0000 +++ leim/quail/latin-ltx.el 2011-05-05 04:00:38 +0000 @@ -498,7 +498,7 @@ ("\\Vert" ?‖) ("\\Vvdash" ?⊪) ("\\Xi" ?Ξ) - ("\\aleph" ?א) + ("\\aleph" ?ℵ) ("\\alpha" ?α) ("\\amalg" ?∐) ("\\angle" ?∠) @@ -515,7 +515,7 @@ ("\\barwedge" ?⊼) ("\\because" ?∵) ("\\beta" ?β) - ("\\beth" ?ב) + ("\\beth" ?ℶ) ("\\between" ?≬) ("\\bigcap" ?⋂) ("\\bigcirc" ?◯) @@ -569,7 +569,7 @@ ("\\dag" ?†) ("\\dagger" ?†) - ("\\daleth" ?ד) + ("\\daleth" ?ℸ) ("\\dashv" ?⊣) ("\\ddag" ?‡) ("\\ddagger" ?‡) @@ -626,7 +626,7 @@ ("\\gets" ?←) ("\\gg" ?≫) ("\\ggg" ?⋙) - ("\\gimel" ?ג) + ("\\gimel" ?ℷ) ("\\gnapprox" ?⋧) ("\\gneq" ?≩) ("\\gneqq" ?≩) === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-05 03:42:09 +0000 +++ lisp/ChangeLog 2011-05-05 04:00:38 +0000 @@ -1,3 +1,8 @@ +2011-05-05 Daniel Colascione + + * progmodes/cc-engine.el (c-forward-decl-or-cast-1): Use + correct match group (bug#8438). + 2011-05-05 Stefan Monnier Fix earlier half-done eieio-defmethod change (bug#8338). === modified file 'src/ChangeLog' --- src/ChangeLog 2011-05-05 02:05:36 +0000 +++ src/ChangeLog 2011-05-05 04:00:38 +0000 @@ -1,3 +1,12 @@ +2011-05-05 Eli Zaretskii + + * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]: + New version that can reserve upto 2GB of heap space. + +2011-05-05 Chong Yidong + + * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534). + 2011-05-05 Teodor Zlatanov * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to === modified file 'src/nsfns.m' --- src/nsfns.m 2011-04-07 03:34:05 +0000 +++ src/nsfns.m 2011-05-05 04:00:38 +0000 @@ -1416,9 +1416,10 @@ DEFUN ("ns-read-file-name", Fns_read_file_name, Sns_read_file_name, 1, 4, 0, doc: /* Use a graphical panel to read a file name, using prompt PROMPT. Optional arg DIR, if non-nil, supplies a default directory. -Optional arg ISLOAD, if non-nil, means read a file name for saving. +Optional arg MUSTMATCH, if non-nil, means the returned file or +directory must exist. Optional arg INIT, if non-nil, provides a default file name to use. */) - (Lisp_Object prompt, Lisp_Object dir, Lisp_Object isLoad, Lisp_Object init) + (Lisp_Object prompt, Lisp_Object dir, Lisp_Object mustmatch, Lisp_Object init) { static id fileDelegate = nil; int ret; @@ -1443,7 +1444,7 @@ if ([dirS characterAtIndex: 0] == '~') dirS = [dirS stringByExpandingTildeInPath]; - panel = NILP (isLoad) ? + panel = NILP (mustmatch) ? (id)[EmacsSavePanel savePanel] : (id)[EmacsOpenPanel openPanel]; [panel setTitle: promptS]; @@ -1457,7 +1458,7 @@ panelOK = 0; BLOCK_INPUT; - if (NILP (isLoad)) + if (NILP (mustmatch)) { ret = [panel runModalForDirectory: dirS file: initS]; } === modified file 'src/w32heap.c' --- src/w32heap.c 2011-01-25 04:08:28 +0000 +++ src/w32heap.c 2011-05-05 04:00:38 +0000 @@ -114,6 +114,7 @@ return data_region_end; } +#if !defined (USE_LISP_UNION_TYPE) && !defined (USE_LSB_TAG) static char * allocate_heap (void) { @@ -140,9 +141,31 @@ return ptr; } - - -/* Emulate Unix sbrk. */ +#else /* USE_LISP_UNION_TYPE || USE_LSB_TAG */ +static char * +allocate_heap (void) +{ + unsigned long size = 0x80000000; /* start by asking for 2GB */ + void *ptr = NULL; + + while (!ptr && size > 0x00100000) + { + reserved_heap_size = size; + ptr = VirtualAlloc (NULL, + get_reserved_heap_size (), + MEM_RESERVE, + PAGE_NOACCESS); + size -= 0x00800000; /* if failed, decrease request by 8MB */ + } + + return ptr; +} +#endif /* USE_LISP_UNION_TYPE || USE_LSB_TAG */ + + +/* Emulate Unix sbrk. Note that ralloc.c expects the return value to + be the address of the _start_ (not end) of the new block in case of + success, and zero (not -1) in case of failure. */ void * sbrk (unsigned long increment) { ------------------------------------------------------------ revno: 104117 fixes bug(s): http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8338 committer: Stefan Monnier branch nick: trunk timestamp: Thu 2011-05-05 00:42:09 -0300 message: Fix earlier half-done eieio-defmethod change. * lisp/emacs-lisp/eieio.el (eieio--defmethod): Rename from eieio-defmethod. Streamline and change calling convention. (defmethod): Adjust accordingly and simplify. (eieio-defclass): Fix broken calls to eieio-defmethod and redirect to new eieio--defmethod. (slot-boundp): Minor CSE simplification. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-05 03:26:55 +0000 +++ lisp/ChangeLog 2011-05-05 03:42:09 +0000 @@ -1,3 +1,13 @@ +2011-05-05 Stefan Monnier + + Fix earlier half-done eieio-defmethod change (bug#8338). + * emacs-lisp/eieio.el (eieio--defmethod): Rename from eieio-defmethod. + Streamline and change calling convention. + (defmethod): Adjust accordingly and simplify. + (eieio-defclass): Fix broken calls to eieio-defmethod and redirect to + new eieio--defmethod. + (slot-boundp): Minor CSE simplification. + 2011-05-05 Milan Zamazal * progmodes/glasses.el (glasses-separate-capital-groups): New option. @@ -15,8 +25,8 @@ (autoload-find-generated-file): New function. (generate-file-autoloads): Bind generated-autoload-file to buffer-file-name. - (update-file-autoloads, update-directory-autoloads): Use - autoload-find-generated-file. If called interactively, prompt for + (update-file-autoloads, update-directory-autoloads): + Use autoload-find-generated-file. If called interactively, prompt for output file (Bug#7989). (batch-update-autoloads): Doc fix. === modified file 'lisp/emacs-lisp/eieio.el' --- lisp/emacs-lisp/eieio.el 2011-04-01 15:16:50 +0000 +++ lisp/emacs-lisp/eieio.el 2011-05-05 03:42:09 +0000 @@ -656,14 +656,14 @@ ;; so that users can `setf' the space returned by this function (if acces (progn - (eieio-defmethod acces - (list (if (eq alloc :class) :static :primary) - (list (list 'this cname)) - (format + (eieio--defmethod + acces (if (eq alloc :class) :static :primary) cname + `(lambda (this) + ,(format "Retrieves the slot `%s' from an object of class `%s'" name cname) - (list 'if (list 'slot-boundp 'this (list 'quote name)) - (list 'eieio-oref 'this (list 'quote name)) + (if (slot-boundp this ',name) + (eieio-oref this ',name) ;; Else - Some error? nil? nil))) @@ -683,22 +683,21 @@ ;; If a writer is defined, then create a generic method of that ;; name whose purpose is to set the value of the slot. (if writer - (progn - (eieio-defmethod writer - (list (list (list 'this cname) 'value) - (format "Set the slot `%s' of an object of class `%s'" + (eieio--defmethod + writer nil cname + `(lambda (this value) + ,(format "Set the slot `%s' of an object of class `%s'" name cname) - `(setf (slot-value this ',name) value))) - )) + (setf (slot-value this ',name) value)))) ;; If a reader is defined, then create a generic method ;; of that name whose purpose is to access this slot value. (if reader - (progn - (eieio-defmethod reader - (list (list (list 'this cname)) - (format "Access the slot `%s' from object of class `%s'" + (eieio--defmethod + reader nil cname + `(lambda (this) + ,(format "Access the slot `%s' from object of class `%s'" name cname) - `(slot-value this ',name))))) + (slot-value this ',name)))) ) (setq slots (cdr slots))) @@ -1290,83 +1289,48 @@ ((typearg class-name) arg2 &optional opt &rest rest) \"doc-string\" body)" - (let* ((key (cond ((or (eq ':BEFORE (car args)) - (eq ':before (car args))) - (setq args (cdr args)) - :before) - ((or (eq ':AFTER (car args)) - (eq ':after (car args))) - (setq args (cdr args)) - :after) - ((or (eq ':PRIMARY (car args)) - (eq ':primary (car args))) - (setq args (cdr args)) - :primary) - ((or (eq ':STATIC (car args)) - (eq ':static (car args))) - (setq args (cdr args)) - :static) - (t nil))) + (let* ((key (if (keywordp (car args)) (pop args))) (params (car args)) - (lamparams - (mapcar (lambda (param) (if (listp param) (car param) param)) - params)) (arg1 (car params)) - (class (if (listp arg1) (nth 1 arg1) nil))) - `(eieio-defmethod ',method - '(,@(if key (list key)) - ,params) - (lambda ,lamparams ,@(cdr args))))) + (class (if (consp arg1) (nth 1 arg1)))) + `(eieio--defmethod ',method ',key ',class + (lambda ,(if (consp arg1) + (cons (car arg1) (cdr params)) + params) + ,@(cdr args))))) -(defun eieio-defmethod (method args &optional code) +(defun eieio--defmethod (method kind argclass code) "Work part of the `defmethod' macro defining METHOD with ARGS." - (let ((key nil) (body nil) (firstarg nil) (argfix nil) (argclass nil) loopa) + (let ((key ;; find optional keys - (setq key - (cond ((or (eq ':BEFORE (car args)) - (eq ':before (car args))) - (setq args (cdr args)) + (cond ((or (eq ':BEFORE kind) + (eq ':before kind)) method-before) - ((or (eq ':AFTER (car args)) - (eq ':after (car args))) - (setq args (cdr args)) + ((or (eq ':AFTER kind) + (eq ':after kind)) method-after) - ((or (eq ':PRIMARY (car args)) - (eq ':primary (car args))) - (setq args (cdr args)) + ((or (eq ':PRIMARY kind) + (eq ':primary kind)) method-primary) - ((or (eq ':STATIC (car args)) - (eq ':static (car args))) - (setq args (cdr args)) + ((or (eq ':STATIC kind) + (eq ':static kind)) method-static) ;; Primary key - (t method-primary))) - ;; get body, and fix contents of args to be the arguments of the fn. - (setq body (cdr args) - args (car args)) - (setq loopa args) - ;; Create a fixed version of the arguments - (while loopa - (setq argfix (cons (if (listp (car loopa)) (car (car loopa)) (car loopa)) - argfix)) - (setq loopa (cdr loopa))) + (t method-primary)))) ;; make sure there is a generic (eieio-defgeneric method - (if (stringp (car body)) - (car body) (format "Generically created method `%s'." 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 ;; under the type `primary' which is a non-specific calling of the ;; function. - (setq firstarg (car args)) - (if (listp firstarg) - (progn - (setq argclass (nth 1 firstarg)) + (if argclass (if (not (class-p argclass)) (error "Unknown class type %s in method parameters" - (nth 1 firstarg)))) + argclass)) (if (= key -1) (signal 'wrong-type-argument (list :static 'non-class-arg))) ;; generics are higher @@ -1884,11 +1848,11 @@ ;; Skip typechecking while retrieving this value. (let ((eieio-skip-typecheck t)) ;; Return nil if the magic symbol is in there. - (if (eieio-object-p object) - (if (eq (eieio-oref object slot) eieio-unbound) nil t) - (if (class-p object) - (if (eq (eieio-oref-default object slot) eieio-unbound) nil t) - (signal 'wrong-type-argument (list 'eieio-object-p object)))))) + (not (eq (cond + ((eieio-object-p object) (eieio-oref object slot)) + ((class-p object) (eieio-oref-default object slot)) + (t (signal 'wrong-type-argument (list 'eieio-object-p object)))) + eieio-unbound)))) (defun slot-makeunbound (object slot) "In OBJECT, make SLOT unbound." ------------------------------------------------------------ revno: 104116 committer: Glenn Morris branch nick: trunk timestamp: Wed 2011-05-04 20:30:03 -0700 message: Stop bootstrap clobbering config.log (bug#765) * Makefile.in (bootstrap-clean): Save config.log. (top_distclean): Delete config.log~. diff: === modified file 'ChangeLog' --- ChangeLog 2011-04-27 02:17:44 +0000 +++ ChangeLog 2011-05-05 03:30:03 +0000 @@ -1,3 +1,8 @@ +2011-05-05 Glenn Morris + + * Makefile.in (bootstrap-clean): Save config.log. (Bug#765) + (top_distclean): Delete config.log~. + 2011-04-27 Ben Key * configure.in: Fixed a bug that caused configure with === modified file 'Makefile.in' --- Makefile.in 2011-04-26 06:17:52 +0000 +++ Makefile.in 2011-05-05 03:30:03 +0000 @@ -798,7 +798,7 @@ ### distribution. top_distclean=\ ${top_bootclean}; \ - rm -f config.status Makefile stamp-h1 ${SUBDIR_MAKEFILES} + rm -f config.status config.log~ Makefile stamp-h1 ${SUBDIR_MAKEFILES} distclean: FRC (cd src; $(MAKE) $(MFLAGS) distclean) (cd oldXMenu; $(MAKE) $(MFLAGS) distclean) @@ -828,7 +828,10 @@ -(cd doc/lispintro && $(MAKE) $(MFLAGS) maintainer-clean) (cd leim; $(MAKE) $(MFLAGS) maintainer-clean) (cd lisp; $(MAKE) $(MFLAGS) bootstrap-clean) + [ ! -e config.log ] || mv -f config.log config.log~ ${top_bootclean} +## configure; make bootstrap replaces the real config.log from configure +## with the truncated one from config.status. The former is more useful. ### `maintainer-clean' ### Delete everything from the current directory that can be @@ -927,6 +930,8 @@ .PHONY: bootstrap +## configure; make boostrap replaces the real config.log from configure +## with the truncated one from config.status. The former is more useful. bootstrap: bootstrap-clean FRC if [ -x ./config.status ]; then \ ./config.status; \ ------------------------------------------------------------ revno: 104115 fixes bug(s): http://debbugs.gnu.org/8524 author: Milan Zamazal committer: Glenn Morris branch nick: trunk timestamp: Wed 2011-05-04 20:26:55 -0700 message: Small addition to glasses.el (bug#8524) * lisp/progmodes/glasses.el (glasses-separate-capital-groups): New option. (glasses-make-readable): Use glasses-separate-capital-groups. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-05 00:06:10 +0000 +++ lisp/ChangeLog 2011-05-05 03:26:55 +0000 @@ -1,3 +1,8 @@ +2011-05-05 Milan Zamazal + + * progmodes/glasses.el (glasses-separate-capital-groups): New option. + (glasses-make-readable): Use glasses-separate-capital-groups. + 2011-05-05 Juanma Barranquero * emacs-lisp/warnings.el (warning-level-aliases): Reflow docstring. === modified file 'lisp/progmodes/glasses.el' --- lisp/progmodes/glasses.el 2011-04-22 18:44:26 +0000 +++ lisp/progmodes/glasses.el 2011-05-05 03:26:55 +0000 @@ -116,6 +116,15 @@ :group 'glasses :type '(repeat regexp)) +(defcustom glasses-separate-capital-groups t + "If non-nil, try to separate groups of capital letters. +When the value is non-nil, HTMLSomething and IPv6 are displayed +as HTML_Something and I_Pv6 respectively. Set the value to nil +if you prefer to display them unchanged." + :group 'glasses + :type 'boolean + :version "24.1") + (defcustom glasses-uncapitalize-p nil "If non-nil, downcase embedded capital letters in identifiers. Only identifiers starting with lower case letters are affected, letters inside @@ -212,8 +221,11 @@ 'glasses-init)) ;; Face + separator (goto-char beg) - (while (re-search-forward "[a-z]\\([A-Z]\\)\\|[A-Z]\\([A-Z]\\)[a-z]" - end t) + (while (re-search-forward + (if glasses-separate-capital-groups + "[a-z]\\([A-Z]\\)\\|[A-Z]\\([A-Z]\\)[a-z]" + "[a-z]\\([A-Z]\\)") + end t) (let* ((n (if (match-string 1) 1 2)) (o (glasses-make-overlay (match-beginning n) (match-end n)))) (goto-char (match-beginning n)) ------------------------------------------------------------ revno: 104114 committer: Ben Key branch nick: trunk timestamp: Wed 2011-05-04 21:56:16 -0500 message: * configure.bat: Added support for --cflags and --ldflags options that include quotes as long as command extensions are enabled. Specifically when -I, -L, and similar flags are used to specify supplementary include and library directories a directory name that includes spaces may now be used if it is enclosed in quotes. * INSTALL: Documented the change to configure.bat. diff: === modified file 'nt/ChangeLog' --- nt/ChangeLog 2011-05-04 14:03:16 +0000 +++ nt/ChangeLog 2011-05-05 02:56:16 +0000 @@ -1,3 +1,14 @@ +2011-05-05 Ben Key + + * configure.bat: Added support for --cflags and --ldflags + options that include quotes as long as command extensions are + enabled. Specifically when -I, -L, and similar flags are used + to specify supplementary include and library directories a + directory name that includes spaces may now be used if it is + enclosed in quotes. + + * INSTALL: Documented the change to configure.bat. + 2011-05-04 Juanma Barranquero * INSTALL: Clarify GnuTLS support. === modified file 'nt/INSTALL' --- nt/INSTALL 2011-05-04 14:03:16 +0000 +++ nt/INSTALL 2011-05-05 02:56:16 +0000 @@ -245,6 +245,20 @@ be displayed informing you that "using parameters that include the = character by enclosing them in quotes will not be supported." + You may also use the --cflags and --ldflags options to pass + additional parameters to the compiler and linker, respectively; they + are frequently used to pass -I and -L flags to specify supplementary + include and library directories. If a directory name includes + spaces, you will need to enclose it in quotes, as follows + -I"C:/Program Files/GnuTLS-2.10.1/include". Note that only the + directory name is enclosed in quotes, not the entire argument. Also + note that this functionality is only supported if command extensions + are available. If command extensions are disabled and you attempt to + use this functionality you may see the following warning message + "Error in --cflags argument: ... Backslashes and quotes cannot be + used with --cflags. Please use forward slashes for filenames and + paths (e.g. when passing directories to -I)." + N.B. It is normal to see a few error messages output while configure is running, when gcc support is being tested. These cannot be suppressed because of limitations in the Windows 9X command.com shell. === modified file 'nt/configure.bat' --- nt/configure.bat 2011-04-25 01:29:31 +0000 +++ nt/configure.bat 2011-05-05 02:56:16 +0000 @@ -97,8 +97,10 @@ set nocygwin=N set COMPILER= set usercflags= +set fusercflags= set docflags= set userldflags= +set fuserldflags= set extrauserlibs= set doldflags= set doextralibs= @@ -238,6 +240,7 @@ :ucflagex shift set usercflags=%usercflags%%sep1%%~1 +set fusercflags=%usercflags:"=\"% set sep1= %nothing% shift goto again @@ -245,6 +248,7 @@ :ucflagne shift set usercflags=%usercflags%%sep1%%1 +set fusercflags=%usercflags% set sep1= %nothing% shift goto again @@ -266,6 +270,7 @@ :ulflagex shift set userldflags=%userldflags%%sep2%%~1 +set fuserldflags=%userldflags:"=\"% set sep2= %nothing% shift goto again @@ -273,6 +278,7 @@ :ulflagne shift set userldflags=%userldflags%%sep2%%1 +set fuserldflags=%userldflags% set sep2= %nothing% shift goto again @@ -437,7 +443,7 @@ :chkuser rm -f junk.o echo int main (int argc, char *argv[]) {>junk.c -echo char *usercflags = "%usercflags%";>>junk.c +echo char *usercflags = "%fusercflags%";>>junk.c echo }>>junk.c echo gcc -Werror -c junk.c >>config.log gcc -Werror -c junk.c >>config.log 2>&1 @@ -745,8 +751,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 " %usercflags%">>config.tmp -if (%doldflags%) == (Y) echo #define USER_LDFLAGS " %userldflags%">>config.tmp +if (%docflags%) == (Y) echo #define USER_CFLAGS " %fusercflags%">>config.tmp +if (%doldflags%) == (Y) echo #define USER_LDFLAGS " %fuserldflags%">>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 ------------------------------------------------------------ revno: 104113 committer: Juanma Barranquero branch nick: trunk timestamp: Thu 2011-05-05 04:18:36 +0200 message: src/gnutls.c: Keep list of function aliases in alphabetical order. diff: === modified file 'src/gnutls.c' --- src/gnutls.c 2011-05-05 02:05:36 +0000 +++ src/gnutls.c 2011-05-05 02:18:36 +0000 @@ -203,8 +203,8 @@ #define fn_gnutls_certificate_get_peers gnutls_certificate_get_peers #define fn_gnutls_certificate_set_verify_flags gnutls_certificate_set_verify_flags #define fn_gnutls_certificate_set_x509_crl_file gnutls_certificate_set_x509_crl_file +#define fn_gnutls_certificate_set_x509_key_file gnutls_certificate_set_x509_key_file #define fn_gnutls_certificate_set_x509_trust_file gnutls_certificate_set_x509_trust_file -#define fn_gnutls_certificate_set_x509_key_file gnutls_certificate_set_x509_key_file #define fn_gnutls_certificate_type_get gnutls_certificate_type_get #define fn_gnutls_certificate_verify_peers2 gnutls_certificate_verify_peers2 #define fn_gnutls_credentials_set gnutls_credentials_set ------------------------------------------------------------ revno: 104112 committer: Ted Zlatanov branch nick: quickfixes timestamp: Wed 2011-05-04 21:05:36 -0500 message: Add fn_NAME alias for `gnutls_certificate_set_x509_key_file'. * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to `gnutls_certificate_set_x509_key_file'. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-05-05 00:20:44 +0000 +++ src/ChangeLog 2011-05-05 02:05:36 +0000 @@ -1,3 +1,8 @@ +2011-05-05 Teodor Zlatanov + + * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to + `gnutls_certificate_set_x509_key_file'. + 2011-05-05 Juanma Barranquero * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)): === modified file 'src/gnutls.c' --- src/gnutls.c 2011-05-04 23:56:09 +0000 +++ src/gnutls.c 2011-05-05 02:05:36 +0000 @@ -204,6 +204,7 @@ #define fn_gnutls_certificate_set_verify_flags gnutls_certificate_set_verify_flags #define fn_gnutls_certificate_set_x509_crl_file gnutls_certificate_set_x509_crl_file #define fn_gnutls_certificate_set_x509_trust_file gnutls_certificate_set_x509_trust_file +#define fn_gnutls_certificate_set_x509_key_file gnutls_certificate_set_x509_key_file #define fn_gnutls_certificate_type_get gnutls_certificate_type_get #define fn_gnutls_certificate_verify_peers2 gnutls_certificate_verify_peers2 #define fn_gnutls_credentials_set gnutls_credentials_set ------------------------------------------------------------ revno: 104111 committer: Juanma Barranquero branch nick: trunk timestamp: Thu 2011-05-05 02:20:44 +0200 message: src/makefile.w32-in: Update dependencies. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-05-04 23:56:09 +0000 +++ src/ChangeLog 2011-05-05 00:20:44 +0000 @@ -1,3 +1,8 @@ +2011-05-05 Juanma Barranquero + + * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)): + Update dependencies. + 2011-05-04 Juanma Barranquero * gnutls.h (emacs_gnutls_write, emacs_gnutls_read): === modified file 'src/makefile.w32-in' --- src/makefile.w32-in 2011-04-27 23:35:33 +0000 +++ src/makefile.w32-in 2011-05-05 00:20:44 +0000 @@ -978,6 +978,7 @@ $(SRC)/frame.h \ $(SRC)/systime.h \ $(SRC)/termhooks.h \ + $(SRC)/w32.h \ $(SRC)/w32gui.h \ $(SRC)/w32term.h \ $(SRC)/window.h @@ -1304,7 +1305,9 @@ $(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 \ ------------------------------------------------------------ revno: 104110 committer: Juanma Barranquero branch nick: trunk timestamp: Thu 2011-05-05 02:06:10 +0200 message: lisp/emacs-lisp/warnings.el: Tiny fixes. * emacs-lisp/warnings.el (warning-level-aliases): Reflow docstring. (warning-series): Doc fix. (display-warning): Don't try to create the buffer if we just found it. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-04 15:38:41 +0000 +++ lisp/ChangeLog 2011-05-05 00:06:10 +0000 @@ -1,3 +1,9 @@ +2011-05-05 Juanma Barranquero + + * emacs-lisp/warnings.el (warning-level-aliases): Reflow docstring. + (warning-series): Doc fix. + (display-warning): Don't try to create the buffer if we just found it. + 2011-05-04 Chong Yidong * emacs-lisp/autoload.el (generated-autoload-file): Set to nil. === modified file 'lisp/emacs-lisp/warnings.el' --- lisp/emacs-lisp/warnings.el 2011-01-25 04:08:28 +0000 +++ lisp/emacs-lisp/warnings.el 2011-05-05 00:06:10 +0000 @@ -64,8 +64,8 @@ (critical . :emergency) (alarm . :emergency)) "Alist of aliases for severity levels for `display-warning'. -Each element looks like (ALIAS . LEVEL) and defines -ALIAS as equivalent to LEVEL. LEVEL must be defined in `warning-levels'; +Each element looks like (ALIAS . LEVEL) and defines ALIAS as +equivalent to LEVEL. LEVEL must be defined in `warning-levels'; it may not itself be an alias.") (defcustom warning-minimum-level :warning @@ -141,7 +141,7 @@ A marker indicates a position in the warnings buffer which is the start of the current series; it means that additional warnings in the same buffer should not move point. -t means the next warning begins a series (and stores a marker here). +If t, the next warning begins a series (and stores a marker here). A symbol with a function definition is like t, except also call that function before the next warning.") (put 'warning-series 'risky-local-variable t) @@ -235,7 +235,7 @@ (warning-suppress-p type warning-suppress-log-types) (let* ((typename (if (consp type) (car type) type)) (old (get-buffer buffer-name)) - (buffer (get-buffer-create buffer-name)) + (buffer (or old (get-buffer-create buffer-name))) (level-info (assq level warning-levels)) start end) (with-current-buffer buffer @@ -251,60 +251,60 @@ (unless (eq warning-series t) (funcall warning-series))))) (let ((inhibit-read-only t)) - (unless (bolp) - (newline)) - (setq start (point)) - (if warning-prefix-function - (setq level-info (funcall warning-prefix-function - level level-info))) - (insert (format (nth 1 level-info) - (format warning-type-format typename)) - message) - (newline) - (when (and warning-fill-prefix (not (string-match "\n" message))) - (let ((fill-prefix warning-fill-prefix) - (fill-column 78)) - (fill-region start (point)))) - (setq end (point))) + (unless (bolp) + (newline)) + (setq start (point)) + (if warning-prefix-function + (setq level-info (funcall warning-prefix-function + level level-info))) + (insert (format (nth 1 level-info) + (format warning-type-format typename)) + message) + (newline) + (when (and warning-fill-prefix (not (string-match "\n" message))) + (let ((fill-prefix warning-fill-prefix) + (fill-column 78)) + (fill-region start (point)))) + (setq end (point))) (when (and (markerp warning-series) (eq (marker-buffer warning-series) buffer)) (goto-char warning-series))) (if (nth 2 level-info) (funcall (nth 2 level-info))) - (cond (noninteractive - ;; Noninteractively, take the text we inserted - ;; in the warnings buffer and print it. - ;; Do this unconditionally, since there is no way - ;; to view logged messages unless we output them. - (with-current-buffer buffer - (save-excursion - ;; Don't include the final newline in the arg - ;; to `message', because it adds a newline. - (goto-char end) - (if (bolp) - (forward-char -1)) - (message "%s" (buffer-substring start (point)))))) - ((and (daemonp) (null after-init-time)) - ;; Warnings assigned during daemon initialization go into - ;; the messages buffer. - (message "%s" - (with-current-buffer buffer - (save-excursion - (goto-char end) - (if (bolp) - (forward-char -1)) - (buffer-substring start (point)))))) - (t - ;; Interactively, decide whether the warning merits - ;; immediate display. - (or (< (warning-numeric-level level) - (warning-numeric-level warning-minimum-level)) - (warning-suppress-p type warning-suppress-types) - (let ((window (display-buffer buffer))) - (when (and (markerp warning-series) - (eq (marker-buffer warning-series) buffer)) - (set-window-start window warning-series)) - (sit-for 0)))))))) + (cond (noninteractive + ;; Noninteractively, take the text we inserted + ;; in the warnings buffer and print it. + ;; Do this unconditionally, since there is no way + ;; to view logged messages unless we output them. + (with-current-buffer buffer + (save-excursion + ;; Don't include the final newline in the arg + ;; to `message', because it adds a newline. + (goto-char end) + (if (bolp) + (forward-char -1)) + (message "%s" (buffer-substring start (point)))))) + ((and (daemonp) (null after-init-time)) + ;; Warnings assigned during daemon initialization go into + ;; the messages buffer. + (message "%s" + (with-current-buffer buffer + (save-excursion + (goto-char end) + (if (bolp) + (forward-char -1)) + (buffer-substring start (point)))))) + (t + ;; Interactively, decide whether the warning merits + ;; immediate display. + (or (< (warning-numeric-level level) + (warning-numeric-level warning-minimum-level)) + (warning-suppress-p type warning-suppress-types) + (let ((window (display-buffer buffer))) + (when (and (markerp warning-series) + (eq (marker-buffer warning-series) buffer)) + (set-window-start window warning-series)) + (sit-for 0)))))))) ;;;###autoload (defun lwarn (type level message &rest args) ------------------------------------------------------------ revno: 104109 committer: Juanma Barranquero branch nick: trunk timestamp: Thu 2011-05-05 01:56:09 +0200 message: src/gnutls.c: Remove unused parameter `fildes'. * gnutls.h (emacs_gnutls_write, emacs_gnutls_read): * gnutls.c (emacs_gnutls_write, emacs_gnutls_read): Remove unused parameter `fildes'. * process.c (read_process_output, send_process): Don't pass it. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-05-04 20:03:07 +0000 +++ src/ChangeLog 2011-05-04 23:56:09 +0000 @@ -1,5 +1,12 @@ 2011-05-04 Juanma Barranquero + * gnutls.h (emacs_gnutls_write, emacs_gnutls_read): + * gnutls.c (emacs_gnutls_write, emacs_gnutls_read): + Remove unused parameter `fildes'. + * process.c (read_process_output, send_process): Don't pass it. + +2011-05-04 Juanma Barranquero + Fix previous change: the library cache is defined in w32.c. * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop. (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI". === modified file 'src/gnutls.c' --- src/gnutls.c 2011-05-04 14:03:16 +0000 +++ src/gnutls.c 2011-05-04 23:56:09 +0000 @@ -319,8 +319,7 @@ } EMACS_INT -emacs_gnutls_write (int fildes, struct Lisp_Process *proc, const char *buf, - EMACS_INT nbyte) +emacs_gnutls_write (struct Lisp_Process *proc, const char *buf, EMACS_INT nbyte) { ssize_t rtnval = 0; EMACS_INT bytes_written; @@ -360,8 +359,7 @@ } EMACS_INT -emacs_gnutls_read (int fildes, struct Lisp_Process *proc, char *buf, - EMACS_INT nbyte) +emacs_gnutls_read (struct Lisp_Process *proc, char *buf, EMACS_INT nbyte) { ssize_t rtnval; gnutls_session_t state = proc->gnutls_state; === modified file 'src/gnutls.h' --- src/gnutls.h 2011-05-04 14:03:16 +0000 +++ src/gnutls.h 2011-05-04 23:56:09 +0000 @@ -54,11 +54,9 @@ #define GNUTLS_LOG2(level, max, string, extra) if (level <= max) { gnutls_log_function2 (level, "(Emacs) " string, extra); } extern EMACS_INT -emacs_gnutls_write (int fildes, struct Lisp_Process *proc, const char *buf, - EMACS_INT nbyte); +emacs_gnutls_write (struct Lisp_Process *proc, const char *buf, EMACS_INT nbyte); extern EMACS_INT -emacs_gnutls_read (int fildes, struct Lisp_Process *proc, char *buf, - EMACS_INT nbyte); +emacs_gnutls_read (struct Lisp_Process *proc, char *buf, EMACS_INT nbyte); extern int emacs_gnutls_record_check_pending (gnutls_session_t state); extern void emacs_gnutls_transport_set_errno (gnutls_session_t state, int err); === modified file 'src/process.c' --- src/process.c 2011-05-04 14:03:16 +0000 +++ src/process.c 2011-05-04 23:56:09 +0000 @@ -4952,7 +4952,7 @@ } #ifdef HAVE_GNUTLS if (XPROCESS (proc)->gnutls_p) - nbytes = emacs_gnutls_read (channel, XPROCESS (proc), + nbytes = emacs_gnutls_read (XPROCESS (proc), chars + carryover + buffered, readmax - buffered); else @@ -5415,9 +5415,8 @@ { #ifdef HAVE_GNUTLS if (XPROCESS (proc)->gnutls_p) - written = emacs_gnutls_write (outfd, - XPROCESS (proc), - buf, this); + written = emacs_gnutls_write (XPROCESS (proc), + buf, this); else #endif written = emacs_write (outfd, buf, this); ------------------------------------------------------------ revno: 104108 committer: Juanma Barranquero branch nick: trunk timestamp: Wed 2011-05-04 22:03:07 +0200 message: Fix previous change: the library cache is defined in w32.c. * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop. (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI". diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-05-04 14:03:16 +0000 +++ src/ChangeLog 2011-05-04 20:03:07 +0000 @@ -1,5 +1,11 @@ 2011-05-04 Juanma Barranquero + Fix previous change: the library cache is defined in w32.c. + * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop. + (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI". + +2011-05-04 Juanma Barranquero + Implement dynamic loading of GnuTLS on Windows. * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro. === modified file 'src/image.c' --- src/image.c 2011-05-04 14:03:16 +0000 +++ src/image.c 2011-05-04 20:03:07 +0000 @@ -584,9 +584,12 @@ static void x_emboss (struct frame *, struct image *); static int x_build_heuristic_mask (struct frame *, struct image *, Lisp_Object); - +#ifdef HAVE_NTGUI #define CACHE_IMAGE_TYPE(type, status) \ do { Vlibrary_cache = Fcons (Fcons (type, status), Vlibrary_cache); } while (0) +#else +#define CACHE_IMAGE_TYPE(type, status) +#endif #define ADD_IMAGE_TYPE(type) \ do { Vimage_types = Fcons (type, Vimage_types); } while (0) @@ -8601,10 +8604,12 @@ { Lisp_Object tested; +#ifdef HAVE_NTGUI /* Don't try to reload the library. */ tested = Fassq (type, Vlibrary_cache); if (CONSP (tested)) return XCDR (tested); +#endif #if defined (HAVE_XPM) || defined (HAVE_NS) if (EQ (type, Qxpm)) ------------------------------------------------------------ revno: 104107 committer: Chong Yidong branch nick: trunk timestamp: Wed 2011-05-04 11:38:41 -0400 message: Make autoloading commands prompt for autoload file (Bug#7989) * emacs-lisp/autoload.el (generated-autoload-file): Set to nil. (autoload-find-generated-file): New function. (generate-file-autoloads): Bind generated-autoload-file to buffer-file-name. (update-file-autoloads, update-directory-autoloads): Use autoload-find-generated-file. If called interactively, prompt for output file. (batch-update-autoloads): Doc fix. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-04 14:03:16 +0000 +++ lisp/ChangeLog 2011-05-04 15:38:41 +0000 @@ -1,3 +1,14 @@ +2011-05-04 Chong Yidong + + * emacs-lisp/autoload.el (generated-autoload-file): Set to nil. + (autoload-find-generated-file): New function. + (generate-file-autoloads): Bind generated-autoload-file to + buffer-file-name. + (update-file-autoloads, update-directory-autoloads): Use + autoload-find-generated-file. If called interactively, prompt for + output file (Bug#7989). + (batch-update-autoloads): Doc fix. + 2011-05-04 Juanma Barranquero * term/w32-win.el (dynamic-library-alist): Add `gnutls'. === modified file 'lisp/emacs-lisp/autoload.el' --- lisp/emacs-lisp/autoload.el 2011-05-03 15:33:05 +0000 +++ lisp/emacs-lisp/autoload.el 2011-05-04 15:38:41 +0000 @@ -34,8 +34,8 @@ (require 'help-fns) ;for help-add-fundoc-usage. (eval-when-compile (require 'cl)) -(defvar generated-autoload-file "loaddefs.el" - "File \\[update-file-autoloads] puts autoloads into. +(defvar generated-autoload-file nil + "File into which to write autoload definitions. A Lisp file can set this in its local variables section to make its autoloads go somewhere else. @@ -198,6 +198,15 @@ ;; the doc-string in FORM. ;; Those properties are now set in lisp-mode.el. +(defun autoload-find-generated-file () + "Visit the autoload file for the current buffer, and return its buffer. +If a buffer is visiting the desired autoload file, return it." + (let ((enable-local-variables :safe)) + ;; We used to use `raw-text' to read this file, but this causes + ;; problems when the file contains non-ASCII characters. + (find-file-noselect + (autoload-ensure-default-file (autoload-generated-file))))) + (defun autoload-generated-file () (expand-file-name generated-autoload-file ;; File-local settings of generated-autoload-file should @@ -389,7 +398,8 @@ are used. Return non-nil in the case where no autoloads were added at point." (interactive "fGenerate autoloads for file: ") - (autoload-generate-file-autoloads file (current-buffer))) + (let ((generated-autoload-file buffer-file-name)) + (autoload-generate-file-autoloads file (current-buffer)))) (defvar print-readably) @@ -550,15 +560,22 @@ (save-buffer))))) ;;;###autoload -(defun update-file-autoloads (file &optional save-after) - "Update the autoloads for FILE in `generated-autoload-file' -\(which FILE might bind in its local variables). -If SAVE-AFTER is non-nil (which is always, when called interactively), -save the buffer too. +(defun update-file-autoloads (file &optional save-after outfile) + "Update the autoloads for FILE. +If prefix arg SAVE-AFTER is non-nil, save the buffer too. + +If FILE binds `generated-autoload-file' as a file-local variable, +autoloads are written into that file. Otherwise, the autoloads +file is determined by OUTFILE. If called interactively, prompt +for OUTFILE; if called from Lisp with OUTFILE nil, use the +existing value of `generated-autoload-file'. Return FILE if there was no autoload cookie in it, else nil." - (interactive "fUpdate autoloads for file: \np") - (let* ((autoload-modified-buffers nil) + (interactive (list (read-file-name "Update autoloads for file: ") + current-prefix-arg + (read-file-name "Write autoload definitions to file: "))) + (let* ((generated-autoload-file (or outfile generated-autoload-file)) + (autoload-modified-buffers nil) (no-autoloads (autoload-generate-file-autoloads file))) (if autoload-modified-buffers (if save-after (autoload-save-buffers)) @@ -576,12 +593,7 @@ (let* ((buf (current-buffer)) (existing-buffer (if buffer-file-name buf)) (found nil)) - (with-current-buffer - ;; We used to use `raw-text' to read this file, but this causes - ;; problems when the file contains non-ASCII characters. - (let ((enable-local-variables :safe)) - (find-file-noselect - (autoload-ensure-default-file (autoload-generated-file)))) + (with-current-buffer (autoload-find-generated-file) ;; This is to make generated-autoload-file have Unix EOLs, so ;; that it is portable to all platforms. (or (eq 0 (coding-system-eol-type buffer-file-coding-system)) @@ -640,15 +652,20 @@ ;;;###autoload (defun update-directory-autoloads (&rest dirs) - "\ -Update loaddefs.el with all the current autoloads from DIRS, and no old ones. -This uses `update-file-autoloads' (which see) to do its work. -In an interactive call, you must give one argument, the name -of a single directory. In a call from Lisp, you can supply multiple + "Update autoload definitions for Lisp files in the directories DIRS. +In an interactive call, you must give one argument, the name of a +single directory. In a call from Lisp, you can supply multiple directories as separate arguments, but this usage is discouraged. The function does NOT recursively descend into subdirectories of the -directory or directories specified." +directory or directories specified. + +In an interactive call, prompt for a default output file for the +autoload definitions, and temporarily bind the variable +`generated-autoload-file' to this value. When called from Lisp, +use the existing value of `generated-autoload-file'. If any Lisp +file binds `generated-autoload-file' as a file-local variable, +write its autoloads into the specified file instead." (interactive "DUpdate autoloads from directory: ") (let* ((files-re (let ((tmp nil)) (dolist (suf (get-load-suffixes) @@ -664,14 +681,14 @@ ;; Files with no autoload cookies or whose autoloads go to other ;; files because of file-local autoload-generated-file settings. (no-autoloads nil) - (autoload-modified-buffers nil)) + (autoload-modified-buffers nil) + (generated-autoload-file + (if (called-interactively-p 'interactive) + (read-file-name "Write autoload definitions to file: ") + generated-autoload-file))) - (with-current-buffer - (let ((enable-local-variables :safe)) - (find-file-noselect - (autoload-ensure-default-file (autoload-generated-file)))) + (with-current-buffer (autoload-find-generated-file) (save-excursion - ;; Canonicalize file names and remove the autoload file itself. (setq files (delete (file-relative-name buffer-file-name) (mapcar 'file-relative-name files))) @@ -748,7 +765,9 @@ ;;;###autoload (defun batch-update-autoloads () "Update loaddefs.el autoloads in batch mode. -Calls `update-directory-autoloads' on the command line arguments." +Calls `update-directory-autoloads' on the command line arguments. +Definitions are written to `generated-autoload-file' (which +should be non-nil)." ;; For use during the Emacs build process only. (unless autoload-excludes (let* ((ldir (file-name-directory generated-autoload-file)) ------------------------------------------------------------ revno: 104106 committer: Juanma Barranquero branch nick: trunk timestamp: Wed 2011-05-04 16:03:16 +0200 message: Implement dynamic loading of GnuTLS on Windows. * lisp/term/w32-win.el (dynamic-library-alist): Add `gnutls'. * nt/INSTALL: Clarify GnuTLS support. * src/callproc.c, src/emacs.c: Include lisp.h before src/w32.h, not after. * src/gnutls.c (Qgnutls_dll): Define. (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros. (gnutls_*): Declare function pointers. (init_gnutls_functions): New function to initialize function pointers. (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit) (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers. (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno): Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno. (emacs_gnutls_write, emacs_gnutls_read) (emacs_gnutls_handle_error, Fgnutls_error_fatalp) (Fgnutls_available_p): New function. (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers. (syms_of_gnutls) : Initialize and staticpro it. (syms_of_gnutls) : defsubr it. * src/gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro. (emacs_gnutls_write, emacs_gnutls_read): Mark as extern. (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno): Declare. * src/w32.c (QCloaded_from, Vlibrary_cache): Define. (w32_delayed_load): Move from image.c. When loading a library, record its filename in the :loaded-from property of the library id. (globals_of_w32) : Initialize and staticpro them. (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions. * src/image.c: Include w32.h. (Vimage_type_cache): Delete. (syms_of_image) : Don't initialize and staticpro it. (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead. (w32_delayed_load): Move to w32.c. * src/process.c: Include lisp.h before src/w32.h, not after. (wait_reading_process_output): Call emacs_gnutls_record_check_pending instead of gnutls_record_check_pending. * src/w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-04 02:06:28 +0000 +++ lisp/ChangeLog 2011-05-04 14:03:16 +0000 @@ -1,3 +1,7 @@ +2011-05-04 Juanma Barranquero + + * term/w32-win.el (dynamic-library-alist): Add `gnutls'. + 2011-05-04 Glenn Morris * calendar/diary-lib.el (diary-fancy-date-pattern): Turn it into a === modified file 'lisp/term/w32-win.el' --- lisp/term/w32-win.el 2011-02-03 07:31:42 +0000 +++ lisp/term/w32-win.el 2011-05-04 14:03:16 +0000 @@ -202,13 +202,14 @@ '(png "libpng12d.dll" "libpng12.dll" "libpng3.dll" "libpng.dll" ;; these are libpng 1.2.8 from GTK+ "libpng13d.dll" "libpng13.dll")) - '(jpeg "jpeg62.dll" "libjpeg.dll" "jpeg-62.dll" "jpeg.dll") - '(tiff "libtiff3.dll" "libtiff.dll") - '(gif "giflib4.dll" "libungif4.dll" "libungif.dll") - '(svg "librsvg-2-2.dll") - '(gdk-pixbuf "libgdk_pixbuf-2.0-0.dll") - '(glib "libglib-2.0-0.dll") - '(gobject "libgobject-2.0-0.dll"))) + '(jpeg "jpeg62.dll" "libjpeg.dll" "jpeg-62.dll" "jpeg.dll") + '(tiff "libtiff3.dll" "libtiff.dll") + '(gif "giflib4.dll" "libungif4.dll" "libungif.dll") + '(svg "librsvg-2-2.dll") + '(gdk-pixbuf "libgdk_pixbuf-2.0-0.dll") + '(glib "libglib-2.0-0.dll") + '(gobject "libgobject-2.0-0.dll") + '(gnutls "libgnutls-26.dll"))) ;;; multi-tty support (defvar w32-initialized nil === modified file 'nt/ChangeLog' --- nt/ChangeLog 2011-04-30 09:14:30 +0000 +++ nt/ChangeLog 2011-05-04 14:03:16 +0000 @@ -1,3 +1,7 @@ +2011-05-04 Juanma Barranquero + + * INSTALL: Clarify GnuTLS support. + 2011-04-30 Eli Zaretskii * config.nt (HAVE_LONG_LONG_INT, HAVE_UNSIGNED_LONG_LONG_INT): === modified file 'nt/INSTALL' --- nt/INSTALL 2011-04-28 20:28:51 +0000 +++ nt/INSTALL 2011-05-04 14:03:16 +0000 @@ -325,12 +325,17 @@ * Optional GnuTLS support - You can build Emacs with GnuTLS support. Put the gnutls/gnutls.h header in - the include path and link to the appropriate libraries (gnutls.dll and - gcrypt.dll) with the --lib option. - - You can get pre-built binaries and an installer at - http://josefsson.org/gnutls4win/. + If configure.bat finds the gnutls/gnutls.h file in the include path, + Emacs is built with GnuTLS support by default; to avoid that you can + pass the argument --without-gnutls. + + In order to support GnuTLS at runtime, a GnuTLS-enabled Emacs must + be able to find the relevant DLLs during startup; failure to do so + is not an error, but GnuTLS won't be available to the running + session. + + You can get pre-built binaries (including any required DLL and the + gnutls.h file) and an installer at http://josefsson.org/gnutls4win/. * Experimental SVG support === modified file 'src/ChangeLog' --- src/ChangeLog 2011-05-04 01:45:27 +0000 +++ src/ChangeLog 2011-05-04 14:03:16 +0000 @@ -1,3 +1,48 @@ +2011-05-04 Juanma Barranquero + + Implement dynamic loading of GnuTLS on Windows. + + * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro. + (emacs_gnutls_write, emacs_gnutls_read): Mark as extern. + (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno): + Declare. + + * gnutls.c (Qgnutls_dll): Define. + (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros. + (gnutls_*): Declare function pointers. + (init_gnutls_functions): New function to initialize function pointers. + (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit) + (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers. + (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno): + Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno. + (emacs_gnutls_write, emacs_gnutls_read) + (emacs_gnutls_handle_error, Fgnutls_error_fatalp) + (Fgnutls_available_p): New function. + (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers. + (syms_of_gnutls) : Initialize and staticpro it. + (syms_of_gnutls) : defsubr it. + + * image.c: Include w32.h. + (Vimage_type_cache): Delete. + (syms_of_image) : Don't initialize and staticpro it. + (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead. + (w32_delayed_load): Move to w32.c. + + * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare. + + * w32.c (QCloaded_from, Vlibrary_cache): Define. + (w32_delayed_load): Move from image.c. When loading a library, record + its filename in the :loaded-from property of the library id. + (globals_of_w32) : + Initialize and staticpro them. + (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions. + + * process.c: Include lisp.h before w32.h, not after. + (wait_reading_process_output): Call emacs_gnutls_record_check_pending + instead of gnutls_record_check_pending. + + * callproc.c, emacs.c: Include lisp.h before w32.h, not after. + 2011-05-04 Teodor Zlatanov * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options === modified file 'src/callproc.c' --- src/callproc.c 2011-05-01 09:02:01 +0000 +++ src/callproc.c 2011-05-04 14:03:16 +0000 @@ -29,6 +29,8 @@ #include #include +#include "lisp.h" + #ifdef WINDOWSNT #define NOMINMAX #include @@ -41,7 +43,6 @@ #include #endif /* MSDOS */ -#include "lisp.h" #include "commands.h" #include "buffer.h" #include "character.h" === modified file 'src/emacs.c' --- src/emacs.c 2011-04-16 20:21:26 +0000 +++ src/emacs.c 2011-05-04 14:03:16 +0000 @@ -29,6 +29,8 @@ #include #include +#include "lisp.h" + #ifdef WINDOWSNT #include #include /* just for w32.h */ @@ -41,7 +43,6 @@ #include #endif -#include "lisp.h" #include "commands.h" #include "intervals.h" #include "buffer.h" === modified file 'src/gnutls.c' --- src/gnutls.c 2011-05-04 01:45:27 +0000 +++ src/gnutls.c 2011-05-04 14:03:16 +0000 @@ -34,6 +34,7 @@ static int emacs_gnutls_handle_error (gnutls_session_t, int err); +static Lisp_Object Qgnutls_dll; static Lisp_Object Qgnutls_log_level; static Lisp_Object Qgnutls_code; static Lisp_Object Qgnutls_anon, Qgnutls_x509pki; @@ -56,6 +57,181 @@ /* Callback keys for `gnutls-boot'. Unused currently. */ static Lisp_Object Qgnutls_bootprop_callbacks_verify; +static void gnutls_log_function (int, const char *); +static void gnutls_log_function2 (int, const char*, const char*); + + +#ifdef WINDOWSNT + +/* Macro for defining functions that will be loaded from the GnuTLS DLL. */ +#define DEF_GNUTLS_FN(rettype,func,args) rettype (FAR CDECL *fn_##func)args + +/* Macro for loading GnuTLS functions from the library. */ +#define LOAD_GNUTLS_FN(lib,func) { \ + fn_##func = (void *) GetProcAddress (lib, #func); \ + if (!fn_##func) return 0; \ + } + +DEF_GNUTLS_FN (gnutls_alert_description_t, gnutls_alert_get, + (gnutls_session_t)); +DEF_GNUTLS_FN (const char *, gnutls_alert_get_name, + (gnutls_alert_description_t)); +DEF_GNUTLS_FN (int, gnutls_alert_send_appropriate, (gnutls_session_t, int)); +DEF_GNUTLS_FN (int, gnutls_anon_allocate_client_credentials, + (gnutls_anon_client_credentials_t *)); +DEF_GNUTLS_FN (void, gnutls_anon_free_client_credentials, + (gnutls_anon_client_credentials_t)); +DEF_GNUTLS_FN (int, gnutls_bye, (gnutls_session_t, gnutls_close_request_t)); +DEF_GNUTLS_FN (int, gnutls_certificate_allocate_credentials, + (gnutls_certificate_credentials_t *)); +DEF_GNUTLS_FN (void, gnutls_certificate_free_credentials, + (gnutls_certificate_credentials_t)); +DEF_GNUTLS_FN (const gnutls_datum_t *, gnutls_certificate_get_peers, + (gnutls_session_t, unsigned int *)); +DEF_GNUTLS_FN (void, gnutls_certificate_set_verify_flags, + (gnutls_certificate_credentials_t, unsigned int)); +DEF_GNUTLS_FN (int, gnutls_certificate_set_x509_crl_file, + (gnutls_certificate_credentials_t, const char *, + gnutls_x509_crt_fmt_t)); +DEF_GNUTLS_FN (int, gnutls_certificate_set_x509_key_file, + (gnutls_certificate_credentials_t, const char *, const char *, + gnutls_x509_crt_fmt_t)); +DEF_GNUTLS_FN (int, gnutls_certificate_set_x509_trust_file, + (gnutls_certificate_credentials_t, const char *, + gnutls_x509_crt_fmt_t)); +DEF_GNUTLS_FN (gnutls_certificate_type_t, gnutls_certificate_type_get, + (gnutls_session_t)); +DEF_GNUTLS_FN (int, gnutls_certificate_verify_peers2, + (gnutls_session_t, unsigned int *)); +DEF_GNUTLS_FN (int, gnutls_credentials_set, + (gnutls_session_t, gnutls_credentials_type_t, void *)); +DEF_GNUTLS_FN (void, gnutls_deinit, (gnutls_session_t)); +DEF_GNUTLS_FN (int, gnutls_error_is_fatal, (int)); +DEF_GNUTLS_FN (int, gnutls_global_init, (void)); +DEF_GNUTLS_FN (void, gnutls_global_set_log_function, (gnutls_log_func)); +DEF_GNUTLS_FN (void, gnutls_global_set_log_level, (int)); +DEF_GNUTLS_FN (int, gnutls_handshake, (gnutls_session_t)); +DEF_GNUTLS_FN (int, gnutls_init, (gnutls_session_t *, gnutls_connection_end_t)); +DEF_GNUTLS_FN (int, gnutls_priority_set_direct, + (gnutls_session_t, const char *, const char **)); +DEF_GNUTLS_FN (size_t, gnutls_record_check_pending, (gnutls_session_t)); +DEF_GNUTLS_FN (ssize_t, gnutls_record_recv, (gnutls_session_t, void *, size_t)); +DEF_GNUTLS_FN (ssize_t, gnutls_record_send, + (gnutls_session_t, const void *, size_t)); +DEF_GNUTLS_FN (const char *, gnutls_strerror, (int)); +DEF_GNUTLS_FN (void, gnutls_transport_set_errno, (gnutls_session_t, int)); +DEF_GNUTLS_FN (void, gnutls_transport_set_lowat, (gnutls_session_t, int)); +DEF_GNUTLS_FN (void, gnutls_transport_set_ptr2, + (gnutls_session_t, gnutls_transport_ptr_t, + gnutls_transport_ptr_t)); +DEF_GNUTLS_FN (void, gnutls_transport_set_pull_function, + (gnutls_session_t, gnutls_pull_func)); +DEF_GNUTLS_FN (void, gnutls_transport_set_push_function, + (gnutls_session_t, gnutls_push_func)); +DEF_GNUTLS_FN (int, gnutls_x509_crt_check_hostname, + (gnutls_x509_crt_t, const char *)); +DEF_GNUTLS_FN (void, gnutls_x509_crt_deinit, (gnutls_x509_crt_t)); +DEF_GNUTLS_FN (int, gnutls_x509_crt_import, + (gnutls_x509_crt_t, const gnutls_datum_t *, + gnutls_x509_crt_fmt_t)); +DEF_GNUTLS_FN (int, gnutls_x509_crt_init, (gnutls_x509_crt_t *)); + +static int +init_gnutls_functions (Lisp_Object libraries) +{ + HMODULE library; + + if (!(library = w32_delayed_load (libraries, Qgnutls_dll))) + { + GNUTLS_LOG (1, 1, "GnuTLS library not found"); + return 0; + } + + LOAD_GNUTLS_FN (library, gnutls_alert_get); + LOAD_GNUTLS_FN (library, gnutls_alert_get_name); + LOAD_GNUTLS_FN (library, gnutls_alert_send_appropriate); + LOAD_GNUTLS_FN (library, gnutls_anon_allocate_client_credentials); + LOAD_GNUTLS_FN (library, gnutls_anon_free_client_credentials); + LOAD_GNUTLS_FN (library, gnutls_bye); + LOAD_GNUTLS_FN (library, gnutls_certificate_allocate_credentials); + LOAD_GNUTLS_FN (library, gnutls_certificate_free_credentials); + LOAD_GNUTLS_FN (library, gnutls_certificate_get_peers); + LOAD_GNUTLS_FN (library, gnutls_certificate_set_verify_flags); + LOAD_GNUTLS_FN (library, gnutls_certificate_set_x509_crl_file); + LOAD_GNUTLS_FN (library, gnutls_certificate_set_x509_key_file); + LOAD_GNUTLS_FN (library, gnutls_certificate_set_x509_trust_file); + LOAD_GNUTLS_FN (library, gnutls_certificate_type_get); + LOAD_GNUTLS_FN (library, gnutls_certificate_verify_peers2); + LOAD_GNUTLS_FN (library, gnutls_credentials_set); + LOAD_GNUTLS_FN (library, gnutls_deinit); + LOAD_GNUTLS_FN (library, gnutls_error_is_fatal); + LOAD_GNUTLS_FN (library, gnutls_global_init); + LOAD_GNUTLS_FN (library, gnutls_global_set_log_function); + LOAD_GNUTLS_FN (library, gnutls_global_set_log_level); + LOAD_GNUTLS_FN (library, gnutls_handshake); + LOAD_GNUTLS_FN (library, gnutls_init); + LOAD_GNUTLS_FN (library, gnutls_priority_set_direct); + LOAD_GNUTLS_FN (library, gnutls_record_check_pending); + LOAD_GNUTLS_FN (library, gnutls_record_recv); + LOAD_GNUTLS_FN (library, gnutls_record_send); + LOAD_GNUTLS_FN (library, gnutls_strerror); + LOAD_GNUTLS_FN (library, gnutls_transport_set_errno); + LOAD_GNUTLS_FN (library, gnutls_transport_set_lowat); + LOAD_GNUTLS_FN (library, gnutls_transport_set_ptr2); + LOAD_GNUTLS_FN (library, gnutls_transport_set_pull_function); + LOAD_GNUTLS_FN (library, gnutls_transport_set_push_function); + LOAD_GNUTLS_FN (library, gnutls_x509_crt_check_hostname); + LOAD_GNUTLS_FN (library, gnutls_x509_crt_deinit); + LOAD_GNUTLS_FN (library, gnutls_x509_crt_import); + LOAD_GNUTLS_FN (library, gnutls_x509_crt_init); + + GNUTLS_LOG2 (1, 1, "GnuTLS library loaded:", + SDATA (Fget (Qgnutls_dll, QCloaded_from))); + return 1; +} + +#else /* !WINDOWSNT */ + +#define fn_gnutls_alert_get gnutls_alert_get +#define fn_gnutls_alert_get_name gnutls_alert_get_name +#define fn_gnutls_alert_send_appropriate gnutls_alert_send_appropriate +#define fn_gnutls_anon_allocate_client_credentials gnutls_anon_allocate_client_credentials +#define fn_gnutls_anon_free_client_credentials gnutls_anon_free_client_credentials +#define fn_gnutls_bye gnutls_bye +#define fn_gnutls_certificate_allocate_credentials gnutls_certificate_allocate_credentials +#define fn_gnutls_certificate_free_credentials gnutls_certificate_free_credentials +#define fn_gnutls_certificate_get_peers gnutls_certificate_get_peers +#define fn_gnutls_certificate_set_verify_flags gnutls_certificate_set_verify_flags +#define fn_gnutls_certificate_set_x509_crl_file gnutls_certificate_set_x509_crl_file +#define fn_gnutls_certificate_set_x509_trust_file gnutls_certificate_set_x509_trust_file +#define fn_gnutls_certificate_type_get gnutls_certificate_type_get +#define fn_gnutls_certificate_verify_peers2 gnutls_certificate_verify_peers2 +#define fn_gnutls_credentials_set gnutls_credentials_set +#define fn_gnutls_deinit gnutls_deinit +#define fn_gnutls_error_is_fatal gnutls_error_is_fatal +#define fn_gnutls_global_init gnutls_global_init +#define fn_gnutls_global_set_log_function gnutls_global_set_log_function +#define fn_gnutls_global_set_log_level gnutls_global_set_log_level +#define fn_gnutls_handshake gnutls_handshake +#define fn_gnutls_init gnutls_init +#define fn_gnutls_priority_set_direct gnutls_priority_set_direct +#define fn_gnutls_record_check_pending gnutls_record_check_pending +#define fn_gnutls_record_recv gnutls_record_recv +#define fn_gnutls_record_send gnutls_record_send +#define fn_gnutls_strerror gnutls_strerror +#define fn_gnutls_transport_set_errno gnutls_transport_set_errno +#define fn_gnutls_transport_set_lowat gnutls_transport_set_lowat +#define fn_gnutls_transport_set_ptr2 gnutls_transport_set_ptr2 +#define fn_gnutls_transport_set_pull_function gnutls_transport_set_pull_function +#define fn_gnutls_transport_set_push_function gnutls_transport_set_push_function +#define fn_gnutls_x509_crt_check_hostname gnutls_x509_crt_check_hostname +#define fn_gnutls_x509_crt_deinit gnutls_x509_crt_deinit +#define fn_gnutls_x509_crt_import gnutls_x509_crt_import +#define fn_gnutls_x509_crt_init gnutls_x509_crt_init + +#endif /* !WINDOWSNT */ + + static void gnutls_log_function (int level, const char* string) { @@ -83,11 +259,11 @@ /* On W32 we cannot transfer socket handles between different runtime libraries, so we tell GnuTLS to use our special push/pull functions. */ - gnutls_transport_set_ptr2 (state, - (gnutls_transport_ptr_t) proc, - (gnutls_transport_ptr_t) proc); - gnutls_transport_set_push_function (state, &emacs_gnutls_push); - gnutls_transport_set_pull_function (state, &emacs_gnutls_pull); + fn_gnutls_transport_set_ptr2 (state, + (gnutls_transport_ptr_t) proc, + (gnutls_transport_ptr_t) proc); + fn_gnutls_transport_set_push_function (state, &emacs_gnutls_push); + fn_gnutls_transport_set_pull_function (state, &emacs_gnutls_pull); /* For non blocking sockets or other custom made pull/push functions the gnutls_transport_set_lowat must be called, with @@ -96,14 +272,14 @@ (Note: this is probably not strictly necessary as the lowat value is only used when no custom pull/push functions are set.) */ - gnutls_transport_set_lowat (state, 0); + fn_gnutls_transport_set_lowat (state, 0); #else /* This is how GnuTLS takes sockets: as file descriptors passed in. For an Emacs process socket, infd and outfd are the same but we use this two-argument version for clarity. */ - gnutls_transport_set_ptr2 (state, - (gnutls_transport_ptr_t) (long) proc->infd, - (gnutls_transport_ptr_t) (long) proc->outfd); + fn_gnutls_transport_set_ptr2 (state, + (gnutls_transport_ptr_t) (long) proc->infd, + (gnutls_transport_ptr_t) (long) proc->outfd); #endif proc->gnutls_initstage = GNUTLS_STAGE_TRANSPORT_POINTERS_SET; @@ -111,10 +287,10 @@ do { - ret = gnutls_handshake (state); + ret = fn_gnutls_handshake (state); emacs_gnutls_handle_error (state, ret); } - while (ret < 0 && gnutls_error_is_fatal (ret) == 0); + while (ret < 0 && fn_gnutls_error_is_fatal (ret) == 0); proc->gnutls_initstage = GNUTLS_STAGE_HANDSHAKE_TRIED; @@ -125,11 +301,23 @@ } else { - gnutls_alert_send_appropriate (state, ret); + fn_gnutls_alert_send_appropriate (state, ret); } return ret; } +int +emacs_gnutls_record_check_pending (gnutls_session_t state) +{ + return fn_gnutls_record_check_pending (state); +} + +void +emacs_gnutls_transport_set_errno (gnutls_session_t state, int err) +{ + fn_gnutls_transport_set_errno (state, err); +} + EMACS_INT emacs_gnutls_write (int fildes, struct Lisp_Process *proc, const char *buf, EMACS_INT nbyte) @@ -152,7 +340,7 @@ while (nbyte > 0) { - rtnval = gnutls_write (state, buf, nbyte); + rtnval = fn_gnutls_record_send (state, buf, nbyte); if (rtnval < 0) { @@ -183,7 +371,7 @@ emacs_gnutls_handshake (proc); return -1; } - rtnval = gnutls_read (state, buf, nbyte); + rtnval = fn_gnutls_record_recv (state, buf, nbyte); if (rtnval >= 0) return rtnval; else if (emacs_gnutls_handle_error (state, rtnval) == 0) @@ -215,11 +403,11 @@ /* TODO: use gnutls-error-fatalp and gnutls-error-string. */ - str = gnutls_strerror (err); + str = fn_gnutls_strerror (err); if (!str) str = "unknown"; - if (gnutls_error_is_fatal (err)) + if (fn_gnutls_error_is_fatal (err)) { ret = err; GNUTLS_LOG2 (0, max_log_level, "fatal error:", str); @@ -234,9 +422,9 @@ if (err == GNUTLS_E_WARNING_ALERT_RECEIVED || err == GNUTLS_E_FATAL_ALERT_RECEIVED) { - int alert = gnutls_alert_get (session); + int alert = fn_gnutls_alert_get (session); int level = (err == GNUTLS_E_FATAL_ALERT_RECEIVED) ? 0 : 1; - str = gnutls_alert_get_name (alert); + str = fn_gnutls_alert_get_name (alert); if (!str) str = "unknown"; @@ -314,7 +502,7 @@ if (!NUMBERP (err)) error ("Not an error symbol or code"); - if (0 == gnutls_error_is_fatal (XINT (err))) + if (0 == fn_gnutls_error_is_fatal (XINT (err))) return Qnil; return Qt; @@ -346,7 +534,7 @@ if (!NUMBERP (err)) return build_string ("Not an error symbol or code"); - return build_string (gnutls_strerror (XINT (err))); + return build_string (fn_gnutls_strerror (XINT (err))); } DEFUN ("gnutls-deinit", Fgnutls_deinit, Sgnutls_deinit, 1, 1, 0, @@ -361,13 +549,34 @@ if (GNUTLS_INITSTAGE (proc) >= GNUTLS_STAGE_INIT) { - gnutls_deinit (state); + fn_gnutls_deinit (state); GNUTLS_INITSTAGE (proc) = GNUTLS_STAGE_INIT - 1; } return Qt; } +DEFUN ("gnutls-available-p", Fgnutls_available_p, Sgnutls_available_p, 0, 0, 0, + doc: /* Return t if GnuTLS is available in this instance of Emacs. */) + (void) +{ +#ifdef WINDOWSNT + Lisp_Object found = Fassq (Qgnutls_dll, Vlibrary_cache); + if (CONSP (found)) + return XCDR (found); + else + { + Lisp_Object status; + status = init_gnutls_functions (Vdynamic_library_alist) ? Qt : Qnil; + Vlibrary_cache = Fcons (Fcons (Qgnutls_dll, status), Vlibrary_cache); + return status; + } +#else + return Qt; +#endif +} + + /* Initializes global GnuTLS state to defaults. Call `gnutls-global-deinit' when GnuTLS usage is no longer needed. Returns zero on success. */ @@ -377,8 +586,7 @@ int ret = GNUTLS_E_SUCCESS; if (!gnutls_global_initialized) - ret = gnutls_global_init (); - + ret = fn_gnutls_global_init (); gnutls_global_initialized = 1; return gnutls_make_error (ret); @@ -488,6 +696,12 @@ CHECK_SYMBOL (type); CHECK_LIST (proplist); + if (NILP (Fgnutls_available_p ())) + { + error ("GnuTLS not available"); + return gnutls_make_error (GNUTLS_EMACS_ERROR_NOT_LOADED); + } + hostname = Fplist_get (proplist, Qgnutls_bootprop_hostname); priority_string = Fplist_get (proplist, Qgnutls_bootprop_priority); trustfiles = Fplist_get (proplist, Qgnutls_bootprop_trustfiles); @@ -509,8 +723,8 @@ if (NUMBERP (loglevel)) { - gnutls_global_set_log_function (gnutls_log_function); - gnutls_global_set_log_level (XINT (loglevel)); + fn_gnutls_global_set_log_function (gnutls_log_function); + fn_gnutls_global_set_log_level (XINT (loglevel)); max_log_level = XINT (loglevel); XPROCESS (proc)->gnutls_log_level = max_log_level; } @@ -529,13 +743,13 @@ { GNUTLS_LOG (2, max_log_level, "deallocating x509 credentials"); x509_cred = XPROCESS (proc)->gnutls_x509_cred; - gnutls_certificate_free_credentials (x509_cred); + fn_gnutls_certificate_free_credentials (x509_cred); } else if (EQ (type, Qgnutls_anon)) { GNUTLS_LOG (2, max_log_level, "deallocating anon credentials"); anon_cred = XPROCESS (proc)->gnutls_anon_cred; - gnutls_anon_free_client_credentials (anon_cred); + fn_gnutls_anon_free_client_credentials (anon_cred); } else { @@ -558,7 +772,7 @@ { GNUTLS_LOG (2, max_log_level, "allocating x509 credentials"); x509_cred = XPROCESS (proc)->gnutls_x509_cred; - if (gnutls_certificate_allocate_credentials (&x509_cred) < 0) + if (fn_gnutls_certificate_allocate_credentials (&x509_cred) < 0) memory_full (); if (NUMBERP (verify_flags)) @@ -576,13 +790,13 @@ /* The default is already GNUTLS_VERIFY_ALLOW_X509_V1_CA_CRT. */ GNUTLS_LOG (2, max_log_level, "ignoring invalid verify-flags"); } - gnutls_certificate_set_verify_flags (x509_cred, gnutls_verify_flags); + fn_gnutls_certificate_set_verify_flags (x509_cred, gnutls_verify_flags); } else if (EQ (type, Qgnutls_anon)) { GNUTLS_LOG (2, max_log_level, "allocating anon credentials"); anon_cred = XPROCESS (proc)->gnutls_anon_cred; - if (gnutls_anon_allocate_client_credentials (&anon_cred) < 0) + if (fn_gnutls_anon_allocate_client_credentials (&anon_cred) < 0) memory_full (); } else @@ -605,7 +819,7 @@ { GNUTLS_LOG2 (1, max_log_level, "setting the trustfile: ", SSDATA (trustfile)); - ret = gnutls_certificate_set_x509_trust_file + ret = fn_gnutls_certificate_set_x509_trust_file (x509_cred, SSDATA (trustfile), file_format); @@ -627,7 +841,7 @@ { GNUTLS_LOG2 (1, max_log_level, "setting the CRL file: ", SSDATA (crlfile)); - ret = gnutls_certificate_set_x509_crl_file + ret = fn_gnutls_certificate_set_x509_crl_file (x509_cred, SSDATA (crlfile), file_format); @@ -652,7 +866,7 @@ SSDATA (keyfile)); GNUTLS_LOG2 (1, max_log_level, "setting the client cert file: ", SSDATA (certfile)); - ret = gnutls_certificate_set_x509_key_file + ret = fn_gnutls_certificate_set_x509_key_file (x509_cred, SSDATA (certfile), SSDATA (keyfile), @@ -685,7 +899,7 @@ GNUTLS_LOG (1, max_log_level, "gnutls_init"); - ret = gnutls_init (&state, GNUTLS_CLIENT); + ret = fn_gnutls_init (&state, GNUTLS_CLIENT); if (ret < GNUTLS_E_SUCCESS) return gnutls_make_error (ret); @@ -708,9 +922,9 @@ GNUTLS_LOG (1, max_log_level, "setting the priority string"); - ret = gnutls_priority_set_direct (state, - priority_string_ptr, - NULL); + ret = fn_gnutls_priority_set_direct (state, + priority_string_ptr, + NULL); if (ret < GNUTLS_E_SUCCESS) return gnutls_make_error (ret); @@ -719,11 +933,11 @@ if (EQ (type, Qgnutls_x509pki)) { - ret = gnutls_cred_set (state, GNUTLS_CRD_CERTIFICATE, x509_cred); + ret = fn_gnutls_credentials_set (state, GNUTLS_CRD_CERTIFICATE, x509_cred); } else if (EQ (type, Qgnutls_anon)) { - ret = gnutls_cred_set (state, GNUTLS_CRD_ANON, anon_cred); + ret = fn_gnutls_credentials_set (state, GNUTLS_CRD_ANON, anon_cred); } else { @@ -751,7 +965,7 @@ check of the certificate's hostname with gnutls_x509_crt_check_hostname() against :hostname. */ - ret = gnutls_certificate_verify_peers2 (state, &peer_verification); + ret = fn_gnutls_certificate_verify_peers2 (state, &peer_verification); if (ret < GNUTLS_E_SUCCESS) return gnutls_make_error (ret); @@ -802,15 +1016,15 @@ /* Up to here the process is the same for X.509 certificates and OpenPGP keys. From now on X.509 certificates are assumed. This can be easily extended to work with openpgp keys as well. */ - if (gnutls_certificate_type_get (state) == GNUTLS_CRT_X509) + if (fn_gnutls_certificate_type_get (state) == GNUTLS_CRT_X509) { - ret = gnutls_x509_crt_init (&gnutls_verify_cert); + ret = fn_gnutls_x509_crt_init (&gnutls_verify_cert); if (ret < GNUTLS_E_SUCCESS) return gnutls_make_error (ret); gnutls_verify_cert_list = - gnutls_certificate_get_peers (state, &gnutls_verify_cert_list_size); + fn_gnutls_certificate_get_peers (state, &gnutls_verify_cert_list_size); if (NULL == gnutls_verify_cert_list) { @@ -818,17 +1032,17 @@ } /* We only check the first certificate in the given chain. */ - ret = gnutls_x509_crt_import (gnutls_verify_cert, - &gnutls_verify_cert_list[0], - GNUTLS_X509_FMT_DER); + ret = fn_gnutls_x509_crt_import (gnutls_verify_cert, + &gnutls_verify_cert_list[0], + GNUTLS_X509_FMT_DER); if (ret < GNUTLS_E_SUCCESS) { - gnutls_x509_crt_deinit (gnutls_verify_cert); + fn_gnutls_x509_crt_deinit (gnutls_verify_cert); return gnutls_make_error (ret); } - if (!gnutls_x509_crt_check_hostname (gnutls_verify_cert, c_hostname)) + if (!fn_gnutls_x509_crt_check_hostname (gnutls_verify_cert, c_hostname)) { if (NILP (verify_hostname_error)) { @@ -837,13 +1051,13 @@ } else { - gnutls_x509_crt_deinit (gnutls_verify_cert); + fn_gnutls_x509_crt_deinit (gnutls_verify_cert); error ("The x509 certificate does not match \"%s\"", c_hostname); } } - gnutls_x509_crt_deinit (gnutls_verify_cert); + fn_gnutls_x509_crt_deinit (gnutls_verify_cert); } return gnutls_make_error (ret); @@ -872,8 +1086,8 @@ state = XPROCESS (proc)->gnutls_state; - ret = gnutls_bye (state, - NILP (cont) ? GNUTLS_SHUT_RDWR : GNUTLS_SHUT_WR); + ret = fn_gnutls_bye (state, + NILP (cont) ? GNUTLS_SHUT_RDWR : GNUTLS_SHUT_WR); return gnutls_make_error (ret); } @@ -883,6 +1097,9 @@ { gnutls_global_initialized = 0; + Qgnutls_dll = intern_c_string ("gnutls"); + staticpro (&Qgnutls_dll); + Qgnutls_log_level = intern_c_string ("gnutls-log-level"); staticpro (&Qgnutls_log_level); @@ -956,6 +1173,7 @@ defsubr (&Sgnutls_boot); defsubr (&Sgnutls_deinit); defsubr (&Sgnutls_bye); + defsubr (&Sgnutls_available_p); } #endif /* HAVE_GNUTLS */ === modified file 'src/gnutls.h' --- src/gnutls.h 2011-04-25 01:30:51 +0000 +++ src/gnutls.h 2011-05-04 14:03:16 +0000 @@ -42,6 +42,7 @@ GNUTLS_STAGE_READY, } gnutls_initstage_t; +#define GNUTLS_EMACS_ERROR_NOT_LOADED GNUTLS_E_APPLICATION_ERROR_MIN + 1 #define GNUTLS_EMACS_ERROR_INVALID_TYPE GNUTLS_E_APPLICATION_ERROR_MIN #define GNUTLS_INITSTAGE(proc) (XPROCESS (proc)->gnutls_initstage) @@ -52,13 +53,16 @@ #define GNUTLS_LOG2(level, max, string, extra) if (level <= max) { gnutls_log_function2 (level, "(Emacs) " string, extra); } -EMACS_INT +extern EMACS_INT emacs_gnutls_write (int fildes, struct Lisp_Process *proc, const char *buf, EMACS_INT nbyte); -EMACS_INT +extern EMACS_INT emacs_gnutls_read (int fildes, struct Lisp_Process *proc, char *buf, EMACS_INT nbyte); +extern int emacs_gnutls_record_check_pending (gnutls_session_t state); +extern void emacs_gnutls_transport_set_errno (gnutls_session_t state, int err); + extern void syms_of_gnutls (void); #endif === modified file 'src/image.c' --- src/image.c 2011-04-25 21:34:39 +0000 +++ src/image.c 2011-05-04 14:03:16 +0000 @@ -67,6 +67,7 @@ #ifdef HAVE_NTGUI +#include "w32.h" #include "w32term.h" /* W32_TODO : Color tables on W32. */ @@ -556,10 +557,6 @@ static struct image_type *image_types; -/* Cache for delayed-loading image types. */ - -static Lisp_Object Vimage_type_cache; - /* The symbol `xbm' which is used as the type symbol for XBM images. */ static Lisp_Object Qxbm; @@ -589,7 +586,7 @@ Lisp_Object); #define CACHE_IMAGE_TYPE(type, status) \ - do { Vimage_type_cache = Fcons (Fcons (type, status), Vimage_type_cache); } while (0) + do { Vlibrary_cache = Fcons (Fcons (type, status), Vlibrary_cache); } while (0) #define ADD_IMAGE_TYPE(type) \ do { Vimage_types = Fcons (type, Vimage_types); } while (0) @@ -1900,34 +1897,6 @@ if (!fn_##func) return 0; \ } -/* Load a DLL implementing an image type. - The argument LIBRARIES is usually the variable - `dynamic-library-alist', which associates a symbol, identifying - an external DLL library, to a list of possible filenames. - The function returns NULL if no library could be loaded for - the given symbol, or if the library was previously loaded; - else the handle of the DLL. */ -static HMODULE -w32_delayed_load (Lisp_Object libraries, Lisp_Object type) -{ - HMODULE library = NULL; - - if (CONSP (libraries) && NILP (Fassq (type, Vimage_type_cache))) - { - Lisp_Object dlls = Fassq (type, libraries); - - if (CONSP (dlls)) - for (dlls = XCDR (dlls); CONSP (dlls); dlls = XCDR (dlls)) - { - CHECK_STRING_CAR (dlls); - if (library = LoadLibrary (SDATA (XCAR (dlls)))) - break; - } - } - - return library; -} - #endif /* HAVE_NTGUI */ static int x_create_x_image_and_pixmap (struct frame *, int, int, int, @@ -5452,7 +5421,6 @@ { HMODULE library; - /* Try loading libpng under probable names. */ if (!(library = w32_delayed_load (libraries, Qpng))) return 0; @@ -8634,7 +8602,7 @@ Lisp_Object tested; /* Don't try to reload the library. */ - tested = Fassq (type, Vimage_type_cache); + tested = Fassq (type, Vlibrary_cache); if (CONSP (tested)) return XCDR (tested); @@ -8714,9 +8682,6 @@ non-numeric, there is no explicit limit on the size of images. */); Vmax_image_size = make_float (MAX_IMAGE_SIZE); - Vimage_type_cache = Qnil; - staticpro (&Vimage_type_cache); - Qpbm = intern_c_string ("pbm"); staticpro (&Qpbm); ADD_IMAGE_TYPE (Qpbm); === modified file 'src/process.c' --- src/process.c 2011-04-30 09:31:01 +0000 +++ src/process.c 2011-05-04 14:03:16 +0000 @@ -33,6 +33,8 @@ #include #include +#include "lisp.h" + /* Only MS-DOS does not define `subprocesses'. */ #ifdef subprocesses @@ -77,7 +79,6 @@ #endif /* subprocesses */ -#include "lisp.h" #include "systime.h" #include "systty.h" @@ -4537,10 +4538,10 @@ some data in the TCP buffers so that select works, but with custom pull/push functions we need to check if some data is available in the buffers manually. */ - if (nfds == 0 && + if (nfds == 0 && wait_proc && wait_proc->gnutls_p /* Check for valid process. */ /* Do we have pending data? */ - && gnutls_record_check_pending (wait_proc->gnutls_state) > 0) + && emacs_gnutls_record_check_pending (wait_proc->gnutls_state) > 0) { nfds = 1; /* Set to Available. */ === modified file 'src/w32.c' --- src/w32.c 2011-04-28 19:51:12 +0000 +++ src/w32.c 2011-05-04 14:03:16 +0000 @@ -150,6 +150,8 @@ typedef HRESULT (WINAPI * ShGetFolderPath_fn) (IN HWND, IN int, IN HANDLE, IN DWORD, OUT char *); +Lisp_Object QCloaded_from; + void globals_of_w32 (void); static DWORD get_rid (PSID); @@ -5712,6 +5714,54 @@ return localtime (t); } + + +/* Delayed loading of libraries. */ + +Lisp_Object Vlibrary_cache; + +/* The argument LIBRARIES is an alist that associates a symbol + LIBRARY_ID, identifying an external DLL library known to Emacs, to + a list of filenames under which the library is usually found. In + most cases, the argument passed as LIBRARIES is the variable + `dynamic-library-alist', which is initialized to a list of common + library names. If the function loads the library successfully, it + returns the handle of the DLL, and records the filename in the + property :loaded-from of LIBRARY_ID; it returns NULL if the library + could not be found, or when it was already loaded (because the + handle is not recorded anywhere, and so is lost after use). It + would be trivial to save the handle too in :loaded-from, but + currently there's no use case for it. */ +HMODULE +w32_delayed_load (Lisp_Object libraries, Lisp_Object library_id) +{ + HMODULE library_dll = NULL; + + CHECK_SYMBOL (library_id); + + if (CONSP (libraries) && NILP (Fassq (library_id, Vlibrary_cache))) + { + Lisp_Object found = Qnil; + Lisp_Object dlls = Fassq (library_id, libraries); + + if (CONSP (dlls)) + for (dlls = XCDR (dlls); CONSP (dlls); dlls = XCDR (dlls)) + { + CHECK_STRING_CAR (dlls); + if (library_dll = LoadLibrary (SDATA (XCAR (dlls)))) + { + found = XCAR (dlls); + break; + } + } + + Fput (library_id, QCloaded_from, found); + } + + return library_dll; +} + + static void check_windows_init_file (void) { @@ -5910,6 +5960,12 @@ get_process_times_fn = (GetProcessTimes_Proc) GetProcAddress (kernel32, "GetProcessTimes"); + QCloaded_from = intern_c_string (":loaded-from"); + staticpro (&QCloaded_from); + + Vlibrary_cache = Qnil; + staticpro (&Vlibrary_cache); + g_b_init_is_windows_9x = 0; g_b_init_open_process_token = 0; g_b_init_get_token_information = 0; @@ -6178,7 +6234,7 @@ err = errno; /* Other errors are just passed on. */ } - gnutls_transport_set_errno (process->gnutls_state, err); + emacs_gnutls_transport_set_errno (process->gnutls_state, err); return -1; } @@ -6197,8 +6253,8 @@ /* Negative bytes written means we got an error in errno. Translate the WSAEWOULDBLOCK alias EWOULDBLOCK to EAGAIN. */ - gnutls_transport_set_errno (process->gnutls_state, - errno == EWOULDBLOCK ? EAGAIN : errno); + emacs_gnutls_transport_set_errno (process->gnutls_state, + errno == EWOULDBLOCK ? EAGAIN : errno); return -1; } === modified file 'src/w32.h' --- src/w32.h 2011-04-25 01:30:51 +0000 +++ src/w32.h 2011-05-04 14:03:16 +0000 @@ -143,6 +143,9 @@ extern int _sys_read_ahead (int fd); extern int _sys_wait_accept (int fd); +extern Lisp_Object Vlibrary_cache, QCloaded_from; +extern HMODULE w32_delayed_load (Lisp_Object, Lisp_Object); + #ifdef HAVE_GNUTLS #include ------------------------------------------------------------ revno: 104105 author: Teodor Zlatanov committer: Katsumi Yamaoka branch nick: trunk timestamp: Wed 2011-05-04 11:28:46 +0000 message: registry.el (registry-reindex): Fix percentage message. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2011-05-03 22:41:28 +0000 +++ lisp/gnus/ChangeLog 2011-05-04 11:28:46 +0000 @@ -1,3 +1,7 @@ +2011-05-04 Teodor Zlatanov + + * registry.el (registry-reindex): Fix percentage message. + 2011-05-03 Teodor Zlatanov * shr.el: Add shr-link face for links. === modified file 'lisp/gnus/registry.el' --- lisp/gnus/registry.el 2011-05-03 22:41:28 +0000 +++ lisp/gnus/registry.el 2011-05-04 11:28:46 +0000 @@ -298,7 +298,7 @@ (when (and (< 0 expected) (= 0 (mod count 1000))) (message "reindexing: %d of %d (%.2f%%)" - count expected (/ (* 1000 count) expected))) + count expected (/ (* 100 count) expected))) (dolist (val (cdr-safe (assq tr v))) (let* ((value-keys (registry-lookup-secondary-value db tr val))) (push key value-keys) ------------------------------------------------------------ revno: 104104 committer: Glenn Morris branch nick: trunk timestamp: Tue 2011-05-03 19:06:28 -0700 message: Small diary-lib.el font-locking fix. * lisp/calendar/diary-lib.el (diary-fancy-date-pattern): Turn it into a function, so it follows changes in calendar-date-style. (diary-fancy-date-matcher): New function. (diary-fancy-font-lock-keywords): Use diary-fancy-date-matcher. (diary-fancy-font-lock-fontify-region-function): Use diary-fancy-date-pattern as a function. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-04 02:03:30 +0000 +++ lisp/ChangeLog 2011-05-04 02:06:28 +0000 @@ -1,5 +1,12 @@ 2011-05-04 Glenn Morris + * calendar/diary-lib.el (diary-fancy-date-pattern): Turn it into a + function, so it follows changes in calendar-date-style. + (diary-fancy-date-matcher): New function. + (diary-fancy-font-lock-keywords): Use diary-fancy-date-matcher. + (diary-fancy-font-lock-fontify-region-function): + Use diary-fancy-date-pattern as a function. + * calendar/diary-lib.el (diary-fancy-date-pattern): Do not use non-numbers for `year' etc pseudo-variables. (Bug#8583) === modified file 'lisp/calendar/diary-lib.el' --- lisp/calendar/diary-lib.el 2011-05-04 02:03:30 +0000 +++ lisp/calendar/diary-lib.el 2011-05-04 02:06:28 +0000 @@ -2364,8 +2364,9 @@ ;;; Fancy Diary Mode. -;; FIXME does not update upon changes to the name-arrays. -(defvar diary-fancy-date-pattern +(defun diary-fancy-date-pattern () + "Return a regexp matching the first line of a fancy diary date header. +This depends on the calendar date style." (concat (let ((dayname (diary-name-pattern calendar-day-name-array nil t)) (monthname (diary-name-pattern calendar-month-name-array nil t)) @@ -2381,26 +2382,27 @@ (mapconcat 'eval calendar-date-display-form "") nil t)) ;; Optional ": holiday name" after the date. - "\\(: .*\\)?") - "Regular expression matching the first line of a fancy diary date header.") + "\\(: .*\\)?")) + +(defun diary-fancy-date-matcher (limit) + "Search for a fancy diary data header, up to LIMIT." + ;; Any number of " other holiday name" lines, followed by "==" line. + (when (re-search-forward + (format "%s\\(\n +.*\\)*\n=+$" (diary-fancy-date-pattern)) limit t) + (put-text-property (match-beginning 0) (match-end 0) 'font-lock-multiline t) + t)) (define-obsolete-variable-alias 'fancy-diary-font-lock-keywords 'diary-fancy-font-lock-keywords "23.1") (defvar diary-fancy-font-lock-keywords - (list - (list - ;; Any number of " other holiday name" lines, followed by "==" line. - (concat diary-fancy-date-pattern "\\(\n +.*\\)*\n=+$") - '(0 (progn (put-text-property (match-beginning 0) (match-end 0) - 'font-lock-multiline t) - diary-face))) - '("^.*\\([aA]nniversary\\|[bB]irthday\\).*$" . 'diary-anniversary) - '("^.*Yahrzeit.*$" . font-lock-reference-face) - '("^\\(Erev \\)?Rosh Hodesh.*" . font-lock-function-name-face) - '("^Day.*omer.*$" . font-lock-builtin-face) - '("^Parashat.*$" . font-lock-comment-face) - `(,(format "\\(^\\|\\s-\\)%s\\(-%s\\)?" diary-time-regexp + `((diary-fancy-date-matcher . diary-face) + ("^.*\\([aA]nniversary\\|[bB]irthday\\).*$" . 'diary-anniversary) + ("^.*Yahrzeit.*$" . font-lock-reference-face) + ("^\\(Erev \\)?Rosh Hodesh.*" . font-lock-function-name-face) + ("^Day.*omer.*$" . font-lock-builtin-face) + ("^Parashat.*$" . font-lock-comment-face) + (,(format "\\(^\\|\\s-\\)%s\\(-%s\\)?" diary-time-regexp diary-time-regexp) . 'diary-time)) "Keywords to highlight in fancy diary display.") @@ -2416,7 +2418,7 @@ (while (and (looking-at " +[^ ]") (zerop (forward-line -1)))) ;; This check not essential. - (if (looking-at diary-fancy-date-pattern) + (if (looking-at (diary-fancy-date-pattern)) (setq beg (line-beginning-position))) (goto-char end) (forward-line 0) ------------------------------------------------------------ revno: 104103 committer: Glenn Morris branch nick: trunk timestamp: Tue 2011-05-03 19:03:30 -0700 message: diary-lib.el fix for bug#8583. * lisp/calendar/diary-lib.el (diary-fancy-date-pattern): Do not use non-numbers for `year' etc pseudo-variables. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-04 01:44:58 +0000 +++ lisp/ChangeLog 2011-05-04 02:03:30 +0000 @@ -1,3 +1,8 @@ +2011-05-04 Glenn Morris + + * calendar/diary-lib.el (diary-fancy-date-pattern): Do not use + non-numbers for `year' etc pseudo-variables. (Bug#8583) + 2011-05-04 Teodor Zlatanov * net/gnutls.el (gnutls-negotiate): Use CL-style keyword arguments === modified file 'lisp/calendar/diary-lib.el' --- lisp/calendar/diary-lib.el 2011-04-19 04:11:01 +0000 +++ lisp/calendar/diary-lib.el 2011-05-04 02:03:30 +0000 @@ -2090,7 +2090,7 @@ '(day " " monthname)) (t '(monthname " " day)))) ;; Iso cannot contain "-", because this form used eg by - ;; insert-anniversary-diary-entry. + ;; diary-insert-anniversary-entry. (t (cond ((eq calendar-date-style 'iso) '((format "%s %.2d %.2d" year (string-to-number month) (string-to-number day)))) @@ -2369,13 +2369,20 @@ (concat (let ((dayname (diary-name-pattern calendar-day-name-array nil t)) (monthname (diary-name-pattern calendar-month-name-array nil t)) - (day "[0-9]+") - (month "[0-9]+") - (year "-?[0-9]+")) - (mapconcat 'eval calendar-date-display-form "")) + (day "1") + (month "2") + ;; FIXME? This used to be "-?[0-9]+" - what was the "-?" for? + (year "3")) + ;; This is ugly. c-d-d-form expects `day' etc to be "numbers in + ;; string form"; eg the iso version calls string-to-number on some. + ;; Therefore we cannot eg just let day = "[0-9]+". (Bug#8583). + ;; Assumes no integers in c-day/month-name-array. + (replace-regexp-in-string "[0-9]+" "[0-9]+" + (mapconcat 'eval calendar-date-display-form "") + nil t)) ;; Optional ": holiday name" after the date. "\\(: .*\\)?") - "Regular expression matching a date header in Fancy Diary.") + "Regular expression matching the first line of a fancy diary date header.") (define-obsolete-variable-alias 'fancy-diary-font-lock-keywords 'diary-fancy-font-lock-keywords "23.1") ------------------------------------------------------------ revno: 104102 committer: Glenn Morris branch nick: trunk timestamp: Tue 2011-05-03 19:01:27 -0700 message: Comment fix. diff: === modified file 'lisp/progmodes/fortran.el' --- lisp/progmodes/fortran.el 2011-04-22 18:44:26 +0000 +++ lisp/progmodes/fortran.el 2011-05-04 02:01:27 +0000 @@ -492,7 +492,7 @@ This is used to fontify fixed-format Fortran comments." ;; This results in a non-byte-compiled function. We could pass it through ;; `byte-compile', but simple benchmarks indicate that it's probably not - ;; worth the trouble (about ½% of slow down). + ;; worth the trouble (about 0.5% of slow down). (eval ;I hate `eval', but it's hard to avoid it here. `(syntax-propertize-rules ("^[cd\\*]" (0 "<")) ------------------------------------------------------------ revno: 104101 committer: Glenn Morris branch nick: trunk timestamp: Tue 2011-05-03 19:00:20 -0700 message: Mark tiny change. diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2011-05-03 22:41:28 +0000 +++ doc/misc/ChangeLog 2011-05-04 02:00:20 +0000 @@ -1,4 +1,4 @@ -2011-05-03 Peter Münster +2011-05-03 Peter Münster (tiny change) * gnus.texi (Summary Buffer Lines): gnus-summary-user-date-format-alist does not exist. ------------------------------------------------------------ revno: 104100 committer: Ted Zlatanov branch nick: quickfixes timestamp: Tue 2011-05-03 20:45:27 -0500 message: Support :keylist and :crlfiles options to `gnutls-boot' and use them. * src/gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options instead of :keyfiles. Give GnuTLS the keylist and the CRL lists as passed in. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-05-03 15:54:54 +0000 +++ src/ChangeLog 2011-05-04 01:45:27 +0000 @@ -1,3 +1,9 @@ +2011-05-04 Teodor Zlatanov + + * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options + instead of :keyfiles. Give GnuTLS the keylist and the CRL lists + as passed in. + 2011-05-03 Jan Djärv * xterm.c (x_set_frame_alpha): Do not set property on anything === modified file 'src/gnutls.c' --- src/gnutls.c 2011-05-02 02:49:06 +0000 +++ src/gnutls.c 2011-05-04 01:45:27 +0000 @@ -44,7 +44,8 @@ /* The following are for the property list of `gnutls-boot'. */ static Lisp_Object Qgnutls_bootprop_priority; static Lisp_Object Qgnutls_bootprop_trustfiles; -static Lisp_Object Qgnutls_bootprop_keyfiles; +static Lisp_Object Qgnutls_bootprop_keylist; +static Lisp_Object Qgnutls_bootprop_crlfiles; static Lisp_Object Qgnutls_bootprop_callbacks; static Lisp_Object Qgnutls_bootprop_loglevel; static Lisp_Object Qgnutls_bootprop_hostname; @@ -412,7 +413,10 @@ :trustfiles is a list of PEM-encoded trust files for `gnutls-x509pki'. -:keyfiles is a list of PEM-encoded key files for `gnutls-x509pki'. +:crlfiles is a list of PEM-encoded CRL lists for `gnutls-x509pki'. + +:keylist is an alist of PEM-encoded key files and PEM-encoded +certificates for `gnutls-x509pki'. :callbacks is an alist of callback functions, see below. @@ -471,7 +475,8 @@ /* Placeholders for the property list elements. */ Lisp_Object priority_string; Lisp_Object trustfiles; - Lisp_Object keyfiles; + Lisp_Object crlfiles; + Lisp_Object keylist; /* Lisp_Object callbacks; */ Lisp_Object loglevel; Lisp_Object hostname; @@ -486,7 +491,8 @@ hostname = Fplist_get (proplist, Qgnutls_bootprop_hostname); priority_string = Fplist_get (proplist, Qgnutls_bootprop_priority); trustfiles = Fplist_get (proplist, Qgnutls_bootprop_trustfiles); - keyfiles = Fplist_get (proplist, Qgnutls_bootprop_keyfiles); + keylist = Fplist_get (proplist, Qgnutls_bootprop_keylist); + crlfiles = Fplist_get (proplist, Qgnutls_bootprop_crlfiles); /* callbacks = Fplist_get (proplist, Qgnutls_bootprop_callbacks); */ loglevel = Fplist_get (proplist, Qgnutls_bootprop_loglevel); verify_flags = Fplist_get (proplist, Qgnutls_bootprop_verify_flags); @@ -614,15 +620,41 @@ } } - for (tail = keyfiles; !NILP (tail); tail = Fcdr (tail)) - { - Lisp_Object keyfile = Fcar (tail); - if (STRINGP (keyfile)) - { - GNUTLS_LOG2 (1, max_log_level, "setting the keyfile: ", + for (tail = crlfiles; !NILP (tail); tail = Fcdr (tail)) + { + Lisp_Object crlfile = Fcar (tail); + if (STRINGP (crlfile)) + { + GNUTLS_LOG2 (1, max_log_level, "setting the CRL file: ", + SSDATA (crlfile)); + ret = gnutls_certificate_set_x509_crl_file + (x509_cred, + SSDATA (crlfile), + file_format); + + if (ret < GNUTLS_E_SUCCESS) + return gnutls_make_error (ret); + } + else + { + error ("Sorry, GnuTLS can't use non-string CRL file %s", + SDATA (crlfile)); + } + } + + for (tail = keylist; !NILP (tail); tail = Fcdr (tail)) + { + Lisp_Object keyfile = Fcar (Fcar (tail)); + Lisp_Object certfile = Fcar (Fcdr (tail)); + if (STRINGP (keyfile) && STRINGP (certfile)) + { + GNUTLS_LOG2 (1, max_log_level, "setting the client key file: ", SSDATA (keyfile)); - ret = gnutls_certificate_set_x509_crl_file + GNUTLS_LOG2 (1, max_log_level, "setting the client cert file: ", + SSDATA (certfile)); + ret = gnutls_certificate_set_x509_key_file (x509_cred, + SSDATA (certfile), SSDATA (keyfile), file_format); @@ -631,8 +663,12 @@ } else { - error ("Sorry, GnuTLS can't use non-string keyfile %s", - SDATA (keyfile)); + if (STRINGP (keyfile)) + error ("Sorry, GnuTLS can't use non-string client cert file %s", + SDATA (certfile)); + else + error ("Sorry, GnuTLS can't use non-string client key file %s", + SDATA (keyfile)); } } } @@ -868,8 +904,11 @@ Qgnutls_bootprop_trustfiles = intern_c_string (":trustfiles"); staticpro (&Qgnutls_bootprop_trustfiles); - Qgnutls_bootprop_keyfiles = intern_c_string (":keyfiles"); - staticpro (&Qgnutls_bootprop_keyfiles); + Qgnutls_bootprop_keylist = intern_c_string (":keylist"); + staticpro (&Qgnutls_bootprop_keylist); + + Qgnutls_bootprop_crlfiles = intern_c_string (":crlfiles"); + staticpro (&Qgnutls_bootprop_crlfiles); Qgnutls_bootprop_callbacks = intern_c_string (":callbacks"); staticpro (&Qgnutls_bootprop_callbacks); ------------------------------------------------------------ revno: 104099 committer: Ted Zlatanov branch nick: quickfixes timestamp: Tue 2011-05-03 20:44:58 -0500 message: Use CL-style keyword arguments for `gnutls-negotiate' and allow :keylist and :crlfiles arguments. * lisp/net/gnutls.el (gnutls-negotiate): Use CL-style keyword arguments instead of positional arguments. Allow :keylist and :crlfiles arguments. (open-gnutls-stream): Call it. * lisp/net/network-stream.el (network-stream-open-starttls): Adjust to call `gnutls-negotiate' with :process and :hostname arguments. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-04 01:19:32 +0000 +++ lisp/ChangeLog 2011-05-04 01:44:58 +0000 @@ -1,3 +1,13 @@ +2011-05-04 Teodor Zlatanov + + * net/gnutls.el (gnutls-negotiate): Use CL-style keyword arguments + instead of positional arguments. Allow :keylist and :crlfiles + arguments. + (open-gnutls-stream): Call it. + + * net/network-stream.el (network-stream-open-starttls): Adjust to + call `gnutls-negotiate' with :process and :hostname arguments. + 2011-05-04 Stefan Monnier * minibuffer.el (completion--message): New function. === modified file 'lisp/net/gnutls.el' --- lisp/net/gnutls.el 2011-04-25 13:47:23 +0000 +++ lisp/net/gnutls.el 2011-05-04 01:44:58 +0000 @@ -35,6 +35,8 @@ ;;; Code: +(eval-when-compile (require 'cl)) + (defgroup gnutls nil "Emacs interface to the GnuTLS library." :prefix "gnutls-" @@ -72,9 +74,9 @@ documentation for the specific parameters you can use to open a GnuTLS connection, including specifying the credential type, trust and key files, and priority string." - (gnutls-negotiate (open-network-stream name buffer host service) - 'gnutls-x509pki - host)) + (gnutls-negotiate :process (open-network-stream name buffer host service) + :type 'gnutls-x509pki + :hostname host)) (put 'gnutls-error 'error-conditions @@ -85,16 +87,23 @@ (declare-function gnutls-boot "gnutls.c" (proc type proplist)) (declare-function gnutls-errorp "gnutls.c" (error)) -(defun gnutls-negotiate (proc type hostname &optional priority-string - trustfiles keyfiles verify-flags - verify-error verify-hostname-error) +(defun* gnutls-negotiate + (&rest spec + &key process type hostname priority-string + trustfiles crlfiles keylist verify-flags + verify-error verify-hostname-error + &allow-other-keys) "Negotiate a SSL/TLS connection. Returns proc. Signals gnutls-error. + +Note arguments are passed CL style, :type TYPE instead of just TYPE. + TYPE is `gnutls-x509pki' (default) or `gnutls-anon'. Use nil for the default. -PROC is a process returned by `open-network-stream'. +PROCESS is a process returned by `open-network-stream'. HOSTNAME is the remote hostname. It must be a valid string. PRIORITY-STRING is as per the GnuTLS docs, default is \"NORMAL\". TRUSTFILES is a list of CA bundles. -KEYFILES is a list of client keys. +CRLFILES is a list of CRL files. +KEYLIST is an alist of (client key file, client cert file) pairs. When VERIFY-HOSTNAME-ERROR is not nil, an error will be raised when the hostname does not match the presented certificate's host @@ -141,7 +150,8 @@ :hostname ,hostname :loglevel ,gnutls-log-level :trustfiles ,trustfiles - :keyfiles ,keyfiles + :crlfiles ,crlfiles + :keylist ,keylist :verify-flags ,verify-flags :verify-error ,verify-error :verify-hostname-error ,verify-hostname-error @@ -149,14 +159,14 @@ ret) (gnutls-message-maybe - (setq ret (gnutls-boot proc type params)) + (setq ret (gnutls-boot process type params)) "boot: %s" params) (when (gnutls-errorp ret) ;; This is a error from the underlying C code. - (signal 'gnutls-error (list proc ret))) + (signal 'gnutls-error (list process ret))) - proc)) + process)) (declare-function gnutls-error-string "gnutls.c" (error)) === modified file 'lisp/net/network-stream.el' --- lisp/net/network-stream.el 2011-05-01 15:39:10 +0000 +++ lisp/net/network-stream.el 2011-05-04 01:44:58 +0000 @@ -45,9 +45,7 @@ (require 'tls) (require 'starttls) -(declare-function gnutls-negotiate "gnutls" - (proc type host &optional priority-string trustfiles keyfiles - verify-flags verify-error verify-hostname-error)) +(declare-function gnutls-negotiate "gnutls" (&rest spec)) ;;;###autoload (defun open-network-stream (name buffer host service &rest parameters) @@ -203,7 +201,7 @@ (network-stream-command stream starttls-command eoc)) ;; The server said it was OK to begin STARTTLS negotiations. (if (fboundp 'open-gnutls-stream) - (gnutls-negotiate stream nil host) + (gnutls-negotiate :process stream :hostname host) (unless (starttls-negotiate stream) (delete-process stream))) (if (memq (process-status stream) '(open run)) ------------------------------------------------------------ revno: 104098 committer: Stefan Monnier branch nick: trunk timestamp: Tue 2011-05-03 22:19:32 -0300 message: * lisp/minibuffer.el (completion--message): New function. (completion--do-completion, minibuffer-complete) (minibuffer-force-complete, minibuffer-complete-word): Use it. (completion--do-completion): Don't ignore completion-auto-help when in icomplete-mode. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-04 01:02:09 +0000 +++ lisp/ChangeLog 2011-05-04 01:19:32 +0000 @@ -1,5 +1,11 @@ 2011-05-04 Stefan Monnier + * minibuffer.el (completion--message): New function. + (completion--do-completion, minibuffer-complete) + (minibuffer-force-complete, minibuffer-complete-word): Use it. + (completion--do-completion): Don't ignore completion-auto-help when in + icomplete-mode. + * whitespace.el (whitespace-trailing-regexp): Don't rely on the internal encoding (e.g. tibetan zero is not whitespace). (global-whitespace-mode): Prefer save-current-buffer. === modified file 'lisp/minibuffer.el' --- lisp/minibuffer.el 2011-04-28 15:32:28 +0000 +++ lisp/minibuffer.el 2011-05-04 01:19:32 +0000 @@ -558,6 +558,10 @@ (defvar completion-fail-discreetly nil "If non-nil, stay quiet when there is no match.") +(defun completion--message (msg) + (if completion-show-inline-help + (minibuffer-message msg))) + (defun completion--do-completion (&optional try-completion-function) "Do the completion and return a summary of what happened. M = completion was performed, the text was Modified. @@ -585,9 +589,9 @@ (cond ((null comp) (minibuffer-hide-completions) - (when (and (not completion-fail-discreetly) completion-show-inline-help) + (unless completion-fail-discreetly (ding) - (minibuffer-message "No match")) + (completion--message "No match")) (minibuffer--bitset nil nil nil)) ((eq t comp) (minibuffer-hide-completions) @@ -657,15 +661,13 @@ (minibuffer-hide-completions)) ;; Show the completion table, if requested. ((not exact) - (if (cond (icomplete-mode t) - ((null completion-show-inline-help) t) - ((eq completion-auto-help 'lazy) - (eq this-command last-command)) - (t completion-auto-help)) + (if (case completion-auto-help + (lazy (eq this-command last-command)) + (t completion-auto-help)) (minibuffer-completion-help) - (minibuffer-message "Next char not unique"))) + (completion--message "Next char not unique"))) ;; If the last exact completion and this one were the same, it - ;; means we've already given a "Next char not unique" message + ;; means we've already given a "Complete, but not unique" message ;; and the user's hit TAB again, so now we give him help. ((eq this-command last-command) (if completion-auto-help (minibuffer-completion-help)))) @@ -703,11 +705,9 @@ t) (t (case (completion--do-completion) (#b000 nil) - (#b001 (if completion-show-inline-help - (minibuffer-message "Sole completion")) + (#b001 (completion--message "Sole completion") t) - (#b011 (if completion-show-inline-help - (minibuffer-message "Complete, but not unique")) + (#b011 (completion--message "Complete, but not unique") t) (t t))))) @@ -765,9 +765,8 @@ (end (field-end)) (all (completion-all-sorted-completions))) (if (not (consp all)) - (if completion-show-inline-help - (minibuffer-message - (if all "No more completions" "No completions"))) + (completion--message + (if all "No more completions" "No completions")) (setq completion-cycling t) (goto-char end) (insert (car all)) @@ -955,11 +954,9 @@ (interactive) (case (completion--do-completion 'completion--try-word-completion) (#b000 nil) - (#b001 (if completion-show-inline-help - (minibuffer-message "Sole completion")) + (#b001 (completion--message "Sole completion") t) - (#b011 (if completion-show-inline-help - (minibuffer-message "Complete, but not unique")) + (#b011 (completion--message "Complete, but not unique") t) (t t))) ------------------------------------------------------------ revno: 104097 committer: Stefan Monnier branch nick: trunk timestamp: Tue 2011-05-03 22:02:09 -0300 message: * lisp/whitespace.el (whitespace-trailing-regexp): Don't rely on the internal encoding (e.g. tibetan zero is not whitespace). (global-whitespace-mode): Prefer save-current-buffer. (whitespace-trailing-regexp): Remove useless save-match-data. (whitespace-empty-at-bob-regexp): Minor simplification. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-03 15:33:05 +0000 +++ lisp/ChangeLog 2011-05-04 01:02:09 +0000 @@ -1,3 +1,11 @@ +2011-05-04 Stefan Monnier + + * whitespace.el (whitespace-trailing-regexp): Don't rely on the + internal encoding (e.g. tibetan zero is not whitespace). + (global-whitespace-mode): Prefer save-current-buffer. + (whitespace-trailing-regexp): Remove useless save-match-data. + (whitespace-empty-at-bob-regexp): Minor simplification. + 2011-05-03 Chong Yidong * emacs-lisp/autoload.el (generated-autoload-file): Doc fix (Bug#7989). === modified file 'lisp/whitespace.el' --- lisp/whitespace.el 2011-04-30 15:15:07 +0000 +++ lisp/whitespace.el 2011-05-04 01:02:09 +0000 @@ -800,13 +800,12 @@ (defcustom whitespace-trailing-regexp - "\\(\\(\t\\| \\|\xA0\\|\x8A0\\|\x920\\|\xE20\\|\xF20\\)+\\)$" + "\\([\t \u00A0]+\\)$" "Specify trailing characters regexp. If you're using `mule' package, there may be other characters besides: - \" \" \"\\t\" \"\\xA0\" \"\\x8A0\" \"\\x920\" \"\\xE20\" \ -\"\\xF20\" + \" \" \"\\t\" \"\\u00A0\" that should be considered blank. @@ -1133,7 +1132,7 @@ (noninteractive ; running a batch job (setq global-whitespace-mode nil)) (global-whitespace-mode ; global-whitespace-mode on - (save-excursion + (save-current-buffer (add-hook 'find-file-hook 'whitespace-turn-on-if-enabled) (add-hook 'after-change-major-mode-hook 'whitespace-turn-on-if-enabled) (dolist (buffer (buffer-list)) ; adjust all local mode @@ -1141,7 +1140,7 @@ (unless whitespace-mode (whitespace-turn-on-if-enabled))))) (t ; global-whitespace-mode off - (save-excursion + (save-current-buffer (remove-hook 'find-file-hook 'whitespace-turn-on-if-enabled) (remove-hook 'after-change-major-mode-hook 'whitespace-turn-on-if-enabled) (dolist (buffer (buffer-list)) ; adjust all local mode @@ -1526,7 +1525,7 @@ ;; whole buffer (t (save-excursion - (save-match-data + (save-match-data ;FIXME: Why? ;; PROBLEM 1: empty lines at bob ;; PROBLEM 2: empty lines at eob ;; ACTION: remove all empty lines at bob and/or eob @@ -1598,7 +1597,7 @@ overwrite-mode ; enforce no overwrite tmp) (save-excursion - (save-match-data + (save-match-data ;FIXME: Why? ;; PROBLEM 1: 8 or more SPACEs at bol (cond ;; ACTION: replace 8 or more SPACEs at bol by TABs, if @@ -1870,7 +1869,7 @@ (interactive "r") (setq force (or current-prefix-arg force)) (save-excursion - (save-match-data + (save-match-data ;FIXME: Why? (let* ((has-bogus nil) (rstart (min start end)) (rend (max start end)) @@ -2412,9 +2411,8 @@ "Match trailing spaces which do not contain the point at end of line." (let ((status t)) (while (if (re-search-forward whitespace-trailing-regexp limit t) - (save-match-data - (= whitespace-point (match-end 1))) ;; loop if point at eol - (setq status nil))) ;; end of buffer + (= whitespace-point (match-end 1)) ;; Loop if point at eol. + (setq status nil))) ;; End of buffer. status)) @@ -2428,9 +2426,7 @@ ((= b 1) (setq r (and (/= whitespace-point 1) (looking-at whitespace-empty-at-bob-regexp))) - (if r - (set-marker whitespace-bob-marker (match-end 1)) - (set-marker whitespace-bob-marker b))) + (set-marker whitespace-bob-marker (if r (match-end 1) b))) ;; inside bob empty region ((<= limit whitespace-bob-marker) (setq r (looking-at whitespace-empty-at-bob-regexp)) @@ -2441,9 +2437,7 @@ ;; intersection with end of bob empty region ((<= b whitespace-bob-marker) (setq r (looking-at whitespace-empty-at-bob-regexp)) - (if r - (set-marker whitespace-bob-marker (match-end 1)) - (set-marker whitespace-bob-marker b))) + (set-marker whitespace-bob-marker (if r (match-end 1) b))) ;; it is not inside bob empty region (t (setq r nil))) ------------------------------------------------------------ revno: 104096 author: Gnus develoeprs committer: Katsumi Yamaoka branch nick: trunk timestamp: Tue 2011-05-03 22:41:28 +0000 message: Merge changes made in Gnus trunk. gnus.texi (Summary Buffer Lines): gnus-summary-user-date-format-alist does not exist. (Sorting the Summary Buffer): More about sorting threads. shr.el: Add shr-link face for links. (shr-urlify): Use it. registry.el (registry-insert): Make error message more helpful. diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2011-04-25 18:14:38 +0000 +++ doc/misc/ChangeLog 2011-05-03 22:41:28 +0000 @@ -1,3 +1,9 @@ +2011-05-03 Peter Münster + + * gnus.texi (Summary Buffer Lines): + gnus-summary-user-date-format-alist does not exist. + (Sorting the Summary Buffer): More about sorting threads. + 2011-04-25 Michael Albinus * trampver.texi: Update release number. === modified file 'doc/misc/gnus.texi' --- doc/misc/gnus.texi 2011-04-14 12:43:49 +0000 +++ doc/misc/gnus.texi 2011-05-03 22:41:28 +0000 @@ -4953,7 +4953,7 @@ Desired cursor position (instead of after first colon). @item &user-date; Age sensitive date format. Various date format is defined in -@code{gnus-summary-user-date-format-alist}. +@code{gnus-user-date-format-alist}. @item u User defined specifier. The next character in the format string should be a letter. Gnus will call the function @@ -7340,7 +7340,9 @@ Each function takes two threads and returns non-@code{nil} if the first thread should be sorted before the other. Note that sorting really is -normally done by looking only at the roots of each thread. +normally done by looking only at the roots of each thread. Exceptions +to this rule are @code{gnus-thread-sort-by-most-recent-number} and +@code{gnus-thread-sort-by-most-recent-date}. If you use more than one function, the primary sort key should be the last function in the list. You should probably always include === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2011-05-02 22:41:38 +0000 +++ lisp/gnus/ChangeLog 2011-05-03 22:41:28 +0000 @@ -1,3 +1,10 @@ +2011-05-03 Teodor Zlatanov + + * shr.el: Add shr-link face for links. + (shr-urlify): Use it. + + * registry.el (registry-insert): Make error message more helpful. + 2011-05-02 Lars Magne Ingebrigtsen * gnus-html.el (gnus-html-schedule-image-fetching): Use === modified file 'lisp/gnus/registry.el' --- lisp/gnus/registry.el 2011-04-18 22:59:02 +0000 +++ lisp/gnus/registry.el 2011-05-03 22:41:28 +0000 @@ -272,7 +272,7 @@ (assert (< (registry-size db) (oref db :max-hard)) nil - "max-hard size limit reached") + "registry max-hard size limit reached") ;; store the entry (puthash key entry (oref db :data)) === modified file 'lisp/gnus/shr.el' --- lisp/gnus/shr.el 2011-05-02 22:41:38 +0000 +++ lisp/gnus/shr.el 2011-05-03 22:41:28 +0000 @@ -91,6 +91,12 @@ "Font for elements." :group 'shr) +(defface shr-link '((t (:underline t) + (:foreground "yellow") + (:background "black"))) + "Font for elements." + :group 'shr) + ;;; Internal variables. (defvar shr-folding-mode nil) @@ -591,6 +597,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) 'shr-url url)) (defun shr-encode-url (url) ------------------------------------------------------------ revno: 104095 fixes bug(s): http://debbugs.gnu.org/8608 committer: Jan D. branch nick: trunk timestamp: Tue 2011-05-03 17:54:54 +0200 message: * xterm.c (x_set_frame_alpha): Do not set property on anything else than FRAME_X_OUTER_WINDOW. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-05-02 03:57:02 +0000 +++ src/ChangeLog 2011-05-03 15:54:54 +0000 @@ -1,3 +1,8 @@ +2011-05-03 Jan Djärv + + * xterm.c (x_set_frame_alpha): Do not set property on anything + else than FRAME_X_OUTER_WINDOW (Bug#8608). + 2011-05-02 Juanma Barranquero * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596) === modified file 'src/xterm.c' --- src/xterm.c 2011-04-17 18:40:55 +0000 +++ src/xterm.c 2011-05-03 15:54:54 +0000 @@ -454,11 +454,6 @@ double alpha_min = 1.0; unsigned long opac; - if (FRAME_X_DISPLAY_INFO (f)->root_window != FRAME_X_OUTPUT (f)->parent_desc) - /* Since the WM decoration lies under the FRAME_OUTER_WINDOW, - we must treat the former instead of the latter. */ - win = FRAME_X_OUTPUT (f)->parent_desc; - if (dpyinfo->x_highlight_frame == f) alpha = f->alpha[0]; else ------------------------------------------------------------ revno: 104094 committer: Glenn Morris branch nick: trunk timestamp: Tue 2011-05-03 08:51:14 -0700 message: Mark tiny change. diff: === modified file 'lisp/erc/ChangeLog' --- lisp/erc/ChangeLog 2011-05-03 08:37:51 +0000 +++ lisp/erc/ChangeLog 2011-05-03 15:51:14 +0000 @@ -1,4 +1,4 @@ -2011-05-03 Debarshi Ray +2011-05-03 Debarshi Ray (tiny change) * erc-backend.el (671): New response handler. * erc.el (english): Add 671 to catalog. ------------------------------------------------------------ revno: 104093 committer: Chong Yidong branch nick: trunk timestamp: Tue 2011-05-03 11:33:05 -0400 message: * emacs-lisp/autoload.el (generated-autoload-file): Doc fix (Bug#7989). diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-03 15:08:20 +0000 +++ lisp/ChangeLog 2011-05-03 15:33:05 +0000 @@ -1,3 +1,7 @@ +2011-05-03 Chong Yidong + + * emacs-lisp/autoload.el (generated-autoload-file): Doc fix (Bug#7989). + 2011-05-03 Agustín Martín Domingo * textmodes/ispell.el (ispell-add-per-file-word-list): === modified file 'lisp/emacs-lisp/autoload.el' --- lisp/emacs-lisp/autoload.el 2011-03-11 20:04:22 +0000 +++ lisp/emacs-lisp/autoload.el 2011-05-03 15:33:05 +0000 @@ -35,10 +35,18 @@ (eval-when-compile (require 'cl)) (defvar generated-autoload-file "loaddefs.el" - "*File \\[update-file-autoloads] puts autoloads into. -A `.el' file can set this in its local variables section to make its -autoloads go somewhere else. The autoload file is assumed to contain a -trailer starting with a FormFeed character.") + "File \\[update-file-autoloads] puts autoloads into. +A Lisp file can set this in its local variables section to make +its autoloads go somewhere else. + +If this is a relative file name, the directory is determined as +follows: + - If a Lisp file defined `generated-autoload-file' as a + file-local variable, use its containing directory. + - Otherwise use the \"lisp\" subdirectory of `source-directory'. + +The autoload file is assumed to contain a trailer starting with a +FormFeed character.") ;;;###autoload (put 'generated-autoload-file 'safe-local-variable 'stringp) ------------------------------------------------------------ revno: 104092 committer: Agustin Martin branch nick: trunk timestamp: Tue 2011-05-03 17:08:20 +0200 message: Fix my last lisp/Changelog entry. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-03 14:11:39 +0000 +++ lisp/ChangeLog 2011-05-03 15:08:20 +0000 @@ -1,7 +1,7 @@ 2011-05-03 Agustín Martín Domingo * textmodes/ispell.el (ispell-add-per-file-word-list): - Use `concat' for string. + Use `concat' to create string for insertion. 2011-05-03 Stefan Monnier ------------------------------------------------------------ revno: 104091 fixes bug(s): http://debbugs.gnu.org/8579 committer: Agustin Martin branch nick: trunk timestamp: Tue 2011-05-03 16:11:39 +0200 message: ispell.el (ispell-add-per-file-word-list): Use `concat' to create string for insertion. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-03 14:03:48 +0000 +++ lisp/ChangeLog 2011-05-03 14:11:39 +0000 @@ -1,3 +1,8 @@ +2011-05-03 Agustín Martín Domingo + + * textmodes/ispell.el (ispell-add-per-file-word-list): + Use `concat' for string. + 2011-05-03 Stefan Monnier * textmodes/bibtex.el (bibtex-fill-field-bounds, bibtex-fill-entry): === modified file 'lisp/textmodes/ispell.el' --- lisp/textmodes/ispell.el 2011-05-03 11:08:15 +0000 +++ lisp/textmodes/ispell.el 2011-05-03 14:11:39 +0000 @@ -3916,7 +3916,7 @@ (open-line 1) (unless found (newline)) (insert (if comment-start - (progn + (concat (if (fboundp 'comment-padright) ;; Try and use the proper comment marker, ;; e.g. ";;" rather than ";". ------------------------------------------------------------ revno: 104090 committer: Stefan Monnier branch nick: trunk timestamp: Tue 2011-05-03 11:03:48 -0300 message: * lisp/textmodes/bibtex.el (bibtex-fill-field-bounds, bibtex-fill-entry): Avoid open-line which runs post-self-insert-hook. (bibtex-fill-entry): Remove unused `end' var. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-03 11:08:15 +0000 +++ lisp/ChangeLog 2011-05-03 14:03:48 +0000 @@ -1,12 +1,18 @@ +2011-05-03 Stefan Monnier + + * textmodes/bibtex.el (bibtex-fill-field-bounds, bibtex-fill-entry): + Avoid open-line which runs post-self-insert-hook. + (bibtex-fill-entry): Remove unused `end' var. + 2011-05-03 Dirk Ullrich (tiny change) - * textmodes/ispell.el (ispell-add-per-file-word-list): - Protect against `nil' value of `comment-start' (Bug#8579). + * textmodes/ispell.el (ispell-add-per-file-word-list): + Protect against `nil' value of `comment-start' (Bug#8579). 2011-05-03 Leo Liu * isearch.el (isearch-yank-pop): New command. - (isearch-mode-map): bind it to `M-y'. + (isearch-mode-map): Bind it to `M-y'. (isearch-forward): Mention it. 2011-05-03 Stefan Monnier === modified file 'lisp/textmodes/bibtex.el' --- lisp/textmodes/bibtex.el 2011-01-26 08:36:39 +0000 +++ lisp/textmodes/bibtex.el 2011-05-03 14:03:48 +0000 @@ -4313,8 +4313,7 @@ (goto-char (bibtex-start-of-field bounds)) (forward-char) ; leading comma (bibtex-delete-whitespace) - (open-line 1) - (forward-char) + (insert "\n") (indent-to-column (+ bibtex-entry-offset bibtex-field-indentation)) (re-search-forward "[ \t\n]*=" end-field) @@ -4352,7 +4351,6 @@ If `bibtex-align-at-equal-sign' is non-nil, align equal signs, too." (interactive "*") (let ((pnt (copy-marker (point))) - (end (copy-marker (bibtex-end-of-entry))) (beg (bibtex-beginning-of-entry)) ; move point bounds) (bibtex-delete-whitespace) @@ -4364,8 +4362,7 @@ (forward-char)) (skip-chars-backward " \t\n") (bibtex-delete-whitespace) - (open-line 1) - (forward-char) + (insert "\n") (indent-to-column bibtex-entry-offset) (goto-char pnt))) ------------------------------------------------------------ revno: 104089 fixes bug(s): http://debbugs.gnu.org/8579 committer: Agustin Martin branch nick: trunk timestamp: Tue 2011-05-03 13:08:15 +0200 message: ispell.el (ispell-add-per-file-word-list): Protect against `nil' value of `comment-start' (Bug#8579). diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-03 03:34:26 +0000 +++ lisp/ChangeLog 2011-05-03 11:08:15 +0000 @@ -1,3 +1,8 @@ +2011-05-03 Dirk Ullrich (tiny change) + + * textmodes/ispell.el (ispell-add-per-file-word-list): + Protect against `nil' value of `comment-start' (Bug#8579). + 2011-05-03 Leo Liu * isearch.el (isearch-yank-pop): New command. === modified file 'lisp/textmodes/ispell.el' --- lisp/textmodes/ispell.el 2011-05-03 01:48:32 +0000 +++ lisp/textmodes/ispell.el 2011-05-03 11:08:15 +0000 @@ -3915,14 +3915,18 @@ (progn (open-line 1) (unless found (newline)) - (insert (if (fboundp 'comment-padright) - ;; Try and use the proper comment marker, - ;; e.g. ";;" rather than ";". - (comment-padright comment-start - (comment-add nil)) - comment-start) - " " ispell-words-keyword) - (if (> (length comment-end) 0) + (insert (if comment-start + (progn + (if (fboundp 'comment-padright) + ;; Try and use the proper comment marker, + ;; e.g. ";;" rather than ";". + (comment-padright comment-start + (comment-add nil)) + comment-start) + " ") + "") + ispell-words-keyword) + (if (and comment-end (> (length comment-end) 0)) (save-excursion (newline) (insert comment-end))))) ------------------------------------------------------------ revno: 104088 committer: Julien Danjou branch nick: trunk timestamp: Tue 2011-05-03 10:37:51 +0200 message: * lisp/erc/erc-backend.el (671): New response handler. * lisp/erc/erc.el (english): Add 671 to catalog. diff: === modified file 'lisp/erc/ChangeLog' --- lisp/erc/ChangeLog 2011-04-29 15:23:59 +0000 +++ lisp/erc/ChangeLog 2011-05-03 08:37:51 +0000 @@ -1,3 +1,8 @@ +2011-05-03 Debarshi Ray + + * erc-backend.el (671): New response handler. + * erc.el (english): Add 671 to catalog. + 2011-04-29 Stefan Monnier * erc-pcomplete.el (erc-pcomplete-nick-postfix): Remove the " " in the === modified file 'lisp/erc/erc-backend.el' --- lisp/erc/erc-backend.el 2011-01-25 04:08:28 +0000 +++ lisp/erc/erc-backend.el 2011-05-03 08:37:51 +0000 @@ -1951,6 +1951,13 @@ (erc-display-message parsed '(error notice) 'active 's482 ?c channel ?m message))) +(define-erc-response-handler (671) + "Secure connection response in WHOIS." nil + (let ((nick (second (erc-response.command-args parsed))) + (securemsg (erc-response.contents parsed))) + (erc-display-message parsed 'notice 'active 's671 + ?n nick ?a securemsg))) + (define-erc-response-handler (431 445 446 451 462 463 464 481 483 484 485 491 501 502) ;; 431 - No nickname given === modified file 'lisp/erc/erc.el' --- lisp/erc/erc.el 2011-04-26 13:50:09 +0000 +++ lisp/erc/erc.el 2011-05-03 08:37:51 +0000 @@ -6351,7 +6351,8 @@ (s485 . "You're not the original channel operator") (s491 . "No O-lines for your host") (s501 . "Unknown MODE flag") - (s502 . "You can't change modes for other users"))) + (s502 . "You can't change modes for other users") + (s671 . "%n %a"))) (defun erc-message-english-PART (&rest args) "Format a proper PART message. ------------------------------------------------------------ revno: 104087 committer: Leo Liu branch nick: trunk timestamp: Tue 2011-05-03 11:34:26 +0800 message: New command isearch-yank-pop and bind it to `M-y' in Isearch diff: === modified file 'etc/ChangeLog' --- etc/ChangeLog 2011-05-03 00:48:07 +0000 +++ etc/ChangeLog 2011-05-03 03:34:26 +0000 @@ -1,3 +1,7 @@ +2011-05-03 Leo Liu + + * NEWS: Mention the new command isearch-yank-pop. + 2011-05-03 Teodor Zlatanov * NEWS: Mention new library gnutls.el and explain GnuTLS === modified file 'etc/NEWS' --- etc/NEWS 2011-05-03 00:48:07 +0000 +++ etc/NEWS 2011-05-03 03:34:26 +0000 @@ -281,6 +281,10 @@ *** C-y in Isearch is now bound to isearch-yank-kill, instead of isearch-yank-line. +--- +*** M-y in Isearch is now bound to isearch-yank-pop, instead of +isearch-yank-kill. + +++ *** M-s C-e in Isearch is now bound to isearch-yank-line. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-03 01:52:52 +0000 +++ lisp/ChangeLog 2011-05-03 03:34:26 +0000 @@ -1,3 +1,9 @@ +2011-05-03 Leo Liu + + * isearch.el (isearch-yank-pop): New command. + (isearch-mode-map): bind it to `M-y'. + (isearch-forward): Mention it. + 2011-05-03 Stefan Monnier * simple.el (minibuffer-complete-shell-command): Remove. === modified file 'lisp/isearch.el' --- lisp/isearch.el 2011-04-19 13:44:55 +0000 +++ lisp/isearch.el 2011-05-03 03:34:26 +0000 @@ -473,7 +473,7 @@ (define-key map "\M-n" 'isearch-ring-advance) (define-key map "\M-p" 'isearch-ring-retreat) - (define-key map "\M-y" 'isearch-yank-kill) + (define-key map "\M-y" 'isearch-yank-pop) (define-key map "\M-\t" 'isearch-complete) @@ -637,6 +637,8 @@ Type \\[isearch-yank-line] to yank rest of line onto end of search string\ and search for it. Type \\[isearch-yank-kill] to yank the last string of killed text. +Type \\[isearch-yank-pop] to replace string just yanked into search prompt + with string killed before it. Type \\[isearch-quote-char] to quote control character to search for it. \\[isearch-abort] while searching or when search has failed cancels input\ back to what has @@ -1497,6 +1499,18 @@ (interactive) (isearch-yank-string (current-kill 0))) +(defun isearch-yank-pop () + "Replace just-yanked search string with previously killed string." + (interactive) + (if (not (memq last-command '(isearch-yank-kill isearch-yank-pop))) + ;; Fall back on `isearch-yank-kill' for the benefits of people + ;; who are used to the old behavior of `M-y' in isearch mode. In + ;; future, this fallback may be changed if we ever change + ;; `yank-pop' to do something like the kill-ring-browser. + (isearch-yank-kill) + (isearch-pop-state) + (isearch-yank-string (current-kill 1)))) + (defun isearch-yank-x-selection () "Pull current X selection into search string." (interactive) ------------------------------------------------------------ Use --include-merges or -n0 to see merged revisions.