X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/5e2dfaa48edd8fc566892fd3e72baa50a7dbe2b4..b88a41d0064828aab6c75d7a8c6f543022fa5dd5:/lisp/emacs-lisp/lucid.el diff --git a/lisp/emacs-lisp/lucid.el b/lisp/emacs-lisp/lucid.el index 11a246b0ea..80e5ef330d 100644 --- a/lisp/emacs-lisp/lucid.el +++ b/lisp/emacs-lisp/lucid.el @@ -1,6 +1,9 @@ -;;; lucid.el --- Emulate some Lucid Emacs functions. +;;; lucid.el --- emulate some Lucid Emacs functions -;; Copyright (C) 1993, 1995 Free Software Foundation, Inc. +;; Copyright (C) 1993, 1995, 2001 Free Software Foundation, Inc. + +;; Maintainer: FSF +;; Keywords: emulations ;; This file is part of GNU Emacs. @@ -19,6 +22,8 @@ ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. +;;; Commentary: + ;;; Code: ;; XEmacs autoloads CL so we might as well make use of it. @@ -26,6 +31,9 @@ (defalias 'current-time-seconds 'current-time) +;; In case cl-map-keymap is an alias for map-keymap, avoid circular calls. +(fset 'cl-map-keymap (indirect-function 'cl-map-keymap)) + (defun map-keymap (function keymap &optional sort-first) "Call FUNCTION for every binding in KEYMAP. This does not include bindings inherited from a parent keymap. @@ -102,12 +110,43 @@ bottom of the buffer stack." (list buf))) (buffer-list))))))) +(defun device-class (&optional device) + "Return the class (color behavior) of DEVICE. +This will be one of 'color, 'grayscale, or 'mono. +This function exists for compatibility with XEmacs." + (cond + ((display-color-p device) 'color) + ((display-grayscale-p device) 'grayscale) + (t 'mono))) + (defalias 'find-face 'internal-find-face) (defalias 'get-face 'internal-get-face) (defalias 'try-face-font 'internal-try-face-font) (defalias 'exec-to-string 'shell-command-to-string) + +;; Buffer context + +(defun buffer-syntactic-context (&optional buffer) + "Syntactic context at point in BUFFER. +Either of `string', `comment' or nil. +This is an XEmacs compatibility function." + (with-current-buffer (or buffer (current-buffer)) + (let ((state (syntax-ppss (point)))) + (cond + ((nth 3 state) 'string) + ((nth 4 state) 'comment))))) + + +(defun buffer-syntactic-context-depth (&optional buffer) + "Syntactic parenthesis depth at point in BUFFER. +This is an XEmacs compatibility function." + (with-current-buffer (or buffer (current-buffer)) + (nth 0 (syntax-ppss (point))))) + + +;; Extents (defun make-extent (beg end &optional buffer) (make-overlay beg end buffer)) @@ -224,4 +263,5 @@ bottom of the buffer stack." (provide 'lucid) -;;; end of lucid.el +;;; arch-tag: 80f9ab46-0b36-4151-86ed-3edb6d449c9e +;;; lucid.el ends here