X-Git-Url: https://git.hcoop.net/bpt/emacs.git/blobdiff_plain/d52969e8afaa19ed1acc01f4ff0bb651bf7869a7..a383d0913e9e40ee895c8bf95c463df9170c6850:/lisp/hippie-exp.el diff --git a/lisp/hippie-exp.el b/lisp/hippie-exp.el index b67bcf1026..d3b8a2cf6c 100644 --- a/lisp/hippie-exp.el +++ b/lisp/hippie-exp.el @@ -1,10 +1,9 @@ ;;; hippie-exp.el --- expand text trying various ways to find its expansion -;; Copyright (C) 1992, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, -;; 2009, 2010, 2011 Free Software Foundation, Inc. +;; Copyright (C) 1992, 2001-2014 Free Software Foundation, Inc. ;; Author: Anders Holst -;; Last change: 3 March 1998 +;; Maintainer: emacs-devel@gnu.org ;; Version: 1.6 ;; Keywords: abbrev convenience @@ -157,7 +156,7 @@ ;; opposite situation to occur, that `hippie-expand' misses some ;; suggestion because it thinks it has already tried it. ;; -;; Acknowledgement +;; Acknowledgment ;; ;; I want to thank Mikael Djurfeldt in discussions with whom the idea ;; of this function took form. @@ -200,6 +199,7 @@ (defvar he-search-window ()) +;;; Autoloaded for historical reasons (bug#12982) ;;;###autoload (defcustom hippie-expand-try-functions-list '(try-complete-file-name-partially @@ -218,31 +218,26 @@ or insert functions in this list." :type '(repeat function) :group 'hippie-expand) -;;;###autoload (defcustom hippie-expand-verbose t "Non-nil makes `hippie-expand' output which function it is trying." :type 'boolean :group 'hippie-expand) -;;;###autoload (defcustom hippie-expand-dabbrev-skip-space nil "Non-nil means tolerate trailing spaces in the abbreviation to expand." :group 'hippie-expand :type 'boolean) -;;;###autoload (defcustom hippie-expand-dabbrev-as-symbol t "Non-nil means expand as symbols, i.e. syntax `_' is considered a letter." :group 'hippie-expand :type 'boolean) -;;;###autoload (defcustom hippie-expand-no-restriction t "Non-nil means that narrowed buffers are widened during search." :group 'hippie-expand :type 'boolean) -;;;###autoload (defcustom hippie-expand-max-buffers () "The maximum number of buffers (apart from the current) searched. If nil, all buffers are searched." @@ -250,15 +245,13 @@ If nil, all buffers are searched." integer) :group 'hippie-expand) -;;;###autoload -(defcustom hippie-expand-ignore-buffers (list (purecopy "^ \\*.*\\*$") 'dired-mode) +(defcustom hippie-expand-ignore-buffers '("^ \\*.*\\*$" dired-mode) "A list specifying which buffers not to search (if not current). Can contain both regexps matching buffer names (as strings) and major modes \(as atoms)" :type '(repeat (choice regexp (symbol :tag "Major Mode"))) :group 'hippie-expand) -;;;###autoload (defcustom hippie-expand-only-buffers () "A list specifying the only buffers to search (in addition to current). Can contain both regexps matching buffer names (as strings) and major modes @@ -303,7 +296,7 @@ undoes the expansion." (message "No further expansions found")) (ding)) (if (and hippie-expand-verbose - (not (window-minibuffer-p (selected-window)))) + (not (window-minibuffer-p))) (message "Using %s" (nth he-num hippie-expand-try-functions-list))))) (if (and (>= he-num 0) @@ -312,7 +305,7 @@ undoes the expansion." (setq he-num -1) (he-reset-string) (if (and hippie-expand-verbose - (not (window-minibuffer-p (selected-window)))) + (not (window-minibuffer-p))) (message "Undoing expansions")))))) ;; Initializes the region to expand (to between BEG and END). @@ -392,7 +385,7 @@ undoes the expansion." lst))) ;; Check if current buffer matches any atom or regexp in LST. -;; Atoms are interpreted as major modes, strings as regexps mathing the name. +;; Atoms are interpreted as major modes, strings as regexps matching the name. (defun he-buffer-member (lst) (or (memq major-mode lst) (progn @@ -722,7 +715,7 @@ string). It returns t if a new completion is found, nil otherwise." (defun he-line-search-regexp (pat strip-prompt) (if strip-prompt - (concat "\\(" comint-prompt-regexp "\\|^\\s-*\\)\\(" + (concat "\\(" comint-prompt-regexp "\\|^\\s-*\\)\\(?2:" (regexp-quote pat) "[^\n]*[^ \t\n]\\)") (concat "^\\(\\s-*\\)\\(" @@ -985,7 +978,7 @@ The argument OLD has to be nil the first call of this function, and t for subsequent calls (for further possible expansions of the same string). It returns t if a new expansion is found, nil otherwise." (let ((expansion ()) - (flag (if (frame-visible-p (window-frame (selected-window))) + (flag (if (frame-visible-p (window-frame)) 'visible t))) (unless old (he-init-string (he-dabbrev-beg) (point))