|
@@ -4403,7 +4403,7 @@ means to push this value onto the list in the variable.")
|
|
|
|
|
|
(defun org-set-regexps-and-options ()
|
|
|
"Precompute regular expressions for current buffer."
|
|
|
- (when (org-mode-p)
|
|
|
+ (when (eq major-mode 'org-mode)
|
|
|
(org-set-local 'org-todo-kwd-alist nil)
|
|
|
(org-set-local 'org-todo-key-alist nil)
|
|
|
(org-set-local 'org-todo-key-trigger nil)
|
|
@@ -6020,7 +6020,7 @@ in special contexts.
|
|
|
(and limit-level (1- (* limit-level 2)))
|
|
|
limit-level)))
|
|
|
(org-outline-regexp
|
|
|
- (if (not (org-mode-p))
|
|
|
+ (if (not (eq major-mode 'org-mode))
|
|
|
outline-regexp
|
|
|
(concat "\\*" (if nstars (format "\\{1,%d\\} " nstars) "+ "))))
|
|
|
(bob-special (and org-cycle-global-at-bob (not arg) (bobp)
|
|
@@ -6259,7 +6259,7 @@ With \\[universal-argument] prefix arg, switch to startup visibility.
|
|
|
With a numeric prefix, show all headlines up to that level."
|
|
|
(interactive "P")
|
|
|
(let ((org-cycle-include-plain-lists
|
|
|
- (if (org-mode-p) org-cycle-include-plain-lists nil)))
|
|
|
+ (if (eq major-mode 'org-mode) org-cycle-include-plain-lists nil)))
|
|
|
(cond
|
|
|
((integerp arg)
|
|
|
(show-all)
|
|
@@ -6469,7 +6469,7 @@ open and agenda-wise Org files."
|
|
|
(let ((files (mapcar 'expand-file-name (org-agenda-files))))
|
|
|
(dolist (buf (buffer-list))
|
|
|
(with-current-buffer buf
|
|
|
- (if (and (org-mode-p) (buffer-file-name))
|
|
|
+ (if (and (eq major-mode 'org-mode) (buffer-file-name))
|
|
|
(let ((file (expand-file-name (buffer-file-name))))
|
|
|
(unless (member file files)
|
|
|
(push file files))))))
|
|
@@ -6485,7 +6485,7 @@ open and agenda-wise Org files."
|
|
|
|
|
|
(defun org-cycle-hide-drawers (state)
|
|
|
"Re-hide all drawers after a visibility state change."
|
|
|
- (when (and (org-mode-p)
|
|
|
+ (when (and (eq major-mode 'org-mode)
|
|
|
(not (memq state '(overview folded contents))))
|
|
|
(save-excursion
|
|
|
(let* ((globalp (memq state '(contents all)))
|
|
@@ -8630,7 +8630,7 @@ For file links, arg negates `org-context-in-file-links'."
|
|
|
(setq cpltxt (concat "file:" file)
|
|
|
link (org-make-link cpltxt))))
|
|
|
|
|
|
- ((and (buffer-file-name (buffer-base-buffer)) (org-mode-p))
|
|
|
+ ((and (buffer-file-name (buffer-base-buffer)) (eq major-mode 'org-mode))
|
|
|
(setq custom-id (org-entry-get nil "CUSTOM_ID"))
|
|
|
(cond
|
|
|
((org-in-regexp "<<\\(.*?\\)>>")
|
|
@@ -9774,12 +9774,12 @@ in all files. If AVOID-POS is given, ignore matches near that position."
|
|
|
((string-match "^/\\(.*\\)/$" s)
|
|
|
;; A regular expression
|
|
|
(cond
|
|
|
- ((org-mode-p)
|
|
|
+ ((eq major-mode 'org-mode)
|
|
|
(org-occur (match-string 1 s)))
|
|
|
;;((eq major-mode 'dired-mode)
|
|
|
;; (grep (concat "grep -n -e '" (match-string 1 s) "' *")))
|
|
|
(t (org-do-occur (match-string 1 s)))))
|
|
|
- ((and (org-mode-p) org-link-search-must-match-exact-headline)
|
|
|
+ ((and (eq major-mode 'org-mode) org-link-search-must-match-exact-headline)
|
|
|
(and (equal (string-to-char s) ?*) (setq s (substring s 1)))
|
|
|
(goto-char (point-min))
|
|
|
(cond
|
|
@@ -9847,7 +9847,7 @@ in all files. If AVOID-POS is given, ignore matches near that position."
|
|
|
(goto-char (match-beginning 1))
|
|
|
(goto-char pos)
|
|
|
(error "No match"))))))
|
|
|
- (and (org-mode-p) (org-show-context 'link-search))
|
|
|
+ (and (eq major-mode 'org-mode) (org-show-context 'link-search))
|
|
|
type))
|
|
|
|
|
|
(defun org-search-not-self (group &rest args)
|
|
@@ -10116,7 +10116,7 @@ If the file does not exist, an error is thrown."
|
|
|
(set-match-data link-match-data)
|
|
|
(eval cmd))))
|
|
|
(t (funcall (cdr (assq 'file org-link-frame-setup)) file)))
|
|
|
- (and (org-mode-p) (eq old-mode 'org-mode)
|
|
|
+ (and (eq major-mode 'org-mode) (eq old-mode 'org-mode)
|
|
|
(or (not (equal old-buffer (current-buffer)))
|
|
|
(not (equal old-pos (point))))
|
|
|
(org-mark-ring-push old-pos old-buffer))))
|
|
@@ -10439,7 +10439,7 @@ such as the file name."
|
|
|
(interactive "P")
|
|
|
(let* ((bfn (buffer-file-name (buffer-base-buffer)))
|
|
|
(case-fold-search nil)
|
|
|
- (path (and (org-mode-p) (org-get-outline-path))))
|
|
|
+ (path (and (eq major-mode 'org-mode) (org-get-outline-path))))
|
|
|
(if current (setq path (append path
|
|
|
(save-excursion
|
|
|
(org-back-to-heading t)
|
|
@@ -10906,7 +10906,7 @@ Error if there is no such block at point."
|
|
|
"Update all dynamic blocks in the buffer.
|
|
|
This function can be used in a hook."
|
|
|
(interactive)
|
|
|
- (when (org-mode-p)
|
|
|
+ (when (eq major-mode 'org-mode)
|
|
|
(org-map-dblocks 'org-update-dblock)))
|
|
|
|
|
|
|
|
@@ -13292,7 +13292,7 @@ This works in the agenda, and also in an org-mode buffer."
|
|
|
(interactive
|
|
|
(list (region-beginning) (region-end)
|
|
|
(let ((org-last-tags-completion-table
|
|
|
- (if (org-mode-p)
|
|
|
+ (if (eq major-mode 'org-mode)
|
|
|
(org-get-buffer-tags)
|
|
|
(org-global-tags-completion-table))))
|
|
|
(org-icompleting-read
|
|
@@ -13311,7 +13311,7 @@ This works in the agenda, and also in an org-mode buffer."
|
|
|
(loop for l from l1 to l2 do
|
|
|
(org-goto-line l)
|
|
|
(setq m (get-text-property (point) 'org-hd-marker))
|
|
|
- (when (or (and (org-mode-p) (org-on-heading-p))
|
|
|
+ (when (or (and (eq major-mode 'org-mode) (org-on-heading-p))
|
|
|
(and agendap m))
|
|
|
(setq buf (if agendap (marker-buffer m) (current-buffer))
|
|
|
pos (if agendap m (point)))
|
|
@@ -13881,7 +13881,7 @@ things up because then unnecessary parsing is avoided."
|
|
|
beg end range props sum-props key key1 value string clocksum)
|
|
|
(save-excursion
|
|
|
(when (condition-case nil
|
|
|
- (and (org-mode-p) (org-back-to-heading t))
|
|
|
+ (and (eq major-mode 'org-mode) (org-back-to-heading t))
|
|
|
(error nil))
|
|
|
(setq beg (point))
|
|
|
(setq sum-props (get-text-property (point) 'org-summaries))
|
|
@@ -16010,7 +16010,7 @@ Entries containing a colon are interpreted as H:MM by
|
|
|
"Save all Org-mode buffers without user confirmation."
|
|
|
(interactive)
|
|
|
(message "Saving all Org-mode buffers...")
|
|
|
- (save-some-buffers t 'org-mode-p)
|
|
|
+ (save-some-buffers t (lambda () (eq major-mode 'org-mode)))
|
|
|
(when (featurep 'org-id) (org-id-locations-save))
|
|
|
(message "Saving all Org-mode buffers... done"))
|
|
|
|
|
@@ -16034,7 +16034,7 @@ changes from another. I believe the procedure must be like this:
|
|
|
(save-window-excursion
|
|
|
(mapc
|
|
|
(lambda (b)
|
|
|
- (when (and (with-current-buffer b (org-mode-p))
|
|
|
+ (when (and (with-current-buffer b (eq major-mode 'org-mode))
|
|
|
(with-current-buffer b buffer-file-name))
|
|
|
(org-pop-to-buffer-same-window b)
|
|
|
(revert-buffer t 'no-confirm)))
|
|
@@ -16086,17 +16086,17 @@ If EXCLUDE-TMP is non-nil, ignore temporary buffers."
|
|
|
(filter
|
|
|
(cond
|
|
|
((eq predicate 'files)
|
|
|
- (lambda (b) (with-current-buffer b (org-mode-p))))
|
|
|
+ (lambda (b) (with-current-buffer b (eq major-mode 'org-mode))))
|
|
|
((eq predicate 'export)
|
|
|
(lambda (b) (string-match "\*Org .*Export" (buffer-name b))))
|
|
|
((eq predicate 'agenda)
|
|
|
(lambda (b)
|
|
|
(with-current-buffer b
|
|
|
- (and (org-mode-p)
|
|
|
+ (and (eq major-mode 'org-mode)
|
|
|
(setq bfn (buffer-file-name b))
|
|
|
(member (file-truename bfn) agenda-files)))))
|
|
|
(t (lambda (b) (with-current-buffer b
|
|
|
- (or (org-mode-p)
|
|
|
+ (or (eq major-mode 'org-mode)
|
|
|
(string-match "\*Org .*Export"
|
|
|
(buffer-name b)))))))))
|
|
|
(delq nil
|
|
@@ -16398,7 +16398,7 @@ an embedded LaTeX fragment, let texmathp do its job.
|
|
|
(interactive)
|
|
|
(let (p)
|
|
|
(cond
|
|
|
- ((not (org-mode-p)) ad-do-it)
|
|
|
+ ((not (eq major-mode 'org-mode)) ad-do-it)
|
|
|
((eq this-command 'cdlatex-math-symbol)
|
|
|
(setq ad-return-value t
|
|
|
texmathp-why '("cdlatex-math-symbol in org-mode" . 0)))
|
|
@@ -18837,8 +18837,8 @@ Your bug report will be posted to the Org-mode mailing list.
|
|
|
(save-excursion
|
|
|
(while bl
|
|
|
(set-buffer (pop bl))
|
|
|
- (if (org-mode-p) (setq bl nil)))
|
|
|
- (when (org-mode-p)
|
|
|
+ (if (eq major-mode 'org-mode) (setq bl nil)))
|
|
|
+ (when (eq major-mode 'org-mode)
|
|
|
(easy-menu-change
|
|
|
'("Org") "File List for Agenda"
|
|
|
(append
|
|
@@ -19424,18 +19424,18 @@ NAMES is a list of strings containing names of blocks."
|
|
|
;; Emacs 23
|
|
|
(add-hook 'occur-mode-find-occurrence-hook
|
|
|
(lambda ()
|
|
|
- (when (org-mode-p)
|
|
|
+ (when (eq major-mode 'org-mode)
|
|
|
(org-reveal))))
|
|
|
;; Emacs 22
|
|
|
(defadvice occur-mode-goto-occurrence
|
|
|
(after org-occur-reveal activate)
|
|
|
- (and (org-mode-p) (org-reveal)))
|
|
|
+ (and (eq major-mode 'org-mode) (org-reveal)))
|
|
|
(defadvice occur-mode-goto-occurrence-other-window
|
|
|
(after org-occur-reveal activate)
|
|
|
- (and (org-mode-p) (org-reveal)))
|
|
|
+ (and (eq major-mode 'org-mode) (org-reveal)))
|
|
|
(defadvice occur-mode-display-occurrence
|
|
|
(after org-occur-reveal activate)
|
|
|
- (when (org-mode-p)
|
|
|
+ (when (eq major-mode 'org-mode)
|
|
|
(let ((pos (occur-mode-find-occurrence)))
|
|
|
(with-current-buffer (marker-buffer pos)
|
|
|
(save-excursion
|
|
@@ -20491,7 +20491,7 @@ If there is no such heading, return nil."
|
|
|
(org-back-to-heading invisible-OK)
|
|
|
(let ((first t)
|
|
|
(level (funcall outline-level)))
|
|
|
- (if (and (org-mode-p) (< level 1000))
|
|
|
+ (if (and (eq major-mode 'org-mode) (< level 1000))
|
|
|
;; A true heading (not a plain list item), in Org-mode
|
|
|
;; This means we can easily find the end by looking
|
|
|
;; only for the right number of stars. Using a regexp to do
|
|
@@ -20516,7 +20516,7 @@ If there is no such heading, return nil."
|
|
|
|
|
|
(defadvice outline-end-of-subtree (around prefer-org-version activate compile)
|
|
|
"Use Org version in org-mode, for dramatic speed-up."
|
|
|
- (if (org-mode-p)
|
|
|
+ (if (eq major-mode 'org-mode)
|
|
|
(progn
|
|
|
(org-end-of-subtree nil t)
|
|
|
(unless (eobp) (backward-char 1)))
|
|
@@ -20688,7 +20688,7 @@ Show the heading too, if it is currently invisible."
|
|
|
'(progn
|
|
|
(add-hook 'imenu-after-jump-hook
|
|
|
(lambda ()
|
|
|
- (if (org-mode-p)
|
|
|
+ (if (eq major-mode 'org-mode)
|
|
|
(org-show-context 'org-goto))))))
|
|
|
|
|
|
(defun org-link-display-format (link)
|
|
@@ -20749,7 +20749,7 @@ To get rid of the restriction, use \\[org-agenda-remove-restriction-lock]."
|
|
|
(with-current-buffer (find-file-noselect
|
|
|
(let ((default-directory dir))
|
|
|
(expand-file-name txt)))
|
|
|
- (unless (org-mode-p)
|
|
|
+ (unless (eq major-mode 'org-mode)
|
|
|
(error "Cannot restrict to non-Org-mode file"))
|
|
|
(org-agenda-set-restriction-lock 'file)))
|
|
|
(t (error "Don't know how to restrict Org-mode's agenda")))
|
|
@@ -20766,7 +20766,7 @@ To get rid of the restriction, use \\[org-agenda-remove-restriction-lock]."
|
|
|
(define-key speedbar-file-key-map ">" 'org-agenda-remove-restriction-lock)
|
|
|
(define-key speedbar-file-key-map "\C-c\C-x>" 'org-agenda-remove-restriction-lock)
|
|
|
(add-hook 'speedbar-visiting-tag-hook
|
|
|
- (lambda () (and (org-mode-p) (org-show-context 'org-goto))))))
|
|
|
+ (lambda () (and (eq major-mode 'org-mode) (org-show-context 'org-goto))))))
|
|
|
|
|
|
;;; Fixes and Hacks for problems with other packages
|
|
|
|
|
@@ -20809,12 +20809,12 @@ To get rid of the restriction, use \\[org-agenda-remove-restriction-lock]."
|
|
|
(eval-after-load "ecb"
|
|
|
'(defadvice ecb-method-clicked (after esf/org-show-context activate)
|
|
|
"Make hierarchy visible when jumping into location from ECB tree buffer."
|
|
|
- (if (org-mode-p)
|
|
|
+ (if (eq major-mode 'org-mode)
|
|
|
(org-show-context))))
|
|
|
|
|
|
(defun org-bookmark-jump-unhide ()
|
|
|
"Unhide the current position, to show the bookmark location."
|
|
|
- (and (org-mode-p)
|
|
|
+ (and (eq major-mode 'org-mode)
|
|
|
(or (outline-invisible-p)
|
|
|
(save-excursion (goto-char (max (point-min) (1- (point))))
|
|
|
(outline-invisible-p)))
|