Browse Source

Maintenance: Remove unused variables.

Carsten Dominik 16 years ago
parent
commit
f31255c8f3

+ 2 - 2
ORGWEBPAGE/Changes.org

@@ -108,8 +108,8 @@ a reference like =@I$1..@II$2= will now work.
 
 
 The LaTeX idiom =\par= will insert a paragraph break at that
 The LaTeX idiom =\par= will insert a paragraph break at that
 location.  Normally you would simply leave an empty line to get
 location.  Normally you would simply leave an empty line to get
-such a break, but this is useful for footnotes whose definitions
+such a break, but this is useful for footnotes whose
-may not contain empty lines.
+definitions may not contain empty lines.
 
 
 * Version 6.18
 * Version 6.18
 ** Incompatible changes
 ** Incompatible changes

+ 50 - 0
lisp/ChangeLog

@@ -1,5 +1,55 @@
 2009-01-26  Carsten Dominik  <carsten.dominik@gmail.com>
 2009-01-26  Carsten Dominik  <carsten.dominik@gmail.com>
 
 
+	* org-jsinfo.el (org-infojs-handle-options): Remove unnecessary
+	variables.
+
+	* org-footnote.el (org-footnote-normalize): Remove unnecessary
+	variable.
+	(org-insert-footnote-reference-near-definition): Remove
+	unnecessary let form.
+
+	* org-export-latex.el (org-export-latex-first-lines): Add
+	OPT-PLIST parameter.
+	(org-export-as-latex): Call `org-export-latex-first-lines' with
+	opt-plits parameter.
+	(org-export-latex-preprocess): Remove unnecessary variables.
+
+	* org-exp.el (org-infile-export-plist)
+	(org-export-add-options-to-plist, org-export-kill-licensed-text)
+	(org-export-remove-headline-metadata)
+	(org-export-get-title-from-subtree, org-get-min-level)
+	(org-html-do-expand): Remove innecessary let form.
+
+	* org-colview-xemacs.el (org-columns-display-here): Remove
+	unnecessary variables.
+
+	* org-colview.el (org-columns-display-here): Remove unnecessary
+	variables.
+
+	* org-bbdb.el (org-bbdb-anniversaries): Remove unnecessary
+	variables.
+
+	* org-id.el (org-id-alist-to-hash, org-id-find-id-in-file): Remove
+	unnecessary variables.
+
+	* org-agenda.el (org-search-view, org-agenda-get-blocks)
+	(org-agenda-filter-by-tag, org-agenda-action): Remove unnecessary
+	variables.
+
+	* org.el (org-set-emph-re): Clean-up the STACKED stuff.
+	(org-compact-display-after-subtree-move): Remove unnecessary
+	variables.
+	(org-edit-fixed-width-region): Remove unnecessary variables.
+	(org-edit-src-find-region-and-lang): Remove unnecessary variables.
+	(org-olpath-completing-read): Remove unnecessary variable.
+	(org-auto-repeat-maybe): Remove unnecessary variable.
+	(org-map-entries): Remove unnecessary variable.
+	(org-buffer-property-keys, org-imenu-get-tree)
+	(org-speedbar-set-agenda-restriction): Remove unnecessary variables.
+
+-----------------------------------------------------------------
+
+2009-01-26  Carsten Dominik  <carsten.dominik@gmail.com>
 	* org-exp.el (org-export-remove-timestamps): Never remove
 	* org-exp.el (org-export-remove-timestamps): Never remove
 	timestamps from tables.
 	timestamps from tables.
 
 

+ 5 - 5
lisp/org-agenda.el

@@ -2612,7 +2612,7 @@ in `org-agenda-text-search-extra-files'."
 		      'keymap org-agenda-keymap
 		      'keymap org-agenda-keymap
 		      'help-echo (format "mouse-2 or RET jump to location")))
 		      'help-echo (format "mouse-2 or RET jump to location")))
 	 regexp rtn rtnall files file pos
 	 regexp rtn rtnall files file pos
