Selaa lähdekoodia

Mark `org-bound-and-true-p' as obsolete

* lisp/org-macs.el (org-bound-and-true-p): Remove macro.
* lisp/org-compat.el (org-bound-and-true-p): Deprecated alias for
  `bound-and-true-p'.
* lisp/ob-core.el (org-babel-confirm-evaluate):
* lisp/org-agenda.el (org-agenda-write):
(org-agenda-add-entry-text):
(org-agenda-todo):
* lisp/org-clock.el (org-clocktable-defaults):
(org-clocktable-write-default):
* lisp/org-colview.el (org-columns):
(org-columns--compute-spec):
(org-agenda-columns):
* lisp/org-indent.el (org-indent-set-line-properties):
* lisp/org-inlinetask.el (org-inlinetask-fontify):
* lisp/org-mobile.el (org-mobile-write-agenda-for-mobile):
* lisp/org-pcomplete.el (pcomplete/org-mode/file-option/options):
(pcomplete/org-mode/file-option/infojs_opt):
* lisp/org-src.el (org-src-mode-configure-edit-buffer):
(org-edit-table.el):
* lisp/org.el (org-store-link):
(org-refile):
(org-get-export-keywords):
(org-set-tags):
(org-order-calendar-date-args):
(org-mode-restart):
(org-tbl-menu):
(org-beginning-of-line):
(org-end-of-line):
(org-kill-line):
(org-truely-invisible-p):
(org-remove-flyspell-overlays-in): Use `bound-and-true-p' instead of
`org-bound-and-true-p'.
Nicolas Goaziou 8 vuotta sitten
vanhempi
commit
ff80654617

+ 1 - 1
lisp/ob-core.el

