2001-07-15 19:53:53 +00:00
|
|
|
|
;;; lucid.el --- emulate some Lucid Emacs functions
|
1996-01-14 07:34:30 +00:00
|
|
|
|
|
2015-01-01 14:26:41 -08:00
|
|
|
|
;; Copyright (C) 1993, 1995, 2001-2015 Free Software Foundation, Inc.
|
1993-04-08 06:57:54 +00:00
|
|
|
|
|
2014-02-09 17:34:22 -08:00
|
|
|
|
;; Maintainer: emacs-devel@gnu.org
|
2001-09-04 12:54:14 +00:00
|
|
|
|
;; Keywords: emulations
|
2009-11-05 21:17:21 +00:00
|
|
|
|
;; Obsolete-since: 23.2
|
2001-08-06 09:59:02 +00:00
|
|
|
|
|
1993-04-08 06:57:54 +00:00
|
|
|
|
;; This file is part of GNU Emacs.
|
|
|
|
|
|
2008-05-06 03:21:21 +00:00
|
|
|
|
;; GNU Emacs is free software: you can redistribute it and/or modify
|
1993-04-08 06:57:54 +00:00
|
|
|
|
;; it under the terms of the GNU General Public License as published by
|
2008-05-06 03:21:21 +00:00
|
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
;; (at your option) any later version.
|
1993-04-08 06:57:54 +00:00
|
|
|
|
|
|
|
|
|
;; GNU Emacs is distributed in the hope that it will be useful,
|
|
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
;; GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
2008-05-06 03:21:21 +00:00
|
|
|
|
;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
|
1993-04-08 06:57:54 +00:00
|
|
|
|
|
2001-07-15 19:53:53 +00:00
|
|
|
|
;;; Commentary:
|
|
|
|
|
|
1996-01-14 07:34:30 +00:00
|
|
|
|
;;; Code:
|
1993-04-08 06:57:54 +00:00
|
|
|
|
|
2000-07-05 22:07:21 +00:00
|
|
|
|
;; XEmacs autoloads CL so we might as well make use of it.
|
|
|
|
|
(require 'cl)
|
1993-03-09 23:40:36 +00:00
|
|
|
|
|
1993-04-23 06:51:44 +00:00
|
|
|
|
(defalias 'current-time-seconds 'current-time)
|
1993-03-09 23:40:36 +00:00
|
|
|
|
|
1993-03-15 20:40:34 +00:00
|
|
|
|
(defun real-path-name (name &optional default)
|
|
|
|
|
(file-truename (expand-file-name name default)))
|
|
|
|
|
|
|
|
|
|
;; It's not clear what to return if the mouse is not in FRAME.
|
|
|
|
|
(defun read-mouse-position (frame)
|
|
|
|
|
(let ((pos (mouse-position)))
|
|
|
|
|
(if (eq (car pos) frame)
|
|
|
|
|
(cdr pos))))
|
|
|
|
|
|
|
|
|
|
(defun switch-to-other-buffer (arg)
|
|
|
|
|
"Switch to the previous buffer.
|
|
|
|
|
With a numeric arg N, switch to the Nth most recent buffer.
|
|
|
|
|
With an arg of 0, buries the current buffer at the
|
|
|
|
|
bottom of the buffer stack."
|
|
|
|
|
(interactive "p")
|
|
|
|
|
(if (eq arg 0)
|
|
|
|
|
(bury-buffer (current-buffer)))
|
|
|
|
|
(switch-to-buffer
|
|
|
|
|
(if (<= arg 1) (other-buffer (current-buffer))
|
1994-11-17 16:01:49 +00:00
|
|
|
|
(nth arg
|
1993-05-03 03:37:47 +00:00
|
|
|
|
(apply 'nconc
|
|
|
|
|
(mapcar
|
|
|
|
|
(lambda (buf)
|
1993-05-24 02:12:13 +00:00
|
|
|
|
(if (= ?\ (string-to-char (buffer-name buf)))
|
1993-05-03 03:37:47 +00:00
|
|
|
|
nil
|
1993-05-24 02:12:13 +00:00
|
|
|
|
(list buf)))
|
|
|
|
|
(buffer-list)))))))
|
1993-03-27 18:01:28 +00:00
|
|
|
|
|
2002-04-12 03:25:00 +00:00
|
|
|
|
(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)))
|
|
|
|
|
|
Remove some functions, variables and aliases obsolete since at least 21.1.
* doc/misc/misc.texi (Shell Mode): Remove reference to old function name.
* src/character.c (Fchar_bytes): Remove obsolete function.
(syms_of_character): Remove Schar_bytes.
* lisp/subr.el (char-bytes): Remove obsolete function.
* lisp/emacs-lisp/checkdoc.el (checkdoc-minor-keymap): Remove obsolete alias.
* lisp/isearch.el (isearch-return-char): Remove obsolete function.
* lisp/mouse.el: No longer provide mldrag.
(mldrag-drag-mode-line, mldrag-drag-vertical-line):
Remove obsolete aliases.
* lisp/comint.el (comint-kill-output): Remove obsolete alias.
* lisp/shell.el: Comment fix.
* lisp/composite.el (decompose-composite-char): Remove obsolete function.
* lisp/ps-def.el (decompose-composite-char): Remove unused function.
* lisp/iswitchb.el (iswitchb-default-keybindings): Remove obsolete function.
* lisp/outline.el (outline-visible): Remove obsolete function.
* lisp/term/pc-win.el (x-frob-font-slant, x-frob-font-weight):
* lisp/faces.el (internal-find-face, internal-get-face)
(frame-update-faces, frame-update-face-colors)
(x-frob-font-weight, x-frob-font-slant)
(internal-frob-font-weight, internal-frob-font-slant)
(x-make-font-bold, x-make-font-demibold, x-make-font-unbold)
(x-make-font-italic, x-make-font-oblique, x-make-font-unitalic)
(x-make-font-bold-italic): Remove functions and aliases, obsolete
since Emacs 21.1.
* lisp/emulation/viper-util.el (viper-get-face):
* lisp/obsolete/lucid.el (find-face, get-face): Use facep.
* lisp/vc/ediff-init.el (ediff-valid-color-p, ediff-get-face):
Remove unused functions.
* lisp/vc/ediff-util.el (ediff-submit-report): Doc fix.
* etc/NEWS: Mention above changes.
2010-10-01 19:46:13 -07:00
|
|
|
|
(defalias 'find-face 'facep)
|
|
|
|
|
(defalias 'get-face 'facep)
|
2008-09-02 02:43:52 +00:00
|
|
|
|
;; internal-try-face-font was removed from faces.el in rev 1.139, 1999/07/21.
|
|
|
|
|
;;;(defalias 'try-face-font 'internal-try-face-font)
|
1996-09-26 07:48:03 +00:00
|
|
|
|
|
|
|
|
|
(defalias 'exec-to-string 'shell-command-to-string)
|
1993-03-15 20:40:34 +00:00
|
|
|
|
|
2002-04-12 03:25:00 +00:00
|
|
|
|
|
|
|
|
|
;; Buffer context
|
|
|
|
|
|
|
|
|
|
(defun buffer-syntactic-context (&optional buffer)
|
|
|
|
|
"Syntactic context at point in BUFFER.
|
2003-05-06 17:48:39 +00:00
|
|
|
|
Either of `string', `comment' or nil.
|
2002-04-12 03:25:00 +00:00
|
|
|
|
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
|
1995-01-30 07:16:14 +00:00
|
|
|
|
(defun make-extent (beg end &optional buffer)
|
|
|
|
|
(make-overlay beg end buffer))
|
|
|
|
|
|
2000-07-05 22:07:21 +00:00
|
|
|
|
(defun extent-properties (extent) (overlay-properties extent))
|
|
|
|
|
(unless (fboundp 'extent-property) (defalias 'extent-property 'overlay-get))
|
1997-08-13 19:39:39 +00:00
|
|
|
|
|
|
|
|
|
(defun extent-at (pos &optional object property before)
|
|
|
|
|
(with-current-buffer (or object (current-buffer))
|
2014-04-15 09:21:18 -04:00
|
|
|
|
(let ((overlays (overlays-at pos 'sorted)))
|
1997-08-13 19:39:39 +00:00
|
|
|
|
(when property
|
|
|
|
|
(let (filtered)
|
|
|
|
|
(while overlays
|
|
|
|
|
(if (overlay-get (car overlays) property)
|
|
|
|
|
(setq filtered (cons (car overlays) filtered)))
|
|
|
|
|
(setq overlays (cdr overlays)))
|
|
|
|
|
(setq overlays filtered)))
|
|
|
|
|
(if before
|
|
|
|
|
(nth 1 (memq before overlays))
|
|
|
|
|
(car overlays)))))
|
|
|
|
|
|
1995-01-30 07:16:14 +00:00
|
|
|
|
(defun set-extent-property (extent prop value)
|
1997-08-12 17:22:41 +00:00
|
|
|
|
;; Make sure that separate adjacent extents
|
|
|
|
|
;; with the same mouse-face value
|
|
|
|
|
;; do not run together as one extent.
|
|
|
|
|
(and (eq prop 'mouse-face)
|
|
|
|
|
(symbolp value)
|
|
|
|
|
(setq value (list value)))
|
1995-01-30 07:16:14 +00:00
|
|
|
|
(if (eq prop 'duplicable)
|
|
|
|
|
(cond ((and value (not (overlay-get extent prop)))
|
|
|
|
|
;; If becoming duplicable, copy all overlayprops to text props.
|
|
|
|
|
(add-text-properties (overlay-start extent)
|
|
|
|
|
(overlay-end extent)
|
|
|
|
|
(overlay-properties extent)
|
|
|
|
|
(overlay-buffer extent)))
|
|
|
|
|
;; If becoming no longer duplicable, remove these text props.
|
|
|
|
|
((and (not value) (overlay-get extent prop))
|
|
|
|
|
(remove-text-properties (overlay-start extent)
|
|
|
|
|
(overlay-end extent)
|
|
|
|
|
(overlay-properties extent)
|
|
|
|
|
(overlay-buffer extent))))
|
|
|
|
|
;; If extent is already duplicable, put this property
|
|
|
|
|
;; on the text as well as on the overlay.
|
|
|
|
|
(if (overlay-get extent 'duplicable)
|
|
|
|
|
(put-text-property (overlay-start extent)
|
|
|
|
|
(overlay-end extent)
|
|
|
|
|
prop value (overlay-buffer extent))))
|
|
|
|
|
(overlay-put extent prop value))
|
|
|
|
|
|
|
|
|
|
(defun set-extent-face (extent face)
|
|
|
|
|
(set-extent-property extent 'face face))
|
|
|
|
|
|
2000-07-05 22:07:21 +00:00
|
|
|
|
(defun set-extent-end-glyph (extent glyph)
|
|
|
|
|
(set-extent-property extent 'after-string glyph))
|
|
|
|
|
|
1995-01-30 07:16:14 +00:00
|
|
|
|
(defun delete-extent (extent)
|
|
|
|
|
(set-extent-property extent 'duplicable nil)
|
|
|
|
|
(delete-overlay extent))
|
|
|
|
|
|
1993-03-15 20:40:34 +00:00
|
|
|
|
;; Support the Lucid names with `screen' instead of `frame'.
|
|
|
|
|
|
1993-04-23 06:51:44 +00:00
|
|
|
|
(defalias 'current-screen-configuration 'current-frame-configuration)
|
|
|
|
|
(defalias 'delete-screen 'delete-frame)
|
|
|
|
|
(defalias 'find-file-new-screen 'find-file-other-frame)
|
|
|
|
|
(defalias 'find-file-read-only-new-screen 'find-file-read-only-other-frame)
|
|
|
|
|
(defalias 'find-tag-new-screen 'find-tag-other-frame)
|
|
|
|
|
;;(defalias 'focus-screen 'focus-frame)
|
|
|
|
|
(defalias 'iconify-screen 'iconify-frame)
|
|
|
|
|
(defalias 'mail-new-screen 'mail-other-frame)
|
|
|
|
|
(defalias 'make-screen-invisible 'make-frame-invisible)
|
|
|
|
|
(defalias 'make-screen-visible 'make-frame-visible)
|
|
|
|
|
;; (defalias 'minibuffer-screen-list 'minibuffer-frame-list)
|
|
|
|
|
(defalias 'modify-screen-parameters 'modify-frame-parameters)
|
|
|
|
|
(defalias 'next-screen 'next-frame)
|
|
|
|
|
;; (defalias 'next-multiscreen-window 'next-multiframe-window)
|
|
|
|
|
;; (defalias 'previous-multiscreen-window 'previous-multiframe-window)
|
|
|
|
|
;; (defalias 'redirect-screen-focus 'redirect-frame-focus)
|
|
|
|
|
(defalias 'redraw-screen 'redraw-frame)
|
|
|
|
|
;; (defalias 'screen-char-height 'frame-char-height)
|
|
|
|
|
;; (defalias 'screen-char-width 'frame-char-width)
|
|
|
|
|
;; (defalias 'screen-configuration-to-register 'frame-configuration-to-register)
|
|
|
|
|
;; (defalias 'screen-focus 'frame-focus)
|
|
|
|
|
(defalias 'screen-list 'frame-list)
|
|
|
|
|
;; (defalias 'screen-live-p 'frame-live-p)
|
|
|
|
|
(defalias 'screen-parameters 'frame-parameters)
|
|
|
|
|
(defalias 'screen-pixel-height 'frame-pixel-height)
|
|
|
|
|
(defalias 'screen-pixel-width 'frame-pixel-width)
|
|
|
|
|
(defalias 'screen-root-window 'frame-root-window)
|
|
|
|
|
(defalias 'screen-selected-window 'frame-selected-window)
|
|
|
|
|
(defalias 'lower-screen 'lower-frame)
|
|
|
|
|
(defalias 'raise-screen 'raise-frame)
|
|
|
|
|
(defalias 'screen-visible-p 'frame-visible-p)
|
|
|
|
|
(defalias 'screenp 'framep)
|
|
|
|
|
(defalias 'select-screen 'select-frame)
|
|
|
|
|
(defalias 'selected-screen 'selected-frame)
|
|
|
|
|
;; (defalias 'set-screen-configuration 'set-frame-configuration)
|
|
|
|
|
;; (defalias 'set-screen-height 'set-frame-height)
|
|
|
|
|
(defalias 'set-screen-position 'set-frame-position)
|
|
|
|
|
(defalias 'set-screen-size 'set-frame-size)
|
1993-05-03 03:37:47 +00:00
|
|
|
|
;; (defalias 'set-screen-width 'set-frame-width)
|
1993-04-23 06:51:44 +00:00
|
|
|
|
(defalias 'switch-to-buffer-new-screen 'switch-to-buffer-other-frame)
|
|
|
|
|
;; (defalias 'unfocus-screen 'unfocus-frame)
|
|
|
|
|
(defalias 'visible-screen-list 'visible-frame-list)
|
|
|
|
|
(defalias 'window-screen 'window-frame)
|
|
|
|
|
(defalias 'x-create-screen 'x-create-frame)
|
1994-05-06 20:29:42 +00:00
|
|
|
|
(defalias 'x-new-screen 'make-frame)
|
1993-04-08 06:57:54 +00:00
|
|
|
|
|
1993-05-03 03:37:47 +00:00
|
|
|
|
(provide 'lucid)
|
|
|
|
|
|
2010-11-10 19:54:59 -08:00
|
|
|
|
;; Local Variables:
|
|
|
|
|
;; byte-compile-warnings: (not cl-functions)
|
|
|
|
|
;; End:
|
|
|
|
|
|
2001-07-15 19:53:53 +00:00
|
|
|
|
;;; lucid.el ends here
|