diff options
| author | Stefan Monnier | 2002-04-12 03:25:00 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2002-04-12 03:25:00 +0000 |
| commit | efcc2791fae2a2bf44ddb18b7a86d37dee7205ce (patch) | |
| tree | f0a5bf290459d72137fd316a2f7d2d3bb0a07b71 | |
| parent | 0c4a4faa07fcc94849de914296360d3f8cb8ead1 (diff) | |
| download | emacs-efcc2791fae2a2bf44ddb18b7a86d37dee7205ce.tar.gz emacs-efcc2791fae2a2bf44ddb18b7a86d37dee7205ce.zip | |
(device-class, buffer-syntactic-context)
(buffer-syntactic-context-depth): New funs.
| -rw-r--r-- | lisp/emacs-lisp/lucid.el | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/lucid.el b/lisp/emacs-lisp/lucid.el index edd7d6c6d04..1ec500326ff 100644 --- a/lisp/emacs-lisp/lucid.el +++ b/lisp/emacs-lisp/lucid.el | |||
| @@ -107,12 +107,43 @@ bottom of the buffer stack." | |||
| 107 | (list buf))) | 107 | (list buf))) |
| 108 | (buffer-list))))))) | 108 | (buffer-list))))))) |
| 109 | 109 | ||
| 110 | (defun device-class (&optional device) | ||
| 111 | "Return the class (color behavior) of DEVICE. | ||
| 112 | This will be one of 'color, 'grayscale, or 'mono. | ||
| 113 | This function exists for compatibility with XEmacs." | ||
| 114 | (cond | ||
| 115 | ((display-color-p device) 'color) | ||
| 116 | ((display-grayscale-p device) 'grayscale) | ||
| 117 | (t 'mono))) | ||
| 118 | |||
| 110 | (defalias 'find-face 'internal-find-face) | 119 | (defalias 'find-face 'internal-find-face) |
| 111 | (defalias 'get-face 'internal-get-face) | 120 | (defalias 'get-face 'internal-get-face) |
| 112 | (defalias 'try-face-font 'internal-try-face-font) | 121 | (defalias 'try-face-font 'internal-try-face-font) |
| 113 | 122 | ||
| 114 | (defalias 'exec-to-string 'shell-command-to-string) | 123 | (defalias 'exec-to-string 'shell-command-to-string) |
| 115 | 124 | ||
| 125 | |||
| 126 | ;; Buffer context | ||
| 127 | |||
| 128 | (defun buffer-syntactic-context (&optional buffer) | ||
| 129 | "Syntactic context at point in BUFFER. | ||
| 130 | Either of `string', `comment' or `nil'. | ||
| 131 | This is an XEmacs compatibility function." | ||
| 132 | (with-current-buffer (or buffer (current-buffer)) | ||
| 133 | (let ((state (syntax-ppss (point)))) | ||
| 134 | (cond | ||
| 135 | ((nth 3 state) 'string) | ||
| 136 | ((nth 4 state) 'comment))))) | ||
| 137 | |||
| 138 | |||
| 139 | (defun buffer-syntactic-context-depth (&optional buffer) | ||
| 140 | "Syntactic parenthesis depth at point in BUFFER. | ||
| 141 | This is an XEmacs compatibility function." | ||
| 142 | (with-current-buffer (or buffer (current-buffer)) | ||
| 143 | (nth 0 (syntax-ppss (point))))) | ||
| 144 | |||
| 145 | |||
| 146 | ;; Extents | ||
| 116 | (defun make-extent (beg end &optional buffer) | 147 | (defun make-extent (beg end &optional buffer) |
| 117 | (make-overlay beg end buffer)) | 148 | (make-overlay beg end buffer)) |
| 118 | 149 | ||