Fix issue 169

This commit is contained in:
capitaomorte 2011-05-07 20:40:40 +00:00
parent 9cdcd3e218
commit 0a22a2bb63

View File

@ -826,7 +826,7 @@ Key bindings:
`yas/minor-mode-on' is usually called by `yas/global-mode' so `yas/minor-mode-on' is usually called by `yas/global-mode' so
this effectively lets you define exceptions to the \"global\" this effectively lets you define exceptions to the \"global\"
behaviour.") behaviour. Can also be a function of zero arguments.")
(make-variable-buffer-local 'yas/dont-activate) (make-variable-buffer-local 'yas/dont-activate)
(defun yas/minor-mode-on () (defun yas/minor-mode-on ()
@ -837,7 +837,7 @@ Do this unless `yas/dont-activate' is t "
(unless (or (minibufferp) (unless (or (minibufferp)
(and (functionp yas/dont-activate) (and (functionp yas/dont-activate)
(funcall yas/dont-activate)) (funcall yas/dont-activate))
(and (not (functionp yas/dont-activate)) (and (boundp yas/dont-activate)
yas/dont-activate)) yas/dont-activate))
;; Load all snippets definitions unless we still don't have a ;; Load all snippets definitions unless we still don't have a
;; root-directory or some snippets have already been loaded. ;; root-directory or some snippets have already been loaded.
@ -4237,9 +4237,16 @@ Remaining args as in `yas/expand-snippet'."
;;; Some hacks: ;;; Some hacks:
;; `locate-dominating-file' is added for compatibility in emacs < 23 ;;;
(unless (or (eq emacs-major-version 23) ;; `locate-dominating-file'
(fboundp 'locate-dominating-file)) ;; `region-active-p'
;;
;; added for compatibility in emacs < 23
(unless (>= emacs-major-version 23)
(unless (fboundp 'region-active-p)
(defun region-active-p () (and transient-mark-mode mark-active)))
(unless (fboundp 'locate-dominating-file)
(defvar locate-dominating-stop-dir-regexp (defvar locate-dominating-stop-dir-regexp
"\\`\\(?:[\\/][\\/][^\\/]+[\\/]\\|/\\(?:net\\|afs\\|\\.\\.\\.\\)/\\)\\'" "\\`\\(?:[\\/][\\/][^\\/]+[\\/]\\|/\\(?:net\\|afs\\|\\.\\.\\.\\)/\\)\\'"
"Regexp of directory names which stop the search in `locate-dominating-file'. "Regexp of directory names which stop the search in `locate-dominating-file'.
@ -4287,7 +4294,7 @@ and return the directory. Return nil if not found."
file (file-name-directory file (file-name-directory
(directory-file-name file)))) (directory-file-name file))))
(setq file nil)))) (setq file nil))))
root))) root))))
;; `c-neutralize-syntax-in-CPP` sometimes fires "End of Buffer" error ;; `c-neutralize-syntax-in-CPP` sometimes fires "End of Buffer" error
;; (when it execute forward-char) and interrupt the after change ;; (when it execute forward-char) and interrupt the after change