Mercurial > hg > xemacs-beta
diff lisp/prim/subr.el @ 72:b9518feda344 r20-0b31
Import from CVS: tag r20-0b31
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:03:46 +0200 |
parents | 131b0175ea99 |
children | c7528f8e288d |
line wrap: on
line diff
--- a/lisp/prim/subr.el Mon Aug 13 09:03:07 2007 +0200 +++ b/lisp/prim/subr.el Mon Aug 13 09:03:46 2007 +0200 @@ -17,11 +17,18 @@ ;; General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with XEmacs; see the file COPYING. If not, write to the -;; Free Software Foundation, 59 Temple Place - Suite 330, -;; Boston, MA 02111-1307, USA. +;; along with XEmacs; see the file COPYING. If not, write to the Free +;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +;; 02111-1307, USA. + +;;; Synched up with: FSF 19.34. -;;; Synched up with: FSF 19.30. +;;; Commentary: + +;; There's not a whole lot in common now with the FSF version, +;; be wary when applying differences. I've left in a number of lines +;; of commentary just to give diff(1) something to synch itself with to +;; provide useful context diffs. -sb ;;; Code: @@ -64,6 +71,26 @@ nil (define-function ,@args))) + +;;;; Keymap support. +;; XEmacs: removed to keymap.el + +;;;; The global keymap tree. + +;;; global-map, esc-map, and ctl-x-map have their values set up in +;;; keymap.c; we just give them docstrings here. + +;;;; Event manipulation functions. + +;; The call to `read' is to ensure that the value is computed at load time +;; and not compiled into the .elc file. The value is negative on most +;; machines, but not on all! +;; XEmacs: This stuff is done in C Code. + +;;;; Obsolescent names for functions. +;; XEmacs: not used. + +;; XEmacs: (define-function 'not 'null) (define-function-when-void 'numberp 'intergerp) ; different when floats @@ -77,6 +104,8 @@ ;;;; Hook manipulation functions. +;; (defconst run-hooks 'run-hooks ...) + (defun make-local-hook (hook) "Make the hook HOOK local to the current buffer. When a hook is local, its local and global values @@ -95,7 +124,7 @@ buffer. Do not use `make-local-variable' to make a hook variable buffer-local." - (if (local-variable-p hook (current-buffer)) + (if (local-variable-p hook (current-buffer)) ; XEmacs nil (or (boundp hook) (set hook nil)) (make-local-variable hook) @@ -117,7 +146,6 @@ HOOK should be a symbol, and FUNCTION may be any valid function. If HOOK is void, it is first set to nil. If HOOK's value is a single function, it is changed to a list of functions." - ;(interactive "SAdd to hook-var (symbol): \naAdd which function to %s? ") (or (boundp hook) (set hook nil)) (or (default-boundp hook) (set-default hook nil)) ;; If the hook value is a single function, turn it into a list. @@ -127,7 +155,7 @@ (if (or local ;; Detect the case where make-local-variable was used on a hook ;; and do what we used to do. - (and (local-variable-if-set-p hook (current-buffer)) + (and (local-variable-if-set-p hook (current-buffer)) ; XEmacs (not (memq t (symbol-value hook))))) ;; Alter the local value only. (or (if (consp function) @@ -185,6 +213,7 @@ (defun add-to-list (list-var element) "Add to the value of LIST-VAR the element ELEMENT if it isn't there yet. +The test for presence of ELEMENT is done with `equal'. If you want to use `add-to-list' on a variable that is not defined until a certain package is loaded, you should put the call to `add-to-list' into a hook function that will be run only after loading the package. @@ -193,6 +222,7 @@ (or (member element (symbol-value list-var)) (set list-var (cons element (symbol-value list-var))))) +;; XEmacs additions ;; called by Fkill_buffer() (defvar kill-buffer-hook nil "Function or functions to be called when a buffer is killed. @@ -208,6 +238,7 @@ (define-function 'rplaca 'setcar) (define-function 'rplacd 'setcdr) +;; XEmacs (defun mapvector (__function __seq) "Apply FUNCTION to each element of SEQ, making a vector of the results. The result is a vector of the same length as SEQ. @@ -224,6 +255,7 @@ ;;;; String functions. +;; XEmacs (defun replace-in-string (str regexp newtext &optional literal) "Replaces all matches in STR for REGEXP with NEWTEXT string. Optional LITERAL non-nil means do a literal replacement. @@ -547,3 +579,5 @@ (define-function 'set-match-data 'store-match-data) (define-function 'send-string-to-terminal 'external-debugging-output) (define-function 'buffer-string 'buffer-substring) + +;;; subr.el ends here