Browse Source

Merge branch 'master' of git://repo.or.cz/org-mode

Dan Davison 14 years ago
parent
commit
7917e8ea29
8 changed files with 72 additions and 32 deletions
  1. 4 2
      .gitignore
  2. 1 1
      ORGWEBPAGE/index.org
  3. 4 2
      UTILITIES/pw
  4. 10 5
      doc/org.texi
  5. 3 3
      lisp/org-agenda.el
  6. 1 1
      lisp/org-compat.el
  7. 6 1
      lisp/org-publish.el
  8. 43 17
      lisp/org.el

+ 4 - 2
.gitignore

@@ -8,23 +8,25 @@
 *.bak
 *.cp
 *.cps
+*.diff
 *.dvi
 *.elc
 *.fn
 *.fns
 *.html
+*.info
 *.ky
 *.kys
 *.log
+*.patch
 *.pdf
 *.pg
 *.pgs
+*.ps
 *.toc
 *.tp
 *.vr
 *.vrs
-*.dvi
-*.ps
 orgcard_letter.tex
 orgcard.txt
 org

+ 1 - 1
ORGWEBPAGE/index.org

@@ -152,7 +152,7 @@ the command line....):
 
 Some more information about this can be found in the [[http://orgmode.org/worg/org-faq.php][FAQ]], under [[http://orgmode.org/worg/org-faq.php#keeping-current-with-Org-mode-development][How do
 I keep current with Org mode development?]].  For people who cannot use
-git, we provide [[file:org-latest.zip][zip]] or [[file:org-latest.tar.gz][tar.gz]] snapshot release files updated each hour
+git, we provide [[file:org-latest.zip][zip]] or [[file:org-latest.tar.gz][tar.gz]] snapshot release files updated each day
 and corresponding to the latest git version.
 
 ** Alternative distributions

+ 4 - 2
UTILITIES/pw

@@ -285,7 +285,8 @@ def action_apply(rpc, patch_id):
         sys.exit(1)
 
 def action_update_patch(rpc, patch_id, state = None, commit = None,
-                        delegate_str = "", comment_str, archived = False):
+                        delegate_str = "", comment_str = "None",
+			archived = False):
     patch = rpc.patch_get(patch_id)
     if patch == {}:
         sys.stderr.write("Error getting information on patch ID %d\n" % \
@@ -471,7 +472,8 @@ def merge_with(patch_id, rpc, delegate_str, comment_str):
     # If it succeeded this far, mark the patch as "Accepted" by the invoking
     # user.
     action_update_patch(rpc, patch_id, state = 'Accepted', commit = sha,
-                        delegate_str = delegate_str, archived = True)
+                        delegate_str = delegate_str, comment_str = comment_str,
+                        archived = True)
 
     print sha
 

+ 10 - 5
doc/org.texi

@@ -727,10 +727,15 @@ active region by using the mouse to select a region, or pressing
 If you find problems with Org, or if you have questions, remarks, or ideas
 about it, please mail to the Org mailing list @email{emacs-orgmode@@gnu.org}.
 If you are not a member of the mailing list, your mail will be passed to the
-list after a moderator has approved it.
-
-For bug reports, please provide as much information as possible, including
-the version information of Emacs (@kbd{M-x emacs-version @key{RET}}) and Org
+list after a moderator has approved it@footnote{Please consider subscribing
+to the mailing list, in order to minimize the work the mailing list
+moderators have to do.}.
+
+For bug reports, please first try to reproduce the bug with the latest
+version of Org available - if you are running an outdated version, it is
+quite possible that the bug has been fixed already.  If the bug persists,
+prepare a report and provide as much information as possible, including the
+version information of Emacs (@kbd{M-x emacs-version @key{RET}}) and Org
 (@kbd{M-x org-version @key{RET}}), as well as the Org related setup in
 @file{.emacs}.  The easiest way to do this is to use the command
 @example
