Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
947b6566
Commit
947b6566
authored
Mar 28, 2011
by
Leo Liu
Browse files
Place empty abbrev tables after nonempty ones when editing
parent
1db5b1ad
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
2 deletions
+26
-2
lisp/ChangeLog
lisp/ChangeLog
+6
-0
lisp/abbrev.el
lisp/abbrev.el
+20
-2
No files found.
lisp/ChangeLog
View file @
947b6566
2011-03-28 Leo Liu <sdl.web@gmail.com>
* abbrev.el (abbrev-table-empty-p): New function.
(prepare-abbrev-list-buffer): Place empty abbrev tables after
nonempty ones. (Bug#5937)
2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
* cus-start.el (all): Add boolean ns-auto-hide-menu-bar.
...
...
lisp/abbrev.el
View file @
947b6566
...
...
@@ -123,8 +123,13 @@ Otherwise display all abbrevs."
(
if
local
(
insert-abbrev-table-description
(
abbrev-table-name
local-table
)
t
)
(
dolist
(
table
abbrev-table-name-list
)
(
insert-abbrev-table-description
table
t
)))
(
let
(
empty-tables
)
(
dolist
(
table
abbrev-table-name-list
)
(
if
(
abbrev-table-empty-p
(
symbol-value
table
))
(
push
table
empty-tables
)
(
insert-abbrev-table-description
table
t
)))
(
dolist
(
table
(
nreverse
empty-tables
))
(
insert-abbrev-table-description
table
t
))))
(
goto-char
(
point-min
))
(
set-buffer-modified-p
nil
)
(
edit-abbrevs-mode
)
...
...
@@ -420,6 +425,19 @@ PROPS is a list of properties."
(
and
(
vectorp
object
)
(
numberp
(
abbrev-table-get
object
:abbrev-table-modiff
))))
(
defun
abbrev-table-empty-p
(
object
&optional
ignore-system
)
"Return nil if there are no abbrev symbols in OBJECT.
If IGNORE-SYSTEM is non-nil, system definitions are ignored."
(
unless
(
abbrev-table-p
object
)
(
error
"Non abbrev table object"
))
(
not
(
catch
'some
(
mapatoms
(
lambda
(
abbrev
)
(
unless
(
or
(
zerop
(
length
(
symbol-name
abbrev
)))
(
and
ignore-system
(
abbrev-get
abbrev
:system
)))
(
throw
'some
t
)))
object
))))
(
defvar
global-abbrev-table
(
make-abbrev-table
)
"The abbrev table whose abbrevs affect all buffers.
Each buffer may also have a local abbrev table.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment