aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorGlenn Morris2014-10-29 22:15:28 -0700
committerGlenn Morris2014-10-29 22:15:28 -0700
commit52b410c60aebeb769ec9580af25ca50df2a44751 (patch)
treeba5de0b896c5ea410ceb2f2f1866c0fac73ea236 /lisp
parentcc99f920f507d28bb1422f8a3d52723ddc734c8a (diff)
parent237bf45a48999d5a8a3617822dddf3ea305bc269 (diff)
downloademacs-52b410c60aebeb769ec9580af25ca50df2a44751.tar.gz
emacs-52b410c60aebeb769ec9580af25ca50df2a44751.zip
Merge from emacs-24; up to 117634
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog24
-rw-r--r--lisp/emacs-lisp/bytecomp.el23
-rw-r--r--lisp/emacs-lisp/cl-extra.el1
-rw-r--r--lisp/emulation/viper-util.el2
-rw-r--r--lisp/emulation/viper.el3
-rw-r--r--lisp/erc/erc-track.el6
-rw-r--r--lisp/progmodes/cc-defs.el10
-rw-r--r--lisp/progmodes/cc-langs.el6
-rw-r--r--lisp/progmodes/compile.el11
-rw-r--r--lisp/startup.el5
10 files changed, 69 insertions, 22 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 1def6877f2c..56da0d6e154 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,27 @@
12014-10-30 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * progmodes/cc-defs.el (c--macroexpand-all): New function (bug#18845).
4 (c-lang-defconst):
5 * progmodes/cc-langs.el (c-make-init-lang-vars-fun): Use it.
6
72014-10-30 Eli Zaretskii <eliz@gnu.org>
8
9 * progmodes/compile.el (compilation-start):
10 If compilation-scroll-output is non-nil, don't force window-start of
11 the compilation buffer to be at beginning of buffer. (Bug#18874)
12
13 * startup.el (fancy-about-text): Read the entire tutorial, not
14 just its first 256 bytes. (Bug#18760)
15
162014-10-30 Stefan Monnier <monnier@iro.umontreal.ca>
17
18 * emacs-lisp/bytecomp.el: Require cl-extra (bug#18804).
19 * emacs-lisp/cl-extra.el: Add missing provide.
20
21 * emacs-lisp/bytecomp.el (byte-compile-and-folded): Optimize case where
22 all args are copyable (bug#18767).
23 (=, <, >, <=, >=): Re-enable the optimization.
24
12014-10-29 Glenn Morris <rgm@gnu.org> 252014-10-29 Glenn Morris <rgm@gnu.org>
2 26
3 * net/rcirc.el (rcirc-fill-column): Unbump :version. Mark :risky. 27 * net/rcirc.el (rcirc-fill-column): Unbump :version. Mark :risky.
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 62de943f1be..392f6ee83cd 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -120,7 +120,11 @@
120(require 'backquote) 120(require 'backquote)
121(require 'macroexp) 121(require 'macroexp)
122(require 'cconv) 122(require 'cconv)
123(eval-when-compile (require 'cl-lib)) 123
124;; During bootstrap, cl-loaddefs.el is not created yet, so loading cl-lib
125;; doesn't setup autoloads for things like cl-every, which is why we have to
126;; require cl-extra instead (bug#18804).
127(require 'cl-extra)
124 128
125(or (fboundp 'defsubst) 129(or (fboundp 'defsubst)
126 ;; This really ought to be loaded already! 130 ;; This really ought to be loaded already!
@@ -3283,11 +3287,11 @@ If it is nil, then the handler is \"byte-compile-SYMBOL.\""
3283(byte-defop-compiler cons 2) 3287(byte-defop-compiler cons 2)
3284(byte-defop-compiler aref 2) 3288(byte-defop-compiler aref 2)
3285(byte-defop-compiler set 2) 3289(byte-defop-compiler set 2)
3286(byte-defop-compiler (= byte-eqlsign) 2) ;; -and bug#18767 3290(byte-defop-compiler (= byte-eqlsign) 2-and)
3287(byte-defop-compiler (< byte-lss) 2) ;; -and bug#18767 3291(byte-defop-compiler (< byte-lss) 2-and)
3288(byte-defop-compiler (> byte-gtr) 2) ;; -and bug#18767 3292(byte-defop-compiler (> byte-gtr) 2-and)
3289(byte-defop-compiler (<= byte-leq) 2) ;; -and bug#18767 3293(byte-defop-compiler (<= byte-leq) 2-and)
3290(byte-defop-compiler (>= byte-geq) 2) ;; -and bug#18767 3294(byte-defop-compiler (>= byte-geq) 2-and)
3291(byte-defop-compiler get 2) 3295(byte-defop-compiler get 2)
3292(byte-defop-compiler nth 2) 3296(byte-defop-compiler nth 2)
3293(byte-defop-compiler substring 2-3) 3297(byte-defop-compiler substring 2-3)
@@ -3354,13 +3358,14 @@ If it is nil, then the handler is \"byte-compile-SYMBOL.\""
3354(defun byte-compile-and-folded (form) 3358(defun byte-compile-and-folded (form)
3355 "Compile calls to functions like `<='. 3359 "Compile calls to functions like `<='.
3356These implicitly `and' together a bunch of two-arg bytecodes." 3360These implicitly `and' together a bunch of two-arg bytecodes."
3357 ;; FIXME: bug#18767 means we can't do it this way!
3358 (let ((l (length form))) 3361 (let ((l (length form)))
3359 (cond 3362 (cond
3360 ((< l 3) (byte-compile-form `(progn ,(nth 1 form) t))) 3363 ((< l 3) (byte-compile-form `(progn ,(nth 1 form) t)))
3361 ((= l 3) (byte-compile-two-args form)) 3364 ((= l 3) (byte-compile-two-args form))
3362 (t (byte-compile-form `(and (,(car form) ,(nth 1 form) ,(nth 2 form)) 3365 ((cl-every #'macroexp-copyable-p (nthcdr 2 form))
3363 (,(car form) ,@(nthcdr 2 form)))))))) 3366 (byte-compile-form `(and (,(car form) ,(nth 1 form) ,(nth 2 form))
3367 (,(car form) ,@(nthcdr 2 form)))))
3368 (t (byte-compile-normal-call form)))))
3364 3369
3365(defun byte-compile-three-args (form) 3370(defun byte-compile-three-args (form)
3366 (if (not (= (length form) 4)) 3371 (if (not (= (length form) 4))
diff --git a/lisp/emacs-lisp/cl-extra.el b/lisp/emacs-lisp/cl-extra.el
index a7970261608..b8b7b2c170b 100644
--- a/lisp/emacs-lisp/cl-extra.el
+++ b/lisp/emacs-lisp/cl-extra.el
@@ -720,4 +720,5 @@ including `cl-block' and `cl-eval-when'."
720;; generated-autoload-file: "cl-loaddefs.el" 720;; generated-autoload-file: "cl-loaddefs.el"
721;; End: 721;; End:
722 722
723(provide 'cl-extra)
723;;; cl-extra.el ends here 724;;; cl-extra.el ends here
diff --git a/lisp/emulation/viper-util.el b/lisp/emulation/viper-util.el
index 178b23e1fca..4e3b71e3104 100644
--- a/lisp/emulation/viper-util.el
+++ b/lisp/emulation/viper-util.el
@@ -984,7 +984,7 @@ Otherwise return the normal value."
984;; macros, since it enables certain macros to be shared between X and TTY modes 984;; macros, since it enables certain macros to be shared between X and TTY modes
985;; by correctly mapping key sequences for Left/Right/... (on an ascii 985;; by correctly mapping key sequences for Left/Right/... (on an ascii
986;; terminal) into logical keys left, right, etc. 986;; terminal) into logical keys left, right, etc.
987(defun viper-read-key () 987(defun viper-read-key () ;; FIXME: Use `read-key'?
988 (let ((overriding-local-map viper-overriding-map) 988 (let ((overriding-local-map viper-overriding-map)
989 (inhibit-quit t) 989 (inhibit-quit t)
990 help-char key) 990 help-char key)
diff --git a/lisp/emulation/viper.el b/lisp/emulation/viper.el
index d1353bdc8fa..c7394e1cea5 100644
--- a/lisp/emulation/viper.el
+++ b/lisp/emulation/viper.el
@@ -531,6 +531,7 @@ If Viper is enabled, turn it off. Otherwise, turn it on."
531 (if viper-mode 531 (if viper-mode
532 () 532 ()
533 (setq viper-mode t) 533 (setq viper-mode t)
534 ;; FIXME: Don't reload!
534 (load-library "viper")) 535 (load-library "viper"))
535 536
536 (if viper-first-time ; Important check. Prevents mix-up of startup 537 (if viper-first-time ; Important check. Prevents mix-up of startup
@@ -887,6 +888,7 @@ Two differences:
887 ;; When viper-mode is executed in such a case, it will set the major mode 888 ;; When viper-mode is executed in such a case, it will set the major mode
888 ;; back to fundamental-mode. 889 ;; back to fundamental-mode.
889 (if (eq (default-value 'major-mode) 'fundamental-mode) 890 (if (eq (default-value 'major-mode) 'fundamental-mode)
891 ;; FIXME: We should use after-change-major-mode-hook instead!
890 (setq-default major-mode 'viper-mode)) 892 (setq-default major-mode 'viper-mode))
891 893
892 (viper-setup-ESC-to-escape t) 894 (viper-setup-ESC-to-escape t)
@@ -936,6 +938,7 @@ Two differences:
936 938
937 (defadvice self-insert-command (around viper-self-insert-ad activate) 939 (defadvice self-insert-command (around viper-self-insert-ad activate)
938 "Ignore all self-inserting keys in the vi-state." 940 "Ignore all self-inserting keys in the vi-state."
941 ;; FIXME: Use remapping?
939 (if (and (eq viper-current-state 'vi-state) 942 (if (and (eq viper-current-state 'vi-state)
940 ;; Do not use called-interactively-p here. XEmacs does not have it 943 ;; Do not use called-interactively-p here. XEmacs does not have it
941 ;; and interactive-p is just fine. 944 ;; and interactive-p is just fine.
diff --git a/lisp/erc/erc-track.el b/lisp/erc/erc-track.el
index 47e76c3ea1e..fae6be433fd 100644
--- a/lisp/erc/erc-track.el
+++ b/lisp/erc/erc-track.el
@@ -265,9 +265,7 @@ nil - don't add to mode line."
265 (erc-track-add-to-mode-line val)))) 265 (erc-track-add-to-mode-line val))))
266 266
267(defun erc-modified-channels-object (strings) 267(defun erc-modified-channels-object (strings)
268 "Generate a new `erc-modified-channels-object' based on STRINGS. 268 "Generate a new `erc-modified-channels-object' based on STRINGS."
269If STRINGS is nil, we initialize `erc-modified-channels-object' to
270an appropriate initial value for this flavor of Emacs."
271 (if strings 269 (if strings
272 (if (featurep 'xemacs) 270 (if (featurep 'xemacs)
273 (let ((e-m-c-s '("["))) 271 (let ((e-m-c-s '("[")))
@@ -743,7 +741,7 @@ only consider active buffers visible.")
743(defvar erc-modified-channels-update-inside nil 741(defvar erc-modified-channels-update-inside nil
744 "Variable to prevent running `erc-modified-channels-update' multiple 742 "Variable to prevent running `erc-modified-channels-update' multiple
745times. Without it, you cannot debug `erc-modified-channels-display', 743times. Without it, you cannot debug `erc-modified-channels-display',
746because the debugger also cases changes to the window-configuration.") 744because the debugger also causes changes to the window-configuration.")
747 745
748(defun erc-modified-channels-update (&rest _args) 746(defun erc-modified-channels-update (&rest _args)
749 "This function updates the information in `erc-modified-channels-alist' 747 "This function updates the information in `erc-modified-channels-alist'
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
174 174
175 (put 'cc-eval-when-compile 'lisp-indent-hook 0)) 175 (put 'cc-eval-when-compile 'lisp-indent-hook 0))
176 176
177(eval-and-compile
178 (defalias 'c--macroexpand-all
179 (if (fboundp 'macroexpand-all)
180 'macroexpand-all 'cl-macroexpand-all)))
177 181
178;;; Macros. 182;;; Macros.
179 183
@@ -1841,7 +1845,7 @@ system."
1841immediately, i.e. at the same time as the `c-lang-defconst' form 1845immediately, i.e. at the same time as the `c-lang-defconst' form
1842itself is evaluated." 1846itself is evaluated."
1843 ;; Evaluate at macro expansion time, i.e. in the 1847 ;; Evaluate at macro expansion time, i.e. in the
1844 ;; `macroexpand-all' inside `c-lang-defconst'. 1848 ;; `c--macroexpand-all' inside `c-lang-defconst'.
1845 (eval form)) 1849 (eval form))
1846 1850
1847(defmacro c-lang-defconst (name &rest args) 1851(defmacro c-lang-defconst (name &rest args)
@@ -1885,7 +1889,7 @@ constant. A file is identified by its base name."
1885 1889
1886 (let* ((sym (intern (symbol-name name) c-lang-constants)) 1890 (let* ((sym (intern (symbol-name name) c-lang-constants))
1887 ;; Make `c-lang-const' expand to a straightforward call to 1891 ;; Make `c-lang-const' expand to a straightforward call to
1888 ;; `c-get-lang-constant' in `macroexpand-all' below. 1892 ;; `c-get-lang-constant' in `c--macroexpand-all' below.
1889 ;; 1893 ;;
1890 ;; (The default behavior, i.e. to expand to a call inside 1894 ;; (The default behavior, i.e. to expand to a call inside
1891 ;; `eval-when-compile' should be equivalent, since that macro 1895 ;; `eval-when-compile' should be equivalent, since that macro
@@ -1948,7 +1952,7 @@ constant. A file is identified by its base name."
1948 ;; reason, but we also use this expansion handle 1952 ;; reason, but we also use this expansion handle
1949 ;; `c-lang-defconst-eval-immediately' and to register 1953 ;; `c-lang-defconst-eval-immediately' and to register
1950 ;; dependencies on the `c-lang-const's in VAL.) 1954 ;; dependencies on the `c-lang-const's in VAL.)
1951 (setq val (macroexpand-all val)) 1955 (setq val (c--macroexpand-all val))
1952 1956
1953 (setq bindings `(cons (cons ',assigned-mode (lambda () ,val)) ,bindings) 1957 (setq bindings `(cons (cons ',assigned-mode (lambda () ,val)) ,bindings)
1954 args (cdr args)))) 1958 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."
3238 `(lambda () 3238 `(lambda ()
3239 3239
3240 ;; This let sets up the context for `c-mode-var' and similar 3240 ;; This let sets up the context for `c-mode-var' and similar
3241 ;; that could be in the result from `macroexpand-all'. 3241 ;; that could be in the result from `c--macroexpand-all'.
3242 (let ((c-buffer-is-cc-mode ',mode) 3242 (let ((c-buffer-is-cc-mode ',mode)
3243 current-var source-eval) 3243 current-var source-eval)
3244 (c-make-emacs-variables-local) 3244 (c-make-emacs-variables-local)
@@ -3248,12 +3248,12 @@ accomplish that conveniently."
3248 (setq ,@(let ((c-buffer-is-cc-mode mode) 3248 (setq ,@(let ((c-buffer-is-cc-mode mode)
3249 (c-lang-const-expansion 'immediate)) 3249 (c-lang-const-expansion 'immediate))
3250 ;; `c-lang-const' will expand to the evaluated 3250 ;; `c-lang-const' will expand to the evaluated
3251 ;; constant immediately in `macroexpand-all' 3251 ;; constant immediately in `c--macroexpand-all'
3252 ;; below. 3252 ;; below.
3253 (mapcan 3253 (mapcan
3254 (lambda (init) 3254 (lambda (init)
3255 `(current-var ',(car init) 3255 `(current-var ',(car init)
3256 ,(car init) ,(macroexpand-all 3256 ,(car init) ,(c--macroexpand-all
3257 (elt init 1)))) 3257 (elt init 1))))
3258 ;; Note: The following `append' copies the 3258 ;; Note: The following `append' copies the
3259 ;; first argument. That list is small, so 3259 ;; 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."
1676 (list command mode name-function highlight-regexp)) 1676 (list command mode name-function highlight-regexp))
1677 (set (make-local-variable 'revert-buffer-function) 1677 (set (make-local-variable 'revert-buffer-function)
1678 'compilation-revert-buffer) 1678 'compilation-revert-buffer)
1679 (and outwin (set-window-start outwin (point-min))) 1679 (and outwin
1680 ;; Forcing the window-start overrides the usual redisplay
1681 ;; feature of bringing point into view, so setting the
1682 ;; window-start to top of the buffer risks losing the
1683 ;; effect of moving point to EOB below, per
1684 ;; compilation-scroll-output, if the command is long
1685 ;; enough to push point outside of the window. This
1686 ;; could happen, e.g., in `rgrep'.
1687 (not compilation-scroll-output)
1688 (set-window-start outwin (point-min)))
1680 1689
1681 ;; Position point as the user will see it. 1690 ;; Position point as the user will see it.
1682 (let ((desired-visible-point 1691 (let ((desired-visible-point
diff --git a/lisp/startup.el b/lisp/startup.el
index 0dacf191c14..88611a0cd8f 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -1496,7 +1496,10 @@ Each element in the list should be a list of strings or pairs
1496 (title (with-temp-buffer 1496 (title (with-temp-buffer
1497 (insert-file-contents 1497 (insert-file-contents
1498 (expand-file-name tut tutorial-directory) 1498 (expand-file-name tut tutorial-directory)
1499 nil 0 256) 1499 ;; Reat the entire file, to make sure any
1500 ;; coding cookies and other local variables
1501 ;; get acted upon.
1502 nil)
1500 (search-forward ".") 1503 (search-forward ".")
1501 (buffer-substring (point-min) (1- (point)))))) 1504 (buffer-substring (point-min) (1- (point))))))
1502 ;; If there is a specific tutorial for the current language 1505 ;; If there is a specific tutorial for the current language