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

Lines Matching +defs:isearch +defs:mode +defs:end +defs:hook

1 ;;; outline.el --- outline mode commands for Emacs
28 ;; This package is a major mode for editing outline-format documents.
51 Note that Outline mode only checks this regexp at the start of a line,
54 in the file it applies to. See also `outline-heading-end-regexp'."
59 (defcustom outline-heading-end-regexp "\n"
60 "Regular expression to match the end of a heading line.
62 regexp is searched for. The heading ends at the end of the match.
68 (defvar outline-mode-prefix-map
95 (defvar outline-mode-menu-bar-map
143 (defvar outline-minor-mode-menu-bar-map
150 ;; Flatten the major mode's menus into a single menu.
157 outline-mode-menu-bar-map))))))
161 (defvar outline-mode-map
163 (define-key map "\C-c" outline-mode-prefix-map)
164 (define-key map [menu-bar] outline-mode-menu-bar-map)
172 "Additional expressions to highlight in Outline mode.")
248 (defvar outline-view-change-hook nil
249 "Normal hook to be run after outline visibility changes.")
251 (defvar outline-mode-hook nil
252 "*This hook is run when outline mode starts.")
258 (define-derived-mode outline-mode text-mode "Outline"
259 "Set major mode for editing outlines with selective display.
264 invisible, or visible again. Invisible lines are attached to the end
268 Commands:\\<outline-mode-map>
296 Turning on outline mode calls the value of `text-mode-hook' and then of
297 `outline-mode-hook', if they are non-nil."
312 (add-hook 'change-major-mode-hook 'show-all nil t))
314 (defcustom outline-minor-mode-prefix "\C-c@"
315 "*Prefix key to use for Outline commands in Outline minor mode.
316 The value of this variable is checked as part of loading Outline mode.
322 (define-minor-mode outline-minor-mode
323 "Toggle Outline minor mode.
324 With arg, turn Outline minor mode on if arg is positive, off otherwise.
325 See the command `outline-mode' for more information on this mode."
326 nil " Outl" (list (cons [menu-bar] outline-minor-mode-menu-bar-map)
327 (cons outline-minor-mode-prefix outline-mode-prefix-map))
329 (if outline-minor-mode
331 ;; Turn off this mode if we change major modes.
332 (add-hook 'change-major-mode-hook
333 (lambda () (outline-minor-mode -1))
341 ;; When turning off outline mode, get rid of any outline hiding.
355 If a mode or document needs several sets of outline headings (for example
357 within each set. For example in texinfo mode:
382 (- (match-end 0) (match-beginning 0))))
387 at the end of the buffer."
455 (unless (bolp) (end-of-line) (newline))
459 (run-hooks 'outline-insert-heading-hook)))
477 If transient-mark-mode is on, and mark is active, promote headings in
484 (list (if (and transient-mark-mode mark-active) 'region
489 (outline-map-region 'outline-promote (region-beginning) (region-end)))
516 If transient-mark-mode is on, and mark is active, demote headings in
523 (list (if (and transient-mark-mode mark-active) 'region
528 (outline-map-region 'outline-demote (region-beginning) (region-end)))
592 (defun outline-map-region (fun beg end)
597 (setq end (copy-marker end))
599 (when (re-search-forward (concat "^\\(?:" outline-regexp "\\)") end t)
604 (< (point) end))
622 beg end folded)
627 (save-excursion (outline-end-of-heading)
629 (outline-end-of-subtree))
631 (setq end (point))
641 (progn (outline-end-of-subtree)
644 (insert (delete-and-extract-region beg end))
649 (defun outline-end-of-heading ()
650 (if (re-search-forward outline-heading-end-regexp nil 'move)
661 (end-of-line))
691 This puts point at the start of the current subtree, and mark at the end."
700 (outline-end-of-subtree)
706 (defvar outline-isearch-open-invisible-function nil
707 "Function called if `isearch' finishes in an invisible overlay.
719 (overlay-put o 'isearch-open-invisible
720 (or outline-isearch-open-invisible-function
721 'outline-isearch-open-invisible))))
723 (run-hooks 'outline-view-change-hook))
731 ;; (remove-overlays (overlay-start o) (overlay-end o)
739 (let ((end (overlay-end o)))
744 (and (not (eobp)) (< (point) end))))))
759 (< (point) (overlay-end o))
763 ;; I've seen it happen at the end of buffer.
766 ;; Function to be set as an outline-isearch-open-invisible' property
769 (defun outline-isearch-open-invisible (overlay)
770 ;; We rely on the fact that isearch places point on the matched text.
779 (outline-end-of-heading)
796 (defun hide-region-body (start end)
798 ;; Nullify the hook to avoid repeated calls to `outline-flag-region'
800 ;; and run the hook finally.
801 (let (outline-view-change-hook)
804 (narrow-to-region start end)
807 (outline-end-of-heading)
814 (outline-end-of-heading))))))
815 (run-hooks 'outline-view-change-hook))
833 ;; (outline-end-of-heading)
834 (hide-region-body (point) (progn (outline-end-of-subtree) (point)))))
842 "Show the current heading and move to its end."
848 (progn (outline-end-of-heading) (point))
863 (let* (outline-view-change-hook
869 (end (progn
874 (outline-flag-region beg end t)
880 beg end)))
881 (run-hooks 'outline-view-change-hook))
887 (let (outline-view-change-hook)
896 (run-hooks 'outline-view-change-hook))
903 (if (not (outline-invisible-p (line-end-position)))
911 (outline-end-of-heading)
913 (progn (outline-end-of-subtree) (point))
916 (defun outline-end-of-subtree ()
927 ;; Go to end of line before heading
953 (let (outline-view-change-hook)
962 (progn (outline-end-of-subtree)
964 (run-hooks 'outline-view-change-hook))
1049 (defun outline-headers-as-kill (beg end)
1058 (narrow-to-region beg end)
1061 start end)
1068 end (progn (outline-end-of-heading)
1070 (insert-buffer-substring buffer start end)
1077 end (progn (outline-end-of-heading) (point)))
1079 (insert-buffer-substring buffer start end)