diff options
| author | Paul Eggert | 2012-04-18 10:07:06 -0700 |
|---|---|---|
| committer | Paul Eggert | 2012-04-18 10:07:06 -0700 |
| commit | 99c8ec3fbfc439845c29144a61a42a5183441eaf (patch) | |
| tree | cbaf6f814980f68f463bd76155c973f5a19378a6 | |
| parent | 6c94c34fe8fef20680c29731277ad8baf87bf47e (diff) | |
| parent | 12a106a903756aac5fd545ba8cb8f1b5dc7d9304 (diff) | |
| download | emacs-99c8ec3fbfc439845c29144a61a42a5183441eaf.tar.gz emacs-99c8ec3fbfc439845c29144a61a42a5183441eaf.zip | |
Merge from trunk.
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/abbrev.el | 17 |
2 files changed, 20 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 054b3ca5f47..de484dc68fa 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2012-04-18 Leo Liu <sdl.web@gmail.com> | ||
| 2 | |||
| 3 | * abbrev.el (edit-abbrevs): Move point to the abbrev table of | ||
| 4 | current buffer. | ||
| 5 | (prepare-abbrev-list-buffer): Enter edit-abbrevs-mode only if | ||
| 6 | LOCAL is nil. | ||
| 7 | |||
| 1 | 2012-04-18 Chong Yidong <cyd@gnu.org> | 8 | 2012-04-18 Chong Yidong <cyd@gnu.org> |
| 2 | 9 | ||
| 3 | * simple.el (line-move): Use forward-line if in batch mode | 10 | * simple.el (line-move): Use forward-line if in batch mode |
diff --git a/lisp/abbrev.el b/lisp/abbrev.el index 3845c4ce4e6..7f54d3dc253 100644 --- a/lisp/abbrev.el +++ b/lisp/abbrev.el | |||
| @@ -134,10 +134,13 @@ Otherwise display all abbrevs." | |||
| 134 | (push table empty-tables) | 134 | (push table empty-tables) |
| 135 | (insert-abbrev-table-description table t))) | 135 | (insert-abbrev-table-description table t))) |
| 136 | (dolist (table (nreverse empty-tables)) | 136 | (dolist (table (nreverse empty-tables)) |
| 137 | (insert-abbrev-table-description table t)))) | 137 | (insert-abbrev-table-description table t))) |
| 138 | ;; Note: `list-abbrevs' can dispaly only local abbrevs, in | ||
| 139 | ;; which case editing could lose abbrevs of other tables. Thus | ||
| 140 | ;; enter `edit-abbrevs-mode' only if LOCAL is nil. | ||
| 141 | (edit-abbrevs-mode)) | ||
| 138 | (goto-char (point-min)) | 142 | (goto-char (point-min)) |
| 139 | (set-buffer-modified-p nil) | 143 | (set-buffer-modified-p nil) |
| 140 | (edit-abbrevs-mode) | ||
| 141 | (current-buffer)))) | 144 | (current-buffer)))) |
| 142 | 145 | ||
| 143 | (defun edit-abbrevs-mode () | 146 | (defun edit-abbrevs-mode () |
| @@ -152,7 +155,8 @@ Otherwise display all abbrevs." | |||
| 152 | 155 | ||
| 153 | (defun edit-abbrevs () | 156 | (defun edit-abbrevs () |
| 154 | "Alter abbrev definitions by editing a list of them. | 157 | "Alter abbrev definitions by editing a list of them. |
| 155 | Selects a buffer containing a list of abbrev definitions. | 158 | Selects a buffer containing a list of abbrev definitions with |
| 159 | point located in the abbrev table of current buffer. | ||
| 156 | You can edit them and type \\<edit-abbrevs-map>\\[edit-abbrevs-redefine] to redefine abbrevs | 160 | You can edit them and type \\<edit-abbrevs-map>\\[edit-abbrevs-redefine] to redefine abbrevs |
| 157 | according to your editing. | 161 | according to your editing. |
| 158 | Buffer contains a header line for each abbrev table, | 162 | Buffer contains a header line for each abbrev table, |
| @@ -163,7 +167,12 @@ where NAME and EXPANSION are strings with quotes, | |||
| 163 | USECOUNT is an integer, and HOOK is any valid function | 167 | USECOUNT is an integer, and HOOK is any valid function |
| 164 | or may be omitted (it is usually omitted)." | 168 | or may be omitted (it is usually omitted)." |
| 165 | (interactive) | 169 | (interactive) |
| 166 | (switch-to-buffer (prepare-abbrev-list-buffer))) | 170 | (let ((table-name (abbrev-table-name local-abbrev-table))) |
| 171 | (switch-to-buffer (prepare-abbrev-list-buffer)) | ||
| 172 | (when (and table-name | ||
| 173 | (search-forward | ||
| 174 | (concat "(" (symbol-name table-name) ")\n\n") nil t)) | ||
| 175 | (goto-char (match-end 0))))) | ||
| 167 | 176 | ||
| 168 | (defun edit-abbrevs-redefine () | 177 | (defun edit-abbrevs-redefine () |
| 169 | "Redefine abbrevs according to current buffer contents." | 178 | "Redefine abbrevs according to current buffer contents." |