diff options
| author | Stefan Monnier | 2007-11-18 19:32:53 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2007-11-18 19:32:53 +0000 |
| commit | 0b281d035a2f0bfea611744f1548096500eb5487 (patch) | |
| tree | 6852072a1d6a45d9fb4b3e982b0c88ebe7118801 | |
| parent | a94129699b60b2b4137cd6aecbd84cecfaed9c2d (diff) | |
| download | emacs-0b281d035a2f0bfea611744f1548096500eb5487.tar.gz emacs-0b281d035a2f0bfea611744f1548096500eb5487.zip | |
(kill-all-abbrevs, insert-abbrevs, prepare-abbrev-list-buffer): Use dolist.
(clear-abbrev-table): Preserve properties.
| -rw-r--r-- | lisp/ChangeLog | 32 | ||||
| -rw-r--r-- | lisp/abbrev.el | 45 |
2 files changed, 41 insertions, 36 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 63dee8f6e0d..8c1bcf780c4 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,19 +1,24 @@ | |||
| 1 | 2007-11-18 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * abbrev.el (kill-all-abbrevs, insert-abbrevs) | ||
| 4 | (prepare-abbrev-list-buffer): Use dolist. | ||
| 5 | (clear-abbrev-table): Preserve properties. | ||
| 6 | |||
| 1 | 2007-11-18 Shigeru Fukaya <shigeru.fukaya@gmail.com> (tiny change) | 7 | 2007-11-18 Shigeru Fukaya <shigeru.fukaya@gmail.com> (tiny change) |
| 2 | 8 | ||
| 3 | * textmodes/texinfmt.el (texinfo-format-printindex): Collect | 9 | * textmodes/texinfmt.el (texinfo-format-printindex): |
| 4 | combined indexes using texinfo-short-index-format-cmds-alist. | 10 | Collect combined indexes using texinfo-short-index-format-cmds-alist. |
| 5 | Reported on <bug-texinfo@gnu.org>. | 11 | Reported on <bug-texinfo@gnu.org>. |
| 6 | 12 | ||
| 7 | 2007-11-18 Michael Albinus <michael.albinus@gmx.de> | 13 | 2007-11-18 Michael Albinus <michael.albinus@gmx.de> |
| 8 | 14 | ||
| 9 | * net/tramp.el (tramp-completion-reread-directory-timeout): New | 15 | * net/tramp.el (tramp-completion-reread-directory-timeout): |
| 10 | defcustom. | 16 | New defcustom. |
| 11 | (tramp-handle-file-name-all-completions): Flush directory contents | 17 | (tramp-handle-file-name-all-completions): Flush directory contents |
| 12 | from cache regularly. | 18 | from cache regularly. |
| 13 | (tramp-set-auto-save-file-modes): Check also for | 19 | (tramp-set-auto-save-file-modes): Check also for `buffer-modified-p'. |
| 14 | `buffer-modified-p'. | 20 | (tramp-open-connection-setup-interactive-shell): |
| 15 | (tramp-open-connection-setup-interactive-shell): Call | 21 | Call `tramp-cleanup-connection' via funcall. |
| 16 | `tramp-cleanup-connection' via funcall. | ||
| 17 | 22 | ||
| 18 | * net/tramp-ftp.el (tramp-ftp-file-name-handler): Temp file is already | 23 | * net/tramp-ftp.el (tramp-ftp-file-name-handler): Temp file is already |
| 19 | created when copying. | 24 | created when copying. |
| @@ -21,18 +26,17 @@ | |||
| 21 | 2007-11-17 Dan Nicolaescu <dann@ics.uci.edu> | 26 | 2007-11-17 Dan Nicolaescu <dann@ics.uci.edu> |
| 22 | 27 | ||
| 23 | * eshell/esh-util.el (eshell-under-xemacs-p): Remove. | 28 | * eshell/esh-util.el (eshell-under-xemacs-p): Remove. |
| 24 | * eshell/esh-mode.el (eshell-mode-syntax-table) | 29 | * eshell/esh-mode.el (eshell-mode-syntax-table, command-running-p): |
| 25 | (command-running-p): | ||
| 26 | * eshell/esh-ext.el (eshell-external-command): | 30 | * eshell/esh-ext.el (eshell-external-command): |
| 27 | * eshell/esh-cmd.el (require): | 31 | * eshell/esh-cmd.el (require): |
| 28 | * eshell/em-unix.el (eshell-plain-locate-behavior): | 32 | * eshell/em-unix.el (eshell-plain-locate-behavior): |
| 29 | * eshell/em-cmpl.el (eshell-cmpl-initialize): Replace | 33 | * eshell/em-cmpl.el (eshell-cmpl-initialize): |
| 30 | eshell-under-xemacs-p with (featurep 'xemacs). | 34 | Replace eshell-under-xemacs-p with (featurep 'xemacs). |
| 31 | * eshell/esh-mode.el (characterp,char-int): Remove unused | 35 | * eshell/esh-mode.el (characterp,char-int): Remove unused |
| 32 | conditional defaliases. | 36 | conditional defaliases. |
| 33 | 37 | ||
| 34 | * pcomplete.el (pcomplete-event-matches-key-specifier-p): Rename | 38 | * pcomplete.el (pcomplete-event-matches-key-specifier-p): |
| 35 | from event-matches-key-specifier-p, define unconditionally. | 39 | Rename from event-matches-key-specifier-p, define unconditionally. |
| 36 | (event-basic-type): Remove unused defalias. | 40 | (event-basic-type): Remove unused defalias. |
| 37 | (pcomplete-show-completions): | 41 | (pcomplete-show-completions): |
| 38 | Use pcomplete-event-matches-key-specifier-p. | 42 | Use pcomplete-event-matches-key-specifier-p. |
diff --git a/lisp/abbrev.el b/lisp/abbrev.el index b6167d2c1a5..d7dfea2f6d8 100644 --- a/lisp/abbrev.el +++ b/lisp/abbrev.el | |||
| @@ -83,10 +83,8 @@ to enable or disable Abbrev mode in the current buffer." | |||
| 83 | (defun kill-all-abbrevs () | 83 | (defun kill-all-abbrevs () |
| 84 | "Undefine all defined abbrevs." | 84 | "Undefine all defined abbrevs." |
| 85 | (interactive) | 85 | (interactive) |
| 86 | (let ((tables abbrev-table-name-list)) | 86 | (dolist (tablesym abbrev-table-name-list) |
| 87 | (while tables | 87 | (clear-abbrev-table (symbol-value tablesym)))) |
| 88 | (clear-abbrev-table (symbol-value (car tables))) | ||
| 89 | (setq tables (cdr tables))))) | ||
| 90 | 88 | ||
| 91 | (defun copy-abbrev-table (table) | 89 | (defun copy-abbrev-table (table) |
| 92 | "Make a new abbrev-table with the same abbrevs as TABLE." | 90 | "Make a new abbrev-table with the same abbrevs as TABLE." |
| @@ -106,10 +104,8 @@ Mark is set after the inserted text." | |||
| 106 | (interactive) | 104 | (interactive) |
| 107 | (push-mark | 105 | (push-mark |
| 108 | (save-excursion | 106 | (save-excursion |
| 109 | (let ((tables abbrev-table-name-list)) | 107 | (dolist (tablesym abbrev-table-name-list) |
| 110 | (while tables | 108 | (insert-abbrev-table-description tablesym t)) |
| 111 | (insert-abbrev-table-description (car tables) t) | ||
| 112 | (setq tables (cdr tables)))) | ||
| 113 | (point)))) | 109 | (point)))) |
| 114 | 110 | ||
| 115 | (defun list-abbrevs (&optional local) | 111 | (defun list-abbrevs (&optional local) |
| @@ -131,18 +127,17 @@ Otherwise display all abbrevs." | |||
| 131 | found)) | 127 | found)) |
| 132 | 128 | ||
| 133 | (defun prepare-abbrev-list-buffer (&optional local) | 129 | (defun prepare-abbrev-list-buffer (&optional local) |
| 134 | (save-excursion | 130 | (with-current-buffer (get-buffer-create "*Abbrevs*") |
| 135 | (let ((table local-abbrev-table)) | 131 | (erase-buffer) |
| 136 | (set-buffer (get-buffer-create "*Abbrevs*")) | 132 | (if local |
| 137 | (erase-buffer) | 133 | (insert-abbrev-table-description |
| 138 | (if local | 134 | (abbrev-table-name local-abbrev-table) t) |
| 139 | (insert-abbrev-table-description (abbrev-table-name table) t) | 135 | (dolist (table abbrev-table-name-list) |
| 140 | (dolist (table abbrev-table-name-list) | 136 | (insert-abbrev-table-description table t))) |
| 141 | (insert-abbrev-table-description table t))) | 137 | (goto-char (point-min)) |
| 142 | (goto-char (point-min)) | 138 | (set-buffer-modified-p nil) |
| 143 | (set-buffer-modified-p nil) | 139 | (edit-abbrevs-mode) |
| 144 | (edit-abbrevs-mode) | 140 | (current-buffer))) |
| 145 | (current-buffer)))) | ||
| 146 | 141 | ||
| 147 | (defun edit-abbrevs-mode () | 142 | (defun edit-abbrevs-mode () |
| 148 | "Major mode for editing the list of abbrev definitions. | 143 | "Major mode for editing the list of abbrev definitions. |
| @@ -524,8 +519,14 @@ the current abbrev table before abbrev lookup happens." | |||
| 524 | (defun clear-abbrev-table (table) | 519 | (defun clear-abbrev-table (table) |
| 525 | "Undefine all abbrevs in abbrev table TABLE, leaving it empty." | 520 | "Undefine all abbrevs in abbrev table TABLE, leaving it empty." |
| 526 | (setq abbrevs-changed t) | 521 | (setq abbrevs-changed t) |
| 527 | (dotimes (i (length table)) | 522 | (let* ((sym (intern-soft "" table))) |
| 528 | (aset table i 0))) | 523 | (dotimes (i (length table)) |
| 524 | (aset table i 0)) | ||
| 525 | ;; Preserve the table's properties. | ||
| 526 | (assert sym) | ||
| 527 | (intern sym table) | ||
| 528 | (abbrev-table-put table :abbrev-table-modiff | ||
| 529 | (1+ (abbrev-table-get table :abbrev-table-modiff))))) | ||
| 529 | 530 | ||
| 530 | (defun define-abbrev (table name expansion &optional hook &rest props) | 531 | (defun define-abbrev (table name expansion &optional hook &rest props) |
| 531 | "Define an abbrev in TABLE named NAME, to expand to EXPANSION and call HOOK. | 532 | "Define an abbrev in TABLE named NAME, to expand to EXPANSION and call HOOK. |