summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorKenichi Handa <handa@gnu.org>2013-05-23 00:12:59 +0900
committerKenichi Handa <handa@gnu.org>2013-05-23 00:12:59 +0900
commite1b96d7e637cf76864013f8dba68135f07638ab8 (patch)
tree1a2ccd5961a60f0268a37444071e8cd7a2255fbc /lisp/emacs-lisp
parente6d2f1553635a746396f2f4261dde31e03e0fdd1 (diff)
parent5d0acd9d3bb26adfac1c80b78aa48dc8b2d34fe0 (diff)
downloademacs-e1b96d7e637cf76864013f8dba68135f07638ab8.tar.gz
emacs-e1b96d7e637cf76864013f8dba68135f07638ab8.tar.bz2
emacs-e1b96d7e637cf76864013f8dba68135f07638ab8.zip
merge trunk
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/autoload.el5
-rw-r--r--lisp/emacs-lisp/bytecomp.el29
-rw-r--r--lisp/emacs-lisp/cl-extra.el7
-rw-r--r--lisp/emacs-lisp/cl-indent.el2
-rw-r--r--lisp/emacs-lisp/cl-loaddefs.el44
-rw-r--r--lisp/emacs-lisp/cl-macs.el40
-rw-r--r--lisp/emacs-lisp/easy-mmode.el15
-rw-r--r--lisp/emacs-lisp/eieio-opt.el4
-rw-r--r--lisp/emacs-lisp/eieio-speedbar.el4
-rw-r--r--lisp/emacs-lisp/package.el5
-rw-r--r--lisp/emacs-lisp/smie.el90
-rw-r--r--lisp/emacs-lisp/tabulated-list.el1
-rw-r--r--lisp/emacs-lisp/testcover.el2
-rw-r--r--lisp/emacs-lisp/timer.el4
14 files changed, 195 insertions, 57 deletions
diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el
index edaecd7ff19..dbb4a239f02 100644
--- a/lisp/emacs-lisp/autoload.el
+++ b/lisp/emacs-lisp/autoload.el
@@ -52,7 +52,10 @@ FormFeed character.")
(defvar generated-autoload-load-name nil
"Load name for `autoload' statements generated from autoload cookies.
-If nil, this defaults to the file name, sans extension.")
+If nil, this defaults to the file name, sans extension.
+Typically, you need to set this when the directory containing the file
+is not in `load-path'.
+This also affects the generated cus-load.el file.")
;;;###autoload
(put 'generated-autoload-load-name 'safe-local-variable 'stringp)
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 0b00c038acc..5e20bba2ddb 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -2213,13 +2213,15 @@ list that represents a doc string reference.
(when (and (consp (nth 1 form))
(eq (car (nth 1 form)) 'quote)
(consp (cdr (nth 1 form)))
- (symbolp (nth 1 (nth 1 form)))
- ;; Don't add it if it's already defined. Otherwise, it might
- ;; hide the actual definition.
- (not (fboundp (nth 1 (nth 1 form)))))
- (push (cons (nth 1 (nth 1 form))
- (cons 'autoload (cdr (cdr form))))
- byte-compile-function-environment)
+ (symbolp (nth 1 (nth 1 form))))
+ ;; Don't add it if it's already defined. Otherwise, it might
+ ;; hide the actual definition. However, do remove any entry from
+ ;; byte-compile-noruntime-functions, in case we have an autoload
+ ;; of foo-func following an (eval-when-compile (require 'foo)).
+ (unless (fboundp (nth 1 (nth 1 form)))
+ (push (cons (nth 1 (nth 1 form))
+ (cons 'autoload (cdr (cdr form))))
+ byte-compile-function-environment))
;; If an autoload occurs _before_ the first call to a function,
;; byte-compile-callargs-warn does not add an entry to
;; byte-compile-unresolved-functions. Here we mimic the logic
@@ -2227,11 +2229,14 @@ list that represents a doc string reference.
;; autoload comes _after_ the function call.
;; Alternatively, similar logic could go in
;; byte-compile-warn-about-unresolved-functions.
- (or (memq (nth 1 (nth 1 form)) byte-compile-noruntime-functions)
- (setq byte-compile-unresolved-functions
- (delq (assq (nth 1 (nth 1 form))
- byte-compile-unresolved-functions)
- byte-compile-unresolved-functions))))
+ (if (memq (nth 1 (nth 1 form)) byte-compile-noruntime-functions)
+ (setq byte-compile-noruntime-functions
+ (delq (nth 1 (nth 1 form)) byte-compile-noruntime-functions)
+ byte-compile-noruntime-functions)
+ (setq byte-compile-unresolved-functions
+ (delq (assq (nth 1 (nth 1 form))
+ byte-compile-unresolved-functions)
+ byte-compile-unresolved-functions))))
(if (stringp (nth 3 form))
form
;; No doc string, so we can compile this as a normal form.
diff --git a/lisp/emacs-lisp/cl-extra.el b/lisp/emacs-lisp/cl-extra.el
index 34892bf2fef..70ad1283cb2 100644
--- a/lisp/emacs-lisp/cl-extra.el
+++ b/lisp/emacs-lisp/cl-extra.el
@@ -597,8 +597,11 @@ PROPLIST is a list of the sort returned by `symbol-plist'.
(macroexp-let2 nil d def
(funcall do `(cl-getf ,getter ,k ,d)
(lambda (v)
- (funcall setter
- `(cl--set-getf ,getter ,k ,v))))))))))
+ (macroexp-let2 nil val v
+ `(progn
+ ,(funcall setter
+ `(cl--set-getf ,getter ,k ,val))
+ ,val))))))))))
(setplist '--cl-getf-symbol-- plist)
(or (get '--cl-getf-symbol-- tag)
;; Originally we called cl-get here,
diff --git a/lisp/emacs-lisp/cl-indent.el b/lisp/emacs-lisp/cl-indent.el
index 599cf3ac345..bbfe9ec6424 100644
--- a/lisp/emacs-lisp/cl-indent.el
+++ b/lisp/emacs-lisp/cl-indent.el
@@ -809,4 +809,6 @@ optional\\|rest\\|key\\|allow-other-keys\\|aux\\|whole\\|body\\|environment\
;(put 'defclass 'common-lisp-indent-function '((&whole 2 &rest (&whole 2 &rest 1) &rest (&whole 2 &rest 1)))
;(put 'defgeneric 'common-lisp-indent-function 'defun)
+(provide 'cl-indent)
+
;;; cl-indent.el ends here
diff --git a/lisp/emacs-lisp/cl-loaddefs.el b/lisp/emacs-lisp/cl-loaddefs.el
index 8ab2abec67e..af19db63f30 100644
--- a/lisp/emacs-lisp/cl-loaddefs.el
+++ b/lisp/emacs-lisp/cl-loaddefs.el
@@ -11,7 +11,7 @@
;;;;;; cl--map-overlays cl--map-intervals cl--map-keymap-recursively
;;;;;; cl-notevery cl-notany cl-every cl-some cl-mapcon cl-mapcan
;;;;;; cl-mapl cl-mapc cl-maplist cl-map cl--mapcar-many cl-equalp
-;;;;;; cl-coerce) "cl-extra" "cl-extra.el" "c5730f2a706cb1efc5fec0a790d3ca72")
+;;;;;; cl-coerce) "cl-extra" "cl-extra.el" "011111887a1f353218e59e14d0b09c68")
;;; Generated autoloads from cl-extra.el
(autoload 'cl-coerce "cl-extra" "\
@@ -267,7 +267,7 @@ including `cl-block' and `cl-eval-when'.
;;;;;; 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" "8a90c81a400a2846e7b4c3da07626d94")
+;;;;;; "cl-macs" "cl-macs.el" "b839ad3781c4f2f849df0639b4eba166")
;;; Generated autoloads from cl-macs.el
(autoload 'cl--compiler-macro-list* "cl-macs" "\
@@ -417,17 +417,35 @@ This is compatible with Common Lisp, but note that `defun' and
(autoload 'cl-loop "cl-macs" "\
The Common Lisp `loop' macro.
-Valid clauses are:
- for VAR from/upfrom/downfrom NUM to/upto/downto/above/below NUM by NUM,
- for VAR in LIST by FUNC, for VAR on LIST by FUNC, for VAR = INIT then EXPR,
- for VAR across ARRAY, repeat NUM, with VAR = INIT, while COND, until COND,
- always COND, never COND, thereis COND, collect EXPR into VAR,
- append EXPR into VAR, nconc EXPR into VAR, sum EXPR into VAR,
- count EXPR into VAR, maximize EXPR into VAR, minimize EXPR into VAR,
- if COND CLAUSE [and CLAUSE]... else CLAUSE [and CLAUSE...],
- unless COND CLAUSE [and CLAUSE]... else CLAUSE [and CLAUSE...],
- do EXPRS..., initially EXPRS..., finally EXPRS..., return EXPR,
- finally return EXPR, named NAME.
+Valid clauses include:
+ For clauses:
+ for VAR from/upfrom/downfrom EXPR1 to/upto/downto/above/below EXPR2 by EXPR3
+ for VAR = EXPR1 then EXPR2
+ for VAR in/on/in-ref LIST by FUNC
+ for VAR across/across-ref ARRAY
+ for VAR being:
+ the elements of/of-ref SEQUENCE [using (index VAR2)]
+ the symbols [of OBARRAY]
+ the hash-keys/hash-values of HASH-TABLE [using (hash-values/hash-keys V2)]
+ the key-codes/key-bindings/key-seqs of KEYMAP [using (key-bindings VAR2)]
+ the overlays/intervals [of BUFFER] [from POS1] [to POS2]
+ the frames/buffers
+ the windows [of FRAME]
+ Iteration clauses:
+ repeat INTEGER
+ while/until/always/never/thereis CONDITION
+ Accumulation clauses:
+ collect/append/nconc/concat/vconcat/count/sum/maximize/minimize FORM
+ [into VAR]
+ Miscellaneous clauses:
+ with VAR = INIT
+ if/when/unless COND CLAUSE [and CLAUSE]... else CLAUSE [and CLAUSE...]
+ named NAME
+ initially/finally [do] EXPRS...
+ do EXPRS...
+ [finally] return EXPR
+
+For more details, see Info node `(cl)Loop Facility'.
\(fn CLAUSE...)" nil t)
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index e9cc200baaa..4aae2c6efe5 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -765,17 +765,35 @@ This is compatible with Common Lisp, but note that `defun' and
;;;###autoload
(defmacro cl-loop (&rest loop-args)
"The Common Lisp `loop' macro.
-Valid clauses are:
- for VAR from/upfrom/downfrom NUM to/upto/downto/above/below NUM by NUM,
- for VAR in LIST by FUNC, for VAR on LIST by FUNC, for VAR = INIT then EXPR,
- for VAR across ARRAY, repeat NUM, with VAR = INIT, while COND, until COND,
- always COND, never COND, thereis COND, collect EXPR into VAR,
- append EXPR into VAR, nconc EXPR into VAR, sum EXPR into VAR,
- count EXPR into VAR, maximize EXPR into VAR, minimize EXPR into VAR,
- if COND CLAUSE [and CLAUSE]... else CLAUSE [and CLAUSE...],
- unless COND CLAUSE [and CLAUSE]... else CLAUSE [and CLAUSE...],
- do EXPRS..., initially EXPRS..., finally EXPRS..., return EXPR,
- finally return EXPR, named NAME.
+Valid clauses include:
+ For clauses:
+ for VAR from/upfrom/downfrom EXPR1 to/upto/downto/above/below EXPR2 by EXPR3
+ for VAR = EXPR1 then EXPR2
+ for VAR in/on/in-ref LIST by FUNC
+ for VAR across/across-ref ARRAY
+ for VAR being:
+ the elements of/of-ref SEQUENCE [using (index VAR2)]
+ the symbols [of OBARRAY]
+ the hash-keys/hash-values of HASH-TABLE [using (hash-values/hash-keys V2)]
+ the key-codes/key-bindings/key-seqs of KEYMAP [using (key-bindings VAR2)]
+ the overlays/intervals [of BUFFER] [from POS1] [to POS2]
+ the frames/buffers
+ the windows [of FRAME]
+ Iteration clauses:
+ repeat INTEGER
+ while/until/always/never/thereis CONDITION
+ Accumulation clauses:
+ collect/append/nconc/concat/vconcat/count/sum/maximize/minimize FORM
+ [into VAR]
+ Miscellaneous clauses:
+ with VAR = INIT
+ if/when/unless COND CLAUSE [and CLAUSE]... else CLAUSE [and CLAUSE...]
+ named NAME
+ initially/finally [do] EXPRS...
+ do EXPRS...
+ [finally] return EXPR
+
+For more details, see Info node `(cl)Loop Facility'.
\(fn CLAUSE...)"
(declare (debug (&rest &or
diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el
index abe7b1ea741..718018fd2d9 100644
--- a/lisp/emacs-lisp/easy-mmode.el
+++ b/lisp/emacs-lisp/easy-mmode.el
@@ -419,6 +419,13 @@ See `%s' for more information on %s."
;; up-to-here.
:autoload-end
+ ;; MODE-set-explicitly is set in MODE-set-explicitly and cleared by
+ ;; kill-all-local-variables.
+ (defvar-local ,MODE-set-explicitly nil)
+ (defun ,MODE-set-explicitly ()
+ (setq ,MODE-set-explicitly t))
+ (put ',MODE-set-explicitly 'definition-name ',global-mode)
+
;; A function which checks whether MODE has been disabled in the major
;; mode hook which has just been run.
(add-hook ',minor-MODE-hook ',MODE-set-explicitly)
@@ -451,13 +458,7 @@ See `%s' for more information on %s."
(defun ,MODE-cmhh ()
(add-to-list ',MODE-buffers (current-buffer))
(add-hook 'post-command-hook ',MODE-check-buffers))
- (put ',MODE-cmhh 'definition-name ',global-mode)
- ;; MODE-set-explicitly is set in MODE-set-explicitly and cleared by
- ;; kill-all-local-variables.
- (defvar-local ,MODE-set-explicitly nil)
- (defun ,MODE-set-explicitly ()
- (setq ,MODE-set-explicitly t))
- (put ',MODE-set-explicitly 'definition-name ',global-mode))))
+ (put ',MODE-cmhh 'definition-name ',global-mode))))
;;;
;;; easy-mmode-defmap
diff --git a/lisp/emacs-lisp/eieio-opt.el b/lisp/emacs-lisp/eieio-opt.el
index 29ad980991b..27f97b31ebe 100644
--- a/lisp/emacs-lisp/eieio-opt.el
+++ b/lisp/emacs-lisp/eieio-opt.el
@@ -795,9 +795,9 @@ Argument INDENT is the depth of indentation."
(defun eieio-describe-class-sb (text token indent)
"Describe the class TEXT in TOKEN.
INDENT is the current indentation level."
- (speedbar-with-attached-buffer
+ (dframe-with-attached-buffer
(eieio-describe-class token))
- (speedbar-maybee-jump-to-attached-frame))
+ (dframe-maybee-jump-to-attached-frame))
(provide 'eieio-opt)
diff --git a/lisp/emacs-lisp/eieio-speedbar.el b/lisp/emacs-lisp/eieio-speedbar.el
index c230226eae4..e964263754f 100644
--- a/lisp/emacs-lisp/eieio-speedbar.el
+++ b/lisp/emacs-lisp/eieio-speedbar.el
@@ -230,9 +230,9 @@ object edit buffer doing an in-place edit.
If your object represents some other item, override this method
and take the appropriate action."
(require 'eieio-custom)
- (speedbar-with-attached-buffer
+ (dframe-with-attached-buffer
(eieio-customize-object object))
- (speedbar-maybee-jump-to-attached-frame))
+ (dframe-maybee-jump-to-attached-frame))
;;; Class definitions
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index c80b8d970dc..41b635bbe30 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -6,6 +6,7 @@
;; Created: 10 Mar 2007
;; Version: 1.0.1
;; Keywords: tools
+;; Package-Requires: ((tabulated-list "1.0"))
;; This file is part of GNU Emacs.
@@ -613,8 +614,8 @@ EXTRA-PROPERTIES is currently unused."
(defvar tar-parse-info)
(declare-function tar-untar-buffer "tar-mode" ())
-(declare-function tar-header-name "tar-mode" (tar-header))
-(declare-function tar-header-link-type "tar-mode" (tar-header))
+(declare-function tar-header-name "tar-mode" (tar-header) t)
+(declare-function tar-header-link-type "tar-mode" (tar-header) t)
(defun package-untar-buffer (dir)
"Untar the current buffer.
diff --git a/lisp/emacs-lisp/smie.el b/lisp/emacs-lisp/smie.el
index c59076974e0..b0883995532 100644
--- a/lisp/emacs-lisp/smie.el
+++ b/lisp/emacs-lisp/smie.el
@@ -1021,6 +1021,91 @@ This uses SMIE's tables and is expected to be placed on `post-self-insert-hook'.
(let ((blink-matching-check-function #'smie-blink-matching-check))
(blink-matching-open))))))))
+(defface smie-matching-block-highlight '((t (:inherit highlight)))
+ "Face used to highlight matching block."
+ :group 'smie)
+
+(defvar smie--highlight-matching-block-overlay nil)
+(defvar-local smie--highlight-matching-block-lastpos -1)
+
+(defun smie-highlight-matching-block ()
+ (when (and smie-closer-alist
+ (/= (point) smie--highlight-matching-block-lastpos))
+ (unless (overlayp smie--highlight-matching-block-overlay)
+ (setq smie--highlight-matching-block-overlay
+ (make-overlay (point) (point))))
+ (setq smie--highlight-matching-block-lastpos (point))
+ (let ((beg-of-tok
+ (lambda (&optional start)
+ "Move to the beginning of current token at START."
+ (let* ((token)
+ (start (or start (point)))
+ (beg (progn
+ (funcall smie-backward-token-function)
+ (forward-comment (point-max))
+ (point)))
+ (end (progn
+ (setq token (funcall smie-forward-token-function))
+ (forward-comment (- (point)))
+ (point))))
+ (if (and (<= beg start) (<= start end)
+ (or (assoc token smie-closer-alist)
+ (rassoc token smie-closer-alist)))
+ (progn (goto-char beg) token)
+ (goto-char start)
+ nil))))
+ (highlight
+ (lambda (beg end)
+ (move-overlay smie--highlight-matching-block-overlay
+ beg end (current-buffer))
+ (overlay-put smie--highlight-matching-block-overlay
+ 'face 'smie-matching-block-highlight))))
+ (save-excursion
+ (condition-case nil
+ (if (nth 8 (syntax-ppss))
+ (overlay-put smie--highlight-matching-block-overlay 'face nil)
+ (let ((token
+ (or (funcall beg-of-tok)
+ (funcall beg-of-tok
+ (prog1 (point)
+ (funcall smie-forward-token-function))))))
+ (cond
+ ((assoc token smie-closer-alist) ; opener
+ (forward-sexp 1)
+ (let ((end (point))
+ (closer (funcall smie-backward-token-function)))
+ (when (rassoc closer smie-closer-alist)
+ (funcall highlight (point) end))))
+ ((rassoc token smie-closer-alist) ; closer
+ (funcall smie-forward-token-function)
+ (forward-sexp -1)
+ (let ((beg (point))
+ (opener (funcall smie-forward-token-function)))
+ (when (assoc opener smie-closer-alist)
+ (funcall highlight beg (point)))))
+ (t (overlay-put smie--highlight-matching-block-overlay
+ 'face nil)))))
+ (scan-error
+ (overlay-put smie--highlight-matching-block-overlay 'face nil)))))))
+
+(defvar smie--highlight-matching-block-timer nil)
+
+;;;###autoload
+(define-minor-mode smie-highlight-matching-block-mode nil
+ :global t :group 'smie
+ (when (timerp smie--highlight-matching-block-timer)
+ (cancel-timer smie--highlight-matching-block-timer))
+ (setq smie--highlight-matching-block-timer nil)
+ (if smie-highlight-matching-block-mode
+ (progn
+ (remove-hook 'post-self-insert-hook #'smie-blink-matching-open 'local)
+ (setq smie--highlight-matching-block-timer
+ (run-with-idle-timer 0.2 t #'smie-highlight-matching-block)))
+ (when smie--highlight-matching-block-overlay
+ (delete-overlay smie--highlight-matching-block-overlay)
+ (setq smie--highlight-matching-block-overlay nil))
+ (kill-local-variable 'smie--highlight-matching-block-lastpos)))
+
;;; The indentation engine.
(defcustom smie-indent-basic 4
@@ -1701,8 +1786,9 @@ KEYWORDS are additional arguments, which can use the following keywords:
;; Only needed for interactive calls to blink-matching-open.
(set (make-local-variable 'blink-matching-check-function)
#'smie-blink-matching-check)
- (add-hook 'post-self-insert-hook
- #'smie-blink-matching-open 'append 'local)
+ (unless smie-highlight-matching-block-mode
+ (add-hook 'post-self-insert-hook
+ #'smie-blink-matching-open 'append 'local))
(set (make-local-variable 'smie-blink-matching-triggers)
(append smie-blink-matching-triggers
;; Rather than wait for SPC to blink, try to blink as
diff --git a/lisp/emacs-lisp/tabulated-list.el b/lisp/emacs-lisp/tabulated-list.el
index 6dba423010f..5660ac8c4cc 100644
--- a/lisp/emacs-lisp/tabulated-list.el
+++ b/lisp/emacs-lisp/tabulated-list.el
@@ -4,6 +4,7 @@
;; Author: Chong Yidong <cyd@stupidchicken.com>
;; Keywords: extensions, lisp
+;; Version: 1.0
;; This file is part of GNU Emacs.
diff --git a/lisp/emacs-lisp/testcover.el b/lisp/emacs-lisp/testcover.el
index 33bb1e3a732..a5619583145 100644
--- a/lisp/emacs-lisp/testcover.el
+++ b/lisp/emacs-lisp/testcover.el
@@ -118,7 +118,7 @@ calls to one of the `testcover-1value-functions', so if that's true then no
brown splotch is shown for these. This list is quite incomplete! Most
side-effect-free functions should be here."
:group 'testcover
- :type 'hook)
+ :type '(repeat symbol))
(defcustom testcover-progn-functions
'(define-key fset function goto-char mapc overlay-put progn
diff --git a/lisp/emacs-lisp/timer.el b/lisp/emacs-lisp/timer.el
index a1bba2ddb6e..0aa31f717ed 100644
--- a/lisp/emacs-lisp/timer.el
+++ b/lisp/emacs-lisp/timer.el
@@ -124,7 +124,7 @@ of SECS seconds since the epoch. SECS may be a fraction."
(floor (mod next-sec-psec 1000000)))))
(defun timer-relative-time (time secs &optional usecs psecs)
- "Advance TIME by SECS seconds and optionally USECS nanoseconds
+ "Advance TIME by SECS seconds and optionally USECS microseconds
and PSECS picoseconds. SECS may be either an integer or a
floating point number."
(let ((delta (if (floatp secs)
@@ -139,7 +139,7 @@ floating point number."
(time-less-p (timer--time t1) (timer--time t2)))
(defun timer-inc-time (timer secs &optional usecs psecs)
- "Increment the time set in TIMER by SECS seconds, USECS nanoseconds,
+ "Increment the time set in TIMER by SECS seconds, USECS microseconds,
and PSECS picoseconds. SECS may be a fraction. If USECS or PSECS are
omitted, they are treated as zero."
(setf (timer--time timer)