@@ -279,7 +279,7 @@ environment, to override this check."
       (`nil nil)
       (`t t)
       (`query (or
-	       (and (not (org-bound-and-true-p
+	       (and (not (bound-and-true-p
 			  org-babel-confirm-evaluate-answer-no))
 		    (yes-or-no-p
 		     (format "Evaluate this %s code block%son your system? "

+ 4 - 4
lisp/org-agenda.el

@@ -3361,7 +3361,7 @@ the agenda to write."
 	     (org-agenda-remove-marked-text 'invisible 'org-filtered)
 	     (run-hooks 'org-agenda-before-write-hook)
 	     (cond
-	      ((org-bound-and-true-p org-mobile-creating-agendas)
+	      ((bound-and-true-p org-mobile-creating-agendas)
 	       (org-mobile-write-agenda-for-mobile file))
 	      ((string-match "\\.org\\'" file)
 	       (let (content p m message-log-max)
@@ -3441,7 +3441,7 @@ This will add a maximum of `org-agenda-add-entry-text-maxlines' lines of the
 entry text following headings shown in the agenda.
 Drawers will be excluded, also the line with scheduling/deadline info."
   (when (and (> org-agenda-add-entry-text-maxlines 0)
-	     (not (org-bound-and-true-p org-mobile-creating-agendas)))
+	     (not (bound-and-true-p org-mobile-creating-agendas)))
     (let (m txt)
       (goto-char (point-min))
       (while (not (eobp))
@@ -8870,7 +8870,7 @@ the same tree node, and the headline of the tree node in the Org-mode file."
 	  (call-interactively 'org-todo))
 	(and (bolp) (forward-char 1))
 	(setq newhead (org-get-heading))
-	(when (and (org-bound-and-true-p
+	(when (and (bound-and-true-p
 		    org-agenda-headline-snapshot-before-repeat)
 		   (not (equal org-agenda-headline-snapshot-before-repeat
 			       newhead))
@@ -8883,7 +8883,7 @@ the same tree node, and the headline of the tree node in the Org-mode file."
       (beginning-of-line 1)
       (save-window-excursion
 	(org-agenda-change-all-lines newhead hdmarker 'fixface just-one))
-      (when (org-bound-and-true-p org-clock-out-when-done)
+      (when (bound-and-true-p org-clock-out-when-done)
       	(string-match (concat "^" (regexp-opt org-done-keywords-for-agenda))
 		      newhead)
 	(org-agenda-unmark-clocking-task))

+ 2 - 2
lisp/org-clock.el

@@ -289,7 +289,7 @@ string as argument."
 (defcustom org-clocktable-defaults
   (list
    :maxlevel 2
-   :lang (or (org-bound-and-true-p org-export-default-language) "en")
+   :lang (or (bound-and-true-p org-export-default-language) "en")
    :scope 'file
    :block nil
    :wstart 1
@@ -2449,7 +2449,7 @@ from the dynamic block definition."
   ;; well-defined number of columns...
   (let* ((hlchars '((1 . "*") (2 . "/")))
 	 (lwords (assoc (or (plist-get params :lang)
-			    (org-bound-and-true-p org-export-default-language)
+			    (bound-and-true-p org-export-default-language)
 			    "en")
 			org-clock-clocktable-language-setup))
 	 (multifile (plist-get params :multifile))

+ 4 - 4
lisp/org-colview.el

@@ -805,7 +805,7 @@ When COLUMNS-FMT-STRING is non-nil, use it as the column format."
 	    (org-columns--set-widths cache)
 	    (org-columns--display-here-title)
 	    (when (setq-local org-columns-flyspell-was-active
-			      (org-bound-and-true-p flyspell-mode))
+			      (bound-and-true-p flyspell-mode))
 	      (flyspell-mode 0))
 	    (unless (local-variable-p 'org-colview-initial-truncate-line-value)
 	      (setq-local org-colview-initial-truncate-line-value
@@ -1121,7 +1121,7 @@ format instead.  Otherwise, use H:M format."
 SPEC is a column format specification.  When optional argument
 UPDATE is non-nil, summarized values can replace existing ones in
 properties drawers."
-  (let* ((lmax (if (org-bound-and-true-p org-inlinetask-min-level)
+  (let* ((lmax (if (bound-and-true-p org-inlinetask-min-level)
 		   org-inlinetask-min-level
 		 29))			;Hard-code deepest level.
 	 (lvals (make-vector (1+ lmax) nil))
@@ -1512,7 +1512,7 @@ PARAMS is a property list of parameters:
   (let ((org-columns--time (float-time (current-time)))
 	(fmt
 	 (cond
-	  ((org-bound-and-true-p org-agenda-overriding-columns-format))
+	  ((bound-and-true-p org-agenda-overriding-columns-format))
 	  ((let ((m (org-get-at-bol 'org-hd-marker)))
 	     (and m
 		  (or (org-entry-get m "COLUMNS" t)
@@ -1548,7 +1548,7 @@ PARAMS is a property list of parameters:
 	  (org-columns--set-widths cache)
 	  (org-columns--display-here-title)
 	  (when (setq-local org-columns-flyspell-was-active
-			    (org-bound-and-true-p flyspell-mode))
+			    (bound-and-true-p flyspell-mode))
 	    (flyspell-mode 0))
 	  (dolist (entry cache)
 	    (goto-char (car entry))

+ 4 - 2
lisp/org-compat.el

@@ -58,6 +58,7 @@
 
 ;;;; XEmacs compatibility, now removed.
 (define-obsolete-function-alias 'org-add-hook 'add-hook "Org 9.0")
+(define-obsolete-function-alias 'org-bound-and-true-p 'bound-and-true-p "Org 9.0")
 (define-obsolete-function-alias 'org-decompose-region 'decompose-region "Org 9.0")
 (define-obsolete-function-alias 'org-defvaralias 'defvaralias "Org 9.0")
 (define-obsolete-function-alias 'org-detach-overlay 'delete-overlay "Org 9.0")
@@ -75,7 +76,8 @@
   "Replace posix classes in regular expression."
   (declare (debug (form)))
   s)
-(make-obsolete 'org-re "It is now a no-op.  Please remove it altogether." "Org 9.0")
+(make-obsolete 'org-re "It is now a no-op.  You can safely remove it."
+	       "Org 9.0")
 
 ;;;; Functions from cl-lib that Org used to have its own implementation of.
 (define-obsolete-function-alias 'org-count 'cl-count "Org 9.0")
@@ -88,8 +90,8 @@
 (define-obsolete-function-alias 'org-floor* 'cl-floor "Org 9.0")
 
 ;;;; Functions available since Emacs 24.3
-(define-obsolete-function-alias 'org-char-to-string 'char-to-string "Org 9.0")
 (define-obsolete-function-alias 'org-buffer-narrowed-p 'buffer-narrowed-p "Org 9.0")
+(define-obsolete-function-alias 'org-char-to-string 'char-to-string "Org 9.0")
 (define-obsolete-function-alias 'org-delete-directory 'delete-directory "Org 9.0")
 (define-obsolete-function-alias 'org-number-sequence 'number-sequence "Org 9.0")
 (define-obsolete-function-alias 'org-pop-to-buffer-same-window 'pop-to-buffer-same-window "Org 9.0")

+ 1 - 1
lisp/org-indent.el

@@ -255,7 +255,7 @@ have `org-warning' face."
 			       ?*)))
 	 (line
 	  (cond
-	   ((and (org-bound-and-true-p org-inlinetask-show-first-star)
+	   ((and (bound-and-true-p org-inlinetask-show-first-star)
 		 (eq heading 'inlinetask))
 	    (concat org-indent-inlinetask-first-star
 		    (org-add-props (substring stars 1) nil 'face 'org-hide)))

+ 1 - 1
lisp/org-inlinetask.el

@@ -286,7 +286,7 @@ If the task has an end part, also demote it."
 		     ",\\}\\)\\(\\*\\* .*\\)"))
 	 ;; Virtual indentation will add the warning face on the first
 	 ;; star.  Thus, in that case, only hide it.
-	 (start-face (if (and (org-bound-and-true-p org-indent-mode)
+	 (start-face (if (and (bound-and-true-p org-indent-mode)
 			      (> org-indent-indentation-per-level 1))
 			 'org-hide
 		       'org-warning)))

+ 0 - 5
lisp/org-macs.el

@@ -47,11 +47,6 @@
       `(with-no-warnings (called-interactively-p ,kind))
     `(interactive-p)))
 
-(defmacro org-bound-and-true-p (var)
-  "Return the value of symbol VAR if it is bound, else nil."
-  (declare (debug (symbolp)))
-  `(and (boundp (quote ,var)) ,var))
-
 (defun org-string-nw-p (s)
   "Return S if S is a string containing a non-blank character.
 Otherwise, return nil."

+ 1 - 1
lisp/org-mobile.el

@@ -649,7 +649,7 @@ The table of checksums is written to the file mobile-checksums."
 		     m 10 "   " 'planning)
 		    "\n")
 	    (when (setq id
-			(if (org-bound-and-true-p
+			(if (bound-and-true-p
 			     org-mobile-force-id-on-agenda-items)
 			    (org-id-get m 'create)
 			  (or (org-entry-get m "ID")

+ 2 - 2
lisp/org-pcomplete.el

@@ -262,7 +262,7 @@ When completing for #+STARTUP, for example, this function returns
 	      "|:" "tags:" "tasks:" "<:" "todo:")
 	    ;; OPTION items from registered back-ends.
 	    (let (items)
-	      (dolist (backend (org-bound-and-true-p
+	      (dolist (backend (bound-and-true-p
 				org-export-registered-backends))
 		(dolist (option (org-export-backend-options backend))
 		  (let ((item (nth 2 option)))
@@ -274,7 +274,7 @@ When completing for #+STARTUP, for example, this function returns
   (while (pcomplete-here
 	  (pcomplete-uniqify-list
 	   (mapcar (lambda (item) (format "%s:" (car item)))
-		   (org-bound-and-true-p org-html-infojs-opts-table))))))
+		   (bound-and-true-p org-html-infojs-opts-table))))))
 
 (defun pcomplete/org-mode/file-option/bind ()
   "Complete arguments for the #+BIND file option, which are variable names."

+ 3 - 3
lisp/org-src.el

@@ -613,9 +613,9 @@ See also `org-src-mode-hook'."
 		   (setq org-src--auto-save-timer nil)))))))))
 
 (defun org-src-mode-configure-edit-buffer ()
-  (when (org-bound-and-true-p org-src--from-org-mode)
+  (when (bound-and-true-p org-src--from-org-mode)
     (add-hook 'kill-buffer-hook #'org-src--remove-overlay nil 'local)
-    (if (org-bound-and-true-p org-src--allow-write-back)
+    (if (bound-and-true-p org-src--allow-write-back)
 	(progn
 	  (setq buffer-offer-save t)
 	  (setq buffer-file-name
@@ -790,7 +790,7 @@ Throw an error when not at such a table."
      element
      (org-src--construct-edit-buffer-name (buffer-name) "Table")
      #'text-mode t)
-    (when (org-bound-and-true-p flyspell-mode) (flyspell-mode -1))
+    (when (bound-and-true-p flyspell-mode) (flyspell-mode -1))
     (table-recognize)
     t))
 

+ 14 - 14
lisp/org.el

@@ -9826,7 +9826,7 @@ active region."
 	  (t (setq link nil))))
 
 	;; We are in the agenda, link to referenced location
-	((equal (org-bound-and-true-p org-agenda-buffer-name) (buffer-name))
+	((equal (bound-and-true-p org-agenda-buffer-name) (buffer-name))
 	 (let ((m (or (get-text-property (point) 'org-hd-marker)
 		      (get-text-property (point) 'org-marker))))
 	   (when m
@@ -12002,7 +12002,7 @@ prefix argument (`C-u C-u C-u C-c C-w')."
 			  (bookmark-set bookmark-name))))
 		  ;; If we are refiling for capture, make sure that the
 		  ;; last-capture pointers point here
-		  (when (org-bound-and-true-p org-capture-is-refiling)
+		  (when (bound-and-true-p org-capture-is-refiling)
 		    (let ((bookmark-name (plist-get org-bookmark-names-plist
 						    :last-capture-marker)))
 		      (when bookmark-name
@@ -12320,7 +12320,7 @@ Export keywords include options, block names, attributes and
 keywords relative to each registered export back-end."
   (let (keywords)
     (dolist (backend
-	     (org-bound-and-true-p org-export-registered-backends)
+	     (bound-and-true-p org-export-registered-backends)
 	     (delq nil keywords))
       ;; Back-end name (for keywords, like #+LATEX:)
       (push (upcase (symbol-name (org-export-backend-name backend))) keywords)
@@ -15108,7 +15108,7 @@ When JUST-ALIGN is non-nil, only align tags."
 		(let* ((c0 (current-column))
 		       ;; Compute offset for the case of org-indent-mode
 		       ;; active.
-		       (di (if (org-bound-and-true-p org-indent-mode)
+		       (di (if (bound-and-true-p org-indent-mode)
 			       (* (1- org-indent-indentation-per-level)
 				  (1- level))
 			     0))
@@ -17363,7 +17363,7 @@ user function argument order change dependent on argument order."
        ((eq calendar-date-style 'iso)
 	(list arg2 arg3 arg1)))
     (org-no-warnings ;; european-calendar-style is obsolete as of version 23.1
-     (if (org-bound-and-true-p european-calendar-style)
+     (if (bound-and-true-p european-calendar-style)
 	 (list arg2 arg1 arg3)
        (list arg1 arg2 arg3)))))
 
@@ -21256,10 +21256,10 @@ Use \\[org-edit-special] to edit table.el tables"))
 
 (defun org-mode-restart ()
   (interactive)
-  (let ((indent-status (org-bound-and-true-p org-indent-mode)))
+  (let ((indent-status (bound-and-true-p org-indent-mode)))
     (funcall major-mode)
     (hack-local-variables)
-    (when (and indent-status (not (org-bound-and-true-p org-indent-mode)))
+    (when (and indent-status (not (bound-and-true-p org-indent-mode)))
       (org-indent-mode -1)))
   (message "%s restarted" major-mode))
 
@@ -21719,11 +21719,11 @@ on context.  See the individual commands for more information."
      ["Which Column?" org-table-current-column (org-at-table-p)])
     ["Debug Formulas"
      org-table-toggle-formula-debugger
-     :style toggle :selected (org-bound-and-true-p org-table-formula-debug)]
+     :style toggle :selected (bound-and-true-p org-table-formula-debug)]
     ["Show Col/Row Numbers"
      org-table-toggle-coordinate-overlays
      :style toggle
-     :selected (org-bound-and-true-p org-table-overlay-coordinates)]
+     :selected (bound-and-true-p org-table-overlay-coordinates)]
     "--"
     ["Create" org-table-create (and (not (org-at-table-p))
 				    org-enable-table-editor)]
@@ -23931,7 +23931,7 @@ beyond the end of the headline."
 		     (car org-special-ctrl-a/e)
 		   org-special-ctrl-a/e))
 	deactivate-mark	refpos)
-    (call-interactively (if (org-bound-and-true-p visual-line-mode)
+    (call-interactively (if (bound-and-true-p visual-line-mode)
 			    #'beginning-of-visual-line
 			  #'move-beginning-of-line))
     (cond
@@ -23983,7 +23983,7 @@ the cursor is already beyond the end of the headline."
   (interactive "P")
   (let ((special (if (consp org-special-ctrl-a/e) (cdr org-special-ctrl-a/e)
 		   org-special-ctrl-a/e))
-	(move-fun (cond ((org-bound-and-true-p visual-line-mode)
+	(move-fun (cond ((bound-and-true-p visual-line-mode)
 			 'end-of-visual-line)
 			((fboundp 'move-end-of-line) 'move-end-of-line)
 			(t 'end-of-line)))
@@ -24077,7 +24077,7 @@ depending on context."
 		   (not (y-or-n-p "Kill hidden subtree along with headline? "))))
       (user-error "C-k aborted as it would kill a hidden subtree"))
     (call-interactively
-     (if (org-bound-and-true-p visual-line-mode) 'kill-visual-line 'kill-line)))
+     (if (bound-and-true-p visual-line-mode) 'kill-visual-line 'kill-line)))
    ((looking-at ".*?\\S-\\([ \t]+\\(:[[:alnum:]_@#%:]+:\\)\\)[ \t]*$")
     (kill-region (point) (match-beginning 1))
     (org-set-tags nil t))
@@ -24194,7 +24194,7 @@ interactive command with similar behavior."
 This version does not only check the character property, but also
 `visible-mode'."
   ;; Early versions of noutline don't have `outline-invisible-p'.
-  (unless (org-bound-and-true-p visible-mode)
+  (unless (bound-and-true-p visible-mode)
     (outline-invisible-p)))
 
 (defun org-invisible-p2 ()
@@ -25225,7 +25225,7 @@ ELEMENT is the element at point."
 
 (defun org-remove-flyspell-overlays-in (beg end)
   "Remove flyspell overlays in region."
-  (and (org-bound-and-true-p flyspell-mode)
+  (and (bound-and-true-p flyspell-mode)
        (fboundp 'flyspell-delete-region-overlays)
        (flyspell-delete-region-overlays beg end)))