diff options
author | Glenn Morris <rgm@gnu.org> | 2014-10-29 22:15:28 -0700 |
---|---|---|
committer | Glenn Morris <rgm@gnu.org> | 2014-10-29 22:15:28 -0700 |
commit | 52b410c60aebeb769ec9580af25ca50df2a44751 (patch) | |
tree | ba5de0b896c5ea410ceb2f2f1866c0fac73ea236 /lisp/progmodes | |
parent | cc99f920f507d28bb1422f8a3d52723ddc734c8a (diff) | |
parent | 237bf45a48999d5a8a3617822dddf3ea305bc269 (diff) | |
download | emacs-52b410c60aebeb769ec9580af25ca50df2a44751.tar.gz |
Merge from emacs-24; up to 117634
Diffstat (limited to 'lisp/progmodes')
-rw-r--r-- | lisp/progmodes/cc-defs.el | 10 | ||||
-rw-r--r-- | lisp/progmodes/cc-langs.el | 6 | ||||
-rw-r--r-- | lisp/progmodes/compile.el | 11 |
3 files changed, 20 insertions, 7 deletions
diff --git a/lisp/progmodes/cc-defs.el b/lisp/progmodes/cc-defs.el index dc31fde131d..1d8b8abeb2f 100644 --- a/lisp/progmodes/cc-defs.el +++ b/lisp/progmodes/cc-defs.el @@ -174,6 +174,10 @@ This variant works around bugs in `eval-when-compile' in various (put 'cc-eval-when-compile 'lisp-indent-hook 0)) +(eval-and-compile + (defalias 'c--macroexpand-all + (if (fboundp 'macroexpand-all) + 'macroexpand-all 'cl-macroexpand-all))) ;;; Macros. @@ -1841,7 +1845,7 @@ system." immediately, i.e. at the same time as the `c-lang-defconst' form itself is evaluated." ;; Evaluate at macro expansion time, i.e. in the - ;; `macroexpand-all' inside `c-lang-defconst'. + ;; `c--macroexpand-all' inside `c-lang-defconst'. (eval form)) (defmacro c-lang-defconst (name &rest args) @@ -1885,7 +1889,7 @@ constant. A file is identified by its base name." (let* ((sym (intern (symbol-name name) c-lang-constants)) ;; Make `c-lang-const' expand to a straightforward call to - ;; `c-get-lang-constant' in `macroexpand-all' below. + ;; `c-get-lang-constant' in `c--macroexpand-all' below. ;; ;; (The default behavior, i.e. to expand to a call inside ;; `eval-when-compile' should be equivalent, since that macro @@ -1948,7 +1952,7 @@ constant. A file is identified by its base name." ;; reason, but we also use this expansion handle ;; `c-lang-defconst-eval-immediately' and to register ;; dependencies on the `c-lang-const's in VAL.) - (setq val (macroexpand-all val)) + (setq val (c--macroexpand-all val)) (setq bindings `(cons (cons ',assigned-mode (lambda () ,val)) ,bindings) args (cdr args)))) diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index bab928ac5dd..a8dc3b8968c 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el @@ -3238,7 +3238,7 @@ accomplish that conveniently." `(lambda () ;; This let sets up the context for `c-mode-var' and similar - ;; that could be in the result from `macroexpand-all'. + ;; that could be in the result from `c--macroexpand-all'. (let ((c-buffer-is-cc-mode ',mode) current-var source-eval) (c-make-emacs-variables-local) @@ -3248,12 +3248,12 @@ accomplish that conveniently." (setq ,@(let ((c-buffer-is-cc-mode mode) (c-lang-const-expansion 'immediate)) ;; `c-lang-const' will expand to the evaluated - ;; constant immediately in `macroexpand-all' + ;; constant immediately in `c--macroexpand-all' ;; below. (mapcan (lambda (init) `(current-var ',(car init) - ,(car init) ,(macroexpand-all + ,(car init) ,(c--macroexpand-all (elt init 1)))) ;; Note: The following `append' copies the ;; first argument. That list is small, so diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index ee066f4c56c..d3d03cd2030 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -1676,7 +1676,16 @@ Returns the compilation buffer created." (list command mode name-function highlight-regexp)) (set (make-local-variable 'revert-buffer-function) 'compilation-revert-buffer) - (and outwin (set-window-start outwin (point-min))) + (and outwin + ;; Forcing the window-start overrides the usual redisplay + ;; feature of bringing point into view, so setting the + ;; window-start to top of the buffer risks losing the + ;; effect of moving point to EOB below, per + ;; compilation-scroll-output, if the command is long + ;; enough to push point outside of the window. This + ;; could happen, e.g., in `rgrep'. + (not compilation-scroll-output) + (set-window-start outwin (point-min))) ;; Position point as the user will see it. (let ((desired-visible-point |