Commit 0b281d03 authored by Stefan Monnier's avatar Stefan Monnier
Browse files

(kill-all-abbrevs, insert-abbrevs, prepare-abbrev-list-buffer): Use dolist.

(clear-abbrev-table): Preserve properties.
parent a9412969
2007-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
* abbrev.el (kill-all-abbrevs, insert-abbrevs)
(prepare-abbrev-list-buffer): Use dolist.
(clear-abbrev-table): Preserve properties.
2007-11-18 Shigeru Fukaya <shigeru.fukaya@gmail.com> (tiny change)
* textmodes/texinfmt.el (texinfo-format-printindex): Collect
combined indexes using texinfo-short-index-format-cmds-alist.
* textmodes/texinfmt.el (texinfo-format-printindex):
Collect combined indexes using texinfo-short-index-format-cmds-alist.
Reported on <bug-texinfo@gnu.org>.
2007-11-18 Michael Albinus <michael.albinus@gmx.de>
* net/tramp.el (tramp-completion-reread-directory-timeout): New
defcustom.
* net/tramp.el (tramp-completion-reread-directory-timeout):
New defcustom.
(tramp-handle-file-name-all-completions): Flush directory contents
from cache regularly.
(tramp-set-auto-save-file-modes): Check also for
`buffer-modified-p'.
(tramp-open-connection-setup-interactive-shell): Call
`tramp-cleanup-connection' via funcall.
(tramp-set-auto-save-file-modes): Check also for `buffer-modified-p'.
(tramp-open-connection-setup-interactive-shell):
Call `tramp-cleanup-connection' via funcall.
* net/tramp-ftp.el (tramp-ftp-file-name-handler): Temp file is already
created when copying.
......@@ -21,18 +26,17 @@
2007-11-17 Dan Nicolaescu <dann@ics.uci.edu>
* eshell/esh-util.el (eshell-under-xemacs-p): Remove.
* eshell/esh-mode.el (eshell-mode-syntax-table)
(command-running-p):
* eshell/esh-mode.el (eshell-mode-syntax-table, command-running-p):
* eshell/esh-ext.el (eshell-external-command):
* eshell/esh-cmd.el (require):
* eshell/em-unix.el (eshell-plain-locate-behavior):
* eshell/em-cmpl.el (eshell-cmpl-initialize): Replace
eshell-under-xemacs-p with (featurep 'xemacs).
* eshell/em-cmpl.el (eshell-cmpl-initialize):
Replace eshell-under-xemacs-p with (featurep 'xemacs).
* eshell/esh-mode.el (characterp,char-int): Remove unused
conditional defaliases.
* pcomplete.el (pcomplete-event-matches-key-specifier-p): Rename
from event-matches-key-specifier-p, define unconditionally.
* pcomplete.el (pcomplete-event-matches-key-specifier-p):
Rename from event-matches-key-specifier-p, define unconditionally.
(event-basic-type): Remove unused defalias.
(pcomplete-show-completions):
Use pcomplete-event-matches-key-specifier-p.
......
......@@ -83,10 +83,8 @@ to enable or disable Abbrev mode in the current buffer."
(defun kill-all-abbrevs ()
"Undefine all defined abbrevs."
(interactive)
(let ((tables abbrev-table-name-list))
(while tables
(clear-abbrev-table (symbol-value (car tables)))
(setq tables (cdr tables)))))
(dolist (tablesym abbrev-table-name-list)
(clear-abbrev-table (symbol-value tablesym))))
(defun copy-abbrev-table (table)
"Make a new abbrev-table with the same abbrevs as TABLE."
......@@ -106,10 +104,8 @@ Mark is set after the inserted text."
(interactive)
(push-mark
(save-excursion
(let ((tables abbrev-table-name-list))
(while tables
(insert-abbrev-table-description (car tables) t)
(setq tables (cdr tables))))
(dolist (tablesym abbrev-table-name-list)
(insert-abbrev-table-description tablesym t))
(point))))
(defun list-abbrevs (&optional local)
......@@ -131,18 +127,17 @@ Otherwise display all abbrevs."
found))
(defun prepare-abbrev-list-buffer (&optional local)
(save-excursion
(let ((table local-abbrev-table))
(set-buffer (get-buffer-create "*Abbrevs*"))
(erase-buffer)
(if local
(insert-abbrev-table-description (abbrev-table-name table) t)
(dolist (table abbrev-table-name-list)
(insert-abbrev-table-description table t)))
(goto-char (point-min))
(set-buffer-modified-p nil)
(edit-abbrevs-mode)
(current-buffer))))
(with-current-buffer (get-buffer-create "*Abbrevs*")
(erase-buffer)
(if local
(insert-abbrev-table-description
(abbrev-table-name local-abbrev-table) t)
(dolist (table abbrev-table-name-list)
(insert-abbrev-table-description table t)))
(goto-char (point-min))
(set-buffer-modified-p nil)
(edit-abbrevs-mode)
(current-buffer)))
(defun edit-abbrevs-mode ()
"Major mode for editing the list of abbrev definitions.
......@@ -524,8 +519,14 @@ the current abbrev table before abbrev lookup happens."
(defun clear-abbrev-table (table)
"Undefine all abbrevs in abbrev table TABLE, leaving it empty."
(setq abbrevs-changed t)
(dotimes (i (length table))
(aset table i 0)))
(let* ((sym (intern-soft "" table)))
(dotimes (i (length table))
(aset table i 0))
;; Preserve the table's properties.
(assert sym)
(intern sym table)
(abbrev-table-put table :abbrev-table-modiff
(1+ (abbrev-table-get table :abbrev-table-modiff)))))
(defun define-abbrev (table name expansion &optional hook &rest props)
"Define an abbrev in TABLE named NAME, to expand to EXPANSION and call HOOK.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment