X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/2f12b713116a4e15b4744fc78d5f0dbb57fcd1ca..2b96868715a33d5c1bfbd03e961a222076398722:/lisp/completion.el?ds=sidebyside diff --git a/lisp/completion.el b/lisp/completion.el index 99d559df96..6a5c06a62b 100644 --- a/lisp/completion.el +++ b/lisp/completion.el @@ -1,7 +1,7 @@ ;;; 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 @@ -10,10 +10,10 @@ ;; This file is part of GNU Emacs. -;; GNU Emacs is free software; you can redistribute it and/or modify +;; 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 3, or (at your option) -;; any later version. +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. ;; GNU Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -21,9 +21,7 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs; see the file COPYING. If not, write to the -;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -;; Boston, MA 02110-1301, USA. +;; along with GNU Emacs. If not, see . ;;; Commentary: @@ -568,7 +566,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 +600,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 +621,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 +671,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 +2229,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