comparison lisp/subr.el @ 56537:69db3634588e

(butlast, event-modifiers, event-basic-type): Doc fixes.
author John Paul Wallington <jpw@pobox.com>
date Sun, 25 Jul 2004 05:45:13 +0000
parents 78189fca7611
children 1bef61b14e78 4e92102a0172 c08afac24467
comparison
equal deleted inserted replaced
56536:0052eaa23782 56537:69db3634588e
196 (while (consp (cdr list)) 196 (while (consp (cdr list))
197 (setq list (cdr list))) 197 (setq list (cdr list)))
198 list)) 198 list))
199 199
200 (defun butlast (list &optional n) 200 (defun butlast (list &optional n)
201 "Returns a copy of LIST with the last N elements removed." 201 "Return a copy of LIST with the last N elements removed."
202 (if (and n (<= n 0)) list 202 (if (and n (<= n 0)) list
203 (nbutlast (copy-sequence list) n))) 203 (nbutlast (copy-sequence list) n)))
204 204
205 (defun nbutlast (list &optional n) 205 (defun nbutlast (list &optional n)
206 "Modifies LIST to remove the last N elements." 206 "Modifies LIST to remove the last N elements."
639 (and (consp obj) 639 (and (consp obj)
640 (symbolp (car obj)) 640 (symbolp (car obj))
641 (get (car obj) 'event-symbol-elements)))) 641 (get (car obj) 'event-symbol-elements))))
642 642
643 (defun event-modifiers (event) 643 (defun event-modifiers (event)
644 "Returns a list of symbols representing the modifier keys in event EVENT. 644 "Return a list of symbols representing the modifier keys in event EVENT.
645 The elements of the list may include `meta', `control', 645 The elements of the list may include `meta', `control',
646 `shift', `hyper', `super', `alt', `click', `double', `triple', `drag', 646 `shift', `hyper', `super', `alt', `click', `double', `triple', `drag',
647 and `down'." 647 and `down'."
648 (let ((type event)) 648 (let ((type event))
649 (if (listp type) 649 (if (listp type)
668 (or (zerop (logand type ?\A-\^@)) 668 (or (zerop (logand type ?\A-\^@))
669 (setq list (cons 'alt list))) 669 (setq list (cons 'alt list)))
670 list)))) 670 list))))
671 671
672 (defun event-basic-type (event) 672 (defun event-basic-type (event)
673 "Returns the basic type of the given event (all modifiers removed). 673 "Return the basic type of the given event (all modifiers removed).
674 The value is a printing character (not upper case) or a symbol." 674 The value is a printing character (not upper case) or a symbol."
675 (if (consp event) 675 (if (consp event)
676 (setq event (car event))) 676 (setq event (car event)))
677 (if (symbolp event) 677 (if (symbolp event)
678 (car (get event 'event-symbol-elements)) 678 (car (get event 'event-symbol-elements))