+2003-06-18 Stefan Monnier <monnier@cs.yale.edu>
+
+ * subr.el (looking-back): Handle the case of non-trivial regexps.
+ Add an optional `limit' argument.
+ (push, pop, with-temp-file, with-temp-message, delay-mode-hooks)
+ (with-syntax-table): Add edebug info.
+
+2003-06-17 Stefan Monnier <monnier@cs.yale.edu>
+
+ * simple.el (kill-new): Leave yank-handler property alone if no
+ explicit yank-handler is specified.
+ (vis-mode-saved-buffer-invisibility-spec): Rename from
+ saved-buffer-invisibility-spec.
+ (vis-mode): Correctly handle the case where the mode is turned on
+ or off several times in a row.
+
2003-06-17 Luc Teirlinck <teirllm@mail.auburn.edu>
* info.el (Info-fontify-node): Give only the last whitespace
"Add NEWELT to the list stored in the symbol LISTNAME.
This is equivalent to (setq LISTNAME (cons NEWELT LISTNAME)).
LISTNAME must be a symbol."
+ (declare (debug (form sexp)))
(list 'setq listname
(list 'cons newelt listname)))
LISTNAME must be a symbol whose value is a list.
If the value is nil, `pop' returns nil but does not actually
change the list."
+ (declare (debug (sexp)))
(list 'car
(list 'prog1 listname
(list 'setq listname (list 'cdr listname)))))
"Create a new buffer, evaluate BODY there, and write the buffer to FILE.
The value returned is the value of the last form in BODY.
See also `with-temp-buffer'."
+ (declare (debug t))
(let ((temp-file (make-symbol "temp-file"))
(temp-buffer (make-symbol "temp-buffer")))
`(let ((,temp-file ,file)
MESSAGE is written to the message log buffer if `message-log-max' is non-nil.
If MESSAGE is nil, the echo area and message log buffer are unchanged.
Use a MESSAGE of \"\" to temporarily clear the echo area."
+ (declare (debug t))
(let ((current-message (make-symbol "current-message"))
(temp-message (make-symbol "with-temp-message")))
`(let ((,temp-message ,message)
(defmacro delay-mode-hooks (&rest body)
"Execute BODY, but delay any `run-mode-hooks'.
Only affects hooks run in the current buffer."
+ (declare (debug t))
`(progn
(make-local-variable 'delay-mode-hooks)
(let ((delay-mode-hooks t))
The syntax table of the current buffer is saved, BODY is evaluated, and the
saved table is restored, even in case of an abnormal exit.
Value is what BODY returns."
+ (declare (debug t))
(let ((old-table (make-symbol "table"))
(old-buffer (make-symbol "buffer")))
`(let ((,old-table (syntax-table))
(buffer-substring-no-properties (match-beginning num)
(match-end num)))))
-(defun looking-back (regexp)
- "Return t if text before point matches regular expression REGEXP.
-This function modifies the match data that `match-beginning',
-`match-end' and `match-data' access; save and restore the match
-data if you want to preserve them."
+(defun looking-back (regexp &optional limit)
+ "Return non-nil if text before point matches regular expression REGEXP.
+Like `looking-at' except backwards and slower.
+LIMIT if non-nil speeds up the search by specifying how far back the
+match can start."
(save-excursion
- (let ((beg (point)))
- (if (re-search-backward regexp nil t)
- (if (= (match-end 0) beg)
- t
- nil)
- nil))))
+ (re-search-backward (concat "\\(?:" regexp "\\)\\=") limit t)))
(defconst split-string-default-separators "[ \f\t\n\r\v]+"
"The default value of separators for `split-string'.