Browse Source

Merge branch 'maint'

Conflicts:
	lisp/org-list.el
Bastien 10 years ago
parent
commit
7e5249c9fd
2 changed files with 57 additions and 54 deletions
  1. 29 27
      lisp/org-list.el
  2. 28 27
      lisp/org-macs.el

+ 29 - 27
lisp/org-list.el

@@ -638,7 +638,7 @@ Assume point is at an item."
 	   (inlinetask-re (and (featurep 'org-inlinetask)
 	   (inlinetask-re (and (featurep 'org-inlinetask)
 			       (org-inlinetask-outline-regexp)))
 			       (org-inlinetask-outline-regexp)))
 	   (beg-cell (cons (point) (org-get-indentation)))
 	   (beg-cell (cons (point) (org-get-indentation)))
-	   ind itm-lst itm-lst-2 end-lst end-lst-2 struct
+           itm-lst itm-lst-2 end-lst end-lst-2 struct
 	   (assoc-at-point
 	   (assoc-at-point
 	    (function
 	    (function
 	     ;; Return association at point.
 	     ;; Return association at point.
@@ -923,13 +923,13 @@ Value returned is the position of the first child of ITEM."
 	       (< ind (org-list-get-ind child-maybe struct)))
 	       (< ind (org-list-get-ind child-maybe struct)))
       child-maybe)))
       child-maybe)))
 
 
-(defun org-list-get-next-item (item struct prevs)
+(defun org-list-get-next-item (item _struct prevs)
   "Return next item in same sub-list as ITEM, or nil.
   "Return next item in same sub-list as ITEM, or nil.
 STRUCT is the list structure.  PREVS is the alist of previous
 STRUCT is the list structure.  PREVS is the alist of previous
 items, as returned by `org-list-prevs-alist'."
 items, as returned by `org-list-prevs-alist'."
   (car (rassq item prevs)))
   (car (rassq item prevs)))
 
 
-(defun org-list-get-prev-item (item struct prevs)
+(defun org-list-get-prev-item (item _struct prevs)
   "Return previous item in same sub-list as ITEM, or nil.
   "Return previous item in same sub-list as ITEM, or nil.
 STRUCT is the list structure.  PREVS is the alist of previous
 STRUCT is the list structure.  PREVS is the alist of previous
 items, as returned by `org-list-prevs-alist'."
 items, as returned by `org-list-prevs-alist'."
@@ -961,7 +961,7 @@ items, as returned by `org-list-prevs-alist'."
       (push next-item after-item))
       (push next-item after-item))
     (append before-item (list item) (nreverse after-item))))
     (append before-item (list item) (nreverse after-item))))
 
 
-(defun org-list-get-children (item struct parents)
+(defun org-list-get-children (item _struct parents)
   "List all children of ITEM, or nil.
   "List all children of ITEM, or nil.
 STRUCT is the list structure.  PARENTS is the alist of parents,
 STRUCT is the list structure.  PARENTS is the alist of parents,
 as returned by `org-list-parents-alist'."
 as returned by `org-list-parents-alist'."
@@ -979,7 +979,7 @@ STRUCT is the list structure."
 (defun org-list-get-bottom-point (struct)
 (defun org-list-get-bottom-point (struct)
   "Return point at bottom of list.
   "Return point at bottom of list.
 STRUCT is the list structure."
 STRUCT is the list structure."
-  (apply 'max
+  (apply #'max
 	 (mapcar (lambda (e) (org-list-get-item-end (car e) struct)) struct)))
 	 (mapcar (lambda (e) (org-list-get-item-end (car e) struct)) struct)))
 
 
 (defun org-list-get-list-begin (item struct prevs)
 (defun org-list-get-list-begin (item struct prevs)
@@ -1636,8 +1636,7 @@ as returned by `org-list-prevs-alist'."
 	   ;; Pretend that bullets are uppercase and check if alphabet
 	   ;; Pretend that bullets are uppercase and check if alphabet
 	   ;; is sufficient, taking counters into account.
 	   ;; is sufficient, taking counters into account.
 	   (while item
 	   (while item
-	     (let ((bul (org-list-get-bullet item struct))
+	     (let ((count (org-list-get-counter item struct)))
-		   (count (org-list-get-counter item struct)))
 	       ;; Virtually determine current bullet
 	       ;; Virtually determine current bullet
 	       (if (and count (string-match "[a-zA-Z]" count))
 	       (if (and count (string-match "[a-zA-Z]" count))
 		   ;; Counters are not case-sensitive.
 		   ;; Counters are not case-sensitive.
@@ -1734,7 +1733,7 @@ This function modifies STRUCT."
 		  (replace-match "1" nil nil bullet))
 		  (replace-match "1" nil nil bullet))
 		 ;; Not an ordered list: keep bullet.
 		 ;; Not an ordered list: keep bullet.
 		 (t bullet)))))))))
 		 (t bullet)))))))))
