1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-11-24 07:20:29 +00:00

adding optional argument KIND to all org-called-interactively-p function invocations

* lisp/ob.el (org-babel-sha1-hash): Adding optional argument KIND to
  all org-called-interactively-p function invocations.
* lisp/org-agenda.el (org-agenda-redo): Adding optional argument KIND to
  all org-called-interactively-p function invocations.
  (org-agenda-show-1): Adding optional argument KIND to all
  org-called-interactively-p function invocations.
  (org-agenda-set-tags): Adding optional argument KIND to all
  org-called-interactively-p function invocations.
* lisp/org-ascii.el (org-export-as-latin1): Adding optional argument
  KIND to all org-called-interactively-p function invocations.
  (org-export-as-latin1-to-buffer): Adding optional argument KIND to
  all org-called-interactively-p function invocations.
  (org-export-as-utf8-to-buffer): Adding optional argument KIND to all
  org-called-interactively-p function invocations.
  (org-export-region-as-ascii): Adding optional argument KIND to all
  org-called-interactively-p function invocations.
* lisp/org-docbook.el (org-export-region-as-docbook): Adding optional
  argument KIND to all org-called-interactively-p function
  invocations.
* lisp/org-html.el (org-export-region-as-html): Adding optional
  argument KIND to all org-called-interactively-p function
  invocations.
* lisp/org-latex.el (org-export-region-as-latex): Adding optional
  argument KIND to all org-called-interactively-p function
  invocations.
* lisp/org-table.el (org-table-blank-field): Adding optional argument
  KIND to all org-called-interactively-p function invocations.
  (org-table-current-column): Adding optional argument KIND to all
  org-called-interactively-p function invocations.
  (org-table-current-dline): Adding optional argument KIND to all
  org-called-interactively-p function invocations.
  (org-table-sort-lines): Adding optional argument KIND to all
  org-called-interactively-p function invocations.
  (org-table-sum): Adding optional argument KIND to all
  org-called-interactively-p function invocations.
  (org-table-rotate-recalc-marks): Adding optional argument KIND to
  all org-called-interactively-p function invocations.
  (org-table-eval-formula): Adding optional argument KIND to all
  org-called-interactively-p function invocations.
  (orgtbl-send-table): Adding optional argument KIND to all
  org-called-interactively-p function invocations.
* lisp/org.el (org-mode): Adding optional argument KIND to all
  org-called-interactively-p function invocations.
  (org-copy-subtree): Adding optional argument KIND to all
  org-called-interactively-p function invocations.
  (org-paste-subtree): Adding optional argument KIND to all
  org-called-interactively-p function invocations.
  (org-store-link): Adding optional argument KIND to all
  org-called-interactively-p function invocations.
  (org-todo): Adding optional argument KIND to all
  org-called-interactively-p function invocations.
  (org-occur): Adding optional argument KIND to all
  org-called-interactively-p function invocations.
This commit is contained in:
Michael Markert 2011-06-30 00:25:09 +02:00 committed by Eric Schulte
parent c5a6d3a974
commit b3e8b3f87c
8 changed files with 45 additions and 38 deletions

View File

