• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/emacs-93/emacs/lisp/

Lines Matching +defs:activate +defs:mark +defs:hook

160 (defcustom next-error-hook nil
161 "*List of hook functions run by `next-error' after visiting source file."
162 :type 'hook
297 runs `next-error-hook' with `run-hooks', and stays with that buffer
309 (run-hooks 'next-error-hook))))
317 (run-hooks 'next-error-hook)))
360 ;;; Internal variable for `next-error-follow-mode-post-command-hook'.
370 (remove-hook 'post-command-hook 'next-error-follow-mode-post-command-hook t)
371 (add-hook 'post-command-hook 'next-error-follow-mode-post-command-hook nil t)
374 ;;; Used as a `post-command-hook' by `next-error-follow-mode'
376 (defun next-error-follow-mode-post-command-hook ()
395 (run-hooks 'after-change-major-mode-hook)))
744 "Move point to the beginning of the buffer; leave mark at previous position.
745 With \\[universal-argument] prefix, do not set mark at previous position.
752 \(goto-char (point-min)) is faster and avoids clobbering the mark."
755 (and transient-mark-mode mark-active)
756 (push-mark))
769 "Move point to the end of the buffer; leave mark at previous position.
770 With \\[universal-argument] prefix, do not set mark at previous position.
777 \(goto-char (point-max)) is faster and avoids clobbering the mark."
780 (and transient-mark-mode mark-active)
781 (push-mark))
800 (defun mark-whole-buffer ()
801 "Put point at beginning and mark at end of buffer.
804 that uses or sets the mark."
806 (push-mark (point))
807 (push-mark (point-max) nil t)
1180 (add-hook 'minibuffer-setup-hook 'minibuffer-history-initialize)
1186 "A point-motion hook for the minibuffer, that moves point out of the prompt."
1401 In Transient Mark mode when the mark is active, only undo changes within
1430 (if transient-mark-mode mark-active (and arg (not (numberp arg)))))
1452 (if (or transient-mark-mode (numberp arg))
1796 In either case, the output is inserted after point (leaving mark after it).
1840 (push-mark nil t)
1865 ;; This is like exchange-point-and-mark, but doesn't
1866 ;; activate the mark. It is cleaner to avoid activation,
1867 ;; even though the command loop would deactivate the mark
1869 (goto-char (prog1 (mark t)
1870 (set-marker (mark-marker) (point)
2019 In either case, the output is inserted after point (leaving mark after it).
2022 the output in place of text from START to END, putting point and mark
2033 (unless (mark)
2034 (error "The mark is not set now, so there is no region"))
2062 ;; Don't muck with mark unless REPLACE says we should.
2064 (and replace (push-mark (point) 'nomsg))
2075 ;; Don't muck with mark unless REPLACE says we should.
2076 (and replace swap (exchange-point-and-mark)))
2268 These commands include \\[set-mark-command] and \\[start-kbd-macro]."
2543 "Kill (\"cut\") text between point and mark.
2566 ;; Pass point first, then mark, because the order matters
2568 (interactive (list (point) (mark)))
2570 (error "The mark is not set now, so there is no region"))
2603 In Transient Mark mode, deactivate the mark.
2610 (if transient-mark-mode
2611 (setq deactivate-mark t))
2616 In Transient Mark mode, deactivate the mark.
2636 (unless (and transient-mark-mode
2638 ;; Swap point and mark.
2639 (set-marker (mark-marker) (point) (current-buffer))
2643 (set-marker (mark-marker) other-end (current-buffer))
2645 ;; If user quit, deactivate the mark
2647 (and quit-flag mark-active
2648 (deactivate-mark)))
2687 the value of the mark and point; it is guaranteed that START <= END.
2713 (before (< (point) (mark t))))
2715 (funcall (or yank-undo-function 'delete-region) (point) (mark t))
2716 (funcall (or yank-undo-function 'delete-region) (mark t) (point)))
2718 (set-marker (mark-marker) (point) (current-buffer))
2724 ;; This is like exchange-point-and-mark, but doesn't activate the mark.
2726 ;; loop would deactivate the mark because we inserted text.
2727 (goto-char (prog1 (mark t)
2728 (set-marker (mark-marker) (point) (current-buffer))))))
2734 killed OR yanked. Put point at end, and set mark at beginning.
2735 With just \\[universal-argument] as argument, same but put point at beginning (and mark at end).
2749 (push-mark (point))
2755 ;; This is like exchange-point-and-mark, but doesn't activate the mark.
2757 ;; loop would deactivate the mark because we inserted text.
2758 (goto-char (prog1 (mark t)
2759 (set-marker (mark-marker) (point) (current-buffer)))))
3031 Puts mark after the inserted text.
3045 (push-mark
3105 (put 'mark-inactive 'error-conditions '(mark-inactive error))
3106 (put 'mark-inactive 'error-message "The mark is not active now")
3108 (defvar activate-mark-hook nil
3109 "Hook run when the mark becomes active.
3110 It is also run at the end of a command, if the mark is active and
3113 (defvar deactivate-mark-hook nil
3114 "Hook run when the mark becomes inactive.")
3116 (defun mark (&optional force)
3117 "Return this buffer's mark value as integer, or nil if never set.
3120 the mark is not active. However, if `mark-even-if-inactive' is non-nil,
3121 or the argument FORCE is non-nil, it disregards whether the mark
3125 a mistake; see the documentation of `set-mark'."
3126 (if (or force (not transient-mark-mode) mark-active mark-even-if-inactive)
3127 (marker-position (mark-marker))
3128 (signal 'mark-inactive nil)))
3130 ;; Many places set mark-active directly, and several of them failed to also
3131 ;; run deactivate-mark-hook. This shorthand should simplify.
3132 (defsubst deactivate-mark ()
3133 "Deactivate the mark by setting `mark-active' to nil.
3135 Also runs the hook `deactivate-mark-hook'."
3137 ((eq transient-mark-mode 'lambda)
3138 (setq transient-mark-mode nil))
3139 (transient-mark-mode
3140 (setq mark-active nil)
3141 (run-hooks 'deactivate-mark-hook))))
3143 (defun set-mark (pos)
3144 "Set this buffer's mark to POS. Don't use this function!
3146 the user to see that the mark has moved, and you want the previous
3147 mark position to be lost.
3149 Normally, when a new mark is set, the old one should go on the stack.
3150 This is why most applications should use `push-mark', not `set-mark'.
3152 Novice Emacs Lisp programmers often try to use the mark for the wrong
3153 purposes. The mark saves a location for the user's convenience.
3154 Most editing commands should not alter the mark.
3162 (setq mark-active t)
3163 (run-hooks 'activate-mark-hook)
3164 (set-marker (mark-marker) pos (current-buffer)))
3165 ;; Normally we never clear mark-active except in Transient Mark mode.
3166 ;; But when we actually clear out the mark value too,
3167 ;; we must clear mark-active in any mode.
3168 (setq mark-active nil)
3169 (run-hooks 'deactivate-mark-hook)
3170 (set-marker (mark-marker) nil)))
3172 (defvar mark-ring nil
3174 (make-variable-buffer-local 'mark-ring)
3175 (put 'mark-ring 'permanent-local t)
3177 (defcustom mark-ring-max 16
3178 "*Maximum size of mark ring. Start discarding off end if gets this big."
3182 (defvar global-mark-ring nil
3185 (defcustom global-mark-ring-max 16
3186 "*Maximum size of global mark ring. \
3191 (defun pop-to-mark-command ()
3192 "Jump to mark, and pop a new position for mark off the ring
3193 \(does not affect global mark ring\)."
3195 (if (null (mark t))
3196 (error "No mark set in this buffer")
3197 (if (= (point) (mark t))
3199 (goto-char (mark t))
3200 (pop-mark)))
3202 (defun push-mark-command (arg &optional nomsg)
3203 "Set mark at where point is.
3204 If no prefix arg and mark is already set there, just activate it.
3207 (let ((mark (marker-position (mark-marker))))
3208 (if (or arg (null mark) (/= mark (point)))
3209 (push-mark nil nomsg t)
3210 (setq mark-active t)
3211 (run-hooks 'activate-mark-hook)
3215 (defcustom set-mark-command-repeat-pop nil
3216 "*Non-nil means repeating \\[set-mark-command] after popping mark pops it again.
3217 That means that C-u \\[set-mark-command] \\[set-mark-command]
3218 will pop the mark twice, and
3219 C-u \\[set-mark-command] \\[set-mark-command] \\[set-mark-command]
3220 will pop the mark three times.
3222 A value of nil means \\[set-mark-command]'s behavior does not change
3223 after C-u \\[set-mark-command]."
3227 (defun set-mark-command (arg)
3228 "Set the mark where point is, or jump to the mark.
3229 Setting the mark also alters the region, which is the text
3230 between point and mark; this is the closest equivalent in
3233 With no prefix argument, set the mark at point, and push the
3234 old mark position on local mark ring. Also push the old mark on
3235 global mark ring, if the previous mark was set in another buffer.
3237 Immediately repeating this command activates `transient-mark-mode' temporarily.
3239 With prefix argument \(e.g., \\[universal-argument] \\[set-mark-command]\), \
3240 jump to the mark, and set the mark from
3241 position popped off the local mark ring \(this does not affect the global
3242 mark ring\). Use \\[pop-global-mark] to jump to a mark popped off the global
3243 mark ring \(see `pop-global-mark'\).
3245 If `set-mark-command-repeat-pop' is non-nil, repeating
3246 the \\[set-mark-command] command with no prefix argument pops the next position
3247 off the local (or global) mark ring and jumps there.
3250 argument, unconditionally set mark where point is, even if
3251 `set-mark-command-repeat-pop' is non-nil.
3253 Novice Emacs Lisp programmers often try to use the mark for the wrong
3254 purposes. See the documentation of `set-mark' for more information."
3256 (if (eq transient-mark-mode 'lambda)
3257 (setq transient-mark-mode nil))
3260 (push-mark-command nil))
3261 ((not (eq this-command 'set-mark-command))
3263 (pop-to-mark-command)
3264 (push-mark-command t)))
3265 ((and set-mark-command-repeat-pop
3266 (eq last-command 'pop-to-mark-command))
3267 (setq this-command 'pop-to-mark-command)
3268 (pop-to-mark-command))
3269 ((and set-mark-command-repeat-pop
3270 (eq last-command 'pop-global-mark)
3272 (setq this-command 'pop-global-mark)
3273 (pop-global-mark))
3275 (setq this-command 'pop-to-mark-command)
3276 (pop-to-mark-command))
3277 ((and (eq last-command 'set-mark-command)
3278 mark-active (null transient-mark-mode))
3279 (setq transient-mark-mode 'lambda)
3280 (message "Transient-mark-mode temporarily enabled"))
3282 (push-mark-command nil))))
3284 (defun push-mark (&optional location nomsg activate)
3285 "Set mark at LOCATION (point, by default) and push old mark on mark ring.
3286 If the last global mark pushed was not in the current buffer,
3287 also push LOCATION on the global mark ring.
3290 Novice Emacs Lisp programmers often try to use the mark for the wrong
3291 purposes. See the documentation of `set-mark' for more information.
3293 In Transient Mark mode, activate mark if optional third arg ACTIVATE non-nil."
3294 (unless (null (mark t))
3295 (setq mark-ring (cons (copy-marker (mark-marker)) mark-ring))
3296 (when (> (length mark-ring) mark-ring-max)
3297 (move-marker (car (nthcdr mark-ring-max mark-ring)) nil)
3298 (setcdr (nthcdr (1- mark-ring-max) mark-ring) nil)))
3299 (set-marker (mark-marker) (or location (point)) (current-buffer))
3300 ;; Now push the mark on the global mark ring.
3301 (if (and global-mark-ring
3302 (eq (marker-buffer (car global-mark-ring)) (current-buffer)))
3303 ;; The last global mark pushed was in this same buffer.
3306 (setq global-mark-ring (cons (copy-marker (mark-marker)) global-mark-ring))
3307 (when (> (length global-mark-ring) global-mark-ring-max)
3308 (move-marker (car (nthcdr global-mark-ring-max global-mark-ring)) nil)
3309 (setcdr (nthcdr (1- global-mark-ring-max) global-mark-ring) nil)))
3312 (if (or activate (not transient-mark-mode))
3313 (set-mark (mark t)))
3316 (defun pop-mark ()
3317 "Pop off mark ring into the buffer's actual mark.
3318 Does not set point. Does nothing if mark ring is empty."
3319 (when mark-ring
3320 (setq mark-ring (nconc mark-ring (list (copy-marker (mark-marker)))))
3321 (set-marker (mark-marker) (+ 0 (car mark-ring)) (current-buffer))
3322 (move-marker (car mark-ring) nil)
3323 (if (null (mark t)) (ding))
3324 (setq mark-ring (cdr mark-ring)))
3325 (deactivate-mark))
3327 (defalias 'exchange-dot-and-mark 'exchange-point-and-mark)
3328 (defun exchange-point-and-mark (&optional arg)
3329 "Put the mark where point is now, and point where the mark is now.
3330 This command works even when the mark is not active,
3331 and it reactivates the mark.
3332 With prefix arg, `transient-mark-mode' is enabled temporarily."
3335 (if mark-active
3336 (if (null transient-mark-mode)
3337 (setq transient-mark-mode 'lambda))
3340 (let ((omark (mark t)))
3342 (error "No mark set in this buffer"))
3343 (set-mark (point))
3347 (define-minor-mode transient-mark-mode
3351 In Transient Mark mode, when the mark is active, the region is highlighted.
3352 Changing the buffer \"deactivates\" the mark.
3353 So do certain other operations that set the mark
3357 You can also deactivate the mark by typing \\[keyboard-quit] or
3361 and the mark is active, by acting on the region instead of their usual
3366 \"mark.*active\" at the prompt, to see the documentation of
3378 (defun pop-global-mark ()
3379 "Pop off global mark ring and jump to the top location."
3382 (while (and global-mark-ring (not (marker-buffer (car global-mark-ring))))
3383 (setq global-mark-ring (cdr global-mark-ring)))
3384 (or global-mark-ring
3385 (error "No global mark set"))
3386 (let* ((marker (car global-mark-ring))
3389 (setq global-mark-ring (nconc (cdr global-mark-ring)
3390 (list (car global-mark-ring))))
3396 (error "Global mark position is outside accessible part of buffer")))
3943 Leave mark at previous position.
3953 ;; Set point and mark in that window's buffer.
3962 Leave mark at previous position.
3990 If ARG is zero, the words around or after point and around or after mark
4034 With argument 0, interchanges line point is in with line mark is in."
4060 (goto-char (mark))
4063 (exchange-point-and-mark))
4099 (defun mark-word (&optional arg allow-extend)
4100 "Set mark ARG words away from point.
4101 The place mark goes is the same place \\[forward-word] would
4104 or (in Transient Mark mode) if the mark is active,
4108 (or (and (eq last-command this-command) (mark t))
4109 (and transient-mark-mode mark-active)))
4111 (if (< (mark) (point)) -1 1)))
4112 (set-mark
4114 (goto-char (mark))
4118 (push-mark
4325 (custom-add-option 'text-mode-hook 'turn-on-auto-fill)
4595 (deactivate-mark)
4619 ((and transient-mark-mode mark-active)
4620 (deactivate-mark))
4756 \(The user agent will also run `mail-citation-hook', *after* the
5021 (unless (run-hook-with-args-until-success
5064 (run-mode-hooks 'completion-list-mode-hook))
5068 Called from `temp-buffer-show-hook'."
5072 (add-hook 'temp-buffer-show-hook 'completion-list-mode-finish)
5074 (defvar completion-setup-hook nil
5075 "Normal hook run at the end of setting up a completion list buffer.
5076 When this hook is run, the current buffer is the one in which the
5112 The value is set by `display-completion-list' during running `completion-setup-hook'.
5119 ;; This function goes in completion-setup-hook, so that it is called
5189 (add-hook 'completion-setup-hook 'completion-setup-function)
5307 (defvar clone-buffer-hook nil
5308 "Normal hook to run in the new buffer at the end of `clone-buffer'.")
5362 This runs the normal hook `clone-buffer-hook' in the new buffer
5384 (mk (if mark-active (mark t)))
5397 (if mk (set-mark mk))
5417 (run-hooks 'clone-buffer-hook))
5591 (run-hooks 'normal-erase-is-backspace-hook)