Show
Ignore:
Timestamp:
05/13/06 11:31:18 (3 years ago)
Author:
miyoshi
Message:

Sync up with Emacs CVS HEAD.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lisp/subr.el

    r4073 r4079  
    11231123                                (< oa ob) 
    11241124                              oa))))))) 
     1125 
     1126(defun add-to-history (history-var newelt &optional maxelt) 
     1127  "Add NEWELT to the history list stored in the variable HISTORY-VAR. 
     1128Return the new history list. 
     1129If MAXELT is non-nil, it specifies the maximum length of the history. 
     1130Otherwise, the maximum history length is the value of the `history-length' 
     1131property on symbol HISTORY-VAR, if set, or the value of the `history-length' 
     1132variable. 
     1133Remove duplicates of NEWELT unless `history-delete-duplicates' is nil." 
     1134  (unless maxelt 
     1135    (setq maxelt (or (get history-var 'history-length) 
     1136                     history-length))) 
     1137  (let ((history (symbol-value history-var)) 
     1138        tail) 
     1139    (if history-delete-duplicates 
     1140        (setq history (delete newelt history))) 
     1141    (setq history (cons newelt history)) 
     1142    (when (integerp maxelt) 
     1143      (if (= 0 maxelt) 
     1144          (setq history nil) 
     1145        (setq tail (nthcdr (1- maxelt) history)) 
     1146        (when (consp tail) 
     1147          (setcdr tail nil)))) 
     1148    (set history-var history))) 
     1149 
    11251150  
    11261151;;;; Mode hooks. 
     
    19321957  (memq object '(nil t))) 
    19331958 
     1959(defun field-at-pos (pos) 
     1960  "Return the field at position POS, taking stickiness etc into account" 
     1961  (let ((raw-field (get-char-property (field-beginning pos) 'field))) 
     1962    (if (eq raw-field 'boundary) 
     1963        (get-char-property (1- (field-end pos)) 'field) 
     1964      raw-field))) 
     1965 
    19341966  
    19351967;;;; Support for yanking and text properties.