emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/emacs-24 r107960: * lisp/abbrev.el (edit-ab


From: Leo Liu
Subject: [Emacs-diffs] /srv/bzr/emacs/emacs-24 r107960: * lisp/abbrev.el (edit-abbrevs): Move point to the abbrev table of
Date: Fri, 02 Nov 2012 02:02:27 -0000
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 107960
committer: Leo Liu <address@hidden>
branch nick: trunk
timestamp: Thu 2012-04-19 00:43:23 +0800
message:
  * lisp/abbrev.el (edit-abbrevs): Move point to the abbrev table of
  current buffer.
  (prepare-abbrev-list-buffer): Enter edit-abbrevs-mode only if
  LOCAL is nil.
modified:
  lisp/ChangeLog
  lisp/abbrev.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-04-18 07:00:52 +0000
+++ b/lisp/ChangeLog    2012-04-18 16:43:23 +0000
@@ -1,3 +1,10 @@
+2012-04-18  Leo Liu  <address@hidden>
+
+       * abbrev.el (edit-abbrevs): Move point to the abbrev table of
+       current buffer.
+       (prepare-abbrev-list-buffer): Enter edit-abbrevs-mode only if
+       LOCAL is nil.
+
 2012-04-18  Chong Yidong  <address@hidden>
 
        * simple.el (line-move): Use forward-line if in batch mode

=== modified file 'lisp/abbrev.el'
--- a/lisp/abbrev.el    2012-03-04 02:45:04 +0000
+++ b/lisp/abbrev.el    2012-04-18 16:43:23 +0000
@@ -134,10 +134,13 @@
                (push table empty-tables)
              (insert-abbrev-table-description table t)))
          (dolist (table (nreverse empty-tables))
-           (insert-abbrev-table-description table t))))
+           (insert-abbrev-table-description table t)))
+        ;; Note: `list-abbrevs' can dispaly only local abbrevs, in
+        ;; which case editing could lose abbrevs of other tables. Thus
+        ;; enter `edit-abbrevs-mode' only if LOCAL is nil.
+        (edit-abbrevs-mode))
       (goto-char (point-min))
       (set-buffer-modified-p nil)
-      (edit-abbrevs-mode)
       (current-buffer))))
 
 (defun edit-abbrevs-mode ()
@@ -152,7 +155,8 @@
 
 (defun edit-abbrevs ()
   "Alter abbrev definitions by editing a list of them.
-Selects a buffer containing a list of abbrev definitions.
+Selects a buffer containing a list of abbrev definitions with
+point located in the abbrev table of current buffer.
 You can edit them and type \\<edit-abbrevs-map>\\[edit-abbrevs-redefine] to 
redefine abbrevs
 according to your editing.
 Buffer contains a header line for each abbrev table,
@@ -163,7 +167,12 @@
 USECOUNT is an integer, and HOOK is any valid function
 or may be omitted (it is usually omitted)."
   (interactive)
-  (switch-to-buffer (prepare-abbrev-list-buffer)))
+  (let ((table-name (abbrev-table-name local-abbrev-table)))
+    (switch-to-buffer (prepare-abbrev-list-buffer))
+    (when (and table-name
+               (search-forward
+                (concat "(" (symbol-name table-name) ")\n\n") nil t))
+      (goto-char (match-end 0)))))
 
 (defun edit-abbrevs-redefine ()
   "Redefine abbrevs according to current buffer contents."


reply via email to

[Prev in Thread] Current Thread [Next in Thread]