;;; completion.el --- dynamic word-completion code
;; Copyright (C) 1990, 1993, 1995, 1997, 2001, 2002, 2003, 2004,
-;; 2005, 2006, 2007 Free Software Foundation, Inc.
+;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
;; Maintainer: FSF
;; Keywords: abbrev convenience
;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
+;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
(- 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
;; 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)))
(- 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
(- 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
(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