-	 marker priority category tags c neg re
+	 marker category tags c neg re
 	 ee txt beg end words regexps+ regexps- hdl-only buffer beg1 str)
 	 ee txt beg end words regexps+ regexps- hdl-only buffer beg1 str)
     (unless (and (not edit-at)
     (unless (and (not edit-at)
 		 (stringp string)
 		 (stringp string)
@@ -3715,7 +3715,7 @@ FRACTION is what fraction of the head-warning time has passed."
 	 (regexp org-tr-regexp)
 	 (regexp org-tr-regexp)
 	 (d0 (calendar-absolute-from-gregorian date))
 	 (d0 (calendar-absolute-from-gregorian date))
 	 marker hdmarker ee txt d1 d2 s1 s2 timestr category todo-state tags pos
 	 marker hdmarker ee txt d1 d2 s1 s2 timestr category todo-state tags pos
-	 donep head)
+	 head)
     (goto-char (point-min))
     (goto-char (point-min))
     (while (re-search-forward regexp nil t)
     (while (re-search-forward regexp nil t)
       (catch :skip
       (catch :skip
@@ -4324,7 +4324,7 @@ to switch to narrowing."
 	(effort-prompt "")
 	(effort-prompt "")
 	(inhibit-read-only t)
 	(inhibit-read-only t)
 	(current org-agenda-filter)
 	(current org-agenda-filter)
-	char a n tag tags)
+	char a n tag)
     (unless char
     (unless char
       (message
       (message
        "%s by tag [%s ], [TAB], [/]:off, [+-]:narrow, [>=<]:effort: "
        "%s by tag [%s ], [TAB], [/]:off, [+-]:narrow, [>=<]:effort: "
@@ -4423,7 +4423,7 @@ If the line does not have an effort defined, return nil."
       (while (not (eobp))
       (while (not (eobp))
 	(if (get-text-property (point) 'org-marker)
 	(if (get-text-property (point) 'org-marker)
 	    (progn
 	    (progn
-	      (setq tags (get-text-property (point) 'tags))
+	      (setq tags (get-text-property (point) 'tags)) ; used in eval
 	      (if (not (eval org-agenda-filter-form))
 	      (if (not (eval org-agenda-filter-form))
 		  (org-agenda-filter-by-tag-hide-line))
 		  (org-agenda-filter-by-tag-hide-line))
 	      (beginning-of-line 2))
 	      (beginning-of-line 2))
@@ -5419,7 +5419,7 @@ TAB   Visit marked entry in other window
 
 
 The cursor may be at a date in the calendar, or in the Org agenda."
 The cursor may be at a date in the calendar, or in the Org agenda."
   (interactive)
   (interactive)
-  (let (pos ans)
+  (let (ans)
     (message "Select action: [m]ark | [s]chedule [d]eadline [r]emember [ ]show")
     (message "Select action: [m]ark | [s]chedule [d]eadline [r]emember [ ]show")
     (setq ans (read-char-exclusive))
     (setq ans (read-char-exclusive))
     (cond
     (cond

+ 2 - 1
lisp/org-archive.el

@@ -1,6 +1,7 @@
 ;;; org-archive.el --- Archiving for Org-mode
 ;;; org-archive.el --- Archiving for Org-mode
 
 
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009
+;;   Free Software Foundation, Inc.
 
 
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Keywords: outlines, hypermedia, calendar, wp

+ 1 - 1
lisp/org-bbdb.el

@@ -292,7 +292,7 @@ This is used by Org to re-create the anniversary hash table."
          (y (nth 2 date))  ; year
          (y (nth 2 date))  ; year
          (annivs (gethash (list m d) org-bbdb-anniv-hash))
          (annivs (gethash (list m d) org-bbdb-anniv-hash))
          (text ())
          (text ())
-         split class form rec recs)
+         rec recs)
 
 
     ;; we don't want to miss people born on Feb. 29th
     ;; we don't want to miss people born on Feb. 29th
     (when (and (= m 3) (= d 1)
     (when (and (= m 3) (= d 1)

+ 3 - 2
lisp/org-clock.el

@@ -1,6 +1,7 @@
 ;;; org-clock.el --- The time clocking code for Org-mode
 ;;; org-clock.el --- The time clocking code for Org-mode
 
 
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009
+;;   Free Software Foundation, Inc.
 
 
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Keywords: outlines, hypermedia, calendar, wp
@@ -187,7 +188,7 @@ of a different task.")
 (defun org-clock-select-task (&optional prompt)
 (defun org-clock-select-task (&optional prompt)
   "Select a task that recently was associated with clocking."
   "Select a task that recently was associated with clocking."
   (interactive)
   (interactive)
-  (let (sel-list rpl file task (i 0) s)
+  (let (sel-list rpl (i 0) s)
     (save-window-excursion
     (save-window-excursion
       (org-switch-to-buffer-other-window
       (org-switch-to-buffer-other-window
        (get-buffer-create "*Clock Task Select*"))
        (get-buffer-create "*Clock Task Select*"))

+ 3 - 2
lisp/org-colview-xemacs.el

@@ -1,6 +1,7 @@
 ;;; org-colview-xemacs.el --- Column View in Org-mode, XEmacs-specific version
 ;;; org-colview-xemacs.el --- Column View in Org-mode, XEmacs-specific version
 
 
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009
+;;   Free Software Foundation, Inc.
 
 
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Keywords: outlines, hypermedia, calendar, wp
@@ -323,7 +324,7 @@ This is the compiled version of the format.")
 	 (face (if (featurep 'xemacs) color (list color 'org-column)))
 	 (face (if (featurep 'xemacs) color (list color 'org-column)))
 	 (pl (or (get-text-property (point-at-bol) 'prefix-length) 0))
 	 (pl (or (get-text-property (point-at-bol) 'prefix-length) 0))
 	 (cphr (get-text-property (point-at-bol) 'org-complex-heading-regexp))
 	 (cphr (get-text-property (point-at-bol) 'org-complex-heading-regexp))
-	 pom property ass width f string ov column val modval s1 s2 title)
+	 pom property ass width f string ov column val modval s2 title)
     ;; Check if the entry is in another buffer.
     ;; Check if the entry is in another buffer.
     (unless props
     (unless props
       (if (eq major-mode 'org-agenda-mode)
       (if (eq major-mode 'org-agenda-mode)

+ 3 - 2
lisp/org-colview.el

@@ -1,6 +1,7 @@
 ;;; org-colview.el --- Column View in Org-mode
 ;;; org-colview.el --- Column View in Org-mode
 
 
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009
+;;   Free Software Foundation, Inc.
 
 
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Keywords: outlines, hypermedia, calendar, wp
@@ -148,7 +149,7 @@ This is the compiled version of the format.")
 	 (face1 (list color 'org-agenda-column-dateline ref-face))
 	 (face1 (list color 'org-agenda-column-dateline ref-face))
 	 (pl (or (get-text-property (point-at-bol) 'prefix-length) 0))
 	 (pl (or (get-text-property (point-at-bol) 'prefix-length) 0))
 	 (cphr (get-text-property (point-at-bol) 'org-complex-heading-regexp))
 	 (cphr (get-text-property (point-at-bol) 'org-complex-heading-regexp))
-	 pom property ass width f string ov column val modval s1 s2 title)
+	 pom property ass width f string ov column val modval s2 title)
     ;; Check if the entry is in another buffer.
     ;; Check if the entry is in another buffer.
     (unless props
     (unless props
       (if (eq major-mode 'org-agenda-mode)
       (if (eq major-mode 'org-agenda-mode)

+ 2 - 1
lisp/org-compat.el

@@ -1,6 +1,7 @@
 ;;; org-compat.el --- Compatibility code for Org-mode
 ;;; org-compat.el --- Compatibility code for Org-mode
 
 
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009
+;;   Free Software Foundation, Inc.
 
 
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Keywords: outlines, hypermedia, calendar, wp

+ 11 - 12
lisp/org-exp.el

@@ -981,7 +981,7 @@ modified) list.")
 		    "LINK_UP" "LINK_HOME" "SETUPFILE" "STYLE" "LATEX_HEADER"
 		    "LINK_UP" "LINK_HOME" "SETUPFILE" "STYLE" "LATEX_HEADER"
 		    "EXPORT_SELECT_TAGS" "EXPORT_EXCLUDE_TAGS")
 		    "EXPORT_SELECT_TAGS" "EXPORT_EXCLUDE_TAGS")
 		  (mapcar 'car org-export-inbuffer-options-extra))))
 		  (mapcar 'car org-export-inbuffer-options-extra))))
-	    p key val text options js-up js-main js-css js-opt a pr style
+	    p key val text options a pr style
 	    latex-header
 	    latex-header
 	    ext-setup-or-nil setup-contents (start 0))
 	    ext-setup-or-nil setup-contents (start 0))
 	(while (or (and ext-setup-or-nil
 	(while (or (and ext-setup-or-nil
@@ -1040,7 +1040,7 @@ modified) list.")
   "Parse an OPTIONS line and set values in the property list P."
   "Parse an OPTIONS line and set values in the property list P."
   (let (o)
   (let (o)
     (when options
     (when options
-      (let ((op org-export-plist-vars) a)
+      (let ((op org-export-plist-vars))
 	(while (setq o (pop op))
 	(while (setq o (pop op))
 	  (if (and (nth 1 o)
 	  (if (and (nth 1 o)
 		   (string-match (concat (regexp-quote (nth 1 o))
 		   (string-match (concat (regexp-quote (nth 1 o))
@@ -1640,7 +1640,7 @@ on this string to produce the exported version."
 
 
 (defun org-export-kill-licensed-text ()
 (defun org-export-kill-licensed-text ()
   "Remove all text that is marked with a :org-license-to-kill property."
   "Remove all text that is marked with a :org-license-to-kill property."
-  (let (p q)
+  (let (p)
     (while (setq p (text-property-any (point-min) (point-max)
     (while (setq p (text-property-any (point-min) (point-max)
 				      :org-license-to-kill t))
 				      :org-license-to-kill t))
       (delete-region
       (delete-region
@@ -1849,7 +1849,7 @@ from the buffer."
 	(tags (plist-get opts :tags))
 	(tags (plist-get opts :tags))
 	(pri  (plist-get opts :priority))
 	(pri  (plist-get opts :priority))
 	(elts '(1 2 3 4 5))
 	(elts '(1 2 3 4 5))
-	rpl props)
+	rpl)
     (setq elts (delq nil (list 1 (if todo 2) (if pri 3) 4 (if tags 5))))
     (setq elts (delq nil (list 1 (if todo 2) (if pri 3) 4 (if tags 5))))
     (when (or (not todo) (not tags) (not pri))
     (when (or (not todo) (not tags) (not pri))
       (goto-char (point-min))
       (goto-char (point-min))
@@ -1898,7 +1898,7 @@ from the buffer."
 (defun org-export-protect-colon-examples ()
 (defun org-export-protect-colon-examples ()
   "Protect lines starting with a colon."
   "Protect lines starting with a colon."
   (goto-char (point-min))
   (goto-char (point-min))
-  (let ((re "^[ \t]*:\\([ \t]\\|$\\)") beg end)
+  (let ((re "^[ \t]*:\\([ \t]\\|$\\)") beg)
     (while (re-search-forward re nil t)
     (while (re-search-forward re nil t)
       (beginning-of-line 1)
       (beginning-of-line 1)
       (setq beg (point))
       (setq beg (point))
@@ -2133,7 +2133,7 @@ can work correctly."
 
 
 (defun org-export-get-title-from-subtree ()
 (defun org-export-get-title-from-subtree ()
   "Return subtree title and exclude it from export."
   "Return subtree title and exclude it from export."
-  (let (title (m (mark)) (rbeg (region-beginning)) (rend (region-end)))
+  (let (title (rbeg (region-beginning)) (rend (region-end)))
     (save-excursion
     (save-excursion
       (goto-char rbeg)
       (goto-char rbeg)
       (when (and (org-at-heading-p)
       (when (and (org-at-heading-p)
@@ -2160,7 +2160,7 @@ can work correctly."
 
 
 (defun org-get-min-level (lines)
 (defun org-get-min-level (lines)
   "Get the minimum level in LINES."
   "Get the minimum level in LINES."
-  (let ((re "^\\(\\*+\\) ") l min)
+  (let ((re "^\\(\\*+\\) ") l)
     (catch 'exit
     (catch 'exit
       (while (setq l (pop lines))
       (while (setq l (pop lines))
 	(if (string-match re l)
 	(if (string-match re l)
@@ -2363,7 +2363,7 @@ and `+n' for continuing previous numering.
 Code formatting according to language currently only works for HTML.
 Code formatting according to language currently only works for HTML.
 Numbering lines works for all three major backends (html, latex, and ascii)."
 Numbering lines works for all three major backends (html, latex, and ascii)."
   (save-match-data
   (save-match-data
-    (let (num cont rtn named rpllbl keepp textareap cols rows fmt)
+    (let (num cont rtn rpllbl keepp textareap cols rows fmt)
       (setq opts (or opts "")
       (setq opts (or opts "")
 	    num (string-match "[-+]n\\>" opts)
 	    num (string-match "[-+]n\\>" opts)
 	    cont (string-match "\\+n\\>" opts)
 	    cont (string-match "\\+n\\>" opts)
@@ -4445,9 +4445,8 @@ If there are links in the string, don't modify these."
   "Apply all active conversions to translate special ASCII to HTML."
   "Apply all active conversions to translate special ASCII to HTML."
   (setq s (org-html-protect s))
   (setq s (org-html-protect s))
   (if org-export-html-expand
   (if org-export-html-expand
-      (let ((start 0))
+      (while (string-match "@&lt;\\([^&]*\\)&gt;" s)
-	(while (string-match "@&lt;\\([^&]*\\)&gt;" s)
+	(setq s (replace-match "<\\1>" t nil s))))
-	  (setq s (replace-match "<\\1>" t nil s)))))
   (if org-export-with-emphasize
   (if org-export-with-emphasize
       (setq s (org-export-html-convert-emphasize s)))
       (setq s (org-export-html-convert-emphasize s)))
   (if org-export-with-special-strings
   (if org-export-with-special-strings
@@ -4747,7 +4746,7 @@ When COMBINE is non nil, add the category to each line."
 	      "DTSTART"))
 	      "DTSTART"))
 	hd ts ts2 state status (inc t) pos b sexp rrule
 	hd ts ts2 state status (inc t) pos b sexp rrule
 	scheduledp deadlinep todo prefix due start
 	scheduledp deadlinep todo prefix due start
-	tmp pri categories entry location summary desc uid
+	tmp pri categories location summary desc uid
 	(sexp-buffer (get-buffer-create "*ical-tmp*")))
 	(sexp-buffer (get-buffer-create "*ical-tmp*")))
     (org-refresh-category-properties)
     (org-refresh-category-properties)
     (save-excursion
     (save-excursion

+ 4 - 3
lisp/org-export-latex.el

@@ -434,7 +434,8 @@ when PUB-DIR is set, use this as the publishing directory."
 		     (region-p nil)
 		     (region-p nil)
 		     (t (plist-get opt-plist :skip-before-1st-heading))))
 		     (t (plist-get opt-plist :skip-before-1st-heading))))
 	 (text (plist-get opt-plist :text))
 	 (text (plist-get opt-plist :text))
-	 (first-lines (if skip "" (org-export-latex-first-lines rbeg)))
+	 (first-lines (if skip "" (org-export-latex-first-lines
+				   opt-plist rbeg)))
 	 (coding-system (and (boundp 'buffer-file-coding-system)
 	 (coding-system (and (boundp 'buffer-file-coding-system)
 			     buffer-file-coding-system))
 			     buffer-file-coding-system))
 	 (coding-system-for-write (or org-export-latex-coding-system
 	 (coding-system-for-write (or org-export-latex-coding-system
@@ -771,7 +772,7 @@ OPT-PLIST is the options plist for current buffer."
 	     (toc (format "\\setcounter{tocdepth}{%s}\n\\tableofcontents\n\\vspace*{1cm}\n"
 	     (toc (format "\\setcounter{tocdepth}{%s}\n\\tableofcontents\n\\vspace*{1cm}\n"
 			  (plist-get opt-plist :headline-levels))))))))
 			  (plist-get opt-plist :headline-levels))))))))
 
 
-(defun org-export-latex-first-lines (&optional beg)
+(defun org-export-latex-first-lines (opt-plist &optional beg)
   "Export the first lines before first headline.
   "Export the first lines before first headline.
 If BEG is non-nil, the is the beginning of he region."
 If BEG is non-nil, the is the beginning of he region."
   (save-excursion
   (save-excursion
@@ -1306,7 +1307,7 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
 
 
   ;; Convert LaTeX to \LaTeX{}
   ;; Convert LaTeX to \LaTeX{}
   (goto-char (point-min))
   (goto-char (point-min))
-  (let ((case-fold-search nil) rpl)
+  (let ((case-fold-search nil))
     (while (re-search-forward "\\([^+_]\\)LaTeX" nil t)
     (while (re-search-forward "\\([^+_]\\)LaTeX" nil t)
       (org-if-unprotected
       (org-if-unprotected
        (replace-match (org-export-latex-protect-string
        (replace-match (org-export-latex-protect-string

+ 2 - 1
lisp/org-faces.el

@@ -1,6 +1,7 @@
 ;;; org-faces.el --- Face definitions for Org-mode.
 ;;; org-faces.el --- Face definitions for Org-mode.
 
 
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009
+;;   Free Software Foundation, Inc.
 
 
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Keywords: outlines, hypermedia, calendar, wp

+ 7 - 8
lisp/org-footnote.el

@@ -255,7 +255,7 @@ or new, let the user edit the definition of the footnote."
   "Start the definition of a footnote with label LABEL."
   "Start the definition of a footnote with label LABEL."
   (interactive "sLabel: ")
   (interactive "sLabel: ")
   (setq label (org-footnote-normalize-label label))
   (setq label (org-footnote-normalize-label label))
-  (let (re p)
+  (let (re)
     (cond
     (cond
      ((org-mode-p)
      ((org-mode-p)
       (if (not org-footnote-section)
       (if (not org-footnote-section)
@@ -322,7 +322,7 @@ Org-mode exporters.
 When SORT-ONLY is set, only sort the footnote definitions into the
 When SORT-ONLY is set, only sort the footnote definitions into the
 referenced sequence."
 referenced sequence."
   ;; This is based on Paul's function, but rewritten.
   ;; This is based on Paul's function, but rewritten.
-  (let ((count 0) ref def idef ref-table liste beg beg1 marker a before
+  (let ((count 0) ref def idef ref-table beg beg1 marker a before
 	ins-point)
 	ins-point)
      (save-excursion
      (save-excursion
       ;; Now find footnote references, and extract the definitions
       ;; Now find footnote references, and extract the definitions
@@ -443,12 +443,11 @@ referenced sequence."
   "Find first reference of footnote ENTRY and insert the definition there.
   "Find first reference of footnote ENTRY and insert the definition there.
 ENTRY is (fn-label num-mark definition)."
 ENTRY is (fn-label num-mark definition)."
   (when (car entry)
   (when (car entry)
-    (let ((pos (point)))
+    (goto-char (point-min))
-      (goto-char (point-min))
+    (when (re-search-forward (format ".\\[%s[]:]" (regexp-quote (car entry)))
-      (when (re-search-forward (format ".\\[%s[]:]" (regexp-quote (car entry)))
+			     nil t)
-			       nil t)
+      (org-footnote-goto-local-insertion-point)
-	(org-footnote-goto-local-insertion-point)
+      (insert (format "\n\n[%s] %s" (car entry) (nth 2 entry))))))
-	(insert (format "\n\n[%s] %s" (car entry) (nth 2 entry)))))))
 
 
 (defun org-footnote-goto-local-insertion-point ()
 (defun org-footnote-goto-local-insertion-point ()
   "Find insertion point for footnote, just before next outline heading."
   "Find insertion point for footnote, just before next outline heading."

+ 2 - 1
lisp/org-gnus.el

@@ -1,6 +1,7 @@
 ;;; org-gnus.el --- Support for links to Gnus groups and messages from within Org-mode
 ;;; org-gnus.el --- Support for links to Gnus groups and messages from within Org-mode
 
 
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009
+;;   Free Software Foundation, Inc.
 
 
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;;         Tassilo Horn <tassilo at member dot fsf dot org>
 ;;         Tassilo Horn <tassilo at member dot fsf dot org>

+ 2 - 2
lisp/org-id.el

@@ -499,7 +499,7 @@ When CHECK is given, prepare detailed information about duplicate IDs."
   (let ((res (make-hash-table
   (let ((res (make-hash-table
 	      :test 'equal
 	      :test 'equal
 	      :size (apply '+ (mapcar 'length list))))
 	      :size (apply '+ (mapcar 'length list))))
-	f i)
+	f)
     (mapc
     (mapc
      (lambda (x)
      (lambda (x)
        (setq f (car x))
        (setq f (car x))
@@ -540,7 +540,7 @@ If that files does not exist, or if it does not contain this ID,
 return nil.
 return nil.
 The position is returned as a cons cell (file-name . position).  With
 The position is returned as a cons cell (file-name . position).  With
 optional argument MARKERP, return the position as a new marker."
 optional argument MARKERP, return the position as a new marker."
-  (let (org-agenda-new-buffers m buf pos)
+  (let (org-agenda-new-buffers buf pos)
     (cond
     (cond
      ((not file) nil)
      ((not file) nil)
      ((not (file-exists-p file)) nil)
      ((not (file-exists-p file)) nil)

+ 2 - 1
lisp/org-info.el

@@ -1,6 +1,7 @@
 ;;; org-info.el --- Support for links to Info nodes from within Org-Mode
 ;;; org-info.el --- Support for links to Info nodes from within Org-Mode
 
 
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009
+;;   Free Software Foundation, Inc.
 
 
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Keywords: outlines, hypermedia, calendar, wp

+ 3 - 2
lisp/org-jsinfo.el

@@ -1,6 +1,7 @@
 ;;; org-jsinfo.el --- Support for org-info.js Javascript in Org HTML export
 ;;; org-jsinfo.el --- Support for org-info.js Javascript in Org HTML export
 
 
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009
+;;   Free Software Foundation, Inc.
 
 
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Keywords: outlines, hypermedia, calendar, wp
@@ -129,7 +130,7 @@ Option settings will replace the %MANAGER-OPTIONS cookie."
     (let ((template org-infojs-template)
     (let ((template org-infojs-template)
 	(ptoc (plist-get exp-plist :table-of-contents))
 	(ptoc (plist-get exp-plist :table-of-contents))
 	(hlevels (plist-get exp-plist :headline-levels))
 	(hlevels (plist-get exp-plist :headline-levels))
-	tdepth sdepth p1 s p v a1 tmp e opt var val table default)
+	tdepth sdepth s v e opt var val table default)
     (setq sdepth hlevels
     (setq sdepth hlevels
 	  tdepth hlevels)
 	  tdepth hlevels)
     (if (integerp ptoc) (setq tdepth (min ptoc tdepth)))
     (if (integerp ptoc) (setq tdepth (min ptoc tdepth)))

+ 2 - 1
lisp/org-list.el

@@ -1,6 +1,7 @@
 ;;; org-list.el --- Plain lists for Org-mode
 ;;; org-list.el --- Plain lists for Org-mode
 ;;
 ;;
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009
+;;   Free Software Foundation, Inc.
 ;;
 ;;
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;;	   Bastien Guerry <bzg AT altern DOT org>
 ;;	   Bastien Guerry <bzg AT altern DOT org>

+ 2 - 1
lisp/org-macs.el

@@ -1,6 +1,7 @@
 ;;; org-macs.el --- Top-level definitions for Org-mode
 ;;; org-macs.el --- Top-level definitions for Org-mode
 
 
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009
+;;   Free Software Foundation, Inc.
 
 
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Keywords: outlines, hypermedia, calendar, wp

+ 2 - 1
lisp/org-mhe.el

@@ -1,6 +1,7 @@
 ;;; org-mhe.el --- Support for links to MH-E messages from within Org-mode
 ;;; org-mhe.el --- Support for links to MH-E messages from within Org-mode
 
 
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009
+;;   Free Software Foundation, Inc.
 
 
 ;; Author: Thomas Baumann <thomas dot baumann at ch dot tum dot de>
 ;; Author: Thomas Baumann <thomas dot baumann at ch dot tum dot de>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Keywords: outlines, hypermedia, calendar, wp

+ 2 - 1
lisp/org-remember.el

@@ -1,6 +1,7 @@
 ;;; org-remember.el --- Fast note taking in Org-mode
 ;;; org-remember.el --- Fast note taking in Org-mode
 
 
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009
+;;   Free Software Foundation, Inc.
 
 
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Keywords: outlines, hypermedia, calendar, wp

+ 2 - 1
lisp/org-table.el

@@ -1,6 +1,7 @@
 ;;; org-table.el --- The table editor for Org-mode
 ;;; org-table.el --- The table editor for Org-mode
 
 
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009
+;;   Free Software Foundation, Inc.
 
 
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Keywords: outlines, hypermedia, calendar, wp

+ 2 - 1
lisp/org-vm.el

@@ -1,6 +1,7 @@
 ;;; org-vm.el --- Support for links to VM messages from within Org-mode
 ;;; org-vm.el --- Support for links to VM messages from within Org-mode
 
 
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009
+;;   Free Software Foundation, Inc.
 
 
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Keywords: outlines, hypermedia, calendar, wp

+ 2 - 1
lisp/org-wl.el

@@ -1,6 +1,7 @@
 ;;; org-wl.el --- Support for links to Wanderlust messages from within Org-mode
 ;;; org-wl.el --- Support for links to Wanderlust messages from within Org-mode
 
 
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009
+;;   Free Software Foundation, Inc.
 
 
 ;; Author: Tokuya Kameshima <kames at fa2 dot so-net dot ne dot jp>
 ;; Author: Tokuya Kameshima <kames at fa2 dot so-net dot ne dot jp>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Keywords: outlines, hypermedia, calendar, wp

+ 25 - 27
lisp/org.el

@@ -1,6 +1,7 @@
 ;;; org.el --- Outline-based notes management and organizer
 ;;; org.el --- Outline-based notes management and organizer
 ;; Carstens outline-mode for keeping track of everything.
 ;; Carstens outline-mode for keeping track of everything.
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009
+;;   Free Software Foundation, Inc.
 ;;
 ;;
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Keywords: outlines, hypermedia, calendar, wp
@@ -2340,7 +2341,6 @@ Changing this variable requires a restart of Emacs to take effect."
 	   (border (nth 2 e))
 	   (border (nth 2 e))
 	   (body (nth 3 e))
 	   (body (nth 3 e))
 	   (nl (nth 4 e))
 	   (nl (nth 4 e))
-	   (stacked (and nil (nth 5 e))) ; stacked is no longer allowed, forced to nil
 	   (body1 (concat body "*?"))
 	   (body1 (concat body "*?"))
 	   (markers (mapconcat 'car org-emphasis-alist ""))
 	   (markers (mapconcat 'car org-emphasis-alist ""))
 	   (vmarkers (mapconcat
 	   (vmarkers (mapconcat
@@ -2360,17 +2360,17 @@ Changing this variable requires a restart of Emacs to take effect."
                               (int-to-string nl) "\\}")))
                               (int-to-string nl) "\\}")))
       ;; Make the regexp
       ;; Make the regexp
       (setq org-emph-re
       (setq org-emph-re
-	    (concat "\\([" pre (if (and nil stacked) markers) "]\\|^\\)"
+	    (concat "\\([" pre "]\\|^\\)"
 		    "\\("
 		    "\\("
 		    "\\([" markers "]\\)"
 		    "\\([" markers "]\\)"
 		    "\\("
 		    "\\("
 		    "[^" border "]\\|"
 		    "[^" border "]\\|"
-		    "[^" border (if (and nil stacked) markers) "]"
+		    "[^" border "]"
 		    body1
 		    body1
-		    "[^" border (if (and nil stacked) markers) "]"
+		    "[^" border "]"
 		    "\\)"
 		    "\\)"
 		    "\\3\\)"
 		    "\\3\\)"
-		    "\\([" post (if (and nil stacked) markers) "]\\|$\\)"))
+		    "\\([" post "]\\|$\\)"))
       (setq org-verbatim-re
       (setq org-verbatim-re
 	    (concat "\\([" pre "]\\|^\\)"
 	    (concat "\\([" pre "]\\|^\\)"
 		    "\\("
 		    "\\("
@@ -4481,16 +4481,16 @@ This function is the default value of the hook `org-cycle-hook'."
      ((eq state 'subtree)  (or (org-subtree-end-visible-p) (recenter 1))))))
      ((eq state 'subtree)  (or (org-subtree-end-visible-p) (recenter 1))))))
 
 
 (defun org-compact-display-after-subtree-move ()
 (defun org-compact-display-after-subtree-move ()
-  (let (beg end)
+  "Show a compacter version of the tree of the entry's parent."
-    (save-excursion
+  (save-excursion
-      (if (org-up-heading-safe)
+    (if (org-up-heading-safe)
-	  (progn
+	(progn
-	    (hide-subtree)
+	  (hide-subtree)
-	    (show-entry)
+	  (show-entry)
-	    (show-children)
+	  (show-children)
-	    (org-cycle-show-empty-lines 'children)
+	  (org-cycle-show-empty-lines 'children)
-	    (org-cycle-hide-drawers 'children))
+	  (org-cycle-hide-drawers 'children))
-	(org-overview)))))
+      (org-overview))))
 
 
 (defun org-cycle-show-empty-lines (state)
 (defun org-cycle-show-empty-lines (state)
   "Show empty lines above all visible headlines.
   "Show empty lines above all visible headlines.
@@ -5845,7 +5845,7 @@ exit by killing the buffer with \\[org-edit-src-exit]."
 	(msg (substitute-command-keys
 	(msg (substitute-command-keys
 	      "Edit, then exit with C-c ' (C-c and single quote)"))
 	      "Edit, then exit with C-c ' (C-c and single quote)"))
 	(org-mode-p (eq major-mode 'org-mode))
 	(org-mode-p (eq major-mode 'org-mode))
-	beg end lang lang-f)
+	beg end)
     (beginning-of-line 1)
     (beginning-of-line 1)
     (if (looking-at "[ \t]*[^:\n \t]")
     (if (looking-at "[ \t]*[^:\n \t]")
 	nil
 	nil
@@ -5912,7 +5912,7 @@ the language, a switch telling of the content should be in a single line."
 	    ("^#\\+ascii:" "\n" "ascii" single-line)
 	    ("^#\\+ascii:" "\n" "ascii" single-line)
 	    )))
 	    )))
 	(pos (point))
 	(pos (point))
-	re re1 re2 single beg end lang lfmt match-re1)
+	re1 re2 single beg end lang lfmt match-re1)
     (catch 'exit
     (catch 'exit
       (while (setq entry (pop re-list))
       (while (setq entry (pop re-list))
 	(setq re1 (car entry) re2 (nth 1 entry) lang (nth 2 entry)
 	(setq re1 (car entry) re2 (nth 1 entry) lang (nth 2 entry)
@@ -7835,7 +7835,7 @@ operation has put the subtree."
     (apply
     (apply
      'org-ido-completing-read prompt
      'org-ido-completing-read prompt
      (lambda (string predicate &optional flag)
      (lambda (string predicate &optional flag)
-       (let (rtn r s f (l (length string)))
+       (let (rtn r f (l (length string)))
 	 (cond
 	 (cond
 	  ((eq flag nil)
 	  ((eq flag nil)
 	   ;; try completion
 	   ;; try completion
@@ -8658,7 +8658,7 @@ This function is run automatically after each state change to a DONE state."
 	 (org-log-done nil)
 	 (org-log-done nil)
 	 (org-todo-log-states nil)
 	 (org-todo-log-states nil)
 	 (nshiftmax 10) (nshift 0)
 	 (nshiftmax 10) (nshift 0)
-	 re type n what ts mb0 time)
+	 re type n what ts time)
     (when repeat
     (when repeat
       (if (eq org-log-repeat t) (setq org-log-repeat 'state))
       (if (eq org-log-repeat t) (setq org-log-repeat 'state))
       (org-todo (if (eq interpret 'type) last-state head))
       (org-todo (if (eq interpret 'type) last-state head))
@@ -8681,8 +8681,7 @@ This function is run automatically after each state change to a DONE state."
 	      re (save-excursion (outline-next-heading) (point)) t)
 	      re (save-excursion (outline-next-heading) (point)) t)
 	(setq type (if (match-end 1) org-scheduled-string
 	(setq type (if (match-end 1) org-scheduled-string
 		     (if (match-end 3) org-deadline-string "Plain:"))
 		     (if (match-end 3) org-deadline-string "Plain:"))
-	      ts (match-string (if (match-end 2) 2 (if (match-end 4) 4 0)))
+	      ts (match-string (if (match-end 2) 2 (if (match-end 4) 4 0))))
-	      mb0 (match-beginning 0))
 	(when (string-match "\\([.+]\\)?\\(\\+[0-9]+\\)\\([dwmy]\\)" ts)
 	(when (string-match "\\([.+]\\)?\\(\\+[0-9]+\\)\\([dwmy]\\)" ts)
 	  (setq	n (string-to-number (match-string 2 ts))
 	  (setq	n (string-to-number (match-string 2 ts))
 		what (match-string 3 ts))
 		what (match-string 3 ts))
@@ -10165,7 +10164,7 @@ the scanner.  The following items can be given here:
 	 (org-agenda-skip-function
 	 (org-agenda-skip-function
 	  (car (org-delete-all '(comment archive) skip)))
 	  (car (org-delete-all '(comment archive) skip)))
 	 (org-tags-match-list-sublevels t)
 	 (org-tags-match-list-sublevels t)
-	 matcher pos file res
+	 matcher file res
 	 org-todo-keywords-for-agenda
 	 org-todo-keywords-for-agenda
 	 org-done-keywords-for-agenda
 	 org-done-keywords-for-agenda
 	 org-todo-keyword-alist-for-agenda
 	 org-todo-keyword-alist-for-agenda
@@ -10189,7 +10188,6 @@ the scanner.  The following items can be given here:
 	       (list (buffer-file-name (current-buffer))))
 	       (list (buffer-file-name (current-buffer))))
 	      (setq res (org-scan-tags func matcher)))
 	      (setq res (org-scan-tags func matcher)))
 	  ;; Get the right scope
 	  ;; Get the right scope
-	  (setq pos (point))
 	  (cond
 	  (cond
 	   ((and scope (listp scope) (symbolp (car scope)))
 	   ((and scope (listp scope) (symbolp (car scope)))
 	    (setq scope (eval scope)))
 	    (setq scope (eval scope)))
@@ -10587,7 +10585,7 @@ With INCLUDE-DEFAULTS, also include properties that has special meaning
 internally: ARCHIVE, CATEGORY, SUMMARY, DESCRIPTION, LOCATION, and LOGGING.
 internally: ARCHIVE, CATEGORY, SUMMARY, DESCRIPTION, LOCATION, and LOGGING.
 With INCLUDE-COLUMNS, also include property names given in COLUMN
 With INCLUDE-COLUMNS, also include property names given in COLUMN
 formats in the current buffer."
 formats in the current buffer."
-  (let (rtn range cfmt cols s p)
+  (let (rtn range cfmt s p)
     (save-excursion
     (save-excursion
       (save-restriction
       (save-restriction
 	(widen)
 	(widen)
@@ -14845,7 +14843,7 @@ Show the heading too, if it is currently invisible."
 	 (re (concat "^" outline-regexp))
 	 (re (concat "^" outline-regexp))
 	 (subs (make-vector (1+ n) nil))
 	 (subs (make-vector (1+ n) nil))
 	 (last-level 0)
 	 (last-level 0)
-	 m tree level head)
+	 m level head)
     (save-excursion
     (save-excursion
       (save-restriction
       (save-restriction
 	(widen)
 	(widen)
@@ -14898,7 +14896,7 @@ if no description is present"
 To get rid of the restriction, use \\[org-agenda-remove-restriction-lock]."
 To get rid of the restriction, use \\[org-agenda-remove-restriction-lock]."
   (interactive)
   (interactive)
   (require 'org-agenda)
   (require 'org-agenda)
-  (let (p m tp np dir txt w)
+  (let (p m tp np dir txt)
     (cond
     (cond
      ((setq p (text-property-any (point-at-bol) (point-at-eol)
      ((setq p (text-property-any (point-at-bol) (point-at-eol)
 				 'org-imenu t))
 				 'org-imenu t))