Klimi's new dotfiles with stow.
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

50 líneas
1.6 KiB

hace 5 años
  1. ;;; company-abbrev.el --- company-mode completion backend for abbrev
  2. ;; Copyright (C) 2009-2011, 2015 Free Software Foundation, Inc.
  3. ;; Author: Nikolaj Schumacher
  4. ;; This file is part of GNU Emacs.
  5. ;; GNU Emacs is free software: you can redistribute it and/or modify
  6. ;; it under the terms of the GNU General Public License as published by
  7. ;; the Free Software Foundation, either version 3 of the License, or
  8. ;; (at your option) any later version.
  9. ;; GNU Emacs is distributed in the hope that it will be useful,
  10. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. ;; GNU General Public License for more details.
  13. ;; You should have received a copy of the GNU General Public License
  14. ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
  15. ;;; Commentary:
  16. ;;
  17. ;;; Code:
  18. (require 'company)
  19. (require 'cl-lib)
  20. (require 'abbrev)
  21. (defun company-abbrev-insert (match)
  22. "Replace MATCH with the expanded abbrev."
  23. (expand-abbrev))
  24. ;;;###autoload
  25. (defun company-abbrev (command &optional arg &rest ignored)
  26. "`company-mode' completion backend for abbrev."
  27. (interactive (list 'interactive))
  28. (cl-case command
  29. (interactive (company-begin-backend 'company-abbrev
  30. 'company-abbrev-insert))
  31. (prefix (company-grab-symbol))
  32. (candidates (nconc
  33. (delete "" (all-completions arg global-abbrev-table))
  34. (delete "" (all-completions arg local-abbrev-table))))
  35. (meta (abbrev-expansion arg))))
  36. (provide 'company-abbrev)
  37. ;;; company-abbrev.el ends here