-    (mapc fix-bul (mapcar 'car struct))))
+    (mapc fix-bul (mapcar #'car struct))))
 
 
 (defun org-list-struct-fix-ind (struct parents &optional bullet-size)
 (defun org-list-struct-fix-ind (struct parents &optional bullet-size)
   "Verify and correct indentation in STRUCT.
   "Verify and correct indentation in STRUCT.
@@ -1762,7 +1761,7 @@ This function modifies STRUCT."
 				  org-list-indent-offset))
 				  org-list-indent-offset))
                 ;; If no parent, indent like top-point.
                 ;; If no parent, indent like top-point.
 		(org-list-set-ind item struct top-ind))))))
 		(org-list-set-ind item struct top-ind))))))
-    (mapc new-ind (mapcar 'car (cdr struct)))))
+    (mapc new-ind (mapcar #'car (cdr struct)))))
 
 
 (defun org-list-struct-fix-box (struct parents prevs &optional ordered)
 (defun org-list-struct-fix-box (struct parents prevs &optional ordered)
   "Verify and correct checkboxes in STRUCT.
   "Verify and correct checkboxes in STRUCT.
@@ -1777,7 +1776,7 @@ break this rule, the function will return the blocking item.  In
 all others cases, the return value will be nil.
 all others cases, the return value will be nil.
 
 
 This function modifies STRUCT."
 This function modifies STRUCT."
-  (let ((all-items (mapcar 'car struct))
+  (let ((all-items (mapcar #'car struct))
 	(set-parent-box
 	(set-parent-box
 	 (function
 	 (function
 	  (lambda (item)
 	  (lambda (item)
@@ -2354,7 +2353,7 @@ in subtree, ignoring drawers."
 			       "\\|" org-clock-string "\\)"
 			       "\\|" org-clock-string "\\)"
 			       " *[[<]\\([^]>]+\\)[]>]"))
 			       " *[[<]\\([^]>]+\\)[]>]"))
 	   (orderedp (org-entry-get nil "ORDERED"))
 	   (orderedp (org-entry-get nil "ORDERED"))
-	   (bounds
+	   (_bounds
 	    ;; In a region, start at first item in region.
 	    ;; In a region, start at first item in region.
 	    (cond
 	    (cond
 	     ((org-region-active-p)
 	     ((org-region-active-p)
@@ -2411,7 +2410,7 @@ in subtree, ignoring drawers."
 	       (bottom (copy-marker (org-list-get-bottom-point struct)))
 	       (bottom (copy-marker (org-list-get-bottom-point struct)))
 	       (items-to-toggle (org-remove-if
 	       (items-to-toggle (org-remove-if
 				 (lambda (e) (or (< e lim-up) (> e lim-down)))
 				 (lambda (e) (or (< e lim-up) (> e lim-down)))
-				 (mapcar 'car struct))))
+				 (mapcar #'car struct))))
 	  (mapc (lambda (e) (org-list-set-checkbox
 	  (mapc (lambda (e) (org-list-set-checkbox
 			     e struct
 			     e struct
 			     ;; If there is no box at item, leave as-is
 			     ;; If there is no box at item, leave as-is
@@ -2493,7 +2492,7 @@ With optional prefix argument ALL, do this for the whole buffer."
 			  (items
 			  (items
 			   (cond
 			   (cond
 			    ((and recursivep item) (org-list-get-subtree item s))
 			    ((and recursivep item) (org-list-get-subtree item s))
-			    (recursivep (mapcar 'car s))
+			    (recursivep (mapcar #'car s))
 			    (item (org-list-get-children item s par))
 			    (item (org-list-get-children item s par))
 			    (t (org-list-get-all-items
 			    (t (org-list-get-all-items
 				(org-list-get-top-point s) s pre))))
 				(org-list-get-top-point s) s pre))))
@@ -2506,7 +2505,7 @@ With optional prefix argument ALL, do this for the whole buffer."
 		 structs)
 		 structs)
 		(cons c-on c-all)))))
 		(cons c-on c-all)))))
 	  (backup-end 1)
 	  (backup-end 1)
-	  cookies-list structs-bak box-num)
+	  cookies-list structs-bak)
       (goto-char (car bounds))
       (goto-char (car bounds))
       ;; 1. Build an alist for each cookie found within BOUNDS.  The
       ;; 1. Build an alist for each cookie found within BOUNDS.  The
       ;;    key will be position at beginning of cookie and values
       ;;    key will be position at beginning of cookie and values
@@ -2769,6 +2768,7 @@ If a region is active, all items inside will be moved."
      (t (error "Not at an item")))))
      (t (error "Not at an item")))))
 
 
 (defvar org-tab-ind-state)
 (defvar org-tab-ind-state)
+(defvar org-adapt-indentation)
 (defun org-cycle-item-indentation ()
 (defun org-cycle-item-indentation ()
   "Cycle levels of indentation of an empty item.
   "Cycle levels of indentation of an empty item.
 The first run indents the item, if applicable.  Subsequent runs
 The first run indents the item, if applicable.  Subsequent runs
@@ -2960,13 +2960,13 @@ will be parsed as:
   \(3 \"last item\"\)\)
   \(3 \"last item\"\)\)
 
 
 Point is left at list end."
 Point is left at list end."
+  (defvar parse-item)                   ;FIXME: Or use `cl-labels' or `letrec'.
   (let* ((struct (org-list-struct))
   (let* ((struct (org-list-struct))
 	 (prevs (org-list-prevs-alist struct))
 	 (prevs (org-list-prevs-alist struct))
 	 (parents (org-list-parents-alist struct))
 	 (parents (org-list-parents-alist struct))
 	 (top (org-list-get-top-point struct))
 	 (top (org-list-get-top-point struct))
 	 (bottom (org-list-get-bottom-point struct))
 	 (bottom (org-list-get-bottom-point struct))
 	 out
 	 out
-	 parse-item			; for byte-compiler
 	 (get-text
 	 (get-text
 	  (function
 	  (function
 	   ;; Return text between BEG and END, trimmed, with
 	   ;; Return text between BEG and END, trimmed, with
@@ -3092,7 +3092,7 @@ for this list."
 	      (re-search-forward (org-item-beginning-re) bottom-point t)
 	      (re-search-forward (org-item-beginning-re) bottom-point t)
 	      (match-beginning 0)))
 	      (match-beginning 0)))
 	   (plain-list (buffer-substring-no-properties top-point bottom-point))
 	   (plain-list (buffer-substring-no-properties top-point bottom-point))
-	   beg txt)
+	   beg)
       (unless (fboundp transform)
       (unless (fboundp transform)
 	(error "No such transformation function %s" transform))
 	(error "No such transformation function %s" transform))
       (let ((txt (funcall transform plain-list)))
       (let ((txt (funcall transform plain-list)))
@@ -3102,7 +3102,8 @@ for this list."
 	  (unless (re-search-forward
 	  (unless (re-search-forward
 		   (concat "BEGIN RECEIVE ORGLST +"
 		   (concat "BEGIN RECEIVE ORGLST +"
 			   name
 			   name
-			   "\\([ \t]\\|$\\)") nil t)
+			   "\\([ \t]\\|$\\)")
+                   nil t)
 	    (error "Don't know where to insert translated list"))
 	    (error "Don't know where to insert translated list"))
 	  (goto-char (match-beginning 0))
 	  (goto-char (match-beginning 0))
 	  (beginning-of-line 2)
 	  (beginning-of-line 2)
@@ -3250,7 +3251,7 @@ items."
 				      items (or (eval isep) ""))))))))
 				      items (or (eval isep) ""))))))))
     (concat (funcall export-sublist list 0) "\n")))
     (concat (funcall export-sublist list 0) "\n")))
 
 
-(defun org-list-to-latex (list &optional params)
+(defun org-list-to-latex (list &optional _params)
   "Convert LIST into a LaTeX list.
   "Convert LIST into a LaTeX list.
 LIST is as string representing the list to transform, as Org
 LIST is as string representing the list to transform, as Org
 syntax.  Return converted list as a string."
 syntax.  Return converted list as a string."
@@ -3264,7 +3265,7 @@ syntax.  Return converted list as a string."
   (require 'ox-html)
   (require 'ox-html)
   (org-export-string-as list 'html t))
   (org-export-string-as list 'html t))
 
 
-(defun org-list-to-texinfo (list &optional params)
+(defun org-list-to-texinfo (list &optional _params)
   "Convert LIST into a Texinfo list.
   "Convert LIST into a Texinfo list.
 LIST is as string representing the list to transform, as Org
 LIST is as string representing the list to transform, as Org
 syntax.  Return converted list as a string."
 syntax.  Return converted list as a string."
@@ -3275,14 +3276,15 @@ syntax.  Return converted list as a string."
   "Convert LIST into an Org subtree.
   "Convert LIST into an Org subtree.
 LIST is as returned by `org-list-parse-list'.  PARAMS is a property list
 LIST is as returned by `org-list-parse-list'.  PARAMS is a property list
 with overruling parameters for `org-list-to-generic'."
 with overruling parameters for `org-list-to-generic'."
+  (defvar get-stars) (defvar org--blankp)
   (let* ((rule (cdr (assq 'heading org-blank-before-new-entry)))
   (let* ((rule (cdr (assq 'heading org-blank-before-new-entry)))
 	 (level (org-reduced-level (or (org-current-level) 0)))
 	 (level (org-reduced-level (or (org-current-level) 0)))
-	 (blankp (or (eq rule t)
+	 (org--blankp (or (eq rule t)
 		     (and (eq rule 'auto)
 		     (and (eq rule 'auto)
 			  (save-excursion
 			  (save-excursion
 			    (outline-previous-heading)
 			    (outline-previous-heading)
 			    (org-previous-line-empty-p)))))
 			    (org-previous-line-empty-p)))))
-	 (get-stars
+	 (get-stars ;FIXME: Can't rename without renaming it in org.el as well!
 	  (function
 	  (function
 	   ;; Return the string for the heading, depending on depth D
 	   ;; Return the string for the heading, depending on depth D
 	   ;; of current sub-list.
 	   ;; of current sub-list.
@@ -3297,12 +3299,12 @@ with overruling parameters for `org-list-to-generic'."
      list
      list
      (org-combine-plists
      (org-combine-plists
       '(:splice t
       '(:splice t
-		:dtstart " " :dtend " "
+        :dtstart " " :dtend " "
-		:istart (funcall get-stars depth)
+        :istart (funcall get-stars depth)
-		:icount (funcall get-stars depth)
+        :icount (funcall get-stars depth)
-		:isep (if blankp "\n\n" "\n")
+        :isep (if org--blankp "\n\n" "\n")
-		:csep (if blankp "\n\n" "\n")
+        :csep (if org--blankp "\n\n" "\n")
-		:cbon "DONE" :cboff "TODO" :cbtrans "TODO")
+        :cbon "DONE" :cboff "TODO" :cbtrans "TODO")
       params))))
       params))))
 
 
 (provide 'org-list)
 (provide 'org-list)

+ 28 - 27
lisp/org-macs.el

@@ -33,7 +33,7 @@
 
 
 (eval-and-compile
 (eval-and-compile
   (unless (fboundp 'declare-function)
   (unless (fboundp 'declare-function)
-    (defmacro declare-function (fn file &optional arglist fileonly)
+    (defmacro declare-function (fn file &optional _arglist _fileonly)
       `(autoload ',fn ,file)))
       `(autoload ',fn ,file)))
 
 
   (if (>= emacs-major-version 23)
   (if (>= emacs-major-version 23)
@@ -48,13 +48,14 @@
 (declare-function org-string-match-p "org-compat" (&rest args))
 (declare-function org-string-match-p "org-compat" (&rest args))
 
 
 (defmacro org-with-gensyms (symbols &rest body)
 (defmacro org-with-gensyms (symbols &rest body)
+  (declare (debug (sexp body)) (indent 1))
   `(let ,(mapcar (lambda (s)
   `(let ,(mapcar (lambda (s)
-		   `(,s (make-symbol (concat "--" (symbol-name ',s))))) symbols)
+		   `(,s (make-symbol (concat "--" (symbol-name ',s)))))
+                 symbols)
      ,@body))
      ,@body))
-(def-edebug-spec org-with-gensyms (sexp body))
-(put 'org-with-gensyms 'lisp-indent-function 1)
 
 
 (defmacro org-called-interactively-p (&optional kind)
 (defmacro org-called-interactively-p (&optional kind)
+  (declare (debug (&optional ("quote" symbolp)))) ;Why not just `t'?
   (if (featurep 'xemacs)
   (if (featurep 'xemacs)
       `(interactive-p)
       `(interactive-p)
     (if (or (> emacs-major-version 23)
     (if (or (> emacs-major-version 23)
@@ -63,12 +64,11 @@
 	;; defined with no argument in <=23.1
 	;; defined with no argument in <=23.1
 	`(with-no-warnings (called-interactively-p ,kind))
 	`(with-no-warnings (called-interactively-p ,kind))
       `(interactive-p))))
       `(interactive-p))))
-(def-edebug-spec org-called-interactively-p (&optional ("quote" symbolp)))
 
 
 (defmacro org-bound-and-true-p (var)
 (defmacro org-bound-and-true-p (var)
   "Return the value of symbol VAR if it is bound, else nil."
   "Return the value of symbol VAR if it is bound, else nil."
+  (declare (debug (symbolp)))
   `(and (boundp (quote ,var)) ,var))
   `(and (boundp (quote ,var)) ,var))
-(def-edebug-spec org-bound-and-true-p (symbolp))
 
 
 (defun org-string-nw-p (s)
 (defun org-string-nw-p (s)
   "Return S if S is a string containing a non-blank character.
   "Return S if S is a string containing a non-blank character.
@@ -98,10 +98,11 @@ Otherwise return nil."
 
 
 (defmacro org-re (s)
 (defmacro org-re (s)
   "Replace posix classes in regular expression."
   "Replace posix classes in regular expression."
+  (declare (debug (form)))
   (if (featurep 'xemacs) `(org-substitute-posix-classes ,s) s))
   (if (featurep 'xemacs) `(org-substitute-posix-classes ,s) s))
-(def-edebug-spec org-re (form))
 
 
 (defmacro org-preserve-lc (&rest body)
 (defmacro org-preserve-lc (&rest body)
+  (declare (debug (body)))
   (org-with-gensyms (line col)
   (org-with-gensyms (line col)
     `(let ((,line (org-current-line))
     `(let ((,line (org-current-line))
 	   (,col (current-column)))
 	   (,col (current-column)))
@@ -109,12 +110,12 @@ Otherwise return nil."
 	   (progn ,@body)
 	   (progn ,@body)
 	 (org-goto-line ,line)
 	 (org-goto-line ,line)
 	 (org-move-to-column ,col)))))
 	 (org-move-to-column ,col)))))
-(def-edebug-spec org-preserve-lc (body))
 
 
 ;; Use `org-with-silent-modifications' to ignore cosmetic changes and
 ;; Use `org-with-silent-modifications' to ignore cosmetic changes and
 ;; `org-unmodified' to ignore real text modifications
 ;; `org-unmodified' to ignore real text modifications
 (defmacro org-unmodified (&rest body)
 (defmacro org-unmodified (&rest body)
   "Run BODY while preserving the buffer's `buffer-modified-p' state."
   "Run BODY while preserving the buffer's `buffer-modified-p' state."
+  (declare (debug (body)))
   (org-with-gensyms (was-modified)
   (org-with-gensyms (was-modified)
     `(let ((,was-modified (buffer-modified-p)))
     `(let ((,was-modified (buffer-modified-p)))
        (unwind-protect
        (unwind-protect
@@ -122,9 +123,9 @@ Otherwise return nil."
 		 (inhibit-modification-hooks t))
 		 (inhibit-modification-hooks t))
 	     ,@body)
 	     ,@body)
 	 (set-buffer-modified-p ,was-modified)))))
 	 (set-buffer-modified-p ,was-modified)))))
-(def-edebug-spec org-unmodified (body))
 
 
 (defmacro org-without-partial-completion (&rest body)
 (defmacro org-without-partial-completion (&rest body)
+  (declare (debug (body)))
   `(if (and (boundp 'partial-completion-mode)
   `(if (and (boundp 'partial-completion-mode)
 	    partial-completion-mode
 	    partial-completion-mode
 	    (fboundp 'partial-completion-mode))
 	    (fboundp 'partial-completion-mode))
@@ -134,7 +135,6 @@ Otherwise return nil."
 	     ,@body)
 	     ,@body)
 	 (partial-completion-mode 1))
 	 (partial-completion-mode 1))
      ,@body))
      ,@body))
-(def-edebug-spec org-without-partial-completion (body))
 
 
 ;; FIXME: Slated for removal.  Current Org mode does not support Emacs < 22
 ;; FIXME: Slated for removal.  Current Org mode does not support Emacs < 22
 (defmacro org-maybe-intangible (props)
 (defmacro org-maybe-intangible (props)
@@ -151,6 +151,7 @@ We use a macro so that the test can happen at compilation time."
 
 
 (defmacro org-with-point-at (pom &rest body)
 (defmacro org-with-point-at (pom &rest body)
   "Move to buffer and point of point-or-marker POM for the duration of BODY."
   "Move to buffer and point of point-or-marker POM for the duration of BODY."
+  (declare (debug (form body)) (indent 1))
   (org-with-gensyms (mpom)
   (org-with-gensyms (mpom)
     `(let ((,mpom ,pom))
     `(let ((,mpom ,pom))
        (save-excursion
        (save-excursion
@@ -158,15 +159,14 @@ We use a macro so that the test can happen at compilation time."
 	 (org-with-wide-buffer
 	 (org-with-wide-buffer
 	  (goto-char (or ,mpom (point)))
 	  (goto-char (or ,mpom (point)))
 	  ,@body)))))
 	  ,@body)))))
-(def-edebug-spec org-with-point-at (form body))
-(put 'org-with-point-at 'lisp-indent-function 1)
 
 
 (defmacro org-no-warnings (&rest body)
 (defmacro org-no-warnings (&rest body)
+  (declare (debug (body)))
   (cons (if (fboundp 'with-no-warnings) 'with-no-warnings 'progn) body))
   (cons (if (fboundp 'with-no-warnings) 'with-no-warnings 'progn) body))
-(def-edebug-spec org-no-warnings (body))
 
 
 (defmacro org-with-remote-undo (buffer &rest body)
 (defmacro org-with-remote-undo (buffer &rest body)
   "Execute BODY while recording undo information in two buffers."
   "Execute BODY while recording undo information in two buffers."
+  (declare (debug (form body)) (indent 1))
   (org-with-gensyms (cline cmd buf1 buf2 undo1 undo2 c1 c2)
   (org-with-gensyms (cline cmd buf1 buf2 undo1 undo2 c1 c2)
     `(let ((,cline (org-current-line))
     `(let ((,cline (org-current-line))
 	   (,cmd this-command)
 	   (,cmd this-command)
@@ -188,13 +188,11 @@ We use a macro so that the test can happen at compilation time."
 	   ;; remember which buffer to undo
 	   ;; remember which buffer to undo
 	   (push (list ,cmd ,cline ,buf1 ,c1 ,buf2 ,c2)
 	   (push (list ,cmd ,cline ,buf1 ,c1 ,buf2 ,c2)
 		 org-agenda-undo-list))))))
 		 org-agenda-undo-list))))))
-(def-edebug-spec org-with-remote-undo (form body))
-(put 'org-with-remote-undo 'lisp-indent-function 1)
 
 
 (defmacro org-no-read-only (&rest body)
 (defmacro org-no-read-only (&rest body)
   "Inhibit read-only for BODY."
   "Inhibit read-only for BODY."
+  (declare (debug (body)))
   `(let ((inhibit-read-only t)) ,@body))
   `(let ((inhibit-read-only t)) ,@body))
-(def-edebug-spec org-no-read-only (body))
 
 
 (defconst org-rm-props '(invisible t face t keymap t intangible t mouse-face t
 (defconst org-rm-props '(invisible t face t keymap t intangible t mouse-face t
 				   rear-nonsticky t mouse-map t fontified t
 				   rear-nonsticky t mouse-map t fontified t
@@ -314,7 +312,7 @@ This means that the buffer may change while running BODY,
 but it also means that the buffer should stay alive
 but it also means that the buffer should stay alive
 during the operation, because otherwise all these markers will
 during the operation, because otherwise all these markers will
 point nowhere."
 point nowhere."
-  (declare (indent 1))
+  (declare (debug (form body)) (indent 1))
   (org-with-gensyms (data rtn)
   (org-with-gensyms (data rtn)
     `(let ((,data (org-outline-overlay-data ,use-markers))
     `(let ((,data (org-outline-overlay-data ,use-markers))
 	   ,rtn)
 	   ,rtn)
@@ -328,24 +326,28 @@ point nowhere."
 		   (and (markerp (cdr c)) (move-marker (cdr c) nil)))
 		   (and (markerp (cdr c)) (move-marker (cdr c) nil)))
 		 ,data)))
 		 ,data)))
        ,rtn)))
        ,rtn)))
-(def-edebug-spec org-save-outline-visibility (form body))
 
 
 (defmacro org-with-wide-buffer (&rest body)
 (defmacro org-with-wide-buffer (&rest body)
   "Execute body while temporarily widening the buffer."
   "Execute body while temporarily widening the buffer."
+  (declare (debug (body)))
   `(save-excursion
   `(save-excursion
      (save-restriction
      (save-restriction
        (widen)
        (widen)
        ,@body)))
        ,@body)))
-(def-edebug-spec org-with-wide-buffer (body))
 
 
 (defmacro org-with-limited-levels (&rest body)
 (defmacro org-with-limited-levels (&rest body)
   "Execute BODY with limited number of outline levels."
   "Execute BODY with limited number of outline levels."
-  `(let* ((org-called-with-limited-levels t)
+  (declare (debug (body)))
-	  (org-outline-regexp (org-get-limited-outline-regexp))
+  `(progn
-	  (outline-regexp org-outline-regexp)
+     (defvar org-called-with-limited-levels)
-	  (org-outline-regexp-bol (concat "^" org-outline-regexp)))
+     (defvar org-outline-regexp)
-     ,@body))
+     (defvar outline-regexp)
-(def-edebug-spec org-with-limited-levels (body))
+     (defvar org-outline-regexp-bol)
+     (let* ((org-called-with-limited-levels t)
+            (org-outline-regexp (org-get-limited-outline-regexp))
+            (outline-regexp org-outline-regexp)
+            (org-outline-regexp-bol (concat "^" org-outline-regexp)))
+       ,@body)))
 
 
 (defvar org-outline-regexp) ; defined in org.el
 (defvar org-outline-regexp) ; defined in org.el
 (defvar org-odd-levels-only) ; defined in org.el
 (defvar org-odd-levels-only) ; defined in org.el
@@ -371,9 +373,8 @@ The number of levels is controlled by `org-inlinetask-min-level'"
     (format-time-string string (seconds-to-time seconds))))
     (format-time-string string (seconds-to-time seconds))))
 
 
 (defmacro org-eval-in-environment (environment form)
 (defmacro org-eval-in-environment (environment form)
+  (declare (debug (form form)) (indent 1))
   `(eval (list 'let ,environment ',form)))
   `(eval (list 'let ,environment ',form)))
-(def-edebug-spec org-eval-in-environment (form form))
-(put 'org-eval-in-environment 'lisp-indent-function 1)
 
 
 (defun org-make-parameter-alist (flat)
 (defun org-make-parameter-alist (flat)
   "Return alist based on FLAT.
   "Return alist based on FLAT.