diff options
| author | Daniel Mendler <mail@daniel-mendler.de> | 2023-08-20 18:05:26 +0200 |
|---|---|---|
| committer | Daniel Mendler <mail@daniel-mendler.de> | 2023-08-20 18:05:26 +0200 |
| commit | 9481eafadfbef9029d7a9c4ba387830a448e4c83 (patch) | |
| tree | 314fe71848c72d332cefe25ef96a8958f1f07498 /cape.el | |
| parent | 52ffb25a78a74c14d7f5819ba12bb9244c181894 (diff) | |
Rename cape-symbol to cape-elisp-symbol
Stefan Monnier had recommended that a while ago. While Elisp symbols are
commonly referred to as symbols in Emacs, we reduce confusion that way. Cape
also provides `cape-elisp-block', such that the renaming improves consistency.
Diffstat (limited to 'cape.el')
| -rw-r--r-- | cape.el | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -35,7 +35,7 @@ ;; `cape-file': Complete file name ;; `cape-history': Complete from Eshell, Comint or minibuffer history ;; `cape-keyword': Complete programming language keyword -;; `cape-symbol': Complete Elisp symbol +;; `cape-elisp-symbol': Complete Elisp symbol ;; `cape-abbrev': Complete abbreviation (add-global-abbrev, add-mode-abbrev) ;; `cape-dict': Complete word from dictionary file ;; `cape-line': Complete entire line from file @@ -119,7 +119,7 @@ The buffers are scanned for completion candidates by `cape-line'." (const :tag "Buffers with same major mode" cape--buffers-major-mode) (function :tag "Custom function"))) -(defcustom cape-symbol-wrapper +(defcustom cape-elisp-symbol-wrapper '((org-mode ?= ?=) (markdown-mode ?` ?`) (rst-mode "``" "``") @@ -404,7 +404,7 @@ If INTERACTIVE is nil the function acts like a Capf." '(:company-prefix-length t)) ,@cape--file-properties))))) -;;;;; cape-symbol +;;;;; cape-elisp-symbol (defvar cape--symbol-properties (append @@ -421,17 +421,17 @@ If INTERACTIVE is nil the function acts like a Capf." :company-doc-buffer 'elisp--company-doc-buffer :company-docsig 'elisp--company-doc-string :company-location 'elisp--company-location))) - "Completion extra properties for `cape-symbol'.") + "Completion extra properties for `cape-elisp-symbol'.") (defun cape--symbol-predicate (sym) "Return t if SYM is bound, fbound or propertized." (or (fboundp sym) (boundp sym) (symbol-plist sym))) (defun cape--symbol-exit (name status) - "Wrap symbol NAME with `cape-symbol-wrapper' buffers. + "Wrap symbol NAME with `cape-elisp-symbol-wrapper' buffers. STATUS is the exit status." (when-let (((not (eq status 'exact))) - (c (cl-loop for (m . c) in cape-symbol-wrapper + (c (cl-loop for (m . c) in cape-elisp-symbol-wrapper if (derived-mode-p m) return c))) (save-excursion (backward-char (length name)) @@ -453,14 +453,14 @@ STATUS is the exit status." (t " Symbol"))) ;;;###autoload -(defun cape-symbol (&optional interactive) +(defun cape-elisp-symbol (&optional interactive) "Complete Elisp symbol at point. If INTERACTIVE is nil the function acts like a Capf." (interactive (list t)) (if interactive ;; No cycling since it breaks the :exit-function. (let (completion-cycle-threshold) - (cape-interactive #'cape-symbol)) + (cape-interactive #'cape-elisp-symbol)) (pcase-let ((`(,beg . ,end) (cape--bounds 'symbol))) (when (eq (char-after beg) ?') (setq beg (1+ beg) end (max beg end))) |
