emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/textmodes/org.el,v


From: Carsten Dominik
Subject: [Emacs-diffs] Changes to emacs/lisp/textmodes/org.el,v
Date: Wed, 24 Oct 2007 05:37:13 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Carsten Dominik <cdominik>      07/10/24 05:37:12

Index: org.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/textmodes/org.el,v
retrieving revision 1.160
retrieving revision 1.161
diff -u -b -r1.160 -r1.161
--- org.el      22 Oct 2007 21:56:24 -0000      1.160
+++ org.el      24 Oct 2007 05:37:11 -0000      1.161
@@ -5,7 +5,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 5.13d
+;; Version: 5.13e
 ;;
 ;; This file is part of GNU Emacs.
 ;;
@@ -83,7 +83,7 @@
 
 ;;; Version
 
-(defconst org-version "5.13d"
+(defconst org-version "5.13e"
   "The version number of the file org.el.")
 (defun org-version ()
   (interactive)
@@ -2000,7 +2000,7 @@
 
 (defcustom org-agenda-file-regexp "\\.org\\'"
   "Regular expression to match files for `org-agenda-files'.
-If ny element in the list in that variable contains a directory instead
+If any element in the list in that variable contains a directory instead
 of a normal file, all files in that directory that are matched by this
 regular expression will be included."
   :group 'org-agenda
@@ -13748,8 +13748,7 @@
          (goto-char (match-end 1))
          (setq col (current-column))
          (goto-char (match-end 0))
-         (if (eobp) (insert "\n"))
-         (forward-char 1)
+         (if (eobp) (insert "\n") (forward-char 1))
          (if (and (not (looking-at outline-regexp))
                   (looking-at (concat "[^\r\n]*?" org-keyword-time-regexp
                                       "[^\r\n]*"))
@@ -14143,7 +14142,9 @@
                      'keymap org-agenda-keymap
                      'help-echo
                      (format "mouse-2 or RET jump to org file %s"
-                             (abbreviate-file-name buffer-file-name))))
+                             (abbreviate-file-name
+                              (or (buffer-file-name (buffer-base-buffer))
+                                  (buffer-name (buffer-base-buffer)))))))
         (case-fold-search nil)
          lspos
         tags tags-list tags-alist (llast 0) rtn level category i txt
