]> code.delx.au - gnu-emacs/blobdiff - lisp/completion.el
Merge from emacs--rel--22
[gnu-emacs] / lisp / completion.el
index c9e27ab30913d8ccf240bd1237dc5aa73b78f4b3..c2e9ac9493f74bde012d483949d4e700ca0e9700 100644 (file)
@@ -12,7 +12,7 @@
 
 ;; 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,
@@ -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