• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/emacs-92/emacs/lisp/

Lines Matching +defs:after +defs:change +defs:major +defs:mode +defs:hook

96 change the list."
431 saving keyboard macros (see `edmacro-mode')."
456 (defun define-key-after (keymap key definition &optional after)
457 "Add binding in KEYMAP for KEY => DEFINITION, right after AFTER's binding.
459 just after the binding for the event AFTER, instead of at the beginning
469 (unless after (setq after t))
485 ;; When we reach AFTER's binding, insert the new binding after.
488 (if (or (and (eq (car-safe (car tail)) after)
489 (not (eq after t)))
562 which in most cases is shared with all other buffers in the same major mode."
965 'mode-line-inverse-video
1015 (defun make-local-hook (hook)
1016 "Make the hook HOOK local to the current buffer.
1019 You never need to call this function now that `add-hook' does it for you
1022 When a hook is local, its local and global values
1023 work in concert: running the hook actually runs all the hook
1025 of the hook variable.
1028 which acts as a flag to run the hook functions in the default value as
1037 Do not use `make-local-variable' to make a hook variable buffer-local."
1038 (if (local-variable-p hook)
1040 (or (boundp hook) (set hook nil))
1041 (make-local-variable hook)
1042 (set hook (list t)))
1043 hook)
1044 (make-obsolete 'make-local-hook "not necessary any more." "21.1")
1046 (defun add-hook (hook function &optional append local)
1049 FUNCTION is added (if necessary) at the beginning of the hook list
1054 the hook's buffer-local value rather than its default value.
1055 This makes the hook buffer-local if needed, and it makes t a member
1056 of the buffer-local value. That acts as a flag to run the hook
1062 (or (boundp hook) (set hook nil))
1063 (or (default-boundp hook) (set-default hook nil))
1064 (if local (unless (local-variable-if-set-p hook)
1065 (set (make-local-variable hook) (list t)))
1066 ;; Detect the case where make-local-variable was used on a hook
1068 (unless (and (consp (symbol-value hook)) (memq t (symbol-value hook)))
1070 (let ((hook-value (if local (symbol-value hook) (default-value hook))))
1071 ;; If the hook value is a single function, turn it into a list.
1072 (when (or (not (listp hook-value)) (eq (car hook-value) 'lambda))
1073 (setq hook-value (list hook-value)))
1075 (unless (member function hook-value)
1076 (setq hook-value
1078 (append hook-value (list function))
1079 (cons function hook-value))))
1081 (if local (set hook hook-value) (set-default hook hook-value))))
1083 (defun remove-hook (hook function &optional local)
1087 list of hooks to run in HOOK, then nothing is done. See `add-hook'.
1090 the hook's buffer-local value rather than its default value."
1091 (or (boundp hook) (set hook nil))
1092 (or (default-boundp hook) (set-default hook nil))
1093 ;; Do nothing if LOCAL is t but this hook has no local binding.
1094 (unless (and local (not (local-variable-p hook)))
1095 ;; Detect the case where make-local-variable was used on a hook
1097 (when (and (local-variable-p hook)
1098 (not (and (consp (symbol-value hook))
1099 (memq t (symbol-value hook)))))
1101 (let ((hook-value (if local (symbol-value hook) (default-value hook))))
1103 (if (or (not (listp hook-value)) (eq (car hook-value) 'lambda))
1104 (if (equal hook-value function) (setq hook-value nil))
1105 (setq hook-value (delete function (copy-sequence hook-value))))
1106 ;; If the function is on the global hook, we need to shadow it locally
1107 ;;(when (and local (member function (default-value hook))
1108 ;; (not (member (cons 'not function) hook-value)))
1109 ;; (push (cons 'not function) hook-value))
1112 (set-default hook hook-value)
1113 (if (equal hook-value '(t))
1114 (kill-local-variable hook)
1115 (set hook hook-value))))))
1129 into a hook function that will be run only after loading the package.
1130 `eval-after-load' provides one way to do this. In some cases
1131 other hooks, such as major mode hooks, can do the job."
1162 ORDER is nil or omitted, do not change the numeric order of
1222 (defvar delay-mode-hooks nil
1223 "If non-nil, `run-mode-hooks' should delay running the hooks.")
1224 (defvar delayed-mode-hooks nil
1225 "List of delayed mode hooks waiting to be run.")
1226 (make-variable-buffer-local 'delayed-mode-hooks)
1227 (put 'delay-mode-hooks 'permanent-local t)
1229 (defvar after-change-major-mode-hook nil
1230 "Normal hook run at the very end of major mode functions.")
1232 (defun run-mode-hooks (&rest hooks)
1233 "Run mode hooks `delayed-mode-hooks' and HOOKS, or delay HOOKS.
1234 Execution is delayed if `delay-mode-hooks' is non-nil.
1235 If `delay-mode-hooks' is nil, run `after-change-major-mode-hook'
1236 after running the mode hooks.
1237 Major mode functions should use this."
1238 (if delay-mode-hooks
1240 (dolist (hook hooks)
1241 (push hook delayed-mode-hooks))
1242 ;; Normal case, just run the hook as before plus any delayed hooks.
1243 (setq hooks (nconc (nreverse delayed-mode-hooks) hooks))
1244 (setq delayed-mode-hooks nil)
1246 (run-hooks 'after-change-major-mode-hook)))
1248 (defmacro delay-mode-hooks (&rest body)
1249 "Execute BODY, but delay any `run-mode-hooks'.
1251 `run-mode-hooks' that occurs outside any `delayed-mode-hooks' form.
1255 (make-local-variable 'delay-mode-hooks)
1256 (let ((delay-mode-hooks t))
1259 ;; PUBLIC: find if the current mode derives from another.
1261 (defun derived-mode-p (&rest modes)
1262 "Non-nil if the current major mode is derived from one of MODES.
1263 Uses the `derived-mode-parent' property of the symbol to trace backwards."
1264 (let ((parent major-mode))
1266 (setq parent (get parent 'derived-mode-parent))))
1272 ;; If a minor mode is not defined with define-minor-mode,
1274 ;; isearch-mode is deliberately excluded, since you should
1276 (defvar minor-mode-list '(auto-save-mode auto-fill-mode abbrev-mode
1277 overwrite-mode view-mode
1278 hs-minor-mode)
1279 "List of all minor mode functions.")
1281 (defun add-minor-mode (toggle name &optional keymap after toggle-fun)
1282 "Register a new minor mode.
1284 This is an XEmacs-compatibility function. Use `define-minor-mode' instead.
1287 is toggled on or off to say whether the minor mode is active or not.
1289 NAME specifies what will appear in the mode line when the minor mode
1293 Optional KEYMAP is the keymap for the minor mode that will be added
1294 to `minor-mode-map-alist'.
1296 Optional AFTER specifies that TOGGLE should be added after AFTER
1297 in `minor-mode-alist'.
1299 Optional TOGGLE-FUN is an interactive function to toggle the mode.
1302 If TOGGLE has a non-nil `:included' property, an entry for the mode is
1303 included in the mode-line minor mode menu.
1305 (unless (memq toggle minor-mode-list)
1306 (push toggle minor-mode-list))
1310 (put toggle :minor-mode-function toggle-fun))
1311 ;; Add the name to the minor-mode-alist.
1313 (let ((existing (assq toggle minor-mode-alist)))
1316 (let ((tail minor-mode-alist) found)
1318 (if (eq after (caar tail))
1325 (setq minor-mode-alist (cons (list toggle name)
1326 minor-mode-alist)))))))
1329 (define-key mode-line-mode-menu
1335 (let ((mode-name (if (symbolp name) (symbol-value name))))
1336 (if (and (stringp mode-name) (string-match "[^ ]+" mode-name))
1337 (concat " (" (match-string 0 mode-name) ")"))))
1341 ;; Add the map to the minor-mode-map-alist.
1343 (let ((existing (assq toggle minor-mode-map-alist)))
1346 (let ((tail minor-mode-map-alist) found)
1348 (if (eq after (caar tail))
1355 (setq minor-mode-map-alist (cons (cons toggle keymap)
1356 minor-mode-map-alist))))))))
1446 If this is run after Emacs startup, evaluate BODY immediately.
1449 This works by adding a function to `before-init-hook'.
1454 (add-hook 'before-init-hook
1462 FILE, a string, is described in the function `eval-after-load'."
1488 (defun eval-after-load (file form)
1515 This function makes or adds to an entry on `after-load-alist'."
1516 ;; Add this FORM into after-load-alist (regardless of whether we'll be
1520 (elt (assoc regexp-or-feature after-load-alist)))
1523 (push elt after-load-alist))
1535 (defun do-after-load-evaluation (abs-file)
1536 "Evaluate all `eval-after-load' forms, if any, for ABS-FILE.
1538 (let ((after-load-elts after-load-alist)
1540 (while after-load-elts
1541 (setq a-l-element (car after-load-elts)
1542 after-load-elts (cdr after-load-elts))
1549 (defun eval-next-after-load (file)
1551 This makes or adds to an entry on `after-load-alist'.
1553 (eval-after-load file (read)))
1812 ;;; Atomic change groups.
1814 (defmacro atomic-change-group (&rest body)
1815 "Perform BODY as an atomic change group.
1822 user can undo the change normally."
1824 (let ((handle (make-symbol "--change-group-handle--"))
1825 (success (make-symbol "--change-group-success--")))
1826 `(let ((,handle (prepare-change-group))
1833 (activate-change-group ,handle)
1839 (accept-change-group ,handle)
1840 (cancel-change-group ,handle))))))
1842 (defun prepare-change-group (&optional buffer)
1843 "Return a handle for the current buffer's state, for a change group.
1846 Pass the handle to `activate-change-group' afterward to initiate
1847 the actual changes of the change group.
1849 To finish the change group, call either `accept-change-group' or
1850 `cancel-change-group' passing the same handle as argument. Call
1851 `accept-change-group' to accept the changes in the group as final;
1852 call `cancel-change-group' to undo them all. You should use
1854 to `activate-change-group' should be inside the `unwind-protect'.
1857 the source code of `atomic-change-group'.
1860 change group, call this function once for each buffer you want to
1863 (nconc (prepare-change-group buffer-1)
1864 (prepare-change-group buffer-2))
1866 You can then activate that multibuffer change group with a single
1867 call to `activate-change-group' and finish it with a single call
1868 to `accept-change-group' or `cancel-change-group'."
1874 (defun activate-change-group (handle)
1875 "Activate a change group made with `prepare-change-group' (which see)."
1881 (defun accept-change-group (handle)
1882 "Finish a change group made with `prepare-change-group' (which see).
1883 This finishes the change group by accepting its changes as final."
1889 (defun cancel-change-group (handle)
1890 "Finish a change group made with `prepare-change-group' (which see).
1891 This finishes the change group by reverting all of its changes."
1919 (defalias 'redraw-modeline 'force-mode-line-update)
1921 (defun force-mode-line-update (&optional all)
1922 "Force redisplay of the current buffer's mode line and header line.
1923 With optional non-nil ALL, force redisplay of all mode lines and
2036 (defvar suspend-hook nil
2037 "Normal hook run by `suspend-emacs', before suspending.")
2039 (defvar suspend-resume-hook nil
2040 "Normal hook run by `suspend-emacs', after Emacs is continued.")
2042 (defvar temp-buffer-show-hook nil
2043 "Normal hook run by `with-output-to-temp-buffer' after displaying the buffer.
2044 When the hook runs, the temporary buffer is current, and the window it
2045 was displayed in is selected. This hook is normally set up with a
2047 variable names in it, provided the major mode is still Help mode.")
2049 (defvar temp-buffer-setup-hook nil
2050 "Normal hook run by `with-output-to-temp-buffer' at the start.
2051 When the hook runs, the temporary buffer is current.
2052 This hook is normally set up with a function to put the buffer in Help
2053 mode.")
2109 don't change the volume setting of the sound device.
2180 (next-single-property-change (point) 'category nil end))
2185 (setq run-end2 (next-property-change (point) nil run-end))
2202 (while (setq to (next-single-property-change 0 'yank-handler string))
2226 if FUNCTION adjusts point before or after inserting the object.
2259 (next-single-property-change (point) 'font-lock-face nil end))
2431 The original message is restored to the echo area after BODY has finished.
2506 (defmacro combine-after-change-calls (&rest body)
2507 "Execute BODY, but don't call the after-change functions till the end.
2509 and the functions on `after-change-functions' are called several times
2513 If `before-change-functions' is non-nil, then calls to the after-change
2516 Do not alter `after-change-functions' or `before-change-functions'
2520 (let ((combine-after-change-calls t))
2522 (combine-after-change-execute)))
2557 (mode (make-symbol "mode")))
2558 `(lambda (,string ,predicate ,mode)
2563 ((eq ,mode t) (all-completions ,string (,fun ,string) ,predicate))
2564 ((not ,mode) (try-completion ,string (,fun ,string) ,predicate))
2602 `(lambda (string predicate mode)
2604 ((eq mode t)
2607 ((eq mode nil)
2695 repetition bounds operator `\\=\\{...\\}', or right after a `\\'.
2913 (defun syntax-after (pos)
2914 "Return the raw syntax of the char after POS.
2920 (aref (or st (syntax-table)) (char-after pos))))))
2930 (defun text-clone-maintain (ol1 after beg end &optional len)
2933 (when (and after (not undo-in-progress) (overlay-start ol1))
2989 If SPREADP is non-nil it indicates that text inserted before/after the
3052 Optional HOOKVAR is a hook variable that gets run before the message
3054 install a hook function temporarily on this hook variable.
3055 If HOOKVAR is nil, `mail-send-hook' is used.
3062 (put symbol 'hookvar (or hookvar 'mail-send-hook)))
3086 However, if the change since last echo area update is too small
3102 min-change min-time)
3108 is printed after the MESSAGE. You can change MESSAGE of an
3118 Optional MIN-CHANGE determines the minimal change in percents to
3135 (if min-change (max (min min-change 50) 1) 1)
3145 change the displayed message."