@ -749,7 +749,9 @@ the current subtree."
(setf (nth 2 info)
(sort (copy-sequence (nth 2 info))
(lambda (a b) (string< (car a) (car b)))))
((lambda (hash) (when (org-called-interactively-p) (message hash)) hash)
((lambda (hash)
(when (org-called-interactively-p 'interactive) (message hash))
hash)
(sha1 (format "%s-%s"
(mapconcat
#'identity

View File

@ -6083,7 +6083,7 @@ When this is the global TODO list, a prefix argument will be interpreted."
(message "Rebuilding agenda buffer...done")
(put 'org-agenda-filter :preset-filter preset)
(and (or filter preset) (org-agenda-filter-apply filter))
(and cols (org-called-interactively-p) (org-agenda-columns))
(and cols (org-called-interactively-p 'any) (org-agenda-columns))
(org-goto-line line)
(recenter window-line)))
@ -7034,7 +7034,7 @@ if it was hidden in the outline."
(org-back-to-heading)
(run-hook-with-args 'org-cycle-hook 'folded))
(message "Remote: FOLDED"))
((and (org-called-interactively-p) (= more 1))
((and (org-called-interactively-p 'any) (= more 1))
(message "Remote: show with default settings"))
((= more 2)
(show-entry)
@ -7335,7 +7335,7 @@ the same tree node, and the headline of the tree node in the Org-mode file."
"Set tags for the current headline."
(interactive)
(org-agenda-check-no-diary)
(if (and (org-region-active-p) (org-called-interactively-p))
(if (and (org-region-active-p) (org-called-interactively-p 'any))
(call-interactively 'org-change-tag-in-region)
(let* ((hdmarker (or (org-get-at-bol 'org-hd-marker)
(org-agenda-error)))

View File

@ -96,15 +96,15 @@ utf8 Use all UTF-8 characters")
(defun org-export-as-latin1 (&rest args)
"Like `org-export-as-ascii', use latin1 encoding for special symbols."
(interactive)
(org-export-as-encoding 'org-export-as-ascii (org-called-interactively-p)
(org-export-as-encoding 'org-export-as-ascii (org-called-interactively-p 'any)
'latin1 args))
;;;###autoload
(defun org-export-as-latin1-to-buffer (&rest args)
"Like `org-export-as-ascii-to-buffer', use latin1 encoding for symbols."
(interactive)
(org-export-as-encoding 'org-export-as-ascii-to-buffer (org-called-interactively-p)
'latin1 args))
(org-export-as-encoding 'org-export-as-ascii-to-buffer
(org-called-interactively-p 'any) 'latin1 args))
;;;###autoload
(defun org-export-as-utf8 (&rest args)
@ -117,8 +117,8 @@ utf8 Use all UTF-8 characters")
(defun org-export-as-utf8-to-buffer (&rest args)
"Like `org-export-as-ascii-to-buffer', use utf8 encoding for symbols."
(interactive)
(org-export-as-encoding 'org-export-as-ascii-to-buffer (org-called-interactively-p)
'utf8 args))
(org-export-as-encoding 'org-export-as-ascii-to-buffer
(org-called-interactively-p 'any) 'utf8 args))
(defun org-export-as-encoding (command interactivep encoding &rest args)
(let ((org-export-ascii-entities encoding))
@ -176,7 +176,7 @@ a Lisp program could call this function in the following way:
When called interactively, the output buffer is selected, and shown
in a window. A non-interactive call will only return the buffer."
(interactive "r\nP")
(when (org-called-interactively-p)
(when (org-called-interactively-p 'any)
(setq buffer "*Org ASCII Export*"))
(let ((transient-mark-mode t) (zmacs-regions t)
ext-plist rtn)
@ -188,7 +188,7 @@ in a window. A non-interactive call will only return the buffer."
nil nil ext-plist
buffer body-only))
(if (fboundp 'deactivate-mark) (deactivate-mark))
(if (and (org-called-interactively-p) (bufferp rtn))
(if (and (org-called-interactively-p 'any) (bufferp rtn))
(switch-to-buffer-other-window rtn)
rtn)))

View File

@ -325,7 +325,7 @@ could call this function in the following way:
When called interactively, the output buffer is selected, and shown
in a window. A non-interactive call will only return the buffer."
(interactive "r\nP")
(when (org-called-interactively-p)
(when (org-called-interactively-p 'any)
(setq buffer "*Org DocBook Export*"))
(let ((transient-mark-mode t)
(zmacs-regions t)
@ -337,7 +337,7 @@ in a window. A non-interactive call will only return the buffer."
nil nil
buffer body-only))
(if (fboundp 'deactivate-mark) (deactivate-mark))
(if (and (org-called-interactively-p) (bufferp rtn))
(if (and (org-called-interactively-p 'any) (bufferp rtn))
(switch-to-buffer-other-window rtn)
rtn)))

View File

@ -724,7 +724,7 @@ a Lisp program could call this function in the following way:
When called interactively, the output buffer is selected, and shown
in a window. A non-interactive call will only return the buffer."
(interactive "r\nP")
(when (org-called-interactively-p)
(when (org-called-interactively-p 'any)
(setq buffer "*Org HTML Export*"))
(let ((transient-mark-mode t) (zmacs-regions t)
ext-plist rtn)
@ -736,7 +736,7 @@ in a window. A non-interactive call will only return the buffer."
nil nil ext-plist
buffer body-only))
(if (fboundp 'deactivate-mark) (deactivate-mark))
(if (and (org-called-interactively-p) (bufferp rtn))
(if (and (org-called-interactively-p 'any) (bufferp rtn))
(switch-to-buffer-other-window rtn)
rtn)))

View File

@ -717,7 +717,7 @@ a Lisp program could call this function in the following way:
When called interactively, the output buffer is selected, and shown
in a window. A non-interactive call will only return the buffer."
(interactive "r\nP")
(when (org-called-interactively-p)
(when (org-called-interactively-p 'any)
(setq buffer "*Org LaTeX Export*"))
(let ((transient-mark-mode t) (zmacs-regions t)
ext-plist rtn)
@ -729,7 +729,7 @@ in a window. A non-interactive call will only return the buffer."
nil nil ext-plist
buffer body-only))
(if (fboundp 'deactivate-mark) (deactivate-mark))
(if (and (org-called-interactively-p) (bufferp rtn))
(if (and (org-called-interactively-p 'any) (bufferp rtn))
(switch-to-buffer-other-window rtn)
rtn)))

View File

@ -1117,7 +1117,7 @@ Return t when the line exists, nil if it does not exist."
"Blank the current table field or active region."
(interactive)
(org-table-check-inside-data-field)
(if (and (org-called-interactively-p) (org-region-active-p))
(if (and (org-called-interactively-p 'any) (org-region-active-p))
(let (org-table-clip)
(org-table-cut-region (region-beginning) (region-end)))
(skip-chars-backward "^|")
@ -1193,27 +1193,30 @@ is always the old value."
(defun org-table-current-column ()
"Find out which column we are in."
(interactive)
(if (org-called-interactively-p) (org-table-check-inside-data-field))
(if (org-called-interactively-p 'any) (org-table-check-inside-data-field))
(save-excursion
(let ((cnt 0) (pos (point)))
(beginning-of-line 1)
(while (search-forward "|" pos t)
(setq cnt (1+ cnt)))
(if (org-called-interactively-p) (message "In table column %d" cnt))
(when (org-called-interactively-p 'interactive)
(message "In table column %d" cnt))
cnt)))
(defun org-table-current-dline ()
"Find out what table data line we are in.
Only data lines count for this."
(interactive)
(if (org-called-interactively-p) (org-table-check-inside-data-field))
(when (org-called-interactively-p 'any)
(org-table-check-inside-data-field))
(save-excursion
(let ((cnt 0) (pos (point)))
(goto-char (org-table-begin))
(while (<= (point) pos)
(if (looking-at org-table-dataline-regexp) (setq cnt (1+ cnt)))
(beginning-of-line 2))
(if (org-called-interactively-p) (message "This is table line %d" cnt))
(when (org-called-interactively-p 'any)
(message "This is table line %d" cnt))
cnt)))
(defun org-table-goto-column (n &optional on-delim force)
@ -1540,7 +1543,7 @@ should be done in reverse order."
(thiscol (org-table-current-column))
beg end bcol ecol tend tbeg column lns pos)
(when (equal thiscol 0)
(if (org-called-interactively-p)
(if (org-called-interactively-p 'any)
(setq thiscol
(string-to-number
(read-string "Use column N for sorting: ")))
@ -1933,7 +1936,7 @@ If NLAST is a number, only the NLAST fields will actually be summed."
s diff)
(format "%d:%02d:%02d" h m s))))
(kill-new sres)
(if (org-called-interactively-p)
(if (org-called-interactively-p 'interactive)
(message "%s"
(substitute-command-keys
(format "Sum of %d items: %-20s (\\[yank] will insert result into buffer)"
@ -2303,7 +2306,8 @@ of the new mark."
(org-goto-line l1)))
(if (not (= epos (point-at-eol))) (org-table-align))
(org-goto-line l)
(and (org-called-interactively-p) (message "%s" (cdr (assoc new org-recalc-marks))))))
(and (org-called-interactively-p 'interactive)
(message "%s" (cdr (assoc new org-recalc-marks))))))
(defun org-table-maybe-recalculate-line ()
"Recompute the current line if marked for it, and if we haven't just done it."
@ -2521,7 +2525,7 @@ $1-> %s\n" orig formula form0 form))
(if fmt (format fmt (string-to-number ev)) ev)))))
(setq bw (get-buffer-window "*Substitution History*"))
(org-fit-window-to-buffer bw)
(unless (and (org-called-interactively-p) (not ndown))
(unless (and (org-called-interactively-p 'any) (not ndown))
(unless (let (inhibit-redisplay)
(y-or-n-p "Debugging Formula. Continue to next? "))
(org-table-align)
@ -4149,7 +4153,7 @@ this table."
(catch 'exit
(unless (org-at-table-p) (error "Not at a table"))
;; when non-interactive, we assume align has just happened.
(when (org-called-interactively-p) (org-table-align))
(when (org-called-interactively-p 'any) (org-table-align))
(let ((dests (orgtbl-gather-send-defs))
(txt (buffer-substring-no-properties (org-table-begin)
(org-table-end)))

View File

@ -4830,7 +4830,7 @@ The following commands are available:
;; If empty file that did not turn on org-mode automatically, make it to.
(if (and org-insert-mode-line-in-empty-file
(org-called-interactively-p)
(org-called-interactively-p 'any)
(= (point-min) (point-max)))
(insert "# -*- mode: org -*-\n\n"))
(unless org-inhibit-startup
@ -7437,7 +7437,7 @@ of some markers in the region, even if CUT is non-nil. This is
useful if the caller implements cut-and-paste as copy-then-paste-then-cut."
(interactive "p")
(let (beg end folded (beg0 (point)))
(if (org-called-interactively-p)
(if (org-called-interactively-p 'any)
(org-back-to-heading nil) ; take what looks like a subtree
(org-back-to-heading t)) ; take what is really there
(org-back-over-empty-lines)
@ -7566,7 +7566,7 @@ the inserted text when done."
(setq shift (+ delta shift)))
(goto-char (point-min))
(setq newend (point-max))))
(when (or (org-called-interactively-p) for-yank)
(when (or (org-called-interactively-p 'interactive) for-yank)
(message "Clipboard pasted as level %d subtree" new-level))
(if (and (not for-yank) ; in this case, org-yank will decide about folding
kill-ring
@ -8443,7 +8443,7 @@ For file links, arg negates `org-context-in-file-links'."
(when m
(org-with-point-at m
(setq agenda-link
(if (org-called-interactively-p)
(if (org-called-interactively-p 'any)
(call-interactively 'org-store-link)
(org-store-link nil)))))))
@ -8506,9 +8506,10 @@ For file links, arg negates `org-context-in-file-links'."
((and (featurep 'org-id)
(or (eq org-link-to-org-use-id t)
(and (eq org-link-to-org-use-id 'create-if-interactive)
(org-called-interactively-p))
(and (eq org-link-to-org-use-id 'create-if-interactive-and-no-custom-id)
(org-called-interactively-p)
(org-called-interactively-p 'any))
(and (eq org-link-to-org-use-id
'create-if-interactive-and-no-custom-id)
(org-called-interactively-p 'any)
(not custom-id))
(and org-link-to-org-use-id
(org-entry-get nil "ID"))))
@ -8563,7 +8564,7 @@ For file links, arg negates `org-context-in-file-links'."
desc "NONE")))
(setq link (org-make-link cpltxt)))
((org-called-interactively-p)
((org-called-interactively-p 'interactive)
(error "Cannot link to a buffer which is not visiting a file"))
(t (setq link nil)))
@ -8573,7 +8574,7 @@ For file links, arg negates `org-context-in-file-links'."
desc (or desc cpltxt))
(if (equal desc "NONE") (setq desc nil))
(if (and (or (org-called-interactively-p) executing-kbd-macro) link)
(if (and (or (org-called-interactively-p 'any) executing-kbd-macro) link)
(progn
(setq org-stored-links
(cons (list link desc) org-stored-links))
@ -11015,7 +11016,7 @@ For calling through lisp, arg is also interpreted in the following way:
(org-with-wide-buffer
(run-hook-with-args-until-failure
'org-blocker-hook change-plist))))
(if (org-called-interactively-p)
(if (org-called-interactively-p 'interactive)
(error "TODO state change from %s to %s blocked" this state)
;; fail silently
(message "TODO state change from %s to %s blocked" this state)
@ -12162,7 +12163,7 @@ that the match should indeed be shown."
(unless org-sparse-tree-open-archived-trees
(org-hide-archived-subtrees (point-min) (point-max)))
(run-hooks 'org-occur-hook)
(if (org-called-interactively-p)
(if (org-called-interactively-p 'interactive)
(message "%d match(es) for regexp %s" cnt regexp))
cnt))