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

Lines Matching +defs:store +defs:cut +defs:buffer +defs:internal

117 the following lines anywhere in the buffer:
140 the following lines anywhere in the buffer:
151 line enforcing Org-mode will be inserted into the buffer, if this option
162 keys both in Org-mode and in the Org-agenda buffer.
199 Changing this requires executing `M-x org-mode' in a buffer to become
372 "Cycle globally if cursor is at beginning of buffer and not at a headline.
374 C-u TAB. For this special case to work, the first line of the buffer
377 cursor stays at the beginning of the buffer.
379 of the buffer."
400 "Hook that is run after `org-cycle' has changed the buffer visibility.
423 lines to the buffer:
470 The highlights will automatically disappear the next time the buffer is
476 "Non-nil means, any change to the buffer will remove temporary highlights.
601 You may set this option on a per-file basis by adding to the buffer a
792 '(calc-internal-prec 12
855 "buffer-local version of `org-link-abbrev-alist', which see.
857 (make-variable-buffer-local 'org-link-abbrev-alist-local)
878 per-buffer basis from the Org->Hyperlinks menu."
922 (defgroup org-link-store nil
944 :group 'org-link-store
956 :group 'org-link-store
960 "Non-nil means, file links from `org-store-link' contain context.
964 Using a prefix arg to the command \\[org-store-link] (`org-store-link')
966 :group 'org-link-store
972 The command `org-store-link' adds a link pointing to the current
973 location to an internal list. These links accumulate during a session.
979 :group 'org-link-store
983 "Non-nil means, `org-store-link' will create web links to Google groups.
985 Using a prefix arg to the command \\[org-store-link] (`org-store-link')
987 :group 'org-link-store
1058 (defcustom org-display-internal-link-with-indirect-buffer nil
1059 "Non-nil means, use indirect buffer to display infile links.
1060 Activating internal links (from one location in a file to another location
1064 an indirect buffer clone of the current buffer, to avoid any visibility
1065 changes to the current buffer."
1241 When nil, just let remember make the buffer.
1251 The template specifies the structure of the remember buffer. It should have
1262 %a annotation, normally the link created with org-store-link
1302 "Non-nil means, store new notes at the beginning of a file or entry.
1379 the following lines anywhere in the buffer:
1476 (make-variable-buffer-local 'org-display-custom-times)
1523 buffer.
1541 `org-tag-alist' or through a #+TAGS line in the buffer.
1623 (make-variable-buffer-local 'org-category)
1640 "When set, remote killing from the agenda buffer needs confirmation.
1684 You can also define a set of commands, to create a composite agenda buffer.
1714 (const :tag "Tags sparse tree (current buffer)" tags-tree)
1715 (const :tag "TODO keyword tree (current buffer)" todo-tree)
1716 (const :tag "Occur tree (current buffer)" occur-tree)
1837 "Hook run just before displaying an agenda buffer."
1859 "How the agenda buffer should be displayed.
1863 other-frame Use `switch-to-buffer-other-frame' to display agenda.
1864 other-window Use `switch-to-buffer-other-window' to display agenda.
1885 (defcustom org-indirect-buffer-display 'other-window
1888 \\[org-tree-to-indirect-buffer] and \\[org-agenda-tree-to-indirect-buffer].
2590 into the exported HTML text. Otherwise, the buffer will just be saved
2648 lines to the buffer:
3022 ;;; Variables for pre-computed regular expressions, all buffer local
3026 (make-variable-buffer-local 'org-done-string)
3029 (make-variable-buffer-local 'org-todo-regexp)
3032 (make-variable-buffer-local 'org-not-done-regexp)
3035 (make-variable-buffer-local 'org-todo-line-regexp)
3039 (make-variable-buffer-local 'org-todo-line-tags-regexp)
3042 (make-variable-buffer-local 'org-nl-done-regexp)
3045 (make-variable-buffer-local 'org-looking-at-done-regexp)
3048 (make-variable-buffer-local 'org-todo-kwd-priority-p)
3051 (make-variable-buffer-local 'org-todo-kwd-max-priority)
3054 (make-variable-buffer-local 'org-ds-keyword-length)
3057 (make-variable-buffer-local 'org-deadline-regexp)
3060 (make-variable-buffer-local 'org-deadline-time-regexp)
3063 (make-variable-buffer-local 'org-deadline-line-regexp)
3066 (make-variable-buffer-local 'org-scheduled-regexp)
3069 (make-variable-buffer-local 'org-scheduled-time-regexp)
3072 (make-variable-buffer-local 'org-closed-time-regexp)
3076 (make-variable-buffer-local 'org-keyword-time-regexp)
3079 (make-variable-buffer-local 'org-keyword-time-not-clock-regexp)
3082 (make-variable-buffer-local 'org-maybe-keyword-time-regexp)
3106 "Make VAR local in current buffer and set it to VALUE."
3107 (set (make-variable-buffer-local var) value))
3110 "Check if the current buffer is in Org-mode."
3150 "Precompute regular expressions for current buffer."
3285 "Used in various places to store a window configuration.")
3307 (defvar wl-summary-buffer-elmo-folder)
3308 (defvar wl-summary-buffer-folder-name)
3316 (defvar mh-show-folder-buffer)
3356 (defun org-make-overlay (beg end &optional buffer)
3358 (make-extent beg end buffer)
3359 (make-overlay beg end buffer)))
3364 (defun org-move-overlay (ovl beg end &optional buffer)
3366 (set-extent-endpoints ovl beg end (or buffer (current-buffer)))
3367 (move-overlay ovl beg end buffer)))
3438 "Add elements to `buffer-invisibility-spec'.
3439 See documentation for `buffer-invisibility-spec' for the kind of elements
3444 ((or (null buffer-invisibility-spec) (eq buffer-invisibility-spec t))
3445 (setq buffer-invisibility-spec (list arg)))
3447 (setq buffer-invisibility-spec
3448 (cons arg buffer-invisibility-spec)))))
3451 "Remove elements from `buffer-invisibility-spec'."
3454 (if (consp buffer-invisibility-spec)
3455 (setq buffer-invisibility-spec
3456 (delete arg buffer-invisibility-spec)))))
3459 "Is ARG a member of `buffer-invisibility-spec'?"
3460 (if (consp buffer-invisibility-spec)
3461 (member arg buffer-invisibility-spec)
3505 ;; we switch another buffer into org-mode.
3527 (fboundp 'set-display-table-slot) (boundp 'buffer-display-table))
3532 (setq buffer-display-table org-display-table))
3544 ;; Check for running clock before killing a buffer
3545 (org-add-hook 'kill-buffer-hook 'org-check-running-clock nil 'local)
3571 (let ((bmp (buffer-modified-p)))
3573 (set-buffer-modified-p bmp)))
3714 "Run through the buffer and add overlays to links."
3727 "Run through the buffer and add overlays to links."
3738 "Run through the buffer and add overlays to links."
3761 "Run through the buffer and add overlays to bracketed links."
3790 "Run through the buffer and add overlays to dates."
3811 "Run through the buffer and add overlays to target matches."
3981 (let* ((buffer-undo-list t)
3984 deactivate-mark buffer-file-name buffer-file-truename)
3990 ;;;; Visibility cycling, including org-goto and indirect buffer
3995 (make-variable-buffer-local 'org-cycle-global-status)
3997 (make-variable-buffer-local 'org-cycle-subtree-status)
4004 buffer through 3 states (global cycling)
4025 - Special case: if point is the the beginning of the buffer and there is
4136 (buffer-read-only (org-back-to-heading))
4149 (string-match "^[ \t]*$" (buffer-substring
4176 of the first headline in the buffer. This is important, because if the
4189 "Show all headlines in the buffer, like a table of contents.
4211 (when (get-buffer-window (current-buffer))
4271 is often to fold the entire buffer and then dive into the tree. This
4275 This command works around this by showing a copy of the current buffer in
4278 original buffer in which the visibility is still unchanged. It then jumps
4283 (org-get-location (current-buffer) org-goto-help)))
4295 "Let the user select a location in the Org-mode buffer BUF.
4302 (switch-to-buffer (get-buffer-create "*org-goto*"))
4303 (with-output-to-temp-buffer "*Help*"
4305 (shrink-window-if-larger-than-buffer (get-buffer-window "*Help*"))
4306 (setq buffer-read-only nil)
4307 (erase-buffer)
4308 (insert-buffer-substring buf)
4313 (setq buffer-read-only t)
4333 (kill-buffer "*org-goto*")
4372 ;;; Indirect buffer display of subtrees
4376 (defvar org-last-indirect-buffer nil)
4378 (defun org-tree-to-indirect-buffer (&optional arg)
4379 "Create indirect buffer and narrow it to current subtree.
4382 Normally this command removes the indirect buffer previously made
4383 with this command. However, when called with a C-u prefix, the last buffer
4385 If `org-indirect-buffer-display' is `dedicated-frame', the C-u prefix also
4386 requests that a new frame be made for the new buffer, so that the dedicated
4389 (let ((cbuf (current-buffer))
4404 (buffer-live-p org-last-indirect-buffer))
4405 (kill-buffer org-last-indirect-buffer))
4406 (setq ibuf (org-get-indirect-buffer cbuf)
4407 org-last-indirect-buffer ibuf)
4409 ((or (eq org-indirect-buffer-display 'new-frame)
4410 (and arg (eq org-indirect-buffer-display 'dedicated-frame)))
4413 (switch-to-buffer ibuf)
4415 ((eq org-indirect-buffer-display 'dedicated-frame)
4422 (switch-to-buffer ibuf)
4424 ((eq org-indirect-buffer-display 'current-window)
4425 (switch-to-buffer ibuf))
4426 ((eq org-indirect-buffer-display 'other-window)
4427 (pop-to-buffer ibuf))
4436 (defun org-get-indirect-buffer (&optional buffer)
4437 (setq buffer (or buffer (current-buffer)))
4438 (let ((n 1) (base (buffer-name buffer)) bname)
4439 (while (buffer-live-p
4440 (get-buffer (setq bname (concat base "-" (number-to-string n)))))
4443 (make-indirect-buffer buffer bname 'clone)
4444 (error (make-indirect-buffer buffer bname)))))
4464 (if (= (buffer-size) 0)
4714 (error "Cannot move past superior level or buffer limit")))
4724 (setq txt (buffer-substring beg end))
4732 "Clipboard for cut and paste of subtrees.
4740 (defun org-cut-subtree ()
4744 (org-copy-subtree 'cut))
4746 (defun org-copy-subtree (&optional cut)
4749 If CUT is non-nil, actually cut the subtree."
4763 (if cut (kill-region beg end) (copy-region-as-kill beg end))
4766 (if cut "Cut" "Copied")
4801 ^re_ (buffer-substring (point-at-bol) (point)))
4886 "Narrow buffer to the current subtree."
4951 txt (buffer-substring beg end))
5130 the whole buffer."
5133 (let* ((buffer-invisibility-spec nil) ; Emacs 21 compatibility
5315 (setq txt (buffer-substring beg end))
5351 (setq txt (buffer-substring beg end))
5392 (buffer-substring (point-at-bol) (match-beginning 3))))
5484 (this-buffer (current-buffer))
5487 file heading buffer level newfile-p)
5497 (file-name-nondirectory buffer-file-name))
5502 buffer (find-file-noselect file))
5503 (setq buffer (current-buffer)))
5504 (unless buffer
5515 (set-buffer buffer)
5516 ;; Enforce org-mode for the archive buffer
5524 (buffer-file-name this-buffer))))
5525 ;; Force the TODO keywords of the original buffer
5569 ;; Save the buffer, if it is not the same buffer.
5570 (if (not (eq this-buffer buffer)) (save-buffer))))
5571 ;; Here we are back in the original buffer. Everything seems to have
5572 ;; worked. So now cut the tree and finish up.
5573 (let (this-command) (org-cut-subtree))
5576 (if (eq this-buffer buffer)
5810 (if (string-match "^[ \t]*$" (buffer-substring-no-properties
5878 (table (buffer-substring beg end))
5884 (with-current-buffer (find-file-noselect file)
5885 (setq buf (current-buffer))
5886 (erase-buffer)
5905 (save-buffer))
5906 (kill-buffer buf)))
5922 (make-variable-buffer-local 'org-table-overlay-coordinates)
5971 (buffer-substring beg end) "\n"))
6094 (when (or (eq t buffer-invisibility-spec)
6095 (assq 'org-link buffer-invisibility-spec))
6142 (or (not (equal (marker-buffer org-table-aligned-begin-marker)
6143 (current-buffer)))
6305 (org-table-cut-region (region-beginning) (region-end)))
6326 (val (buffer-substring (1+ pos) (match-end 0))))
6608 (setq txt (buffer-substring (point) (1+ (point-at-eol))))
6625 (let* ((line (buffer-substring (point-at-bol) (point-at-eol)))
6645 (buffer-substring (point-at-bol) (point-at-eol))))
6751 (org-split-string (buffer-substring beg end) "\n")))
6761 (defun org-table-cut-region (beg end)
6764 (org-table-copy-region beg end 'cut))
6766 (defun org-table-copy-region (beg end &optional cut)
6773 (rpl (if cut " " nil)))
6797 (if cut (org-table-align))
6808 (error "First cut/copy a region to paste!"))
6905 (org-table-cut-region (region-beginning) (region-end))
6959 (switch-to-buffer-other-window "*Org tmp*")
6960 (erase-buffer)
6978 the table and kill the editing buffer."
6981 (cb (current-buffer))
6987 (setq text (org-trim (buffer-string)))
6989 (kill-buffer cb)
6990 (select-window (get-buffer-window (marker-buffer pos)))
7069 "Apply FUNCTION to the start of all tables in the buffer."
7075 (message "Mapping tables: %d%%" (/ (* 100.0 (point)) (buffer-size)))
7138 (format "Sum of %d items: %-20s (\\[yank] will insert result into buffer)"
7211 (org-table-store-formulas stored-list)
7223 (org-table-store-formulas stored-list))
7226 (defun org-table-store-formulas (alist)
7233 ;; don't overwrite TBLFM, we might use text properties to store stuff
7352 (buffer-substring-no-properties beg end))))
7356 If yes, store the formula and apply it."
7456 (make-variable-buffer-local 'org-table-formula-debug)
7473 suppress-store suppress-analysis)
7523 (formula (if (and equation suppress-store)
7542 (setq modes (org-set-calc-mode 'calc-internal-prec n))
7566 (buffer-substring (point-at-bol) (point-at-eol)))
7621 (with-output-to-temp-buffer "*Substitution History*"
7633 (setq bw (get-buffer-window "*Substitution History*"))
7634 (shrink-window-if-larger-than-buffer bw)
7885 (lasttbl (buffer-substring (org-table-begin) (org-table-end)))
7891 (setq thistbl (buffer-substring (org-table-begin) (org-table-end)))
7945 "Edit the formulas of the current table in a separate buffer."
7953 (switch-to-buffer-other-window "*Edit Formulas*")
7954 (erase-buffer)
7987 "Parse the buffer for formula definitions and install them.
8004 (select-window (get-buffer-window (marker-buffer pos)))
8008 (org-table-store-formulas eql)
8010 (kill-buffer "*Edit Formulas*")
8021 (select-window (get-buffer-window (marker-buffer pos)))
8036 ((not (fboundp 'pp-buffer))
8037 (error "Cannot pretty-print. Command `pp-buffer' is not available."))
8054 (pp-buffer)
8102 (if (and (markerp pos) (marker-buffer pos))
8103 (if (get-buffer-window (marker-buffer pos))
8104 (select-window (get-buffer-window (marker-buffer pos)))
8105 (switch-to-buffer-other-window (get-buffer-window
8106 (marker-buffer pos)))))
8221 (select-window (get-buffer-window (marker-buffer org-pos)))
8233 (let ((other-window-scroll-buffer (marker-buffer org-pos)))
8285 (make-variable-buffer-local 'org-table-coordinate-overlays)
8363 (make-variable-buffer-local 'orgtbl-mode)
8488 '("\C-c\C-w" org-table-cut-region)
8573 ["Cut Rectangle" org-cut-special :active (org-at-table-p)]
8705 (txt (buffer-substring-no-properties
9020 "Contains the links stored with `org-store-link'.")
9022 (defvar org-store-link-plist nil
9023 "Plist with info about the most recently link created with `org-store-link'.")
9026 (defun org-store-link (arg)
9028 This link can later be inserted into an org-buffer with
9034 (setq org-store-link-plist nil) ; reset
9043 (org-store-link-props :type "bbdb" :name name :company company)))
9051 (org-store-link-props :type "info" :file Info-current-file
9062 (org-store-link-props :type "calendar" :date cd)))
9069 (vm-select-folder-buffer)
9071 (folder buffer-file-name)
9076 (org-store-link-props :type "vm" :from from :to to :subject subject
9088 (message-id (elmo-message-field wl-summary-buffer-elmo-folder
9093 wl-summary-buffer-elmo-folder msgnum)
9095 msgnum (wl-summary-buffer-msgdb))))
9100 (org-store-link-props :type "wl" :from from :to to
9104 (setq link (org-make-link "wl:" wl-summary-buffer-folder-name
9113 (org-store-link-props :type "mh" :from from :to to
9123 (let ((folder buffer-file-name)
9128 (org-store-link-props
9142 (org-store-link-props :type "gnus" :group group)
9159 (org-store-link-props :type "gnus" :from from :subject subject
9174 (org-store-link-props :type "w3" :url (url-view-url t)))
9179 (org-store-link-props :type "w3m" :url (url-view-url t)))
9183 (setq link (concat "file:" (abbreviate-file-name buffer-file-name)
9189 (abbreviate-file-name buffer-file-name))
9191 (org-store-link-props :type "image" :file buffer-file-name))
9201 ((and buffer-file-name (org-mode-p))
9204 (abbreviate-file-name buffer-file-name)))
9213 (buffer-substring (region-beginning) (region-end)))
9214 (t (buffer-substring (point-at-bol) (point-at-eol)))))
9223 (buffer-file-name
9226 (abbreviate-file-name buffer-file-name)))
9230 (buffer-substring (region-beginning) (region-end))
9231 (buffer-substring (point-at-bol) (point-at-eol))))
9240 (error "Cannot link to a buffer which is not visiting a file"))
9256 (defun org-store-link-props (&rest plist)
9274 (setq org-store-link-plist plist))
9278 This takes information from `org-store-link-plist' and formats it
9281 (let* ((p org-store-link-plist)
9374 "Find a header field in the current buffer."
9411 `org-store-link'. When the empty string is entered (i.e. if you just
9417 be displayed in the buffer instead of the link.
9434 (prog1 (buffer-substring (region-beginning) (region-end))
9494 (when (and buffer-file-name
9500 (if (equal (file-truename buffer-file-name) (file-truename path))
9546 (message "Link search wrapped back to beginning of buffer"))
9566 (message "Link search wrapped back to end of buffer"))
9629 path (buffer-substring
9679 (switch-to-buffer-other-window
9680 (org-get-buffer-for-internal-link (current-buffer)))
9800 buffer with \\[org-insert-link].")
9829 If the current buffer is in `dired-mode', grep will be used to search
9912 (if (and (or (not (eq (marker-buffer m) (current-buffer)))
9922 (defun org-get-buffer-for-internal-link (buffer)
9923 "Return a buffer to be used for displaying the link target of internal links."
9925 ((not org-display-internal-link-with-indirect-buffer)
9926 buffer)
9927 ((string-match "(Clone)$" (buffer-name buffer))
9930 buffer)
9931 (t ; make a new indirect buffer for displaying the link
9932 (let* ((bn (buffer-name buffer))
9934 (ib (or (get-buffer ibn) (make-indirect-buffer buffer ibn 'clone))))
9935 (with-current-buffer ib (org-overview))
9941 in the *Occur* buffer. This is useful if the regex is long and not useful
9946 (when (setq win (get-buffer-window "*Occur*"))
9953 (and beg end (let ((buffer-read-only)) (delete-region beg end)))
9970 (defun org-mark-ring-push (&optional pos buffer)
9977 (or buffer (current-buffer)))
9996 (switch-to-buffer (marker-buffer m))
10035 (if (< 0 (buffer-size (get-buffer "*BBDB*"))) (throw 'exit nil))
10038 (if (< 0 (buffer-size (get-buffer "*BBDB*"))) (throw 'exit nil))
10041 (if (< 0 (buffer-size (get-buffer "*BBDB*"))) (throw 'exit nil))
10044 (if (< 0 (buffer-size (get-buffer "*BBDB*"))) (throw 'exit nil))
10047 (when (= 0 (buffer-size (get-buffer "*BBDB*")))
10048 (delete-window (get-buffer-window "*BBDB*"))
10095 (vm-select-folder-buffer)
10154 ;; Refer to the show buffer
10155 mh-show-folder-buffer))
10161 ;; mh-index-data is always nil in a show buffer.
10166 (when (buffer-live-p (get-buffer folder))
10168 (pop-to-buffer folder)
10179 "Returns the name of the message folder in a index folder buffer."
10191 ;; Refer to the show buffer
10192 mh-show-folder-buffer)))
10200 ;; Refer to the show buffer
10201 (mh-show-buffer-message-number))))
10205 show buffer for the corresponding message. If you have a more clever
10209 (buffer (get-buffer-create (concat "show-" folder)))
10211 (with-current-buffer buffer
10216 (set-buffer buffer)
10243 (kill-this-buffer)
10248 (kill-this-buffer)
10291 (let ((b (current-buffer)) (p (point)))
10294 (save-excursion (set-buffer b) (goto-char p)
10321 buffer-file-name
10327 (old-buffer (current-buffer))
10370 (or (not (equal old-buffer (current-buffer)))
10372 (org-mark-ring-push old-pos old-buffer))))
10412 (org-store-link nil))
10423 "Initialize *remember* buffer with template, invoke `org-mode'.
10438 (plist-p (if org-store-link-plist t nil))
10453 (setq org-store-link-plist
10456 (erase-buffer)
10469 (let* ((lead (buffer-substring
10481 (and (setq x (plist-get org-store-link-plist
10484 ;; Turn on org-mode in the remember buffer, set local variables
10486 (org-set-local 'org-finish-function 'remember-buffer)
10512 (org-set-local 'org-finish-function 'remember-buffer)))
10516 "Call `remember'. If this is already a remember buffer, re-apply template.
10518 of the remember buffer."
10520 (if (eq org-finish-function 'remember-buffer)
10524 (erase-buffer)
10525 (let ((annotation (plist-get org-store-link-plist :annotation))
10526 (initial (plist-get org-store-link-plist :initial)))
10530 (remember (buffer-substring (point) (mark)))
10546 RET buffer-start as level 2 heading at end of file
10553 So the fastest way to store the note is to press RET RET to append it to
10571 (let* ((txt (buffer-substring (point-min) (point-max)))
10575 (visiting (org-find-base-buffer-visiting file))
10588 ;; We need to add a headline: Use time and first buffer line
10591 " (" (remember-buffer-desc) ")")
10599 (with-current-buffer (or visiting (get-file-buffer file))
10620 (org-get-location (current-buffer) org-remember-help)))
10654 (save-buffer)
10655 (if (not visiting) (kill-buffer (current-buffer)))))))))
10675 (if (string-match (car entry) buffer-file-name)
10682 "Find the first dynamic block with name NAME in the buffer.
10731 "Apply COMMAND to all dynamic blocks in the current buffer.
10749 blocks in the buffer."
10783 "Update all dynamic blocks in the buffer.
10815 (opt (equal (buffer-substring (max (point-at-bol) (- beg 2))
10819 (buffer-substring (point-at-bol) (point))))
10839 (buffer-substring (point-at-bol) beg))
10853 (or org-tag-alist (org-get-buffer-tags)))
10855 (pattern (buffer-substring-no-properties beg end))
10870 (if (get-buffer-window "*Completions*")
10871 (delete-window (get-buffer-window "*Completions*")))
10882 (with-output-to-temp-buffer "*Completions*"
11109 (let (col list elt ts buffer-invisibility-spec)
11186 (switch-to-buffer (marker-buffer org-log-note-marker))
11188 (switch-to-buffer-other-window "*Org Note*")
11189 (erase-buffer)
11197 (org-set-local 'org-finish-function 'org-store-log-note))
11199 (defun org-store-log-note ()
11201 (let ((txt (buffer-string))
11204 (kill-buffer (current-buffer))
11225 (set-buffer (marker-buffer org-log-note-marker))
11231 (setq ind (concat (buffer-substring (point-at-bol) (point)) " "))
11236 (with-current-buffer (marker-buffer org-log-note-return-to)
11242 (make-variable-buffer-local 'org-occur-highlights)
11332 "Remove the occur highlights from the buffer.
11334 from the `before-change-functions' in the current buffer."
11434 (abbreviate-file-name buffer-file-name))))
11604 With prefix ARG, realign all tags in headings in the current buffer."
11613 (let (buffer-invisibility-spec) ; Emacs 21 compatibility
11622 (setq table (or org-tag-alist (org-get-buffer-tags))
11725 (buf (current-buffer))
11727 (buffer-tags nil)
11747 (buffer-substring (1- (point)) (point))
11754 (set-buffer (get-buffer-create " *Org tags*"))
11757 (switch-to-buffer-other-window (get-buffer-create " *Org tags*")))
11758 (erase-buffer)
11805 (if (and (not expert) (fboundp 'fit-window-to-buffer))
11806 (fit-window-to-buffer))
11827 (switch-to-buffer-other-window " *Org tags*")
11828 (and (fboundp 'fit-window-to-buffer)
11829 (fit-window-to-buffer))))
11841 (or buffer-tags
11842 (with-current-buffer buf
11843 (org-get-buffer-tags)))))
11846 (add-to-list 'buffer-tags (list tg))
11897 (defun org-get-buffer-tags ()
11898 "Get a table of all tags used in the buffer, for completion."
11989 to an internal time.
11994 used to insert the time stamp into the buffer to include the time."
12118 Also, store the cursor date in variable org-ans2."
12120 (select-window (get-buffer-window "*Calendar*"))
12126 (org-move-overlay org-date-ovl (1- (point)) (1+ (point)) (current-buffer))
12131 This is used by `org-read-date' in a temporary keymap for the calendar buffer."
12140 "Insert a date stamp for the date given by the internal TIME.
12160 (let ((p (point-min)) (bmp (buffer-modified-p)))
12167 (set-buffer-modified-p bmp)))
12179 (org-parse-time-string (buffer-substring beg end) t)))
12244 This is used by `org-read-date' in a temporary keymap for the calendar buffer."
12274 (defun org-evaluate-time-range (&optional to-buffer)
12277 TO-BUFFER, the result is inserted just after the date stamp into the buffer.
12320 (if (not to-buffer)
12469 (set-buffer "*Calendar*")
12484 (get-buffer-window "*Calendar*" t)
12491 (cwin (get-buffer-window "*Calendar*" t))
12521 "Insert time stamp corresponding to cursor date in *Calendar* buffer.
12549 (move-marker org-clock-marker (point) (buffer-base-buffer))
12557 (if (not (marker-buffer org-clock-marker))
12561 (set-buffer (marker-buffer org-clock-marker))
12585 (if (not (marker-buffer org-clock-marker))
12588 (set-buffer (marker-buffer org-clock-marker))
12595 (make-variable-buffer-local 'org-clock-file-total-minutes)
12601 (let* ((bmp (buffer-modified-p))
12638 (set-buffer-modified-p bmp)))
12641 "Show subtree times in the entire buffer.
12664 (make-variable-buffer-local 'org-clock-overlays)
12679 tx (concat (buffer-substring (1- (point)) (point))
12693 "Remove the occur highlights from the buffer.
12695 from the `before-change-functions' in the current buffer."
12708 (equal (marker-buffer org-clock-marker) (current-buffer))
12723 "Check if the current buffer contains the running clock.
12724 If yes, offer to stop it and to save the buffer with the changes."
12725 (when (and (equal (marker-buffer org-clock-marker) (current-buffer))
12726 (y-or-n-p (format "Clock-out in buffer %s before killing it? "
12727 (buffer-name))))
12729 (when (y-or-n-p "Save changed buffer?")
12730 (save-buffer))))
12734 If the buffer contains lines
12739 is was there before. If these lines are not in the buffer, the table
12786 The return value is a cons cell with two internal times like the ones
12888 "Return an internal list with clocking information.
12960 (when (boundp 'buffer-substring-filters)
12961 (org-set-local 'buffer-substring-filters
12964 buffer-substring-filters)))
12997 (define-key org-agenda-mode-map "\C-c\C-xb" 'org-agenda-tree-to-indirect-buffer)
12998 (define-key org-agenda-mode-map "b" 'org-agenda-tree-to-indirect-buffer)
13076 ["Tree to indirect frame" org-agenda-tree-to-indirect-buffer t]
13123 ["Rebuild buffer" org-agenda-redo t]
13135 "Non-nil means, allow remote undo from the agenda buffer.")
13154 (_buf1 (current-buffer))
13156 (_undo1 buffer-undo-list)
13157 (_undo2 (with-current-buffer ,_buffer buffer-undo-list))
13162 _undo1 (with-current-buffer _buf1 buffer-undo-list))
13164 _undo2 (with-current-buffer _buf2 buffer-undo-list)))
13167 (and _c1 (with-current-buffer _buf1 (undo-boundary)))
13168 (and _c2 (with-current-buffer _buf2 (undo-boundary)))
13169 ;; remember which buffer to undo
13175 This undoes changes both in the agenda buffer and in the remote buffer
13192 (with-current-buffer buf
13193 (let ((last-undo-buffer buf)
13194 buffer-read-only)
13205 (message "`%s' undone (buffer %s)" cmd (buffer-name rembuf))))
13218 (defvar org-agenda-last-dispatch-buffer nil)
13222 "Dispatch agenda commands to collect entries to the agenda buffer.
13233 l Create a timeeline for the current buffer.
13239 If the current buffer is in Org-mode and visiting a file, you can also
13244 (let* ((buf (current-buffer))
13245 (bfn (buffer-file-name (buffer-base-buffer)))
13255 (setq org-agenda-last-dispatch-buffer (current-buffer))
13258 (switch-to-buffer-other-window " *Agenda Commands*")
13259 (erase-buffer)
13267 L Timeline for current buffer # List stuck projects (!=configure)
13295 (org-add-props "1 Restrict call to current buffer 0 Restrict call to region or subtree" nil 'face 'org-table)))
13297 (if (fboundp 'fit-window-to-buffer) (fit-window-to-buffer))
13305 (error "Cannot restrict agenda to current buffer"))
13306 (with-current-buffer " *Agenda Commands*"
13312 (with-current-buffer buf
13417 (set-buffer "*Org Agenda*")
13418 (princ (buffer-string))))
13425 "Make sure current buffer is in org-mode. Error if not."
13427 (error "Cannot execute org-mode agenda command on buffer in %s."
13431 "Fit the window to the buffer size."
13433 (fboundp 'fit-window-to-buffer)
13434 (fit-window-to-buffer nil (/ (* (frame-height) 3) 4)
13453 latter case, the buffer is set up in a way that saving it automatically kills
13454 the buffer and restores the previous window configuration."
13464 (kill-buffer (current-buffer))))
13469 "Edit list and finish with \\[save-buffer]")))
13472 (defun org-store-new-agenda-file-list (list)
13476 (while (setq b (find-buffer-visiting f)) (kill-buffer b))
13486 (with-temp-buffer
13488 (org-split-string (buffer-string) "[ \t\r\n]*?[\r\n][ \t\r\n]*"))))
13494 If the current buffer visits an agenda file, find the next one in the list.
13495 If the current buffer does not, find the first agenda file."
13499 (tcf (if buffer-file-name (file-truename buffer-file-name)))
13509 (if (buffer-base-buffer) (switch-to-buffer (buffer-base-buffer)))))
13527 (ctf (file-truename buffer-file-name))
13531 (if (not x) (setq x (cons ctf (abbreviate-file-name buffer-file-name))))
13535 (org-store-new-agenda-file-list (mapcar 'cdr file-alist))
13545 (let* ((file (or file buffer-file-name))
13556 (org-store-new-agenda-file-list files)
13579 (defvar org-agenda-buffer-name "*Org Agenda*")
13584 (setq buffer-read-only nil)
13591 (let* ((abuf (get-buffer-create org-agenda-buffer-name))
13592 (awin (get-buffer-window abuf)))
13594 ((equal (current-buffer) abuf) nil)
13598 (switch-to-buffer abuf))
13600 (switch-to-buffer-other-window abuf))
13602 (switch-to-buffer-other-frame abuf))
13605 (switch-to-buffer-other-window abuf))))
13606 (setq buffer-read-only nil)
13607 (erase-buffer)
13609 (setq buffer-read-only nil))
13612 "Finishing touch for the agenda buffer, called just before displaying it."
13616 (let ((buffer-read-only))
13635 (set-buffer (org-get-agenda-file-buffer file))
13637 (setq bmp (buffer-modified-p))
13650 (set-buffer-modified-p bmp))))))
13707 (defun org-get-agenda-file-buffer (file)
13708 "Get a buffer visiting FILE. If the buffer needs to be created, add
13710 (let ((buf (org-find-base-buffer-visiting file)))
13713 ;; Make a new buffer and remember it
13720 When a buffer is unmodified, it is just killed. When modified, it is saved
13724 (setq file (buffer-file-name buf))
13725 (when (and (buffer-modified-p buf)
13728 (with-current-buffer buf (save-buffer)))
13729 (kill-buffer buf))))
13733 "Get the table of categories and positions in current buffer."
13747 (if buffer-file-name
13749 (file-name-nondirectory buffer-file-name))
13766 If the buffer contains an active region, only check the region for
13775 (entry buffer-file-name)
13788 (list 'switch-to-buffer-other-window (current-buffer))
13838 (setq buffer-read-only t)))
13841 "Return a list of all relevant day numbers from BEG to END buffer positions.
13885 (defvar org-starting-day nil) ; local variable in the agenda buffer
13892 The view will be for the current week, but from the overview buffer you
14019 (setq buffer-read-only t)
14089 (setq buffer-read-only t)))
14104 buffer)
14116 (setq buffer (if (file-exists-p file)
14117 (org-get-agenda-file-buffer file)
14119 (if (not buffer)
14124 (with-current-buffer buffer
14155 (setq buffer-read-only t)))
14206 (with-current-buffer org-agenda-buffer-name
14217 (let* ((fancy-diary-buffer "*temporary-fancy-diary-buffer*")
14228 (if (not (get-buffer fancy-diary-buffer))
14230 (with-current-buffer fancy-diary-buffer
14231 (setq buffer-read-only nil)
14240 (setq entries (buffer-substring (point-min) (- (point-max) 1)))))
14241 (set-buffer-modified-p nil)
14242 (kill-buffer fancy-diary-buffer)))
14254 "Remove unwanted stuff in buffer created by `fancy-diary-display'.
14284 buffer-file-name)
14293 (abbreviate-file-name buffer-file-name))
14379 (buffer (if (file-exists-p file)
14380 (org-get-agenda-file-buffer file)
14383 (if (not buffer)
14386 (with-current-buffer buffer
14454 (abbreviate-file-name buffer-file-name))))
14501 "No heading for this item in buffer or region.")
14511 (abbreviate-file-name buffer-file-name))))
14528 tmp (buffer-substring (max (point-min)
14532 timestr (buffer-substring (match-beginning 0) (point-at-eol))
14580 (abbreviate-file-name buffer-file-name))))
14599 timestr (buffer-substring (match-beginning 0) (point-at-eol))
14633 (abbreviate-file-name buffer-file-name))))
14658 (setq head (buffer-substring-no-properties
14690 (abbreviate-file-name buffer-file-name))))
14714 (setq head (buffer-substring-no-properties
14740 (abbreviate-file-name buffer-file-name))))
14820 "Format TXT to be inserted into the agenda buffer.
14836 (if buffer-file-name
14838 (file-name-nondirectory buffer-file-name))
15082 "Check if agenda buffer is of allowed type.
15091 "Exit agenda by removing the window or the buffer."
15093 (let ((buf (current-buffer)))
15095 (kill-buffer buf)
15104 "Exit agenda by removing the window or the buffer.
15126 (message "Rebuilding agenda buffer...")
15130 (message "Rebuilding agenda buffer...done")
15214 "Jump to the next line indicating a date in agenda buffer."
15222 (error "No next date after this line in this buffer")))
15226 "Jump to the previous line indicating a date in agenda buffer."
15231 (error "No previous date before this line in this buffer")))
15237 (defun org-highlight (begin end &optional buffer)
15240 org-hl begin end (or buffer (current-buffer))))
15246 (defun org-highlight-until-next-command (beg end &optional buffer)
15247 (org-highlight beg end buffer)
15255 "Toggle follow mode in an agenda buffer."
15263 "Toggle log mode in an agenda buffer."
15273 "Toggle diary inclusion in an agenda buffer."
15283 "Toggle time grid in an agenda buffer."
15333 (buffer (marker-buffer marker))
15335 (switch-to-buffer-other-window buffer)
15351 (buffer (marker-buffer marker))
15354 (org-with-remote-undo buffer
15355 (with-current-buffer buffer
15370 (format "Delete entry with %d lines in buffer \"%s\"? "
15371 n (buffer-name buffer))))
15373 (org-remove-subtree-entries-from-agenda buffer dbeg dend)
15374 (with-current-buffer buffer (delete-region dbeg dend))
15383 (buffer (marker-buffer marker))
15385 (org-with-remote-undo buffer
15386 (with-current-buffer buffer
15397 The subtree is the one in buffer BUF, starting at BEG and ending at END.
15399 (let ((buf (or buf (current-buffer))) m p)
15406 (set-buffer (get-buffer org-agenda-buffer-name))
15412 (equal buf (marker-buffer m))
15416 (let (buffer-read-only)
15436 (buffer (marker-buffer marker))
15438 (switch-to-buffer buffer)
15483 (defun org-agenda-tree-to-indirect-buffer ()
15484 "Show the subtree corresponding to the current entry in an indirect buffer.
15485 This calls the command `org-tree-to-indirect-buffer' from the original
15486 Org-mode buffer.
15494 (buffer (marker-buffer marker))
15496 (with-current-buffer buffer
15499 (call-interactively 'org-tree-to-indirect-buffer)))))
15514 (buffer (marker-buffer marker))
15517 (buffer-read-only nil)
15519 (org-with-remote-undo buffer
15520 (with-current-buffer buffer
15539 "Change all lines in the agenda buffer which match HDMARKER.
15545 (let* ((buffer-read-only nil)
15587 (let ((buffer-read-only))
15617 (buffer (marker-buffer marker))
15620 (buffer-read-only nil)
15622 (org-with-remote-undo buffer
15623 (with-current-buffer buffer
15668 (buffer (marker-buffer hdmarker))
15670 (buffer-read-only nil)
15672 (org-with-remote-undo buffer
15673 (with-current-buffer buffer
15693 (buffer (marker-buffer hdmarker))
15695 (buffer-read-only nil)
15697 (org-with-remote-undo buffer
15698 (with-current-buffer buffer
15718 (buffer (marker-buffer marker))
15720 (org-with-remote-undo buffer
15721 (with-current-buffer buffer
15738 (let ((buffer-read-only nil))
15769 (buffer (marker-buffer marker))
15771 (org-with-remote-undo buffer
15772 (with-current-buffer buffer
15787 (buffer (marker-buffer marker))
15791 (org-with-remote-undo buffer
15792 (with-current-buffer buffer
15805 (buffer (marker-buffer marker))
15809 (org-with-remote-undo buffer
15810 (with-current-buffer buffer
15829 (org-with-remote-undo (marker-buffer marker)
15830 (with-current-buffer (marker-buffer marker)
15838 (unless (marker-buffer org-clock-marker)
15840 (org-with-remote-undo (marker-buffer org-clock-marker)
15846 (unless (marker-buffer org-clock-marker)
15848 (org-with-remote-undo (marker-buffer org-clock-marker)
15869 ; (buf (get-file-buffer (substitute-in-file-name diary-file)))
15984 (with-output-to-temp-buffer "*Dates*"
15986 (if (fboundp 'fit-window-to-buffer)
15987 (fit-window-to-buffer (get-buffer-window "*Dates*")))))
16062 (setq str (concat (buffer-substring lim (point)) "\000 X$.")
16119 (make-variable-buffer-local 'org-latex-fragment-image-overlays)
16122 "Remove all overlays with LaTeX fragment images in current buffer."
16133 display all fragments in the buffer.
16145 msg "Creating images for buffer...%s"))
16162 buffer-file-name)))
16451 (with-output-to-temp-buffer "*Org Export/Publishing Help*"
16761 "Cleanup a buffer substring so that links can be created safely."
16773 (set-buffer (get-buffer-create " org-mode-tmp"))
16774 (erase-buffer)
16827 ;; Find matches for radio targets and turn them into internal links
16887 (setq rtn (buffer-string)))
16888 (kill-buffer " org-mode-tmp")
16963 (buffer-substring
16980 (file-name-nondirectory buffer-file-name))
16982 (buffer (find-file-noselect filename))
16990 (file-name-nondirectory buffer-file-name))))
17006 (switch-to-buffer-other-window buffer)
17007 (erase-buffer)
17084 ;; Replace internal links
17100 (save-buffer)
17180 "Create a copy of the visible part of the current buffer, and export it.
17181 The copy is created in a temporary buffer and removed after use.
17190 (message "Export visible: [a]SCII [h]tml [b]rowse HTML [x]OXO [ ]keep buffer")
17203 (file buffer-file-name)
17204 (buffer (get-buffer-create "*Org Export Visible*"))
17206 (with-current-buffer buffer (erase-buffer))
17211 (append-to-buffer buffer s (point))
17219 (append-to-buffer buffer (match-beginning 0) (1+ (match-end 0))))
17221 (append-to-buffer buffer (1+ (match-beginning 0))
17223 (set-buffer buffer)
17224 (let ((buffer-file-name file)
17230 (kill-buffer buffer)
17231 (switch-to-buffer-other-window buffer)
17265 (buffer-name) (user-full-name) user-mail-address org-export-default-language
17277 (file-name-nondirectory buffer-file-name)
17300 (or org-tag-alist (org-get-buffer-tags)) " ") "")
17306 "Insert into the buffer a template with information for exporting."
17365 (org-open-file buffer-file-name))
17380 When HIDDEN is non-nil, don't display the HTML buffer.
17399 (buffer-substring
17405 (org-current-export-file buffer-file-name)
17420 (file-name-nondirectory buffer-file-name))
17422 (current-dir (file-name-directory buffer-file-name))
17423 (buffer (find-file-noselect filename))
17430 (file-name-nondirectory buffer-file-name))))
17446 (coding-system (and (boundp 'buffer-file-coding-system)
17447 buffer-file-coding-system))
17449 (save-buffer-coding-system coding-system)
17454 table-buffer table-orig-buffer
17467 ;; Switch to the output buffer
17469 (set-buffer buffer)
17470 (switch-to-buffer-other-window buffer))
17471 (erase-buffer)
17661 (setq type (if (match-end 2) (match-string 2 line) "internal"))
17675 ((equal type "internal")
17776 (setq table-open t table-buffer nil table-orig-buffer nil))
17778 (setq table-buffer (cons line table-buffer)
17779 table-orig-buffer (cons origline table-orig-buffer))
17784 table-buffer (nreverse table-buffer)
17785 table-orig-buffer (nreverse table-orig-buffer))
17787 (insert (org-format-table-html table-buffer table-orig-buffer))))
17888 (save-buffer)
18016 (let (line field-buffer
18025 (if field-buffer
18036 field-buffer "\n")
18039 (setq field-buffer nil)))
18042 ;; Break the line into fields and store the fields
18044 (if field-buffer
18045 (setq field-buffer (mapcar
18048 field-buffer))
18049 (setq field-buffer fields))))
18058 (with-current-buffer (get-buffer-create " org-tmp1 ")
18059 (erase-buffer)
18065 (with-current-buffer (get-buffer-create " org-tmp2 ") (erase-buffer))
18067 (set-buffer " org-tmp2 ")
18068 (buffer-substring (point-min) (point-max))))
18281 (org-export-icalendar nil buffer-file-name))
18301 file and store it under the name `org-combined-agenda-icalendar-file'."
18306 file ical-file ical-buffer category started org-agenda-new-buffers)
18313 ical-buffer (org-get-agenda-file-buffer ical-file))
18314 (set-buffer ical-buffer) (erase-buffer))
18318 (set-buffer (org-get-agenda-file-buffer file))
18322 (file-name-nondirectory buffer-file-name))
18324 (setq ical-buffer (org-get-agenda-file-buffer ical-file))
18325 (with-current-buffer ical-buffer (erase-buffer)))
18328 (file-name-nondirectory buffer-file-name))))
18330 (let ((standard-output ical-buffer))
18338 (set-buffer ical-buffer)
18339 (save-buffer)
18345 The iCalendar buffer is still current when this hook is run.
18372 tmp (buffer-substring (max (point-min)
18462 (defun org-export-as-xoxo-insert-into (buffer &rest output)
18463 (with-current-buffer buffer
18467 (defun org-export-as-xoxo (&optional buffer)
18468 "Export the org buffer as XOXO.
18469 The XOXO buffer is named *xoxo-<source buffer name>*"
18470 (interactive (list (current-buffer)))
18474 (with-current-buffer (get-buffer buffer)
18475 (goto-char (point-min)) ;; CD: beginning-of-buffer is not allowed.
18481 (file-name-nondirectory buffer-file-name))
18486 ;; Check the output buffer is empty.
18487 (with-current-buffer out (erase-buffer))
18538 ;; Finish the buffer off and clean it up.
18539 (switch-to-buffer-other-window out)
18541 (save-buffer)
18625 (define-key org-mode-map "\C-c\C-xb" 'org-tree-to-indirect-buffer)
18675 (define-key org-mode-map "\C-c\C-x\C-k" 'org-cut-special)
18676 (define-key org-mode-map "\C-c\C-x\C-w" 'org-cut-special)
18731 (string-match "|" (buffer-substring (point-at-bol) (point)))
18962 (defun org-cut-special ()
18963 "Cut region in table or cut current subtree.
18964 Calls `org-table-copy' or `org-cut-subtree', depending on context.
18968 (if (org-at-table-p) 'org-table-cut-region 'org-cut-subtree)))
18986 with prefix arg, realign all tags in the current buffer.
18989 triggers scanning the buffer for these lines and updating the
19001 - If the current buffer is a remember buffer, close note and file it.
19006 links in this buffer.
19019 (message "Temporary highlights/overlays removed from current buffer"))
19020 ((and (local-variable-p 'org-finish-function (current-buffer))
19110 ["Cut Rectangle" org-cut-special (org-at-table-p)]
19152 ["Subtree to indirect buffer" org-tree-to-indirect-buffer t])
19168 ["Cut Subtree" org-cut-special (not (org-at-table-p))]
19261 ["Store Link (Global)" org-store-link t]
19270 :style radio :selected (member '(org-link) buffer-invisibility-spec)]
19274 :style radio :selected (not (member '(org-link) buffer-invisibility-spec))])
19317 (let ((bl (buffer-list)))
19320 (set-buffer (pop bl))
19570 (defun org-find-base-buffer-visiting (file)
19571 "Like `find-buffer-visiting' but alway return the base buffer and
19572 not an indirect buffer"
19573 (let ((buf (find-buffer-visiting file)))
19574 (or (buffer-base-buffer buf) buf)))