diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 46e8f8aa2b5..5f471795c2d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2001-02-10 Richard M. Stallman + + * simple.el (delete-key-deletes-forward-mode): + Change `let' to `let*' to fix gross bug in last change. + + * repeat.el (repeat): Don't let execute-kbd-macro alter + real-last-command. + 2001-02-10 Eli Zaretskii * simple.el (eval-expression): Doc fix. @@ -402,7 +410,7 @@ from 2001-01-12. It is not needed, since backspace is mapped into DEL. -2001-01-27 Richard M. Stallman +2001-01-27 Richard M. Stallman * dabbrev.el (dabbrev--substitute-expansion): Treat a one-capital-letter abbrev as "not all upper case", @@ -469,7 +477,7 @@ * loadup.el (Top-level) [ms-dos]: Don't load international/ccl twice. -2001-01-26 Richard M. Stallman +2001-01-26 Richard M. Stallman * simple.el (next-line): Don't let `newline' expand abbrevs. Simplify slightly. @@ -791,7 +799,7 @@ * bookmark.el (bookmark-maybe-historicize-string): Use new backquote syntax. -2001-01-12 Richard M. Stallman +2001-01-12 Richard M. Stallman * subr.el (last): Handle a list that doesn't end in nil. @@ -1100,7 +1108,7 @@ accepts extra latin codes, register such codes as safe for the coding system. -2001-01-08 Richard M. Stallman +2001-01-08 Richard M. Stallman * emacs-lisp/bytecomp.el (byte-compile-log-1): In non-batch case, don't mention the file name or the date here, because they are diff --git a/lisp/simple.el b/lisp/simple.el index 147f1303c3b..bb8f3c72126 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -230,7 +230,8 @@ On nonblank line, delete any immediately following blank lines." (defun delete-trailing-whitespace () "Delete all the trailing whitespace across the current buffer. All whitespace after the last non-whitespace character in a line is deleted. -This respects narrowing, created by \\[narrow-to-region] and friends." +This respects narrowing, created by \\[narrow-to-region] and friends. +A formfeed is not considered whitespace by this function." (interactive "*") (save-match-data (save-excursion @@ -4069,12 +4070,12 @@ For more details, see `delete-key-deletes-forward'." (cond ((or (memq window-system '(x w32 mac pc)) (memq system-type '(ms-dos windows-nt))) (let ((bindings - `(([C-delete] [C-backspace] kill-word backward-kill-word) - ([M-delete] [M-backspace] kill-word backward-kill-word) - ([C-M-delete] [C-M-backspace] kill-sexp backward-kill-sexp) + `(([C-delete] [C-backspace]) + ([M-delete] [M-backspace]) + ([C-M-delete] [C-M-backspace]) (,esc-map - [C-delete] [C-backspace] - kill-sexp backward-kill-sexp)))) + [C-delete] [C-backspace]))) + (old-state (lookup-key function-key-map [delete]))) (if delete-key-deletes-forward (progn @@ -4085,19 +4086,18 @@ For more details, see `delete-key-deletes-forward'." (define-key function-key-map [kp-delete] [?\C-?]) (define-key function-key-map [backspace] [?\C-?])) - (dolist (binding bindings) - (let ((map global-map)) - (when (keymapp (car binding)) - (setq map (car binding) binding (cdr binding))) - (let ((key1 (nth 0 binding)) - (key2 (nth 1 binding)) - (binding1 (nth 2 binding)) - (binding2 (nth 3 binding))) - (unless delete-key-deletes-forward - (let ((temp binding1)) - (setq binding1 binding2 binding2 temp))) - (define-key map key1 binding1) - (define-key map key2 binding2)))))) + ;; Maybe swap bindings of C-delete and C-backspace, etc. + (unless (equal old-state (lookup-key function-key-map [delete])) + (dolist (binding bindings) + (let ((map global-map)) + (when (keymapp (car binding)) + (setq map (car binding) binding (cdr binding))) + (let* ((key1 (nth 0 binding)) + (key2 (nth 1 binding)) + (binding1 (lookup-key map key1)) + (binding2 (lookup-key map key2))) + (define-key map key1 binding2) + (define-key map key2 binding1))))))) (t (if delete-key-deletes-forward (progn