summaryrefslogtreecommitdiff
path: root/lisp/completion.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/completion.el')
-rw-r--r--lisp/completion.el32
1 files changed, 20 insertions, 12 deletions
diff --git a/lisp/completion.el b/lisp/completion.el
index 2180e2dace8..c2e9ac9493f 100644
--- a/lisp/completion.el
+++ b/lisp/completion.el
@@ -301,9 +301,9 @@ See also `save-completions-retention-time'."
(let ((olddef (convert-standard-filename "~/.completions")))
(cond
((file-readable-p olddef) olddef)
- ((file-directory-p (convert-standard-filename "~/.emacs.d/"))
+ ((file-directory-p user-emacs-directory)
(convert-standard-filename
- (expand-file-name "completions" "~/.emacs.d/")))
+ (expand-file-name "completions" user-emacs-directory)))
(t olddef)))
"The filename to save completions to."
:type 'file
@@ -568,7 +568,8 @@ But only if it is longer than `completion-min-length'."
(- cmpl-symbol-end cmpl-symbol-start))
(<= (- cmpl-symbol-end cmpl-symbol-start)
completion-max-length))
- (buffer-substring cmpl-symbol-start cmpl-symbol-end))))))
+ (buffer-substring-no-properties
+ cmpl-symbol-start cmpl-symbol-end))))))
;; tests for symbol-under-point
;; `^' indicates cursor pos. where value is returned
@@ -601,7 +602,8 @@ Returns nil if there isn't one longer than `completion-min-length'."
;; Return value if long enough.
(if (>= cmpl-symbol-end
(+ cmpl-symbol-start completion-min-length))
- (buffer-substring cmpl-symbol-start cmpl-symbol-end)))
+ (buffer-substring-no-properties
+ cmpl-symbol-start cmpl-symbol-end)))
((= cmpl-preceding-syntax ?w)
;; chars to ignore at end
(let ((saved-point (point)))
@@ -621,7 +623,8 @@ Returns nil if there isn't one longer than `completion-min-length'."
(- cmpl-symbol-end cmpl-symbol-start))
(<= (- cmpl-symbol-end cmpl-symbol-start)
completion-max-length))
- (buffer-substring cmpl-symbol-start cmpl-symbol-end)))))))
+ (buffer-substring-no-properties
+ cmpl-symbol-start cmpl-symbol-end)))))))
;; tests for symbol-before-point
;; `^' indicates cursor pos. where value is returned
@@ -670,7 +673,8 @@ Returns nil if there isn't one longer than `completion-min-length'."
(- cmpl-symbol-end cmpl-symbol-start))
(<= (- cmpl-symbol-end cmpl-symbol-start)
completion-max-length))
- (buffer-substring cmpl-symbol-start cmpl-symbol-end))))))
+ (buffer-substring-no-properties
+ cmpl-symbol-start cmpl-symbol-end))))))
;; tests for symbol-before-point-for-complete
;; `^' indicates cursor pos. where value is returned
@@ -2227,15 +2231,19 @@ Patched to remove the most recent completion."
(defun completion-separator-self-insert-command (arg)
(interactive "p")
- (use-completion-before-separator)
- (self-insert-command arg))
+ (if (command-remapping 'self-insert-command)
+ (funcall (command-remapping 'self-insert-command) arg)
+ (use-completion-before-separator)
+ (self-insert-command arg)))
(defun completion-separator-self-insert-autofilling (arg)
(interactive "p")
- (use-completion-before-separator)
- (self-insert-command arg)
- (and auto-fill-function
- (funcall auto-fill-function)))
+ (if (command-remapping 'self-insert-command)
+ (funcall (command-remapping 'self-insert-command) arg)
+ (use-completion-before-separator)
+ (self-insert-command arg)
+ (and auto-fill-function
+ (funcall auto-fill-function))))
;;-----------------------------------------------
;; Wrapping Macro