comparison lisp/subr.el @ 90645:7eeafaaa9eab

Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 476-489) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 153-160) - Merge from emacs--devo--0 - Update from CVS Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-127
author Miles Bader <miles@gnu.org>
date Mon, 30 Oct 2006 08:54:41 +0000
parents 8dd8c8286063 c470e5e21c36
children 02cf29720f31
comparison
equal deleted inserted replaced
90644:9b62e05dedf6 90645:7eeafaaa9eab
1098 If you want to use `add-to-list' on a variable that is not defined 1098 If you want to use `add-to-list' on a variable that is not defined
1099 until a certain package is loaded, you should put the call to `add-to-list' 1099 until a certain package is loaded, you should put the call to `add-to-list'
1100 into a hook function that will be run only after loading the package. 1100 into a hook function that will be run only after loading the package.
1101 `eval-after-load' provides one way to do this. In some cases 1101 `eval-after-load' provides one way to do this. In some cases
1102 other hooks, such as major mode hooks, can do the job." 1102 other hooks, such as major mode hooks, can do the job."
1103 (if (if compare-fn 1103 (if (cond
1104 (let (present) 1104 ((null compare-fn)
1105 (dolist (elt (symbol-value list-var))
1106 (if (funcall compare-fn element elt)
1107 (setq present t)))
1108 present)
1109 (member element (symbol-value list-var))) 1105 (member element (symbol-value list-var)))
1106 ((eq compare-fn 'eq)
1107 (memq element (symbol-value list-var)))
1108 ((eq compare-fn 'eql)
1109 (memql element (symbol-value list-var)))
1110 (t
1111 (let (present)
1112 (dolist (elt (symbol-value list-var))
1113 (if (funcall compare-fn element elt)
1114 (setq present t)))
1115 present)))
1110 (symbol-value list-var) 1116 (symbol-value list-var)
1111 (set list-var 1117 (set list-var
1112 (if append 1118 (if append
1113 (append (symbol-value list-var) (list element)) 1119 (append (symbol-value list-var) (list element))
1114 (cons element (symbol-value list-var)))))) 1120 (cons element (symbol-value list-var))))))
1750 (or nodisp (redisplay))) 1756 (or nodisp (redisplay)))
1751 (t 1757 (t
1752 (or nodisp (redisplay)) 1758 (or nodisp (redisplay))
1753 (let ((read (read-event nil nil seconds))) 1759 (let ((read (read-event nil nil seconds)))
1754 (or (null read) 1760 (or (null read)
1755 (progn (push read unread-command-events) 1761 (progn
1756 nil)))))) 1762 ;; If last command was a prefix arg, e.g. C-u, push this event onto
1763 ;; unread-command-events as (t . EVENT) so it will be added to
1764 ;; this-command-keys by read-key-sequence.
1765 (if (eq overriding-terminal-local-map universal-argument-map)
1766 (setq read (cons t read)))
1767 (push read unread-command-events)
1768 nil))))))
1757 1769
1758 ;;; Atomic change groups. 1770 ;;; Atomic change groups.
1759 1771
1760 (defmacro atomic-change-group (&rest body) 1772 (defmacro atomic-change-group (&rest body)
1761 "Perform BODY as an atomic change group. 1773 "Perform BODY as an atomic change group.
2193 (put-text-property (point) run-end 'face face)) 2205 (put-text-property (point) run-end 'face face))
2194 (goto-char run-end))))) 2206 (goto-char run-end)))))
2195 2207
2196 (unless (nth 2 handler) ;; NOEXCLUDE 2208 (unless (nth 2 handler) ;; NOEXCLUDE
2197 (remove-yank-excluded-properties opoint (point))) 2209 (remove-yank-excluded-properties opoint (point)))
2210
2211 ;; If last inserted char has properties, mark them as rear-nonsticky.
2212 (if (and (> end opoint)
2213 (text-properties-at (1- end)))
2214 (put-text-property (1- end) end 'rear-nonsticky t))
2215
2198 (if (eq yank-undo-function t) ;; not set by FUNCTION 2216 (if (eq yank-undo-function t) ;; not set by FUNCTION
2199 (setq yank-undo-function (nth 3 handler))) ;; UNDO 2217 (setq yank-undo-function (nth 3 handler))) ;; UNDO
2200 (if (nth 4 handler) ;; COMMAND 2218 (if (nth 4 handler) ;; COMMAND
2201 (setq this-command (nth 4 handler))))) 2219 (setq this-command (nth 4 handler)))))
2202 2220