@@ -14691,7 +14692,7 @@
                      (setq current (delete tg current))
                    (loop for g in groups do
                          (if (member tg g)
-                             (mapcar (lambda (x)
+                             (mapc (lambda (x)
                                        (setq current (delete x current)))
                                      g)))
                    (push tg current))
@@ -15284,6 +15285,7 @@
 (org-defkey org-columns-map "e" 'org-columns-edit-value)
 (org-defkey org-columns-map "\C-c\C-t" 'org-columns-todo)
 (org-defkey org-columns-map "\C-c\C-c" 'org-columns-set-tags-or-toggle)
+(org-defkey org-columns-map "\C-c\C-o" 'org-columns-open-link)
 (org-defkey org-columns-map "v" 'org-columns-show-value)
 (org-defkey org-columns-map "q" 'org-columns-quit)
 (org-defkey org-columns-map "r" 'org-columns-redo)
@@ -15310,7 +15312,7 @@
     ["Next allowed value" org-columns-next-allowed-value t]
     ["Previous allowed value" org-columns-previous-allowed-value t]
     ["Show full value" org-columns-show-value t]
-    ["Edit allowed" org-columns-edit-allowed t]
+    ["Edit allowed values" org-columns-edit-allowed t]
     "--"
     ["Edit column attributes" org-columns-edit-attributes t]
     ["Increase column width" org-columns-widen t]
@@ -15325,6 +15327,8 @@
     ["OVERVIEW" org-overview t]
     ["Refresh columns display" org-columns-redo t]
     "--"
+    ["Open link" org-columns-open-link t]
+    "--"
     ["Quit" org-columns-quit t]))
 
 (defun org-columns-new-overlay (beg end &optional string face)
@@ -15594,6 +15598,7 @@
         (key1 (concat key "_ALL"))
         (allowed (org-entry-get (point) key1 t))
         nval)
+    ;; FIXME: Cover editing TODO, TAGS etc inbuffer settings.????
     (setq nval (read-string "Allowed: " allowed))
     (org-entry-put 
      (cond ((marker-position org-entry-property-inherited-from)
@@ -15606,6 +15611,9 @@
   (let (hidep)
     (save-excursion
       (beginning-of-line 1)
+      ;; `next-line' is needed here, because it skips invisible line.
+      ;; FIXME: RMS says this should be wrapped into `with-no-warnings'
+      ;; but I don't know how to do this and keep the code XEmacs compatible.
       (condition-case nil (next-line 1) (error nil))
       (setq hidep (org-on-heading-p 1)))
     (eval form)
@@ -15670,15 +15678,21 @@
            (< emacs-major-version 22))
        (error "Emacs 22 is required for the columns feature")))))
 
-;; FIXME: does not yet work
-(defun org-columns-follow-link ()
+(defun org-columns-open-link (&optional arg)
+  (interactive "P")
   (let ((key (get-char-property (point) 'org-columns-key))
        (value (get-char-property (point) 'org-columns-value)))
-    (if (or (string-match org-bracket-link-regexp value)
-           (string-match org-angle-link-re value)
-           (string-match org-plain-link-re value))
-       (org-open-at-point) ; fixme
-      (error "No link in this value"))))
+    (org-open-link-from-string arg)))
+
+(defun org-open-link-from-string (s &optional arg)
+  "Open a link in the string S, as if it was in Org-mode."
+  (interactive)
+  (with-temp-buffer
+    (let ((org-inhibit-startup t))
+      (org-mode)
+      (insert s)
+      (goto-char (point-min))
+      (org-open-at-point arg))))
 
 (defun org-columns-get-format-and-top-level ()
   (let (fmt)
@@ -16323,6 +16337,7 @@
          (if (equal with-time '(16)) 0 org-time-stamp-rounding-minutes))
         (ct (org-current-time))
         (def (or default-time ct))
+        ; (defdecode (decode-time def))
         (calendar-move-hook nil)
         (view-diary-entries-initially nil)
         (view-calendar-holidays-initially nil)
@@ -16440,9 +16455,9 @@
                        (substring ans (match-end 7)))))
 
     (setq tl (parse-time-string ans)
-         year (or (nth 5 tl) (string-to-number (format-time-string "%Y" def)))
-         month (or (nth 4 tl) (string-to-number (format-time-string "%m" def)))
          day (or (nth 3 tl) (string-to-number (format-time-string "%d" def)))
+         month (or (nth 4 tl) (string-to-number (format-time-string "%m" def)))
+         year (or (nth 5 tl) (string-to-number (format-time-string "%Y" def)))
          hour (or (nth 2 tl) (string-to-number (format-time-string "%H" def)))
          minute (or (nth 1 tl) (string-to-number (format-time-string "%M" 
def)))
          second (or (nth 0 tl) 0)
@@ -16471,11 +16486,25 @@
          (format "%04d-%02d-%02d %02d:%02d" year month day hour minute)
        (format "%04d-%02d-%02d" year month day)))))
 
+;(defun org-parse-for-shift (n1 n2 given-dec default-dec)
+;  (cond
+;   ((not (nth n1 given-dec))
+;    (nth n1 default-dec))
+;   ((or (> (nth n1 given-dec) (nth n1 (default-dec)))
+;      (not org-read-date-prefer-future))
+;    (nth n1 given-dec))
+;   (t (1+
+;       (if (nth 3 given-dec)
+;         (nth 3 given-dec)
+;    (if (> (nth
+;  (setq given
+;  (if (and
+
 (defvar parse-time-weekdays)
 
 (defun org-read-date-get-relative (s today default)
   "Check string S for special relative date string.
-TODAY and DEFAULT are ionternal times, for today and for a default.
+TODAY and DEFAULT are internal times, for today and for a default.
 Return shift list (N what def-flag)
 WHAT       is \"d\", \"w\", \"m\", or \"y\" for day. week, month, year.
 N          is the number if WHATs to shift
@@ -16483,7 +16512,7 @@
            the DEFAULT date rather than TODAY."
   (when (string-match
         (concat
-         "\\`[ \t]*\\([-+]\\{1,2\\}\\)?"
+         "\\`[ \t]*\\([-+]\\{1,2\\}\\)"
          "\\([0-9]+\\)?"
          "\\([dwmy]\\|\\(" (mapconcat 'car parse-time-weekdays "\\|") "\\)\\)?"
          "\\([ \t]\\|$\\)") s)
@@ -18260,7 +18289,7 @@
           (region-p (org-region-active-p))
           (custom org-agenda-custom-commands)
           (selstring "")
-          restriction
+          restriction second-time
           c entry key type match prefixes rmheader header-end custom1 desc)
       (save-window-excursion
        (delete-other-windows)
@@ -18339,9 +18368,12 @@
                                   "Prefix key"))))
                    prefixes))
          (goto-char (point-min))
-         (if (and (fboundp 'fit-window-to-buffer)
-                  (not (pos-visible-in-window-p (point-max))))
+         (when (fboundp 'fit-window-to-buffer)
+           (if second-time
+               (if (not (pos-visible-in-window-p (point-max)))
              (fit-window-to-buffer))
+             (setq second-time t)
+             (fit-window-to-buffer)))
          (message "Press key for agenda command%s:"
                   (if restrict-ok
                       (if restriction
@@ -20988,11 +21020,19 @@
 (defun org-agenda-open-link ()
   "Follow the link in the current line, if any."
   (interactive)
+  (org-agenda-copy-local-variable 'org-link-abbrev-alist-local)
   (save-excursion
     (save-restriction
       (narrow-to-region (point-at-bol) (point-at-eol))
       (org-open-at-point))))
 
+(defun org-agenda-copy-local-variable (var)
+  "Get a variable from a referenced buffer and install it here."
+  (let ((m (get-text-property (point) 'org-marker)))
+    (when (and m (buffer-live-p (marker-buffer m)))
+      (org-set-local var (with-current-buffer (marker-buffer m)
+                          (symbol-value var))))))
+
 (defun org-agenda-switch-to (&optional delete-other-windows)
   "Go to the Org-mode file which contains the item at point."
   (interactive)
@@ -22783,7 +22823,7 @@
     (fundamental-mode)
     ;; create local variables for all options, to make sure all called
     ;; functions get the correct information
-    (mapcar (lambda (x)
+    (mapc (lambda (x)
              (set (make-local-variable (cdr x))
                   (plist-get opt-plist (car x))))
            org-export-plist-vars)
@@ -22818,7 +22858,7 @@
        (progn
          (push (concat (nth 3 lang-words) "\n") thetoc)
          (push (concat (make-string (length (nth 3 lang-words)) ?=) "\n") 
thetoc)
-         (mapcar '(lambda (line)
+         (mapc '(lambda (line)
                     (if (string-match org-todo-line-regexp
                                       line)
                         ;; This is a headline
@@ -23450,7 +23490,7 @@
          (org-odd-levels-only odd))
       ;; create local variables for all options, to make sure all called
       ;; functions get the correct information
-      (mapcar (lambda (x)
+      (mapc (lambda (x)
                (set (make-local-variable (cdr x))
                     (plist-get opt-plist (car x))))
              org-export-plist-vars)
@@ -26412,6 +26452,21 @@
        (push (cons k c) new))))
     (nreverse new)))
 
+;(defcustom org-read-date-prefer-future nil
+;  "Non-nil means, when reading an incomplete date from the user, assume 
future.
+;This affects the following situations:
+;1. The user give a day, but no month.
+;   In this case, if the day number if after today, the current month will
+;   be used, otherwise the next month.
+;2. The user gives a month but not a year.
+;   In this case, the the given month is after the current month, the current
+;   year will be used.  Otherwise the next year will be used.;
+;
+;When nil, always the current month and year will be used."
+;  :group 'org-time ;????
+;  :type 'boolean)
+
+
 ;;;; Finish up
 
 (provide 'org)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]