[Orgmode] Re: Please test links
tested ok: mhe, bbdb, info ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Re: Please test links
Hi Carsten, I checked org-wl.el and it works fine. BTW, I have another implementation of org-wl.el. Is it possible to merge my version to the git? The differences between git version and mine are: - Integrated `org-wl-open' function into `org-wl-open'. - org-wl-store-link: If the message on the cursor line is marked as refile ("o"), set the link's folder to the refile destionation folder. I prefer this behavior since I read the email in the inbox folder, set the refile mark, and create TODO task using remember package from the email before performing the refile operation. After I create tasks, I execute the refile. - Fixed "To:" field extraction problem where the function `elmo-message-entity-field' returns a string or a list of strings. - org-wl-open: Added a workaround for `wl-folder-goto-folder-subr', which moves point to the beginning of the current line in the old folder. Thanks, --Tokuya > From: Carsten Dominik science.uva.nl> > Subject: Re: Re: Please test links > Newsgroups: gmane.emacs.orgmode > Date: 2008-03-15 20:35:49 GMT (17 hours and 38 minutes ago) > > At least we got you to learn git! :-) > > Thanks for the analysis, I have fixed this problem for all link > packages, thanks a lot!!! > > Please, everyone, git it another shot. > > Ahh, I don't know what I would do without all this help. > > - Carsten ;;; org-wl.el - Support for links to Wanderlust messages in Org-mode ;; Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. ;; Author: Carsten Dominik ;; Keywords: outlines, hypermedia, calendar, wp ;; Homepage: http://orgmode.org ;; Version: 1.0 ;; ;; This file is part of GNU Emacs. ;; ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs; see the file COPYING. If not, write to the ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ;; Boston, MA 02110-1301, USA. ; ;; ;;; Commentary: ;; This file implements links to Wanderlust messages for Org-mode. ;; Org-mode loads this module by default - if this is not what you want, ;; configure the variable `org-modules'. (require 'org) ;; Declare external functions and variables (declare-function elmo-folder-exists-p "ext:elmo" (folder) t) (declare-function elmo-message-entity-field "ext:elmo-msgdb" (entity field &optional type)) (declare-function elmo-message-field "ext:elmo" (folder number field &optional type) t) (declare-function elmo-msgdb-overview-get-entity "ext:elmo" (&rest unknown) t) ;; Backward compatibility to old version of wl (declare-function wl-summary-buffer-msgdb "ext:wl-folder" (&rest unknown) t) (declare-function wl-folder-get-elmo-folder "ext:wl-folder" (entity &optional no-cache)) (declare-function wl-summary-goto-folder-subr "ext:wl-summary" (&optional name scan-type other-window sticky interactive scoring force-exit)) (declare-function wl-summary-jump-to-msg-by-message-id "ext:wl-summary" (&optional id)) (declare-function wl-summary-line-from "ext:wl-summary" ()) (declare-function wl-summary-line-subject "ext:wl-summary" ()) (declare-function wl-summary-message-number "ext:wl-summary" ()) (declare-function wl-summary-redisplay "ext:wl-summary" (&optional arg)) (defvar wl-summary-buffer-elmo-folder) (defvar wl-summary-buffer-folder-name) (defvar wl-summary-buffer-temp-mark-list) ;; Install the link type (org-add-link-type "wl" 'org-wl-open) (add-hook 'org-store-link-functions 'org-wl-store-link) ;; Implementation (defun org-wl-store-link () "Store a link to an WL folder or message." (when (eq major-mode 'wl-summary-mode) (let* ((msgnum (wl-summary-message-number)) (folder-name (let ((elem (assq msgnum wl-summary-buffer-temp-mark-list))) (if (equal (nth 1 elem) "o") ; marked as refile (nth 2 elem) wl-summary-buffer-folder-name))) (message-id (elmo-message-field wl-summary-buffer-elmo-folder msgnum 'message-id)) (wl-message-entity (if (fboundp 'elmo-message-entity) (elmo-message-entity wl-summary-buffer-elmo-folder msgnum) (elmo-msgdb-overview-get-entity msgnum (wl-summary-buffer-msgdb (from (wl-summary-line-from)) (t
[Orgmode] [PATCH 1/5] Hide drawers after displaying an entry using org-clock-goto.
From: James TD Smith <[EMAIL PROTECTED]> --- org.el |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/org.el b/org.el index 4fe79d7..8fe8edd 100644 --- a/org.el +++ b/org.el @@ -18715,6 +18715,7 @@ If there is no running clock, throw an error, unless FAIL-QUIETLY is set." (goto-char org-clock-marker) (org-show-entry) (org-back-to-heading) + (org-cycle-hide-drawers 'children) (recenter)) (defvar org-clock-file-total-minutes nil ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] [PATCH 0/5] Various patches
The following series implements... --- James TD Smith (5): Fix the X clipboard handling so it works properly, and so it works in XEmacs. Add some new % expansions for remember templates for inserting clipboard values, and for inserting links using the clipboard contents. Add a new sort option, which sorts items by todo keyword in the order of the keyword sequence. Make org-table-export use the orgtbl export functions. Add support for reading the export format and file to export to from properties. Add a way to set a user-defined function to generate descriptions for links. Hide drawers after displaying an entry using org-clock-goto. org.el | 186 ++-- 1 files changed, 135 insertions(+), 51 deletions(-) -- James ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] [PATCH 2/5] Add a way to set a user-defined function to generate descriptions for links.
From: James TD Smith <[EMAIL PROTECTED]> Below is an example which uses w3m to retrieve the titles of web pages to use as link descriptions. (require 'w3m) (defun make-link-description (link desc) "Link description generator for orgmode" (cond ((string-match "https?:" link) (with-temp-buffer (w3m-retrieve link) (goto-char (point-min)) (if (search-forward-regexp "\\([^<]*\\)" (point-max) t) (url-unhex-string (match-string 1) (t (or desc link (setq org-make-link-description 'make-link-description) --- org.el | 37 +++-- 1 files changed, 27 insertions(+), 10 deletions(-) diff --git a/org.el b/org.el index 8fe8edd..021bd59 100644 --- a/org.el +++ b/org.el @@ -1209,6 +1209,15 @@ Changing this variable requires a restart of Emacs to become effective." (const :tag "Tags" tag) (const :tag "Timestamps" date))) +(defcustom org-make-link-description nil + "Function to use to generate link descriptions from links. If +nil the link location will be used. This function must take two +parameters; the first is the link and the second the description +org-insert-link has generated, and should return the description +to use." + :group 'org-link + :type 'function) + (defgroup org-link-store nil "Options concerning storing links in Org-mode" :tag "Org Store Link" @@ -12475,16 +12484,21 @@ be displayed in the buffer instead of the link. If there is already a link at point, this command will allow you to edit link and description parts. -With a \\[universal-argument] prefix, prompts for a file to link to. The file name can be -selected using completion. The path to the file will be relative to -the current directory if the file is in the current directory or a -subdirectory. Otherwise, the link will be the absolute path as -completed in the minibuffer (i.e. normally ~/path/to/file). - -With two \\[universal-argument] prefixes, enforce an absolute path even if the file -is in the current directory or below. -With three \\[universal-argument] prefixes, negate the meaning of -`org-keep-stored-link-after-insertion'." +With a \\[universal-argument] prefix, prompts for a file to link +to. The file name can be selected using completion. The path to +the file will be relative to the current directory if the file is +in the current directory or a subdirectory. Otherwise, the link +will be the absolute path as completed in the minibuffer (i.e. +normally ~/path/to/file). + +With two \\[universal-argument] prefixes, enforce an absolute +path even if the file is in the current directory or below. With +three \\[universal-argument] prefixes, negate the meaning of +`org-keep-stored-link-after-insertion'. + +If `org-make-link-description' is non-nil, this function will be +called with the link target, and the result will be the default +link description." (interactive "P") (let* ((wcf (current-window-configuration)) (region (if (org-region-active-p) @@ -12605,6 +12619,9 @@ With three \\[universal-argument] prefixes, negate the meaning of (if (equal desc origpath) (setq desc path +(if org-make-link-description + (setq desc (funcall org-make-link-description link desc))) + (setq desc (read-string "Description: " desc)) (unless (string-match "\\S-" desc) (setq desc nil)) (if remove (apply 'delete-region remove)) ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] [PATCH 3/5] Some improvements to org-table-export
From: James TD Smith <[EMAIL PROTECTED]> Specify the file to export to as parameter or property Use the export mechanisms from orgtbl instead of the simple export. Specify the table output format in property. --- org.el | 91 +--- 1 files changed, 64 insertions(+), 27 deletions(-) diff --git a/org.el b/org.el index 021bd59..dee8471 100644 --- a/org.el +++ b/org.el @@ -965,6 +965,13 @@ table, obtained by prompting the user." (list (symbol :tag "Major mode") (string :tag "Format" +(defcustom org-table-export-default "orgtbl-to-generic :splice t :sep \"\t\"" + "Default export parameters for org-table-export. These can be + overridden on for a specific table by setting the + TABLE_EXPORT_FORMAT parameter. See orgtbl-export for the + different export transforms and available parameters." + :group 'org-table) + (defgroup org-table-settings nil "Settings for tables in Org-mode." :tag "Org Table Settings" @@ -975,6 +982,7 @@ table, obtained by prompting the user." :group 'org-table-settings :type 'string) + (defcustom org-table-number-regexp "^\\([<>]?[-+^.0-9]*[0-9][-+^.0-9eEdDx()%:]*\\|\\(0[xX]\\)[0-9a-fA-F]+\\|nan\\)$" "Regular expression for recognizing numbers in table columns. @@ -8568,41 +8576,70 @@ are found, lines will be split on whitespace into fields." (insert-file-contents file) (org-table-convert-region beg (+ (point) (- (point-max) pm)) arg))) -(defun org-table-export () +(defun org-table-export (&optional target) "Export table as a tab-separated file. -Such a file can be imported into a spreadsheet program like Excel." +Such a file can be imported into a spreadsheet program like +Excel. If TARGET is set, the table is exported to that file. If +the property TABLE_EXPORT_FILE is set on the entry the table is +in, the table will be exported to that file. Otherwise the user +is prompted for a file to write the table to. + +If the TABLE_EXPORT_FORMAT property is set, the contents of this +property will control export format in the same way as radio +tables in OrgTbl mode. +" (interactive) (let* ((beg (org-table-begin)) (end (org-table-end)) -(table (buffer-substring beg end)) -(file (read-file-name "Export table to: ")) +(txt (buffer-substring-no-properties beg end)) +(file (or target (org-entry-get beg "TABLE_EXPORT_FILE") + (read-file-name "Export table to: "))) +(format (or (org-entry-get beg "TABLE_EXPORT_FORMAT") +org-table-export-default)) buf) (unless (or (not (file-exists-p file)) (y-or-n-p (format "Overwrite file %s? " file))) (error "Abort")) -(with-current-buffer (find-file-noselect file) - (setq buf (current-buffer)) - (erase-buffer) - (fundamental-mode) - (insert table) - (goto-char (point-min)) - (while (re-search-forward "^[ \t]*|[ \t]*" nil t) - (replace-match "" t t) - (end-of-line 1)) - (goto-char (point-min)) - (while (re-search-forward "[ \t]*|[ \t]*$" nil t) - (replace-match "" t t) - (goto-char (min (1+ (point)) (point-max - (goto-char (point-min)) - (while (re-search-forward "^-[-+]*$" nil t) - (replace-match "") - (if (looking-at "\n") - (delete-char 1))) - (goto-char (point-min)) - (while (re-search-forward "[ \t]*|[ \t]*" nil t) - (replace-match "\t" t t)) - (save-buffer)) -(kill-buffer buf))) +(message format) + +(if (string-match "\\([^ \t\r\n]+\\)\\( +.*\\)?" format) + (let* ((transform (intern (match-string 1 format))) + (params (if (match-end 2) + (read (concat "(" (match-string 2 format) ")" + (skip (plist-get params :skip)) + (skipcols (plist-get params :skipcols)) + (lines (nthcdr (or skip 0) (org-split-string txt "[ \t]*\n[ \t]*"))) + (lines (org-table-clean-before-export lines)) + (i0 (if org-table-clean-did-remove-column 2 1)) + (table (mapcar + (lambda (x) +(if (string-match org-table-hline-regexp x) +'hline + (org-remove-by-index + (org-split-string (org-trim x) "\\s-*|\\s-*") + skipcols i0))) + lines)) + (fun (if (= i0 2) 'cdr 'identity)) + (org-table-last-alignment + (org-remove-by-index (funcall fun org-table-last-alignment) +skipcols i0)) + (org-table-last-column-widths + (org-remove-by-index (funcall fun org-table-last-column-widths) +skipcols i0))) + + (unless (fboundp transform) + (error "No such transformation f
[Orgmode] [PATCH 5/5] clipboard handling in remember templats
From: James TD Smith <[EMAIL PROTECTED]> Fix the X clipboard handling so it works properly, and so it works in XEmacs,and add a new % expansion for adding links. This patch reverts the %c expansion to its original function (head of kill ring), and adds three new % expansions as follows: %x - Contents of the X clipboard. This is the first non-empty value from the PRIMARY, SECONDARY and CLIPBOARD X clipboards. %^C - This allows the user to choose between any of the clipboard values available, the kill ring head, and the initial region if set. %^L - Like %^C, but this inserts an org link using the selected value. --- org.el | 56 +--- 1 files changed, 41 insertions(+), 15 deletions(-) diff --git a/org.el b/org.el index d67024f..0e5fa6a 100644 --- a/org.el +++ b/org.el @@ -12509,7 +12509,7 @@ This command can be called in any mode to insert a link in Org-mode syntax." (org-load-modules-maybe) (org-run-like-in-org-mode 'org-insert-link)) -(defun org-insert-link (&optional complete-file) +(defun org-insert-link (&optional complete-file link-location) "Insert a link. At the prompt, enter the link. Completion can be used to select a link previously stored with @@ -12538,7 +12538,10 @@ three \\[universal-argument] prefixes, negate the meaning of If `org-make-link-description' is non-nil, this function will be called with the link target, and the result will be the default -link description." +link description. + +If the `link-location' parameter is non-nil, this value will be +used as the link location instead of reading one interactively" (interactive "P") (let* ((wcf (current-window-configuration)) (region (if (org-region-active-p) @@ -12546,7 +12549,8 @@ link description." (remove (and region (list (region-beginning) (region-end (desc region) tmphist ; byte-compile incorrectly complains about this -link entry file) +(link link-location) +entry file) (cond ((org-in-regexp org-bracket-link-regexp 1) ;; We do have a link at point, and we are going to edit it. @@ -12579,7 +12583,7 @@ link description." (setq link (org-make-link "file:" (match-string 1 (expand-file-name file) (t (setq link (org-make-link "file:" file)) - (t + ((not link) ;; Read link, with completion for stored links. (with-output-to-temp-buffer "*Org Links*" (princ "Insert a link. Use TAB to complete valid link prefixes.\n") @@ -13399,8 +13403,12 @@ RET at beg-of-buf -> Append to file as level 2 headline char0)) (cddr (assoc char templates) -(defvar x-last-selected-text) -(defvar x-last-selected-text-primary) +(defun org-get-x-clipboard (value) + (if (eq window-system 'x) + (let ((x (if org-xemacs-p + (get-selection-no-error value) +(x-selection-value value + (and (> (length x) 0) (set-text-properties 0 (length x) nil x) x ;;;###autoload (defun org-remember-apply-template (&optional use-char skip-interactive) @@ -13416,12 +13424,10 @@ to be run from that hook to function properly." (nth 1 entry) org-default-notes-file)) (headline (nth 2 entry)) -(v-c (or (and (eq window-system 'x) - (fboundp 'x-cut-buffer-or-selection-value) - (x-cut-buffer-or-selection-value)) - (org-bound-and-true-p x-last-selected-text) - (org-bound-and-true-p x-last-selected-text-primary) - (and (> (length kill-ring) 0) (current-kill 0 +(v-c (and (> (length kill-ring) 0) (current-kill 0))) +(v-x (or (org-get-x-clipboard 'PRIMARY) + (org-get-x-clipboard 'CLIPBOARD) + (org-get-x-clipboard 'SECONDARY))) (v-t (format-time-string (car org-time-stamp-formats) (org-current-time))) (v-T (format-time-string (cdr org-time-stamp-formats) (org-current-time))) (v-u (concat "[" (substring v-t 1 -1) "]")) @@ -13431,6 +13437,11 @@ to be run from that hook to function properly." (v-a (if (and (boundp 'annotation) annotation) (if (equal annotation "[[]]") "" annotation) "")) +(clipboards (remove nil (list v-i + (org-get-x-clipboard 'PRIMARY) + (org-get-x-clipboard 'CLIPBOARD) + (org-get-x-clipboard 'SECONDARY) + v-c))) (v-A (if (and v-a (string-match "\\[\\(\\[.*?\\]\\)\\(\\[.*?\\]\\)?\\]" v-a)) (replace-match "[\\1[%^{Link description}]]" nil nil v-a) @@ -13459,7 +13470,7 @@ to
Re: [Orgmode] [PATCH 4/5] Various patches
One of my patches [4/5] appears to have gone missing. I've attatched it to this email. James Add a new sort option, which sorts items by todo keyword in the order of the From: James TD Smith <[EMAIL PROTECTED]> todo sequence. This is a somewhat simple implementation which just uses the position of the keyword in org-todo-keywords-1, so if you have multiple sequences containing the same todo keyword you may not get the ordering you expect. --- org.el |7 +-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/org.el b/org.el index dee8471..d67024f 100644 --- a/org.el +++ b/org.el @@ -982,7 +982,6 @@ table, obtained by prompting the user." :group 'org-table-settings :type 'string) - (defcustom org-table-number-regexp "^\\([<>]?[-+^.0-9]*[0-9][-+^.0-9eEdDx()%:]*\\|\\(0[xX]\\)[0-9a-fA-F]+\\|nan\\)$" "Regular expression for recognizing numbers in table columns. @@ -6993,7 +6992,7 @@ WITH-CASE, the sorting considers case as well." (message (if plain-list-p "Sort %s: [a]lpha [n]umeric [t]ime [f]unc A/N/T/F means reversed:" -"Sort %s: [a]lpha [n]umeric [t]ime [p]riority p[r]operty [f]unc A/N/T/P/F means reversed:") +"Sort %s: [a]lpha [n]umeric [t]ime [p]riority p[r]operty [f]unc keyword [o]rder A/N/T/P/F/O means reversed:") what) (setq sorting-type (read-char-exclusive)) @@ -7084,6 +7083,10 @@ WITH-CASE, the sorting considers case as well." org-default-priority)) ((= dcst ?r) (or (org-entry-get nil property) "")) + ((= dcst ?o) + (if (looking-at org-complex-heading-regexp) + (or (position (match-string 2) org-todo-keywords-1 :test 'string=) + ))) ((= dcst ?f) (if getkey-func (progn ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] [PATCH 4/5] Add a new sort option, which sorts items by todo keyword
This is a somewhat simple implementation which just uses the position of the keyword in org-todo-keywords-1, so if you have multiple sequences containing the same todo keyword you may not get the ordering you expect. --- org.el |7 +-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/org.el b/org.el index dee8471..d67024f 100644 --- a/org.el +++ b/org.el @@ -982,7 +982,6 @@ table, obtained by prompting the user." :group 'org-table-settings :type 'string) - (defcustom org-table-number-regexp "^\\([<>]?[-+^.0-9]*[0-9][-+^.0-9eEdDx()%:]*\\|\\(0[xX]\\)[0-9a-fA-F]+\\|nan\\)$" "Regular expression for recognizing numbers in table columns. @@ -6993,7 +6992,7 @@ WITH-CASE, the sorting considers case as well." (message (if plain-list-p "Sort %s: [a]lpha [n]umeric [t]ime [f]unc A/N/T/F means reversed:" -"Sort %s: [a]lpha [n]umeric [t]ime [p]riority p[r]operty [f]unc A/N/T/P/F means reversed:") +"Sort %s: [a]lpha [n]umeric [t]ime [p]riority p[r]operty [f]unc keyword [o]rder A/N/T/P/F/O means reversed:") what) (setq sorting-type (read-char-exclusive)) @@ -7084,6 +7083,10 @@ WITH-CASE, the sorting considers case as well." org-default-priority)) ((= dcst ?r) (or (org-entry-get nil property) "")) + ((= dcst ?o) + (if (looking-at org-complex-heading-regexp) + (or (position (match-string 2) org-todo-keywords-1 :test 'string=) + ))) ((= dcst ?f) (if getkey-func (progn ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] blogging from org-mode
Hey list, I am trying to set up a blog page on my website and I would prefer to use org-mode for that. I wonder what are the features provided by blorg and org-blog.el and which is better and actively maintained. I have tried both http://www.cognition.ens.fr/~guerry/org-blogging.html and http://dto.freeshell.org/e/org-blog.el but they seem to be down. Thank you ! Cezar ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode