summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>2007-04-11 00:17:47 +0000
committerMiles Bader <miles@gnu.org>2007-04-11 00:17:47 +0000
commit57cb2e6f261bb0aad81a9f7e6f3017b54adee068 (patch)
tree6ceb46f2e3bf08f16468d77f4fbfd201f637596a /lisp/emacs-lisp
parent3bd1d328e94787ac52ef6ba5dfec3b94ba23917a (diff)
parentc429815a6b9d271a57eed4956125f6bc89d1d72b (diff)
downloademacs-57cb2e6f261bb0aad81a9f7e6f3017b54adee068.tar.gz
Merge from emacs--devo--0
Patches applied: * emacs--devo--0 (patch 675-697) - Update from CVS - Merge from gnus--rel--5.10 - Release ERC 5.2. * gnus--rel--5.10 (patch 211-215) - Update from CVS - Merge from emacs--devo--0 Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-189
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/authors.el2
-rw-r--r--lisp/emacs-lisp/byte-opt.el33
-rw-r--r--lisp/emacs-lisp/bytecomp.el10
-rw-r--r--lisp/emacs-lisp/edebug.el3
-rw-r--r--lisp/emacs-lisp/ewoc.el9
-rw-r--r--lisp/emacs-lisp/lisp-mode.el3
-rw-r--r--lisp/emacs-lisp/lisp.el3
-rw-r--r--lisp/emacs-lisp/sregex.el2
-rw-r--r--lisp/emacs-lisp/testcover.el12
-rw-r--r--lisp/emacs-lisp/timer.el17
-rw-r--r--lisp/emacs-lisp/warnings.el13
11 files changed, 51 insertions, 56 deletions
diff --git a/lisp/emacs-lisp/authors.el b/lisp/emacs-lisp/authors.el
index d93d80e0c8e..31464269567 100644
--- a/lisp/emacs-lisp/authors.el
+++ b/lisp/emacs-lisp/authors.el
@@ -688,5 +688,7 @@ the Emacs source tree, from which to build the file."
(authors root)
(write-file file)))
+(provide 'authors)
+
;;; arch-tag: 659d5900-5ff2-43b0-954c-a315cc1e4dc1
;;; authors.el ends here
diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el
index 80a537cadb5..d0589b3eb00 100644
--- a/lisp/emacs-lisp/byte-opt.el
+++ b/lisp/emacs-lisp/byte-opt.el
@@ -545,8 +545,8 @@
(eq (car-safe (nth 2 last)) 'cdr)
(eq (cadr (nth 2 last)) var))))
(progn
- (byte-compile-warn "value returned by `%s' is not used"
- (prin1-to-string (car form)))
+ (byte-compile-warn "value returned from %s is unused"
+ (prin1-to-string form))
nil)))
(byte-compile-log " %s called for effect; deleted" fn)
;; appending a nil here might not be necessary, but it can't hurt.
@@ -1117,27 +1117,6 @@
(byte-optimize-predicate form))
form))
-(put 'concat 'byte-optimizer 'byte-optimize-pure-func)
-(put 'symbol-name 'byte-optimizer 'byte-optimize-pure-func)
-(put 'regexp-opt 'byte-optimizer 'byte-optimize-pure-func)
-(put 'regexp-quote 'byte-optimizer 'byte-optimize-pure-func)
-(put 'string-to-syntax 'byte-optimizer 'byte-optimize-pure-func)
-(defun byte-optimize-pure-func (form)
- "Do constant folding for pure functions.
-This assumes that the function will not have any side-effects and that
-its return value depends solely on its arguments.
-If the function can signal an error, this might change the semantics
-of FORM by signaling the error at compile-time."
- (let ((args (cdr form))
- (constant t))
- (while (and args constant)
- (or (byte-compile-constp (car args))
- (setq constant nil))
- (setq args (cdr args)))
- (if constant
- (list 'quote (eval form))
- form)))
-
;; Avoid having to write forward-... with a negative arg for speed.
;; Fixme: don't be limited to constant args.
(put 'backward-char 'byte-optimizer 'byte-optimize-backward-char)
@@ -1158,14 +1137,6 @@ of FORM by signaling the error at compile-time."
'(forward-word -1))
(t form)))
-(put 'char-before 'byte-optimizer 'byte-optimize-char-before)
-(defun byte-optimize-char-before (form)
- (cond ((= 2 (safe-length form))
- `(char-after (1- ,(nth 1 form))))
- ((= 1 (safe-length form))
- '(char-after (1- (point))))
- (t form)))
-
;; Fixme: delete-char -> delete-region (byte-coded)
;; optimize string-as-unibyte, string-as-multibyte, string-make-unibyte,
;; string-make-multibyte for constant args.
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 15a82fc1b7c..2a32ff9a016 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -2341,7 +2341,7 @@ list that represents a doc string reference.
(eq (car (car (cdr tail))) 'declare))
(let ((declaration (car (cdr tail))))
(setcdr tail (cdr (cdr tail)))
- (princ `(if macro-declaration-function
+ (prin1 `(if macro-declaration-function
(funcall macro-declaration-function
',name ',declaration))
outbuffer)))))
@@ -3148,6 +3148,7 @@ That command is designed for interactive use only" fn))
;; more complicated compiler macros
+(byte-defop-compiler char-before)
(byte-defop-compiler list)
(byte-defop-compiler concat)
(byte-defop-compiler fset)
@@ -3159,6 +3160,13 @@ That command is designed for interactive use only" fn))
(byte-defop-compiler19 (/ byte-quo) byte-compile-quo)
(byte-defop-compiler19 nconc)
+(defun byte-compile-char-before (form)
+ (cond ((= 2 (length form))
+ (byte-compile-form `(char-after (1- ,(nth 1 form)))))
+ ((= 1 (length form))
+ (byte-compile-form '(char-after (1- (point)))))
+ (t (byte-compile-subr-wrong-args form "0-1"))))
+
(defun byte-compile-list (form)
(let ((count (length (cdr form))))
(cond ((= count 0)
diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el
index 2777ea775e9..151bbd2bd9e 100644
--- a/lisp/emacs-lisp/edebug.el
+++ b/lisp/emacs-lisp/edebug.el
@@ -2755,7 +2755,8 @@ MSG is printed after `::::} '."
) ; if edebug-save-windows
;; Restore current buffer always, in case application needs it.
- (set-buffer edebug-outside-buffer)
+ (if (buffer-name edebug-outside-buffer)
+ (set-buffer edebug-outside-buffer))
;; Restore point, and mark.
;; Needed even if restoring windows because
;; that doesn't restore point and mark in the current buffer.
diff --git a/lisp/emacs-lisp/ewoc.el b/lisp/emacs-lisp/ewoc.el
index 3649757f782..9fec81ec2c5 100644
--- a/lisp/emacs-lisp/ewoc.el
+++ b/lisp/emacs-lisp/ewoc.el
@@ -191,8 +191,9 @@ BUT if it is the header or the footer in EWOC return nil instead."
(not (eq dll node))))
(setq node (ewoc--node-right node))))))
-(defun ewoc--insert-new-node (node data pretty-printer)
+(defun ewoc--insert-new-node (node data pretty-printer dll)
"Insert before NODE a new node for DATA, displayed by PRETTY-PRINTER.
+Fourth arg DLL -- from `(ewoc--dll EWOC)' -- is for internal purposes.
Call PRETTY-PRINTER with point at NODE's start, thus pushing back
NODE and leaving the new node's start there. Return the new node."
(save-excursion
@@ -262,8 +263,8 @@ fourth arg NOSEP non-nil inhibits this."
(unless header (setq header ""))
(unless footer (setq footer ""))
(setf (ewoc--node-start-marker dll) (copy-marker pos)
- foot (ewoc--insert-new-node dll footer hf-pp)
- head (ewoc--insert-new-node foot header hf-pp)
+ foot (ewoc--insert-new-node dll footer hf-pp dll)
+ head (ewoc--insert-new-node foot header hf-pp dll)
(ewoc--hf-pp new-ewoc) hf-pp
(ewoc--footer new-ewoc) foot
(ewoc--header new-ewoc) head))
@@ -301,7 +302,7 @@ Return the new node."
"Enter a new element DATA before NODE in EWOC.
Return the new node."
(ewoc--set-buffer-bind-dll ewoc
- (ewoc--insert-new-node node data (ewoc--pretty-printer ewoc))))
+ (ewoc--insert-new-node node data (ewoc--pretty-printer ewoc) dll)))
(defun ewoc-next (ewoc node)
"Return the node in EWOC that follows NODE.
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index 09cb8436c89..164756dfdc3 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -1280,7 +1280,8 @@ and initial semicolons."
"\\|\\s-*\\([(;:\"]\\|`(\\|#'(\\)"))
(paragraph-separate
(concat paragraph-separate "\\|\\s-*\".*[,\\.]$"))
- (fill-column (if (integerp emacs-lisp-docstring-fill-column)
+ (fill-column (if (and (integerp emacs-lisp-docstring-fill-column)
+ (derived-mode-p 'emacs-lisp-mode))
emacs-lisp-docstring-fill-column
fill-column)))
(fill-paragraph justify))
diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el
index 947b4063ad4..5254a8389b4 100644
--- a/lisp/emacs-lisp/lisp.el
+++ b/lisp/emacs-lisp/lisp.el
@@ -582,8 +582,7 @@ symbols with function definitions are considered. Otherwise, all
symbols with function definitions, values or properties are
considered."
(interactive)
-
- (let ((window (get-buffer-window "*Completions*")))
+ (let ((window (get-buffer-window "*Completions*" 0)))
(if (and (eq last-command this-command)
window (window-live-p window) (window-buffer window)
(buffer-name (window-buffer window)))
diff --git a/lisp/emacs-lisp/sregex.el b/lisp/emacs-lisp/sregex.el
index 447691d4046..8041aefc077 100644
--- a/lisp/emacs-lisp/sregex.el
+++ b/lisp/emacs-lisp/sregex.el
@@ -425,7 +425,7 @@ Here are the clauses allowed in an `sregex' or `sregexq' expression:
Stands for \"\\\\'\", matching the empty string at the end of text.
- the symbol `point'
- Stands for \"\\\\=\", matching the empty string at point.
+ Stands for \"\\\\=\\=\", matching the empty string at point.
- the symbol `word-boundary'
Stands for \"\\\\b\", matching the empty string at the beginning or
diff --git a/lisp/emacs-lisp/testcover.el b/lisp/emacs-lisp/testcover.el
index d8c171e111d..7d7e788523b 100644
--- a/lisp/emacs-lisp/testcover.el
+++ b/lisp/emacs-lisp/testcover.el
@@ -190,7 +190,7 @@ call to one of the `testcover-1value-functions'."
changes the instrumentation from edebug to testcover--much faster, no
problems with type-ahead or post-command-hook, etc. If BYTE-COMPILE is
non-nil, byte-compiles each function after instrumenting."
- (interactive "f")
+ (interactive "fStart covering file: ")
(let ((buf (find-file filename))
(load-read-function 'testcover-read)
(edebug-all-defs t))
@@ -428,10 +428,10 @@ FUN should be `testcover-reinstrument' for compositional functions,
list)
result))
-(defun testcover-end (buffer)
+(defun testcover-end (filename)
"Turn off instrumentation of all macros and functions in FILENAME."
- (interactive "b")
- (let ((buf (find-file-noselect buffer)))
+ (interactive "fStop covering file: ")
+ (let ((buf (find-file-noselect filename)))
(eval-buffer buf t)))
@@ -513,7 +513,7 @@ eliminated by adding more test cases."
(defun testcover-mark-all (&optional buffer)
"Mark all forms in BUFFER that did not get completley tested during
coverage tests. This function creates many overlays."
- (interactive "b")
+ (interactive "bMark forms in buffer: ")
(if buffer
(switch-to-buffer buffer))
(goto-char 1)
@@ -523,7 +523,7 @@ coverage tests. This function creates many overlays."
(defun testcover-unmark-all (buffer)
"Remove all overlays from FILENAME."
- (interactive "b")
+ (interactive "bUnmark forms in buffer: ")
(condition-case nil
(progn
(set-buffer buffer)
diff --git a/lisp/emacs-lisp/timer.el b/lisp/emacs-lisp/timer.el
index db6586838bb..092611632ca 100644
--- a/lisp/emacs-lisp/timer.el
+++ b/lisp/emacs-lisp/timer.el
@@ -360,11 +360,16 @@ This function is called, by name, directly by the C code."
(defun run-at-time (time repeat function &rest args)
"Perform an action at time TIME.
Repeat the action every REPEAT seconds, if REPEAT is non-nil.
-TIME should be a string like \"11:23pm\", nil meaning now, a number of seconds
-from now, a value from `current-time', or t (with non-nil REPEAT)
-meaning the next integral multiple of REPEAT.
-REPEAT may be an integer or floating point number.
-The action is to call FUNCTION with arguments ARGS.
+TIME should be one of: a string giving an absolute time like
+\"11:23pm\" (the acceptable formats are those recognized by
+`diary-entry-time'; note that such times are interpreted as times
+today, even if in the past); a string giving a relative time like
+\"2 hours 35 minutes\" (the acceptable formats are those
+recognized by `timer-duration'); nil meaning now; a number of
+seconds from now; a value from `encode-time'; or t (with non-nil
+REPEAT) meaning the next integral multiple of REPEAT. REPEAT may
+be an integer or floating point number. The action is to call
+FUNCTION with arguments ARGS.
This function returns a timer object which you can use in `cancel-timer'."
(interactive "sRun at time: \nNRepeat interval: \naFunction: ")
@@ -385,7 +390,7 @@ This function returns a timer object which you can use in `cancel-timer'."
(if (numberp time)
(setq time (timer-relative-time (current-time) time)))
- ;; Handle relative times like "2 hours and 35 minutes"
+ ;; Handle relative times like "2 hours 35 minutes"
(if (stringp time)
(let ((secs (timer-duration time)))
(if secs
diff --git a/lisp/emacs-lisp/warnings.el b/lisp/emacs-lisp/warnings.el
index b75f0fd242f..99b0b3f3448 100644
--- a/lisp/emacs-lisp/warnings.el
+++ b/lisp/emacs-lisp/warnings.el
@@ -218,8 +218,9 @@ Default is :warning.
but raise suspicion of a possible problem.
:debug -- info for debugging only.
-BUFFER-NAME, if specified, is the name of the buffer for logging the
-warning. By default, it is `*Warnings*'.
+BUFFER-NAME, if specified, is the name of the buffer for logging
+the warning. By default, it is `*Warnings*'. If this function
+has to create the buffer, it disables undo in the buffer.
See the `warnings' custom group for user customization features.
@@ -227,16 +228,22 @@ See also `warning-series', `warning-prefix-function' and
`warning-fill-prefix' for additional programming features."
(unless level
(setq level :warning))
+ (unless buffer-name
+ (setq buffer-name "*Warnings*"))
(if (assq level warning-level-aliases)
(setq level (cdr (assq level warning-level-aliases))))
(or (< (warning-numeric-level level)
(warning-numeric-level warning-minimum-log-level))
(warning-suppress-p type warning-suppress-log-types)
(let* ((typename (if (consp type) (car type) type))
- (buffer (get-buffer-create (or buffer-name "*Warnings*")))
+ (old (get-buffer buffer-name))
+ (buffer (get-buffer-create buffer-name))
(level-info (assq level warning-levels))
start end)
(with-current-buffer buffer
+ ;; If we created the buffer, disable undo.
+ (unless old
+ (setq buffer-undo-list t))
(goto-char (point-max))
(when (and warning-series (symbolp warning-series))
(setq warning-series