Now on revision 112852. ------------------------------------------------------------ revno: 112852 committer: Stefan Monnier branch nick: trunk timestamp: Tue 2013-06-04 22:35:40 -0400 message: Fix compilation error with simultaneous dynamic+lexical scoping. Add warning when a defvar appears after the first let-binding. * lisp/emacs-lisp/bytecomp.el (byte-compile-lexical-variables): New var. (byte-compile-close-variables): Initialize it. (byte-compile--declare-var): New function. (byte-compile-file-form-defvar) (byte-compile-file-form-define-abbrev-table) (byte-compile-file-form-custom-declare-variable): Use it. (byte-compile-make-lambda-lexenv): Change the argument. Simplify. (byte-compile-lambda): Share call to byte-compile-arglist-vars. (byte-compile-bind): Handle dynamic bindings that shadow lexical bindings. (byte-compile-unbind): Make arg non-optional. (byte-compile-let): Simplify. * lisp/emacs-lisp/cconv.el (byte-compile-lexical-variables): Declare var. (cconv--analyse-function, cconv-analyse-form): Populate it. Protect byte-compile-bound-variables to limit the scope of defvars. (cconv-analyse-form): Add missing rule for (defvar ). Remove unneeded rule for `declare'. * lisp/emacs-lisp/cl-macs.el (cl--compiler-macro-adjoin): Use macroexp-let2 so as to avoid depending on cl-adjoin at run-time. * lisp/emacs-lisp/cl-lib.el (cl-pushnew): Use backquotes. * lisp/emacs-lisp/macroexp.el (macroexp--compiling-p): New function. (macroexp--warn-and-return): Use it. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-05 01:19:33 +0000 +++ lisp/ChangeLog 2013-06-05 02:35:40 +0000 @@ -1,3 +1,32 @@ +2013-06-05 Stefan Monnier + + Fix compilation error with simultaneous dynamic+lexical scoping. + Add warning when a defvar appears after the first let-binding. + * emacs-lisp/bytecomp.el (byte-compile-lexical-variables): New var. + (byte-compile-close-variables): Initialize it. + (byte-compile--declare-var): New function. + (byte-compile-file-form-defvar) + (byte-compile-file-form-define-abbrev-table) + (byte-compile-file-form-custom-declare-variable): Use it. + (byte-compile-make-lambda-lexenv): Change the argument. Simplify. + (byte-compile-lambda): Share call to byte-compile-arglist-vars. + (byte-compile-bind): Handle dynamic bindings that shadow + lexical bindings. + (byte-compile-unbind): Make arg non-optional. + (byte-compile-let): Simplify. + * emacs-lisp/cconv.el (byte-compile-lexical-variables): Declare var. + (cconv--analyse-function, cconv-analyse-form): Populate it. + Protect byte-compile-bound-variables to limit the scope of defvars. + (cconv-analyse-form): Add missing rule for (defvar ). + Remove unneeded rule for `declare'. + + * emacs-lisp/cl-macs.el (cl--compiler-macro-adjoin): Use macroexp-let2 + so as to avoid depending on cl-adjoin at run-time. + * emacs-lisp/cl-lib.el (cl-pushnew): Use backquotes. + + * emacs-lisp/macroexp.el (macroexp--compiling-p): New function. + (macroexp--warn-and-return): Use it. + 2013-06-05 Leo Liu * eshell/esh-mode.el (eshell-mode): Fix key bindings. @@ -17,7 +46,7 @@ * emacs-lisp/lisp.el: Use lexical-binding. (lisp--local-variables-1, lisp--local-variables): New functions. (lisp--local-variables-completion-table): New var. - (lisp-completion-at-point): Use it to provide completion of let-bound vars. + (lisp-completion-at-point): Use it complete let-bound vars. * emacs-lisp/lisp-mode.el (eval-sexp-add-defvars): Expand macros eagerly (bug#14422). === modified file 'lisp/emacs-lisp/bytecomp.el' --- lisp/emacs-lisp/bytecomp.el 2013-05-28 06:52:51 +0000 +++ lisp/emacs-lisp/bytecomp.el 2013-06-05 02:35:40 +0000 @@ -411,6 +411,9 @@ (defvar byte-compile-bound-variables nil "List of dynamic variables bound in the context of the current form. This list lives partly on the stack.") +(defvar byte-compile-lexical-variables nil + "List of variables that have been treated as lexical. +Filled in `cconv-analyse-form' but initialized and consulted here.") (defvar byte-compile-const-variables nil "List of variables declared as constants during compilation of this file.") (defvar byte-compile-free-references) @@ -1489,6 +1492,7 @@ (byte-compile--outbuffer nil) (byte-compile-function-environment nil) (byte-compile-bound-variables nil) + (byte-compile-lexical-variables nil) (byte-compile-const-variables nil) (byte-compile-free-references nil) (byte-compile-free-assignments nil) @@ -2245,15 +2249,24 @@ (put 'defvar 'byte-hunk-handler 'byte-compile-file-form-defvar) (put 'defconst 'byte-hunk-handler 'byte-compile-file-form-defvar) + +(defun byte-compile--declare-var (sym) + (when (and (symbolp sym) + (not (string-match "[-*/:$]" (symbol-name sym))) + (byte-compile-warning-enabled-p 'lexical)) + (byte-compile-warn "global/dynamic var `%s' lacks a prefix" + sym)) + (when (memq sym byte-compile-lexical-variables) + (setq byte-compile-lexical-variables + (delq sym byte-compile-lexical-variables)) + (byte-compile-warn "Variable `%S' declared after its first use" sym)) + (push sym byte-compile-bound-variables)) + (defun byte-compile-file-form-defvar (form) - (when (and (symbolp (nth 1 form)) - (not (string-match "[-*/:$]" (symbol-name (nth 1 form)))) - (byte-compile-warning-enabled-p 'lexical)) - (byte-compile-warn "global/dynamic var `%s' lacks a prefix" - (nth 1 form))) - (push (nth 1 form) byte-compile-bound-variables) - (if (eq (car form) 'defconst) - (push (nth 1 form) byte-compile-const-variables)) + (let ((sym (nth 1 form))) + (byte-compile--declare-var sym) + (if (eq (car form) 'defconst) + (push sym byte-compile-const-variables))) (if (and (null (cddr form)) ;No `value' provided. (eq (car form) 'defvar)) ;Just a declaration. nil @@ -2267,7 +2280,7 @@ 'byte-compile-file-form-define-abbrev-table) (defun byte-compile-file-form-define-abbrev-table (form) (if (eq 'quote (car-safe (car-safe (cdr form)))) - (push (car-safe (cdr (cadr form))) byte-compile-bound-variables)) + (byte-compile--declare-var (car-safe (cdr (cadr form))))) (byte-compile-keep-pending form)) (put 'custom-declare-variable 'byte-hunk-handler @@ -2275,7 +2288,7 @@ (defun byte-compile-file-form-custom-declare-variable (form) (when (byte-compile-warning-enabled-p 'callargs) (byte-compile-nogroup-warn form)) - (push (nth 1 (nth 1 form)) byte-compile-bound-variables) + (byte-compile--declare-var (nth 1 (nth 1 form))) (byte-compile-keep-pending form)) (put 'require 'byte-hunk-handler 'byte-compile-file-form-require) @@ -2576,19 +2589,16 @@ "Return a list of the variables in the lambda argument list ARGLIST." (remq '&rest (remq '&optional arglist))) -(defun byte-compile-make-lambda-lexenv (form) +(defun byte-compile-make-lambda-lexenv (args) "Return a new lexical environment for a lambda expression FORM." - ;; See if this is a closure or not - (let ((args (byte-compile-arglist-vars (cadr form)))) - (let ((lexenv nil)) - ;; Fill in the initial stack contents - (let ((stackpos 0)) - ;; Add entries for each argument - (dolist (arg args) - (push (cons arg stackpos) lexenv) - (setq stackpos (1+ stackpos))) - ;; Return the new lexical environment - lexenv)))) + (let* ((lexenv nil) + (stackpos 0)) + ;; Add entries for each argument. + (dolist (arg args) + (push (cons arg stackpos) lexenv) + (setq stackpos (1+ stackpos))) + ;; Return the new lexical environment. + lexenv)) (defun byte-compile-make-args-desc (arglist) (let ((mandatory 0) @@ -2626,9 +2636,9 @@ (byte-compile-set-symbol-position 'lambda)) (byte-compile-check-lambda-list (nth 1 fun)) (let* ((arglist (nth 1 fun)) + (arglistvars (byte-compile-arglist-vars arglist)) (byte-compile-bound-variables - (append (and (not lexical-binding) - (byte-compile-arglist-vars arglist)) + (append (if (not lexical-binding) arglistvars) byte-compile-bound-variables)) (body (cdr (cdr fun))) (doc (if (stringp (car body)) @@ -2676,7 +2686,8 @@ ;; args (since lambda expressions should be ;; closed by now). (and lexical-binding - (byte-compile-make-lambda-lexenv fun)) + (byte-compile-make-lambda-lexenv + arglistvars)) reserved-csts))) ;; Build the actual byte-coded function. (cl-assert (eq 'byte-code (car-safe compiled))) @@ -3862,9 +3873,8 @@ "Emit byte-codes to push the initialization value for CLAUSE on the stack. Return the offset in the form (VAR . OFFSET)." (let* ((var (if (consp clause) (car clause) clause))) - ;; We record the stack position even of dynamic bindings and - ;; variables in non-stack lexical environments; we'll put - ;; them in the proper place below. + ;; We record the stack position even of dynamic bindings; we'll put + ;; them in the proper place later. (prog1 (cons var byte-compile-depth) (if (consp clause) (byte-compile-form (cadr clause)) @@ -3882,33 +3892,41 @@ INIT-LEXENV should be a lexical-environment alist describing the positions of the init value that have been pushed on the stack. Return non-nil if the TOS value was popped." - ;; The presence of lexical bindings mean that we may have to + ;; The mix of lexical and dynamic bindings mean that we may have to ;; juggle things on the stack, to move them to TOS for ;; dynamic binding. - (cond ((not (byte-compile-not-lexical-var-p var)) - ;; VAR is a simple stack-allocated lexical variable - (push (assq var init-lexenv) - byte-compile--lexical-environment) - nil) - ((eq var (caar init-lexenv)) - ;; VAR is dynamic and is on the top of the - ;; stack, so we can just bind it like usual - (byte-compile-dynamic-variable-bind var) - t) - (t - ;; VAR is dynamic, but we have to get its - ;; value out of the middle of the stack - (let ((stack-pos (cdr (assq var init-lexenv)))) - (byte-compile-stack-ref stack-pos) - (byte-compile-dynamic-variable-bind var) - ;; Now we have to store nil into its temporary - ;; stack position to avoid problems with GC - (byte-compile-push-constant nil) - (byte-compile-stack-set stack-pos)) - nil))) + (if (and lexical-binding (not (byte-compile-not-lexical-var-p var))) + ;; VAR is a simple stack-allocated lexical variable. + (progn (push (assq var init-lexenv) + byte-compile--lexical-environment) + nil) + ;; VAR should be dynamically bound. + (while (assq var byte-compile--lexical-environment) + ;; This dynamic binding shadows a lexical binding. + (setq byte-compile--lexical-environment + (remq (assq var byte-compile--lexical-environment) + byte-compile--lexical-environment))) + (cond + ((eq var (caar init-lexenv)) + ;; VAR is dynamic and is on the top of the + ;; stack, so we can just bind it like usual. + (byte-compile-dynamic-variable-bind var) + t) + (t + ;; VAR is dynamic, but we have to get its + ;; value out of the middle of the stack. + (let ((stack-pos (cdr (assq var init-lexenv)))) + (byte-compile-stack-ref stack-pos) + (byte-compile-dynamic-variable-bind var) + ;; Now we have to store nil into its temporary + ;; stack position so it doesn't prevent the value from being GC'd. + ;; FIXME: Not worth the trouble. + ;; (byte-compile-push-constant nil) + ;; (byte-compile-stack-set stack-pos) + ) + nil)))) -(defun byte-compile-unbind (clauses init-lexenv - &optional preserve-body-value) +(defun byte-compile-unbind (clauses init-lexenv preserve-body-value) "Emit byte-codes to unbind the variables bound by CLAUSES. CLAUSES is a `let'-style variable binding list. INIT-LEXENV should be a lexical-environment alist describing the positions of the init value that @@ -3916,7 +3934,7 @@ then an additional value on the top of the stack, above any lexical binding slots, is preserved, so it will be on the top of the stack after all binding slots have been popped." - ;; Unbind dynamic variables + ;; Unbind dynamic variables. (let ((num-dynamic-bindings 0)) (dolist (clause clauses) (unless (assq (if (consp clause) (car clause) clause) @@ -3927,14 +3945,15 @@ ;; Pop lexical variables off the stack, possibly preserving the ;; return value of the body. (when init-lexenv - ;; INIT-LEXENV contains all init values left on the stack + ;; INIT-LEXENV contains all init values left on the stack. (byte-compile-discard (length init-lexenv) preserve-body-value))) (defun byte-compile-let (form) - "Generate code for the `let' form FORM." + "Generate code for the `let' or `let*' form FORM." (let ((clauses (cadr form)) - (init-lexenv nil)) - (when (eq (car form) 'let) + (init-lexenv nil) + (is-let (eq (car form) 'let))) + (when is-let ;; First compute the binding values in the old scope. (dolist (var clauses) (push (byte-compile-push-binding-init var) init-lexenv))) @@ -3946,28 +3965,20 @@ ;; For `let', do it in reverse order, because it makes no ;; semantic difference, but it is a lot more efficient since the ;; values are now in reverse order on the stack. - (dolist (var (if (eq (car form) 'let) (reverse clauses) clauses)) - (unless (eq (car form) 'let) + (dolist (var (if is-let (reverse clauses) clauses)) + (unless is-let (push (byte-compile-push-binding-init var) init-lexenv)) (let ((var (if (consp var) (car var) var))) - (cond ((null lexical-binding) - ;; If there are no lexical bindings, we can do things simply. - (byte-compile-dynamic-variable-bind var)) - ((byte-compile-bind var init-lexenv) - (pop init-lexenv))))) + (if (byte-compile-bind var init-lexenv) + (pop init-lexenv)))) ;; Emit the body. (let ((init-stack-depth byte-compile-depth)) (byte-compile-body-do-effect (cdr (cdr form))) - ;; Unbind the variables. - (if lexical-binding - ;; Unbind both lexical and dynamic variables. - (progn - (cl-assert (or (eq byte-compile-depth init-stack-depth) - (eq byte-compile-depth (1+ init-stack-depth)))) - (byte-compile-unbind clauses init-lexenv (> byte-compile-depth - init-stack-depth))) - ;; Unbind dynamic variables. - (byte-compile-out 'byte-unbind (length clauses))))))) + ;; Unbind both lexical and dynamic variables. + (cl-assert (or (eq byte-compile-depth init-stack-depth) + (eq byte-compile-depth (1+ init-stack-depth)))) + (byte-compile-unbind clauses init-lexenv + (> byte-compile-depth init-stack-depth)))))) === modified file 'lisp/emacs-lisp/cconv.el' --- lisp/emacs-lisp/cconv.el 2013-01-01 09:11:05 +0000 +++ lisp/emacs-lisp/cconv.el 2013-06-05 02:35:40 +0000 @@ -81,7 +81,6 @@ ;; and other oddities. ;; - new byte codes for unwind-protect, catch, and condition-case so that ;; closures aren't needed at all. -;; - inline source code of different binding mode by first compiling it. ;; - a reference to a var that is known statically to always hold a constant ;; should be turned into a byte-constant rather than a byte-stack-ref. ;; Hmm... right, that's called constant propagation and could be done here, @@ -95,6 +94,7 @@ ;; (defmacro dlet (binders &rest body) ;; ;; Works in both lexical and non-lexical mode. +;; (declare (indent 1) (debug let)) ;; `(progn ;; ,@(mapcar (lambda (binder) ;; `(defvar ,(if (consp binder) (car binder) binder))) @@ -489,6 +489,7 @@ (unless (fboundp 'byte-compile-not-lexical-var-p) ;; Only used to test the code in non-lexbind Emacs. (defalias 'byte-compile-not-lexical-var-p 'boundp)) +(defvar byte-compile-lexical-variables) (defun cconv--analyse-use (vardata form varkind) "Analyze the use of a variable. @@ -530,6 +531,7 @@ ;; outside of it. (envcopy (mapcar (lambda (vdata) (list (car vdata) nil nil nil nil)) env)) + (byte-compile-bound-variables byte-compile-bound-variables) (newenv envcopy)) ;; Push it before recursing, so cconv-freevars-alist contains entries in ;; the order they'll be used by closure-convert-rec. @@ -541,6 +543,7 @@ (format "Argument %S is not a lexical variable" arg))) ((eq ?& (aref (symbol-name arg) 0)) nil) ;Ignore &rest, &optional, ... (t (let ((varstruct (list arg nil nil nil nil))) + (cl-pushnew arg byte-compile-lexical-variables) (push (cons (list arg) (cdr varstruct)) newvars) (push varstruct newenv))))) (dolist (form body) ;Analyze body forms. @@ -579,6 +582,7 @@ (let ((orig-env env) (newvars nil) (var nil) + (byte-compile-bound-variables byte-compile-bound-variables) (value nil)) (dolist (binder binders) (if (not (consp binder)) @@ -592,6 +596,7 @@ (cconv-analyse-form value (if (eq letsym 'let*) env orig-env))) (unless (byte-compile-not-lexical-var-p var) + (cl-pushnew var byte-compile-lexical-variables) (let ((varstruct (list var nil nil nil nil))) (push (cons binder (cdr varstruct)) newvars) (push varstruct env)))) @@ -616,7 +621,8 @@ (`((lambda . ,_) . ,_) ; First element is lambda expression. (byte-compile-log-warning - "Use of deprecated ((lambda ...) ...) form" t :warning) + (format "Use of deprecated ((lambda %s ...) ...) form" (nth 1 (car form))) + t :warning) (dolist (exp `((function ,(car form)) . ,(cdr form))) (cconv-analyse-form exp env))) @@ -645,6 +651,7 @@ (`(track-mouse . ,body) (cconv--analyse-function () body env form)) + (`(defvar ,var) (push var byte-compile-bound-variables)) (`(,(or `defconst `defvar) ,var ,value . ,_) (push var byte-compile-bound-variables) (cconv-analyse-form value env)) @@ -668,7 +675,9 @@ ;; seem worth the trouble. (dolist (form forms) (cconv-analyse-form form nil))) - (`(declare . ,_) nil) ;The args don't contain code. + ;; `declare' should now be macro-expanded away (and if they're not, we're + ;; in trouble because they *can* contain code nowadays). + ;; (`(declare . ,_) nil) ;The args don't contain code. (`(,_ . ,body-forms) ; First element is a function or whatever. (dolist (form body-forms) (cconv-analyse-form form env))) === modified file 'lisp/emacs-lisp/cl-lib.el' --- lisp/emacs-lisp/cl-lib.el 2013-02-20 02:07:07 +0000 +++ lisp/emacs-lisp/cl-lib.el 2013-06-05 02:35:40 +0000 @@ -156,8 +156,8 @@ ;; earlier and should have triggered them already. (with-no-warnings ,place) (setq ,place (cons ,var ,place)))) - (list 'setq place (cl-list* 'cl-adjoin x place keys))) - (cl-list* 'cl-callf2 'cl-adjoin x place keys))) + `(setq ,place (cl-adjoin ,x ,place ,@keys))) + `(cl-callf2 cl-adjoin ,x ,place ,@keys))) (defun cl--set-elt (seq n val) (if (listp seq) (setcar (nthcdr n seq) val) (aset seq n val))) === modified file 'lisp/emacs-lisp/cl-loaddefs.el' --- lisp/emacs-lisp/cl-loaddefs.el 2013-05-15 02:00:07 +0000 +++ lisp/emacs-lisp/cl-loaddefs.el 2013-06-05 02:35:40 +0000 @@ -267,7 +267,7 @@ ;;;;;; cl-typecase cl-ecase cl-case cl-load-time-value cl-eval-when ;;;;;; cl-destructuring-bind cl-function cl-defmacro cl-defun cl-gentemp ;;;;;; cl-gensym cl--compiler-macro-cXXr cl--compiler-macro-list*) -;;;;;; "cl-macs" "cl-macs.el" "b839ad3781c4f2f849df0639b4eba166") +;;;;;; "cl-macs" "cl-macs.el" "80cb53f97b21adb6069c43c38a2e094d") ;;; Generated autoloads from cl-macs.el (autoload 'cl--compiler-macro-list* "cl-macs" "\ === modified file 'lisp/emacs-lisp/cl-macs.el' --- lisp/emacs-lisp/cl-macs.el 2013-05-10 02:01:12 +0000 +++ lisp/emacs-lisp/cl-macs.el 2013-06-05 02:35:40 +0000 @@ -2763,10 +2763,10 @@ ;;;###autoload (defun cl--compiler-macro-adjoin (form a list &rest keys) - (if (and (cl--simple-expr-p a) (cl--simple-expr-p list) - (not (memq :key keys))) - `(if (cl-member ,a ,list ,@keys) ,list (cons ,a ,list)) - form)) + (if (memq :key keys) form + (macroexp-let2 macroexp-copyable-p va a + (macroexp-let2 macroexp-copyable-p vlist list + `(if (cl-member ,va ,vlist ,@keys) ,vlist (cons ,va ,vlist)))))) (defun cl--compiler-macro-get (_form sym prop &optional def) (if def === modified file 'lisp/emacs-lisp/macroexp.el' --- lisp/emacs-lisp/macroexp.el 2013-01-02 16:13:04 +0000 +++ lisp/emacs-lisp/macroexp.el 2013-06-05 02:35:40 +0000 @@ -111,15 +111,20 @@ (funcall (eval (cadr form))) (byte-compile-constant nil))) +(defun macroexp--compiling-p () + "Return non-nil if we're macroexpanding for the compiler." + ;; FIXME: ¡¡Major Ugly Hack!! To determine whether the output of this + ;; macro-expansion will be processed by the byte-compiler, we check + ;; circumstantial evidence. + (member '(declare-function . byte-compile-macroexpand-declare-function) + macroexpand-all-environment)) + + (defun macroexp--warn-and-return (msg form) (let ((when-compiled (lambda () (byte-compile-log-warning msg t)))) (cond ((null msg) form) - ;; FIXME: ¡¡Major Ugly Hack!! To determine whether the output of this - ;; macro-expansion will be processed by the byte-compiler, we check - ;; circumstantial evidence. - ((member '(declare-function . byte-compile-macroexpand-declare-function) - macroexpand-all-environment) + ((macroexp--compiling-p) `(progn (macroexp--funcall-if-compiled ',when-compiled) ,form)) ------------------------------------------------------------ revno: 112851 committer: Stefan Monnier branch nick: trunk timestamp: Tue 2013-06-04 21:58:43 -0400 message: * src/keymap.c (Fcurrent_active_maps, Fdescribe_buffer_bindings): * src/keyboard.c (menu_bar_items, tool_bar_items): * src/doc.c (Fsubstitute_command_keys): Voverriding_terminal_local_map does not override local keymaps any more. diff: === modified file 'etc/NEWS' --- etc/NEWS 2013-06-03 13:35:21 +0000 +++ etc/NEWS 2013-06-05 01:58:43 +0000 @@ -396,6 +396,10 @@ * Incompatible Lisp Changes in Emacs 24.4 +** overriding-terminal-local-map does not replace the local keymaps any more. +It used to disable the minor mode, major mode, and text-property keymaps, +whereas now it simply has higher precedence. + ** Default process filers and sentinels are not nil any more. Instead they default to a function which does what the nil value used to do. === modified file 'lisp/subr.el' --- lisp/subr.el 2013-06-03 13:03:05 +0000 +++ lisp/subr.el 2013-06-05 01:58:43 +0000 @@ -1,4 +1,4 @@ -;;; subr.el --- basic lisp subroutines for Emacs -*- coding: utf-8 -*- +;;; subr.el --- basic lisp subroutines for Emacs -*- coding: utf-8; lexical-binding:t -*- ;; Copyright (C) 1985-1986, 1992, 1994-1995, 1999-2013 Free Software ;; Foundation, Inc. @@ -39,7 +39,7 @@ (setq custom-declare-variable-list (cons arguments custom-declare-variable-list))) -(defmacro declare-function (fn file &optional arglist fileonly) +(defmacro declare-function (_fn _file &optional _arglist _fileonly) "Tell the byte-compiler that function FN is defined, in FILE. Optional ARGLIST is the argument list used by the function. The FILE argument is not used by the byte-compiler, but by the @@ -1261,6 +1261,8 @@ (make-obsolete-variable 'redisplay-end-trigger-functions 'jit-lock-register "23.1") (make-obsolete-variable 'deferred-action-list 'post-command-hook "24.1") (make-obsolete-variable 'deferred-action-function 'post-command-hook "24.1") +(make-obsolete-variable 'overriding-local-map + 'overriding-terminal-local-map "24.4" 'set) (make-obsolete 'window-redisplay-end-trigger nil "23.1") (make-obsolete 'set-window-redisplay-end-trigger nil "23.1") @@ -1478,11 +1480,48 @@ The return value is the new value of LIST-VAR. +This is handy to add some elements to configuration variables, +but please do not abuse it in Elisp code, where you are usually better off +using `push' or `cl-pushnew'. + If you want to use `add-to-list' on a variable that is not defined until a certain package is loaded, you should put the call to `add-to-list' into a hook function that will be run only after loading the package. `eval-after-load' provides one way to do this. In some cases other hooks, such as major mode hooks, can do the job." + (declare + (compiler-macro + (lambda (exp) + ;; FIXME: Something like this could be used for `set' as well. + (if (or (not (eq 'quote (car-safe list-var))) + (special-variable-p (cadr list-var)) + (and append compare-fn)) + exp + (let* ((sym (cadr list-var)) + (msg (format "`add-to-list' can't use lexical var `%s'; use `push' or `cl-pushnew'" + sym)) + ;; Big ugly hack so we only output a warning during + ;; byte-compilation, and so we can use + ;; byte-compile-not-lexical-var-p to silence the warning + ;; when a defvar has been seen but not yet executed. + (warnfun (lambda () + ;; FIXME: We should also emit a warning for let-bound + ;; variables with dynamic binding. + (when (assq sym byte-compile--lexical-environment) + (byte-compile-log-warning msg t :error)))) + (code + (if append + (macroexp-let2 macroexp-copyable-p x element + `(unless (member ,x ,sym) + (setq ,sym (append ,sym (list ,x))))) + (require 'cl-lib) + `(cl-pushnew ,element ,sym + :test ,(or compare-fn '#'equal))))) + (if (not (macroexp--compiling-p)) + code + `(progn + (macroexp--funcall-if-compiled ',warnfun) + ,code))))))) (if (cond ((null compare-fn) (member element (symbol-value list-var))) @@ -2054,8 +2093,8 @@ ;; disable quail's input methods, so although read-key-sequence ;; always inherits the input method, in practice read-key does not ;; inherit the input method (at least not if it's based on quail). - (let ((overriding-terminal-local-map read-key-empty-map) - (overriding-local-map nil) + (let ((overriding-terminal-local-map nil) + (overriding-local-map read-key-empty-map) (echo-keystrokes 0) (old-global-map (current-global-map)) (timer (run-with-idle-timer === modified file 'src/ChangeLog' --- src/ChangeLog 2013-06-04 16:33:46 +0000 +++ src/ChangeLog 2013-06-05 01:58:43 +0000 @@ -1,3 +1,10 @@ +2013-06-05 Stefan Monnier + + * keymap.c (Fcurrent_active_maps, Fdescribe_buffer_bindings): + * keyboard.c (menu_bar_items, tool_bar_items): + * doc.c (Fsubstitute_command_keys): Voverriding_terminal_local_map does + not override local keymaps any more. + 2013-06-04 Eli Zaretskii * window.c (Fpos_visible_in_window_p): Doc fix. (Bug#14540) === modified file 'src/doc.c' --- src/doc.c 2013-05-15 20:12:53 +0000 +++ src/doc.c 2013-06-05 01:58:43 +0000 @@ -758,9 +758,7 @@ or a specified local map (which means search just that and the global map). If non-nil, it might come from Voverriding_local_map, or from a \\ construct in STRING itself.. */ - keymap = KVAR (current_kboard, Voverriding_terminal_local_map); - if (NILP (keymap)) - keymap = Voverriding_local_map; + keymap = Voverriding_local_map; bsize = SBYTES (string); bufp = buf = xmalloc (bsize); === modified file 'src/keyboard.c' --- src/keyboard.c 2013-06-03 15:18:18 +0000 +++ src/keyboard.c 2013-06-05 01:58:43 +0000 @@ -7392,7 +7392,8 @@ Lisp_Object *tmaps; /* Should overriding-terminal-local-map and overriding-local-map apply? */ - if (!NILP (Voverriding_local_map_menu_flag)) + if (!NILP (Voverriding_local_map_menu_flag) + && !NILP (Voverriding_local_map)) { /* Yes, use them (if non-nil) as well as the global map. */ maps = alloca (3 * sizeof (maps[0])); @@ -7412,8 +7413,11 @@ Lisp_Object tem; ptrdiff_t nminor; nminor = current_minor_maps (NULL, &tmaps); - maps = alloca ((nminor + 3) * sizeof *maps); + maps = alloca ((nminor + 4) * sizeof *maps); nmaps = 0; + tem = KVAR (current_kboard, Voverriding_terminal_local_map); + if (!NILP (tem) && !NILP (Voverriding_local_map_menu_flag)) + maps[nmaps++] = tem; if (tem = get_local_map (PT, current_buffer, Qkeymap), !NILP (tem)) maps[nmaps++] = tem; memcpy (maps + nmaps, tmaps, nminor * sizeof (maps[0])); @@ -7938,7 +7942,8 @@ to process. */ /* Should overriding-terminal-local-map and overriding-local-map apply? */ - if (!NILP (Voverriding_local_map_menu_flag)) + if (!NILP (Voverriding_local_map_menu_flag) + && !NILP (Voverriding_local_map)) { /* Yes, use them (if non-nil) as well as the global map. */ maps = alloca (3 * sizeof *maps); @@ -7958,8 +7963,11 @@ Lisp_Object tem; ptrdiff_t nminor; nminor = current_minor_maps (NULL, &tmaps); - maps = alloca ((nminor + 3) * sizeof *maps); + maps = alloca ((nminor + 4) * sizeof *maps); nmaps = 0; + tem = KVAR (current_kboard, Voverriding_terminal_local_map); + if (!NILP (tem) && !NILP (Voverriding_local_map_menu_flag)) + maps[nmaps++] = tem; if (tem = get_local_map (PT, current_buffer, Qkeymap), !NILP (tem)) maps[nmaps++] = tem; memcpy (maps + nmaps, tmaps, nminor * sizeof (maps[0])); @@ -11443,10 +11451,7 @@ DEFVAR_KBOARD ("overriding-terminal-local-map", Voverriding_terminal_local_map, - doc: /* Per-terminal keymap that overrides all other local keymaps. -If this variable is non-nil, it is used as a keymap instead of the -buffer's local map, and the minor mode keymaps and text property keymaps. -It also replaces `overriding-local-map'. + doc: /* Per-terminal keymap that takes precedence over all other keymaps. This variable is intended to let commands such as `universal-argument' set up a different keymap for reading the next command. @@ -11456,7 +11461,7 @@ See Info node `(elisp)Multiple Terminals'. */); DEFVAR_LISP ("overriding-local-map", Voverriding_local_map, - doc: /* Keymap that overrides all other local keymaps. + doc: /* Keymap that overrides almost all other local keymaps. If this variable is non-nil, it is used as a keymap--replacing the buffer's local map, the minor mode keymaps, and char property keymaps. */); Voverriding_local_map = Qnil; === modified file 'src/keymap.c' --- src/keymap.c 2013-04-02 01:54:56 +0000 +++ src/keymap.c 2013-06-05 01:58:43 +0000 @@ -56,28 +56,28 @@ #include "keymap.h" #include "window.h" -/* Actually allocate storage for these variables */ - -Lisp_Object current_global_map; /* Current global keymap */ - -Lisp_Object global_map; /* default global key bindings */ +/* Actually allocate storage for these variables. */ + +Lisp_Object current_global_map; /* Current global keymap. */ + +Lisp_Object global_map; /* Default global key bindings. */ Lisp_Object meta_map; /* The keymap used for globally bound - ESC-prefixed default commands */ + ESC-prefixed default commands. */ Lisp_Object control_x_map; /* The keymap used for globally bound - C-x-prefixed default commands */ + C-x-prefixed default commands. */ /* The keymap used by the minibuf for local bindings when spaces are allowed in the - minibuf */ + minibuf. */ /* The keymap used by the minibuf for local bindings when spaces are not encouraged - in the minibuf */ + in the minibuf. */ -/* keymap used for minibuffers when doing completion */ -/* keymap used for minibuffers when doing completion and require a match */ +/* Keymap used for minibuffers when doing completion. */ +/* Keymap used for minibuffers when doing completion and require a match. */ static Lisp_Object Qkeymapp, Qnon_ascii; Lisp_Object Qkeymap, Qmenu_item, Qremap; static Lisp_Object QCadvertised_binding; @@ -1571,17 +1571,14 @@ } } - if (!NILP (olp)) - { - if (!NILP (KVAR (current_kboard, Voverriding_terminal_local_map))) - keymaps = Fcons (KVAR (current_kboard, Voverriding_terminal_local_map), - keymaps); + if (!NILP (olp) /* The doc said that overriding-terminal-local-map should override overriding-local-map. The code used them both, but it seems clearer to use just one. rms, jan 2005. */ - else if (!NILP (Voverriding_local_map)) - keymaps = Fcons (Voverriding_local_map, keymaps); - } + && NILP (KVAR (current_kboard, Voverriding_terminal_local_map)) + && !NILP (Voverriding_local_map)) + keymaps = Fcons (Voverriding_local_map, keymaps); + if (NILP (XCDR (keymaps))) { Lisp_Object *maps; @@ -1592,6 +1589,7 @@ Lisp_Object local_map = get_local_map (pt, current_buffer, Qlocal_map); /* This returns nil unless there is a `keymap' property. */ Lisp_Object keymap = get_local_map (pt, current_buffer, Qkeymap); + Lisp_Object otlp = KVAR (current_kboard, Voverriding_terminal_local_map); if (CONSP (position)) { @@ -1656,6 +1654,9 @@ if (!NILP (keymap)) keymaps = Fcons (keymap, keymaps); + + if (!NILP (olp) && !NILP (otlp)) + keymaps = Fcons (otlp, keymaps); } unbind_to (count, Qnil); @@ -2851,7 +2852,7 @@ insert ("\n", 1); - /* Insert calls signal_after_change which may GC. */ + /* Insert calls signal_after_change which may GC. */ translate = SDATA (KVAR (current_kboard, Vkeyboard_translate_table)); } @@ -2867,6 +2868,14 @@ start1 = Qnil; if (!NILP (KVAR (current_kboard, Voverriding_terminal_local_map))) start1 = KVAR (current_kboard, Voverriding_terminal_local_map); + + if (!NILP (start1)) + { + describe_map_tree (start1, 1, shadow, prefix, + "\f\nOverriding Bindings", nomenu, 0, 0, 0); + shadow = Fcons (start1, shadow); + start1 = Qnil; + } else if (!NILP (Voverriding_local_map)) start1 = Voverriding_local_map; ------------------------------------------------------------ revno: 112850 committer: Leo Liu branch nick: trunk timestamp: Wed 2013-06-05 09:19:33 +0800 message: * eshell/esh-mode.el (eshell-mode): Fix key bindings. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-04 23:52:06 +0000 +++ lisp/ChangeLog 2013-06-05 01:19:33 +0000 @@ -1,3 +1,7 @@ +2013-06-05 Leo Liu + + * eshell/esh-mode.el (eshell-mode): Fix key bindings. + 2013-06-04 Leo Liu * progmodes/compile.el (compile-goto-error): Add optional arg NOMSG. === modified file 'lisp/eshell/esh-mode.el' --- lisp/eshell/esh-mode.el 2013-05-23 04:57:27 +0000 +++ lisp/eshell/esh-mode.el 2013-06-05 01:19:33 +0000 @@ -326,11 +326,8 @@ (if mode-line-elt (setcar mode-line-elt 'eshell-command-running-string)))) - (define-key eshell-mode-map [return] 'eshell-send-input) - (define-key eshell-mode-map [(control ?m)] 'eshell-send-input) - (define-key eshell-mode-map [(control ?j)] 'eshell-send-input) - (define-key eshell-mode-map [(meta return)] 'eshell-queue-input) - (define-key eshell-mode-map [(meta control ?m)] 'eshell-queue-input) + (define-key eshell-mode-map "\r" 'eshell-send-input) + (define-key eshell-mode-map "\M-\r" 'eshell-queue-input) (define-key eshell-mode-map [(meta control ?l)] 'eshell-show-output) (define-key eshell-mode-map [(control ?a)] 'eshell-bol) ------------------------------------------------------------ revno: 112849 committer: Leo Liu branch nick: trunk timestamp: Wed 2013-06-05 07:52:06 +0800 message: * progmodes/compile.el (compile-goto-error): Add optional arg NOMSG. (compilation-auto-jump): Suppress the "Mark set" message to give way to exit message. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-03 23:34:27 +0000 +++ lisp/ChangeLog 2013-06-04 23:52:06 +0000 @@ -1,3 +1,9 @@ +2013-06-04 Leo Liu + + * progmodes/compile.el (compile-goto-error): Add optional arg NOMSG. + (compilation-auto-jump): Suppress the "Mark set" message to give + way to exit message. + 2013-06-03 Tassilo Horn * eshell/em-term.el (cl-lib): Require `cl-lib'. === modified file 'lisp/progmodes/compile.el' --- lisp/progmodes/compile.el 2013-04-24 13:50:22 +0000 +++ lisp/progmodes/compile.el 2013-06-04 23:52:06 +0000 @@ -1002,7 +1002,7 @@ (let ((win (get-buffer-window buffer 0))) (if win (set-window-point win pos))) (if compilation-auto-jump-to-first-error - (compile-goto-error)))) + (compile-goto-error nil t)))) ;; This function is the central driver, called when font-locking to gather ;; all information needed to later jump to corresponding source code. @@ -2317,7 +2317,7 @@ (defalias 'compile-mouse-goto-error 'compile-goto-error) -(defun compile-goto-error (&optional event) +(defun compile-goto-error (&optional event nomsg) "Visit the source for the error message at point. Use this command in a compilation log buffer. Sets the mark at point there." (interactive (list last-input-event)) @@ -2328,7 +2328,7 @@ (if (get-text-property (point) 'compilation-directory) (dired-other-window (car (get-text-property (point) 'compilation-directory))) - (push-mark) + (push-mark nil nomsg) (setq compilation-current-error (point)) (next-error-internal))) ------------------------------------------------------------ revno: 112848 fixes bug: http://debbugs.gnu.org/14540 committer: Eli Zaretskii branch nick: trunk timestamp: Tue 2013-06-04 19:33:46 +0300 message: Fix bug #14540 with inaccurate doc string of pos-visible-in-window-p. src/window.c (Fpos_visible_in_window_p): Doc fix. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-06-03 19:28:13 +0000 +++ src/ChangeLog 2013-06-04 16:33:46 +0000 @@ -1,3 +1,7 @@ +2013-06-04 Eli Zaretskii + + * window.c (Fpos_visible_in_window_p): Doc fix. (Bug#14540) + 2013-06-03 Eli Zaretskii * w32console.c (initialize_w32_display): Return the dimensions of === modified file 'src/window.c' --- src/window.c 2013-04-12 17:32:52 +0000 +++ src/window.c 2013-06-04 16:33:46 +0000 @@ -1620,12 +1620,13 @@ defaults to point in WINDOW; WINDOW defaults to the selected window. If POS is visible, return t if PARTIALLY is nil; if PARTIALLY is non-nil, -return value is a list of 2 or 6 elements (X Y [RTOP RBOT ROWH VPOS]), +the return value is a list of 2 or 6 elements (X Y [RTOP RBOT ROWH VPOS]), where X and Y are the pixel coordinates relative to the top left corner of the window. The remaining elements are omitted if the character after POS is fully visible; otherwise, RTOP and RBOT are the number of pixels -off-window at the top and bottom of the row, ROWH is the height of the -display row, and VPOS is the row number (0-based) containing POS. */) +off-window at the top and bottom of the screen line ("row") containing +POS, ROWH is the visible height of that row, and VPOS is the row number +\(zero-based). */) (Lisp_Object pos, Lisp_Object window, Lisp_Object partially) { register struct window *w; ------------------------------------------------------------ revno: 112847 committer: Alan Mackenzie branch nick: trunk timestamp: Tue 2013-06-04 13:26:15 +0000 message: Remove faulty optimisation from indentation calculation. * progmodes/cc-engine.el (c-guess-basic-syntax): Don't calculate search limit based on 2000 characters back from indent-point. diff: === modified file 'lisp/progmodes/cc-engine.el' --- lisp/progmodes/cc-engine.el 2013-06-01 18:19:29 +0000 +++ lisp/progmodes/cc-engine.el 2013-06-04 13:26:15 +0000 @@ -9355,10 +9355,6 @@ containing-sexp nil))) (setq lim (1+ containing-sexp)))) (setq lim (point-min))) - (when (c-beginning-of-macro) - (goto-char indent-point) - (let ((lim1 (c-determine-limit 2000))) - (setq lim (max lim lim1)))) ;; If we're in a parenthesis list then ',' delimits the ;; "statements" rather than being an operator (with the ------------------------------------------------------------ revno: 112846 committer: Glenn Morris branch nick: trunk timestamp: Tue 2013-06-04 06:17:52 -0400 message: Auto-commit of generated files. diff: === modified file 'autogen/Makefile.in' --- autogen/Makefile.in 2013-05-16 16:37:05 +0000 +++ autogen/Makefile.in 2013-06-04 10:17:52 +0000 @@ -437,6 +437,8 @@ GCONF_LIBS = @GCONF_LIBS@ GETLOADAVG_LIBS = @GETLOADAVG_LIBS@ GETOPT_H = @GETOPT_H@ +GFILENOTIFY_CFLAGS = @GFILENOTIFY_CFLAGS@ +GFILENOTIFY_LIBS = @GFILENOTIFY_LIBS@ GMALLOC_OBJ = @GMALLOC_OBJ@ GNULIB_ALPHASORT = @GNULIB_ALPHASORT@ GNULIB_ATOLL = @GNULIB_ATOLL@ @@ -941,6 +943,7 @@ NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@ NEXT_TIME_H = @NEXT_TIME_H@ NEXT_UNISTD_H = @NEXT_UNISTD_H@ +NOTIFY_OBJ = @NOTIFY_OBJ@ NS_OBJ = @NS_OBJ@ NS_OBJC_OBJ = @NS_OBJC_OBJ@ NTDIR = @NTDIR@ @@ -1132,6 +1135,7 @@ XARGS_LIMIT = @XARGS_LIMIT@ XFT_CFLAGS = @XFT_CFLAGS@ XFT_LIBS = @XFT_LIBS@ +XGSELOBJ = @XGSELOBJ@ XINERAMA_CFLAGS = @XINERAMA_CFLAGS@ XINERAMA_LIBS = @XINERAMA_LIBS@ XMENU_OBJ = @XMENU_OBJ@ === modified file 'autogen/config.in' --- autogen/config.in 2013-06-03 13:03:05 +0000 +++ autogen/config.in 2013-06-04 10:17:52 +0000 @@ -132,7 +132,7 @@ #if !defined _FORTIFY_SOURCE && defined __OPTIMIZE__ && __OPTIMIZE__ # define _FORTIFY_SOURCE 2 #endif - + /* Define to 1 if futimesat mishandles a NULL file name. */ #undef FUTIMESAT_NULL_BUG @@ -547,12 +547,15 @@ /* Define to 1 if you have the `get_current_dir_name' function. */ #undef HAVE_GET_CURRENT_DIR_NAME -/* Define to 1 to use glib's notify. */ +/* Define to 1 if using GFile. */ #undef HAVE_GFILENOTIFY /* Define to 1 if you have a gif (or ungif) library. */ #undef HAVE_GIF +/* Define to 1 if GLib is linked in. */ +#undef HAVE_GLIB + /* Define if using GnuTLS. */ #undef HAVE_GNUTLS @@ -1036,9 +1039,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_BITYPES_H -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_INOTIFY_H - /* Define to 1 if you have the header file. */ #undef HAVE_SYS_INTTYPES_H @@ -1502,7 +1502,7 @@ /* Define to nonzero if you want access control list support. */ #undef USE_ACL -/* Define to 1 if if using file notifications. */ +/* Define to 1 if using file notifications. */ #undef USE_FILE_NOTIFY /* Define to 1 if using GTK. */ @@ -1845,3 +1845,4 @@ mode: c End: */ + === modified file 'autogen/configure' --- autogen/configure 2013-05-27 10:17:36 +0000 +++ autogen/configure 2013-06-04 10:17:52 +0000 @@ -1288,6 +1288,7 @@ configuration version copyright +XGSELOBJ KRB4LIB DESLIB KRB5LIB @@ -1325,6 +1326,9 @@ FONTCONFIG_CFLAGS LIBXMU LIBXTR6 +NOTIFY_OBJ +GFILENOTIFY_LIBS +GFILENOTIFY_CFLAGS LIBGNUTLS_LIBS LIBGNUTLS_CFLAGS LIBSELINUX_LIBS @@ -1529,7 +1533,7 @@ with_gsettings with_selinux with_gnutls -with_inotify +with_file_notification with_makeinfo with_compress_info with_pkg_config_prog @@ -2257,7 +2261,9 @@ --without-gsettings don't compile with GSettings support --without-selinux don't compile with SELinux support --without-gnutls don't use -lgnutls for SSL/TLS support - --without-inotify don't compile with inotify (file-watch) support + --with-file-notification=LIB + use a file notification library (LIB one of: yes, + gfile, inotify, w32, no) --without-makeinfo don't require makeinfo for building manuals --without-compress-info don't compress the installed Info pages --with-pkg-config-prog=FILENAME @@ -4332,11 +4338,24 @@ fi -# Check whether --with-inotify was given. -if test "${with_inotify+set}" = set; then : - withval=$with_inotify; + +# Check whether --with-file-notification was given. +if test "${with_file_notification+set}" = set; then : + withval=$with_file_notification; case "${withval}" in + y | ye | yes ) val=yes ;; + n | no ) val=no ;; + g | gf | gfi | gfil | gfile ) val=gfile ;; + i | in | ino | inot | inoti | inotif | inotify ) val=inotify ;; + w | w3 | w32 ) val=w32 ;; + * ) as_fn_error "\`--with-file-notification=$withval' is invalid; +this option's value should be \`yes', \`no', \`gfile', \`inotify' or \`w32'. +\`yes' is a synonym for \`w32' on MS-Windows, and for \`gfile' otherwise." "$LINENO" 5 + ;; + esac + with_file_notification=$val + else - with_inotify=$with_features + with_file_notification=yes fi @@ -10236,7 +10255,6 @@ W32_RES_LINK="-Wl,emacs.res" else W32_OBJ="$W32_OBJ w32.o w32console.o w32heap.o w32inevt.o w32proc.o" - W32_OBJ="$W32_OBJ w32notify.o" W32_LIBS="$W32_LIBS -lwinmm -lgdi32 -lcomdlg32" W32_LIBS="$W32_LIBS -lmpr -lwinspool -lole32 -lcomctl32 -lusp10" W32_RES_LINK="\$(EMACSRES)" @@ -12007,32 +12025,122 @@ -if test "${with_inotify}" = "yes"; then - for ac_header in sys/inotify.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "sys/inotify.h" "ac_cv_header_sys_inotify_h" "$ac_includes_default" +NOTIFY_OBJ= +NOTIFY_SUMMARY=no + +if test "${with_file_notification}" = "yes"; then + if test "${opsys}" = "mingw32"; then + with_file_notification=w32 + else + with_file_notification=gfile + fi +fi + +if test "${with_file_notification}" = "gfile"; then + + succeeded=no + + if test "$PKG_CONFIG" = "no" ; then + HAVE_GFILENOTIFY=no + else + PKG_CONFIG_MIN_VERSION=0.9.0 + if "$PKG_CONFIG" --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gio-2.0 >= 2.24" >&5 +$as_echo_n "checking for gio-2.0 >= 2.24... " >&6; } + + if "$PKG_CONFIG" --exists "gio-2.0 >= 2.24" 2>&5 && + GFILENOTIFY_CFLAGS=`"$PKG_CONFIG" --cflags "gio-2.0 >= 2.24" 2>&5` && + GFILENOTIFY_LIBS=`"$PKG_CONFIG" --libs "gio-2.0 >= 2.24" 2>&5`; then + edit_cflags=" + s,///*,/,g + s/^/ / + s/ -I/ $isystem/g + s/^ // + " + GFILENOTIFY_CFLAGS=`$as_echo "$GFILENOTIFY_CFLAGS" | sed -e "$edit_cflags"` + GFILENOTIFY_LIBS=`$as_echo "$GFILENOTIFY_LIBS" | sed -e 's,///*,/,g'` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes CFLAGS='$GFILENOTIFY_CFLAGS' LIBS='$GFILENOTIFY_LIBS'" >&5 +$as_echo "yes CFLAGS='$GFILENOTIFY_CFLAGS' LIBS='$GFILENOTIFY_LIBS'" >&6; } + succeeded=yes + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + GFILENOTIFY_CFLAGS="" + GFILENOTIFY_LIBS="" + ## If we have a custom action on failure, don't print errors, but + ## do set a variable so people can do so. Do it in a subshell + ## to capture any diagnostics in invoking pkg-config. + GFILENOTIFY_PKG_ERRORS=`("$PKG_CONFIG" --print-errors "gio-2.0 >= 2.24") 2>&1` + + fi + + + + else + echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer." + echo "*** See http://www.freedesktop.org/software/pkgconfig" + fi + fi + + if test $succeeded = yes; then + HAVE_GFILENOTIFY=yes + else + HAVE_GFILENOTIFY=no + fi + + if test "$HAVE_GFILENOTIFY" = "yes"; then + +$as_echo "#define HAVE_GFILENOTIFY 1" >>confdefs.h + + NOTIFY_OBJ=gfilenotify.o + NOTIFY_SUMMARY="yes -lgio (gfile)" + fi +fi +if test "${with_file_notification}" = "inotify"; then + ac_fn_c_check_header_mongrel "$LINENO" "sys/inotify.h" "ac_cv_header_sys_inotify_h" "$ac_includes_default" if test "x$ac_cv_header_sys_inotify_h" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_INOTIFY_H 1 -_ACEOF fi -done if test "$ac_cv_header_sys_inotify_h" = yes ; then - ac_fn_c_check_func "$LINENO" "inotify_init1" "ac_cv_func_inotify_init1" + ac_fn_c_check_func "$LINENO" "inotify_init1" "ac_cv_func_inotify_init1" if test "x$ac_cv_func_inotify_init1" = x""yes; then : fi - fi -fi -if test "$ac_cv_func_inotify_init1" = yes; then + if test "$ac_cv_func_inotify_init1" = yes; then $as_echo "#define HAVE_INOTIFY 1" >>confdefs.h -fi + NOTIFY_OBJ=inotify.o + NOTIFY_SUMMARY="yes -lglibc (inotify)" + fi + fi +fi +if test "${with_file_notification}" = "w32"; then + ac_fn_c_check_header_mongrel "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default" +if test "x$ac_cv_header_windows_h" = x""yes; then : + +fi + + + if test "$ac_cv_header_windows_h" = yes ; then + +$as_echo "#define HAVE_W32NOTIFY 1" >>confdefs.h + + NOTIFY_OBJ=w32notify.o + NOTIFY_SUMMARY="yes (w32)" + fi +fi +if test -n "$NOTIFY_OBJ"; then + +$as_echo "#define USE_FILE_NOTIFY 1" >>confdefs.h + +fi + + + HAVE_XAW3D=no LUCID_LIBW= @@ -16061,6 +16169,38 @@ done +XGSELOBJ= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether GLib is linked in" >&5 +$as_echo_n "checking whether GLib is linked in... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +g_print ("Hello world"); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + links_glib=yes +else + links_glib=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $links_glib" >&5 +$as_echo "$links_glib" >&6; } +if test "${links_glib}" = "yes"; then + +$as_echo "#define HAVE_GLIB 1" >>confdefs.h + + XGSELOBJ=xgselect.o +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and CODESET" >&5 $as_echo_n "checking for nl_langinfo and CODESET... " >&6; } if test "${emacs_cv_langinfo_codeset+set}" = set; then : @@ -17025,7 +17165,7 @@ $as_echo "#define HAVE_X_WINDOWS 1" >>confdefs.h XMENU_OBJ=xmenu.o - XOBJ="xterm.o xfns.o xselect.o xrdb.o xsmfns.o xsettings.o xgselect.o" + XOBJ="xterm.o xfns.o xselect.o xrdb.o xsmfns.o xsettings.o" FONT_OBJ=xfont.o if test "$HAVE_XFT" = "yes"; then FONT_OBJ="$FONT_OBJ ftfont.o xftfont.o ftxfont.o" @@ -28413,6 +28553,7 @@ echo " Does Emacs use -ldbus? ${HAVE_DBUS}" echo " Does Emacs use -lgconf? ${HAVE_GCONF}" echo " Does Emacs use GSettings? ${HAVE_GSETTINGS}" +echo " Does Emacs use a file notification library? ${NOTIFY_SUMMARY}" echo " Does Emacs use -lselinux? ${HAVE_LIBSELINUX}" echo " Does Emacs use -lgnutls? ${HAVE_GNUTLS}" echo " Does Emacs use -lxml2? ${HAVE_LIBXML2}" ------------------------------------------------------------ revno: 112845 committer: Katsumi Yamaoka branch nick: trunk timestamp: Tue 2013-06-04 08:43:07 +0000 message: gnus.texi (Article Date): Fix description of gnus-article-update-date-headers diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2013-05-28 01:05:41 +0000 +++ doc/misc/ChangeLog 2013-06-04 08:43:07 +0000 @@ -1,3 +1,8 @@ +2013-06-04 Katsumi Yamaoka + + * gnus.texi (Article Date): + Fix description of gnus-article-update-date-headers. + 2013-05-28 Xue Fuqiao * erc.texi (Special Features): ERC is being maintained within === modified file 'doc/misc/gnus.texi' --- doc/misc/gnus.texi 2013-05-19 22:47:25 +0000 +++ doc/misc/gnus.texi 2013-06-04 08:43:07 +0000 @@ -9517,18 +9517,9 @@ Date: 6 weeks, 4 days, 1 hour, 3 minutes, 8 seconds ago @end example -This line is updated continually by default. The frequency (in -seconds) is controlled by the @code{gnus-article-update-date-headers} -variable. - -If you wish to switch updating off, say: - -@vindex gnus-article-update-date-headers -@lisp -(setq gnus-article-update-date-headers nil) -@end lisp - -in your @file{~/.gnus.el} file. +To make this line updated continually, set the +@code{gnus-article-update-date-headers} variable to the frequency in +seconds (the default is @code{nil}). @item W T o @kindex W T o (Summary) ------------------------------------------------------------ revno: 112844 committer: Katsumi Yamaoka branch nick: trunk timestamp: Tue 2013-06-04 08:14:23 +0000 message: gnus-art.el: Don't assume Date header begins with "Date" diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2013-06-02 16:39:32 +0000 +++ lisp/gnus/ChangeLog 2013-06-04 08:14:23 +0000 @@ -1,3 +1,10 @@ +2013-06-04 Katsumi Yamaoka + + * gnus-art.el (article-date-ut, article-update-date-lapsed): Don't + assume Date header begins with "Date", that may be customized into + something like "X-Sent" using gnus-article-time-format. + (article-transform-date): Allow multi-line Date header. + 2013-06-02 David Engster * registry.el (initialize-instance, registry-lookup) === modified file 'lisp/gnus/gnus-art.el' --- lisp/gnus/gnus-art.el 2013-05-09 01:40:20 +0000 +++ lisp/gnus/gnus-art.el 2013-06-04 08:14:23 +0000 @@ -3430,15 +3430,13 @@ (visible-date (mail-fetch-field "Date")) pos date bface eface) (save-excursion - (goto-char (point-min)) - (when (re-search-forward "^Date:" nil t) - (setq bface (get-text-property (point-at-bol) 'face) - eface (get-text-property (1- (point-at-eol)) 'face))) - ;; Delete any old Date headers. (if date-position (progn (goto-char date-position) (setq date (get-text-property (point) 'original-date)) + (when (looking-at "[^:]+:[\t ]*") + (setq bface (get-text-property (match-beginning 0) 'face) + eface (get-text-property (match-end 0) 'face))) (delete-region (point) (progn (gnus-article-forward-header) @@ -3454,12 +3452,26 @@ (narrow-to-region pos (if (search-forward "\n\n" nil t) (1+ (match-beginning 0)) (point-max))) - (goto-char (point-min)) - (while (re-search-forward "^Date:" nil t) - (setq date (get-text-property (match-beginning 0) 'original-date)) - (delete-region (point-at-bol) (progn - (gnus-article-forward-header) - (point)))) + (while (setq pos (text-property-not-all pos (point-max) + 'gnus-date-type nil)) + (setq date (get-text-property pos 'original-date)) + (goto-char pos) + (when (looking-at "[^:]+:[\t ]*") + (setq bface (get-text-property (match-beginning 0) 'face) + eface (get-text-property (match-end 0) 'face))) + (delete-region pos (or (text-property-any pos (point-max) + 'gnus-date-type nil) + (point-max)))) + (unless date ;; the 1st time + (goto-char (point-min)) + (while (re-search-forward "^Date:[\t ]*" nil t) + (setq date (get-text-property (match-beginning 0) + 'original-date) + bface (get-text-property (match-beginning 0) 'face) + eface (get-text-property (match-end 0) 'face)) + (delete-region (point-at-bol) (progn + (gnus-article-forward-header) + (point))))) (when (and (not date) visible-date) (setq date visible-date)) @@ -3476,20 +3488,25 @@ (list type)) (t type))) - (insert (article-make-date-line date (or this-type 'ut)) "\n") - (forward-line -1) - (beginning-of-line) - (put-text-property (point) (1+ (point)) - 'original-date date) - (put-text-property (point) (1+ (point)) - 'gnus-date-type this-type) + (goto-char + (prog1 + (point) + (add-text-properties + (point) + (progn + (insert (article-make-date-line date (or this-type 'ut)) "\n") + (point)) + (list 'original-date date 'gnus-date-type this-type)))) ;; Do highlighting. - (when (looking-at "\\([^:]+\\): *\\(.*\\)$") - (put-text-property (match-beginning 1) (1+ (match-end 1)) - 'face bface) - (put-text-property (match-beginning 2) (match-end 2) - 'face eface)) - (forward-line 1))) + (when (looking-at + "\\([^:]+:\\)[\t ]*\\(\\(?:[^\t\n ]+[\t ]+\\)*[^\t\n ]+\\)?") + (put-text-property (match-beginning 1) (match-end 1) 'face bface) + (when (match-beginning 2) + (put-text-property (match-beginning 2) (match-end 2) 'face eface)) + (while (and (zerop (forward-line 1)) + (looking-at "[\t ]+\\(\\(?:[^\t\n ]+[\t ]+\\)*[^\t\n ]+\\)?")) + (when (match-beginning 1) + (put-text-property (match-beginning 1) (match-end 1) 'face eface)))))) (defun article-make-date-line (date type) "Return a DATE line of TYPE." @@ -3669,25 +3686,26 @@ (when (eq major-mode 'gnus-article-mode) (let ((old-line (count-lines (point-min) (point))) (old-column (- (point) (line-beginning-position))) - (window-start - (window-start (get-buffer-window (current-buffer))))) - (goto-char (point-min)) - (while (re-search-forward "^Date:" nil t) - (let ((type (get-text-property (match-beginning 0) - 'gnus-date-type))) - (when (memq type '(lapsed combined-lapsed user-format)) - (when (and window-start - (not (= window-start - (save-excursion - (forward-line 1) - (point))))) - (setq window-start nil)) - (save-excursion - (article-date-ut type t (match-beginning 0))) - (forward-line 1) - (when window-start - (set-window-start (get-buffer-window (current-buffer)) - (point)))))) + (window-start (window-start w)) + (pos (point-min)) + type next end) + (while (setq pos (text-property-not-all pos (point-max) + 'gnus-date-type nil)) + (setq next (or (next-single-property-change pos + 'gnus-date-type) + (point-max))) + (setq type (get-text-property pos 'gnus-date-type)) + (when (memq type '(lapsed combined-lapsed user-defined)) + (article-date-ut type t pos) + (setq end (or (next-single-property-change pos + 'gnus-date-type) + (point-max))) + (when window-start + (if (/= window-start next) + (setq window-start nil) + (set-window-start w end))) + (setq next end)) + (setq pos next)) (goto-char (point-min)) (when (> old-column 0) (setq old-line (1- old-line))) ------------------------------------------------------------ revno: 112843 [merge] committer: Xue Fuqiao branch nick: trunk timestamp: Tue 2013-06-04 07:37:20 +0800 message: Some fix for VC. diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2013-06-03 12:25:39 +0000 +++ doc/emacs/ChangeLog 2013-06-03 23:34:27 +0000 @@ -1,15 +1,22 @@ +2013-06-03 Juri Linkov + + * display.texi (Highlight Interactively): Add global keybindings + with the key prefix `M-s h'. Document old command `highlight-phrase'. + Document new command `highlight-symbol-at-point'. + +2013-06-02 Xue Fuqiao + + * maintaining.texi (Branches): Add motivations for branching. + (VC Mode Line): Fix typo. + (VC Directory Commands): Mention `vc-dir-hide-up-to-date' with + prefix argument. + 2013-06-02 Michael Albinus * cmdargs.texi (General Variables): Use "unix:path=/dev/null" as dummy value for $DBUS_SESSION_BUS_ADDRESS. It also suppresses autolaunching of the D-Bus session bus. -2013-06-03 Juri Linkov - - * display.texi (Highlight Interactively): Add global keybindings - with the key prefix `M-s h'. Document old command `highlight-phrase'. - Document new command `highlight-symbol-at-point'. - 2013-06-01 Glenn Morris * programs.texi (Semantic): Fix typo. === modified file 'doc/emacs/maintaining.texi' --- doc/emacs/maintaining.texi 2013-05-30 09:27:55 +0000 +++ doc/emacs/maintaining.texi 2013-06-02 11:56:39 +0000 @@ -379,7 +379,7 @@ that the work file is unmodified, and @samp{:} indicates that it has been modified. @samp{!} indicates that the file contains conflicts as result of a recent merge operation (@pxref{Merging}), or that the file -was removed from the version control. Finally, @samp{?} means that +was removed from the version control. Finally, @samp{?} means that the file is under version control, but is missing from the working tree. @@ -1203,7 +1203,8 @@ @item x Hide files with @samp{up-to-date} status -(@code{vc-dir-hide-up-to-date}). +(@code{vc-dir-hide-up-to-date}). With a prefix argument, hide items +that are in state of item at point from display. @end table @findex vc-dir-mark @@ -1266,10 +1267,16 @@ @cindex branch (version control) One use of version control is to support multiple independent lines -of development, which are called @dfn{branches}. Branches are used -for maintaining separate ``stable'' and ``development'' versions of a -program, and for developing unrelated features in isolation from one -another. +of development, which are called @dfn{branches}. Branches allow for +parts of software to be developed in parallel. Large projects require +many roles to be filled, including developers, build managers, and +quality assurance personnel. Further, multiple releases on different +operating system platforms may have to be maintained. Branches allow +contributors to isolate changes without destabilizing the codebase, +for example, fixes for bugs, new features, and versions +integration. These changes may be later merged (resynchronized) after +testing. + VC's support for branch operations is currently fairly limited. For decentralized version control systems, it provides commands for === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-03 18:12:51 +0000 +++ lisp/ChangeLog 2013-06-03 23:34:27 +0000 @@ -50,6 +50,11 @@ * eshell/em-term.el (eshell-term-initialize): Use `cl-intersection' rather than `intersection'. +2013-06-02 Xue Fuqiao + + * vc/log-view.el: Doc fix. + (log-view-mode-map): Copy keymap from `special-mode-map'. + 2013-06-02 Eric Ludlam * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) === modified file 'lisp/vc/log-view.el' --- lisp/vc/log-view.el 2013-04-27 21:29:00 +0000 +++ lisp/vc/log-view.el 2013-06-02 23:04:43 +0000 @@ -1,9 +1,9 @@ -;;; log-view.el --- Major mode for browsing RCS/CVS/SCCS log output -*- lexical-binding: t -*- +;;; log-view.el --- Major mode for browsing revision log histories -*- lexical-binding: t -*- ;; Copyright (C) 1999-2013 Free Software Foundation, Inc. ;; Author: Stefan Monnier -;; Keywords: rcs, sccs, cvs, log, vc, tools +;; Keywords: tools, vc ;; This file is part of GNU Emacs. @@ -24,10 +24,12 @@ ;; Major mode to browse revision log histories. ;; Currently supports the format output by: -;; RCS, SCCS, CVS, Subversion, and DaRCS. +;; SCCS, RCS, CVS, Subversion, DaRCS, and Mercurial. ;; Examples of log output: +;;;; SCCS: + ;;;; RCS/CVS: ;; ---------------------------- @@ -43,8 +45,6 @@ ;; Change release version from 21.4 to 22.1 throughout. ;; Change development version from 21.3.50 to 22.0.50. -;;;; SCCS: - ;;;; Subversion: ;; ------------------------------------------------------------------------ @@ -117,18 +117,35 @@ (defvar cvs-force-command) (defgroup log-view nil - "Major mode for browsing log output of RCS/CVS/SCCS." + "Major mode for browsing log output of revision log histories." :group 'pcl-cvs :prefix "log-view-") (easy-mmode-defmap log-view-mode-map '( ;; FIXME: (copy-keymap special-mode-map) instead - ("z" . kill-this-buffer) - ("q" . quit-window) - ("g" . revert-buffer) + (" " . scroll-up-command) + ("-" . negative-argument) + ("0" . digit-argument) + ("1" . digit-argument) + ("2" . digit-argument) + ("3" . digit-argument) + ("4" . digit-argument) + ("5" . digit-argument) + ("6" . digit-argument) + ("7" . digit-argument) + ("8" . digit-argument) + ("9" . digit-argument) + ("<" . beginning-of-buffer) + (">" . end-of-buffer) + ("?" . describe-mode) + ("h" . describe-mode) + ("" . scroll-down-command) + (33554464 . scroll-down-command) + ("q" . quit-window) + ("g" . revert-buffer) + ("\C-m" . log-view-toggle-entry-display) - ("m" . log-view-toggle-mark-entry) ("e" . log-view-modify-change-comment) ("d" . log-view-diff) @@ -275,6 +292,7 @@ (easy-mmode-define-navigation log-view-file log-view-file-re "file") (defun log-view-goto-rev (rev) + "Go to revision REV." (goto-char (point-min)) (ignore-errors (while (not (equal rev (log-view-current-tag))) @@ -288,6 +306,7 @@ (defconst log-view-dir-re "^cvs[.ex]* [a-z]+: Logging \\(.+\\)$") (defun log-view-current-file () + "Return the current file." (save-excursion (forward-line 1) (or (re-search-backward log-view-file-re nil t) @@ -340,7 +359,7 @@ (defun log-view-toggle-mark-entry () "Toggle the marked state for the log entry at point. -Individual log entries can be marked and unmarked. The marked +Individual log entries can be marked and unmarked. The marked entries are denoted by changing their background color. `log-view-get-marked' returns the list of tags for the marked log entries." @@ -479,7 +498,8 @@ (funcall f)))) (defun log-view-find-revision (pos) - "Visit the version at point." + "Visit the version at POS. +If called interactively, visit the version at point." (interactive "d") (unless log-view-per-file-logs (when (> (length log-view-vc-fileset) 1) @@ -521,7 +541,8 @@ (log-view-extract-comment))) (defun log-view-annotate-version (pos) - "Annotate the version at point." + "Annotate the version at POS. +If called interactively, annotate the version at point." (interactive "d") (unless log-view-per-file-logs (when (> (length log-view-vc-fileset) 1) ------------------------------------------------------------ Use --include-merged or -n0 to see merged revisions.