diff options
| author | David Aspinall | 2009-05-27 08:34:31 +0000 |
|---|---|---|
| committer | David Aspinall | 2009-05-27 08:34:31 +0000 |
| commit | 21e826b7cc3076364d72f6d4e453d4ffffed0982 (patch) | |
| tree | 2a7e021047d29b756857c5b10b013609bbb5f690 | |
| parent | e3016def0716977cb6a147c6b852e474eb1d69d1 (diff) | |
Cleanup more Emacs compatibility
| -rw-r--r-- | coq/coq.el | 12 | ||||
| -rw-r--r-- | generic/proof-shell.el | 11 | ||||
| -rw-r--r-- | lib/proof-compat.el | 1 |
3 files changed, 10 insertions, 14 deletions
@@ -668,21 +668,11 @@ happen since one of them is necessarily set to t in coq-syntax.el." ) ) - -;; region-exists-p does not exist in some emacs -(cond - ((not (featurep 'region-exists-p)) - (defmacro region-exists-p nil - "Returns t if the mark is active, nil otherwise." - `(not (eq mark-active nil))))) - - - (defun coq-guess-or-ask-for-string (s &optional dontguess) (let ((guess (cond (dontguess nil) - ((region-exists-p) + ((not (eq mark-active nil)) ; region exists (buffer-substring-no-properties (region-beginning) (region-end))) ((fboundp 'symbol-near-point) (symbol-near-point)) ((fboundp 'symbol-at-point) (symbol-at-point))))) diff --git a/generic/proof-shell.el b/generic/proof-shell.el index 43ca29d9..51bb15d1 100644 --- a/generic/proof-shell.el +++ b/generic/proof-shell.el @@ -265,20 +265,25 @@ Does nothing if proof assistant is already running." ;; end-of-line conversion (hence `raw-text'). ;; It is also the only sensible choice since we make the buffer ;; unibyte below. + ;; ;; Update: there are problems here with systems where ;; i) coding-system-for-read/write is not available ;; (e.g. MacOS XEmacs non-mule) ;; ii) 'rawtext can give wrong behaviour anyway ;; (e.g. Mac OS GNU Emacs, maybe Windows) ;; probably because of line-feed conversion. + ;; + ;; Update: much more info now in Elisp manual and recommendations + ;; for sub processes. (normal-coding-system-for-read (and (boundp 'coding-system-for-read) coding-system-for-read)) (coding-system-for-read (if proof-shell-unicode - (if (find-coding-system 'utf-8) - 'utf-8 - normal-coding-system-for-read) + (or (condition-case nil + (check-coding-system 'utf-8) + (error nil)) + normal-coding-system-for-read) (if (string-match "Linux" (shell-command-to-string "uname")) diff --git a/lib/proof-compat.el b/lib/proof-compat.el index 027bdfce..ef97213c 100644 --- a/lib/proof-compat.el +++ b/lib/proof-compat.el @@ -213,6 +213,7 @@ The value returned is the value of the last form in BODY." (error nil)))) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;;; A naughty hack to completion.el |