@@ -749,7 +754,7 @@ about:
 @item What did you expect to happen?
 @item What happened instead?
 @end enumerate
-@noindent Thank you for helping to improve this mode.
+@noindent Thank you for helping to improve this program.
 
 @subsubheading How to create a useful backtrace
 

+ 3 - 3
lisp/org-agenda.el

@@ -5224,8 +5224,8 @@ could bind the variable in the options section of a custom command.")
   (if nosort
       list
     (when org-agenda-before-sorting-filter-function
-      (setq list (mapcar org-agenda-before-sorting-filter-function list)))
-    (delq nil (mapconcat 'identity (sort list 'org-entries-lessp) "\n"))))
+      (setq list (delq nil (mapcar org-agenda-before-sorting-filter-function list))))
+    (mapconcat 'identity (sort list 'org-entries-lessp) "\n")))
 
 (defun org-agenda-highlight-todo (x)
   (let ((org-done-keywords org-done-keywords-for-agenda)
@@ -7138,7 +7138,7 @@ The cursor may be at a date in the calendar, or in the Org agenda."
 	  (setq newhead (org-get-heading)))
 	(org-agenda-change-all-lines newhead hdmarker)))))
 
-(defun org-agenda-clock-out (&optional arg)
+(defun org-agenda-clock-out ()
   "Stop the currently running clock."
   (interactive "P")
   (unless (marker-buffer org-clock-marker)

+ 1 - 1
lisp/org-compat.el

@@ -353,7 +353,7 @@ TIME defaults to the current time."
   (if (fboundp 'looking-at-p)
       (apply 'looking-at-p args)
     (save-match-data
-      (apply 'looking-at-p args))))
+      (apply 'looking-at args))))
 
 ; XEmacs does not have `looking-back'.
 (if (fboundp 'looking-back)

+ 6 - 1
lisp/org-publish.el

@@ -471,7 +471,12 @@ matching filenames."
 		 (i (plist-get (cdr prj) :include))
 		 (xm (concat "^" b (if r ".+" "[^/]+") "\\.\\(" x "\\)$")))
 	    (when (or
-		   (and i (string-match i filename))
+		   (and 
+		    i 
+		    (member filename 
+			    (mapcar 
+			     (lambda (file) (expand-file-name file b))
+			     i)))
 		   (and
 		    (not (and e (string-match e filename)))
 		    (string-match xm filename)))

+ 43 - 17
lisp/org.el

@@ -4038,7 +4038,11 @@ group 3: Priority cookie
 group 4: True headline
 group 5: Tags")
 (make-variable-buffer-local 'org-complex-heading-regexp)
-(defvar org-complex-heading-regexp-format nil)
+(defvar org-complex-heading-regexp-format nil
+  "Printf format to make regexp to match an exact headline.
+This regexp will match the headline of any node which hase the exact
+headline text that is put into the format, but may have any TODO state,
+priority and tags.")
 (make-variable-buffer-local 'org-complex-heading-regexp-format)
 (defvar org-todo-line-tags-regexp nil
   "Matches a headline and puts TODO state into group 2 if present.
@@ -6440,7 +6444,9 @@ the headline hierarchy above."
 	 (selected-point
 	  (if (eq interface 'outline)
 	      (car (org-get-location (current-buffer) org-goto-help))
-	    (nth 3 (org-refile-get-location "Goto: ")))))
+	    (let ((pa (org-refile-get-location "Goto: ")))
+	      (org-refile-check-position pa)
+	      (nth 3 pa)))))
     (if selected-point
 	(progn
 	  (org-mark-ring-push org-goto-start-pos)
@@ -9939,15 +9945,8 @@ on the system \"/user@host:\"."
 			 (setq level (org-reduced-level
 				      (- (match-end 1) (match-beginning 1)))
 			       txt (org-link-display-format (match-string 4))
-			       re (concat "^" (regexp-quote
-					       (buffer-substring
-						(match-beginning 1)
-						(match-end 4)))))
-			 (if (match-end 5) (setq re (concat
-						     re "[ \t]+"
-						     (regexp-quote
-						      (match-string 5)))))
-			 (setq re (concat re "[ \t]*$"))
+			       re (format org-complex-heading-regexp-format
+					  (regexp-quote (match-string 4))))
 			 (when org-refile-use-outline-path
 			   (setq txt (mapconcat
 				      'org-protect-slash
@@ -10246,6 +10245,7 @@ This can be done with a 0 prefix: `C-0 C-c C-w'"
     (setq answ (funcall cfunc prompt tbl nil (not new-nodes)
 			nil 'org-refile-history))
     (setq pa (or (assoc answ tbl) (assoc (concat answ "/") tbl)))
+    (org-refile-check-position pa)
     (if pa
 	(progn
 	  (when (or (not org-refile-history)
@@ -10272,6 +10272,26 @@ This can be done with a 0 prefix: `C-0 C-c C-w'"
 	      (org-refile-new-child parent-target child)))
 	(error "Invalid target location")))))
 
+(defun org-refile-check-position (refile-pointer)
+  "Check if the refile pointer matches the readline to which it points."
+  (let* ((file (nth 1 refile-pointer))
+	 (re (nth 2 refile-pointer))
+	 (pos (nth 3 refile-pointer))
+	 buffer)
+    (when (org-string-nw-p re)
+      (setq buffer (if (markerp pos)
+		       (marker-buffer pos)
+		     (or (find-buffer-visiting file)
+			 (find-file-noselect file))))
+      (with-current-buffer buffer
+	(save-excursion
+	  (save-restriction
+	    (widen)
+	    (goto-char pos)
+	    (beginning-of-line 1)
+	    (unless (org-looking-at-p re)
+	      (error "Invalid refile position, please rebuild the cache"))))))))
+
 (defun org-refile-new-child (parent-target child)
   "Use refile target PARENT-TARGET to add new CHILD below it."
   (unless parent-target
@@ -12755,7 +12775,7 @@ With prefix ARG, realign all tags in headings in the current buffer."
 	 (col (current-column))
 	 (org-setting-tags t)
 	 table current-tags inherited-tags ; computed below when needed
-	 tags p0 c0 c1 rpl)
+	 tags p0 c0 c1 rpl di tc level)
     (if arg
 	(save-excursion
 	  (goto-char (point-min))
@@ -12805,6 +12825,9 @@ With prefix ARG, realign all tags in headings in the current buffer."
 
       ;; Insert new tags at the correct column
       (beginning-of-line 1)
+      (setq level (or (and (looking-at org-outline-regexp)
+			   (- (match-end 0) (point) 1))
+		      1))
       (cond
        ((and (equal current "") (equal tags "")))
        ((re-search-forward
@@ -12813,11 +12836,14 @@ With prefix ARG, realign all tags in headings in the current buffer."
 	(if (equal tags "")
 	    (setq rpl "")
 	  (goto-char (match-beginning 0))
-	  (setq c0 (current-column) p0 (if (equal (char-before) ?*)
-					   (1+ (point)) (point))
-		c1 (max (1+ c0) (if (> org-tags-column 0)
-				    org-tags-column
-				  (- (- org-tags-column) (length tags))))
+	  (setq c0 (current-column)
+		;; compute offset for the case of org-indent-mode active
+		di (if org-indent-mode
+		       (* (1- org-indent-indentation-per-level) (1- level))
+		     0)
+		p0 (if (equal (char-before) ?*) (1+ (point)) (point))
+		tc (+ org-tags-column (if (> org-tags-column 0) (- di) di))
+		c1 (max (1+ c0) (if (> tc 0) tc (- (- tc) (length tags))))
 		rpl (concat (make-string (max 0 (- c1 c0)) ?\ ) tags)))
 	(replace-match rpl t t)
 	(and (not (featurep 'xemacs)) c0 indent-tabs-mode (tabify p0 (point)))