From fd6b2a6b77ee0cb1fdcd774b5eb6ba7b6f5be31f Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Wed, 11 Apr 2012 13:00:40 +0200 Subject: [PATCH 01/13] orgcard.tex: Fix copyright year. --- doc/orgcard.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/orgcard.tex b/doc/orgcard.tex index eec3982d9..d06afca80 100644 --- a/doc/orgcard.tex +++ b/doc/orgcard.tex @@ -17,7 +17,7 @@ \pdflayout=(0l) % Nothing else needs to be changed below this line. -% Copyright (C) 1987, 1993, 1996-1997, 2001-2011 +% Copyright (C) 1987, 1993, 1996-1997, 2001-2012 % Free Software Foundation, Inc. % This file is part of GNU Emacs. From 80cc1ccd9ee3f5b11de6dc150f7243cdacd02590 Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Fri, 20 Apr 2012 13:20:42 +0200 Subject: [PATCH 02/13] org-clock.el (org-program-exists): Fix docstring. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * org-clock.el (org-program-exists): Fix docstring. Thanks to Sébastien Vauban for reporting this. --- lisp/org-clock.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/org-clock.el b/lisp/org-clock.el index 434f6a1d5..aabcfc187 100644 --- a/lisp/org-clock.el +++ b/lisp/org-clock.el @@ -664,7 +664,7 @@ Use alsa's aplay tool if available." (error (beep t) (beep t))))))))) (defun org-program-exists (program-name) - "Checks whenever we can locate program and launch it." + "Checks whenever we can locate PROGRAM-NAME using the `which' executable." (if (member system-type '(gnu/linux darwin)) (= 0 (call-process "which" nil nil nil program-name)))) From 7c03bd928fe179c19a9819b550ec2cce45676255 Mon Sep 17 00:00:00 2001 From: Jambunathan K Date: Fri, 20 Apr 2012 22:13:34 +0530 Subject: [PATCH 03/13] OrgOdtStyles.xml: Fix indentation issues with description lists * etc/styles/OrgOdtStyles.xml (OrgDescriptionList): Modify style. With this change, in a description list, if the description paragraph spawns multiple lines then it will correctly indented. --- etc/styles/OrgOdtStyles.xml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/etc/styles/OrgOdtStyles.xml b/etc/styles/OrgOdtStyles.xml index 470b7b134..84125c96d 100644 --- a/etc/styles/OrgOdtStyles.xml +++ b/etc/styles/OrgOdtStyles.xml @@ -649,34 +649,34 @@ - + - + - + - + - + - + - + - + - + - + From 452d4912049a6e470a77c8055929a40f727897fc Mon Sep 17 00:00:00 2001 From: Jambunathan K Date: Fri, 20 Apr 2012 22:15:42 +0530 Subject: [PATCH 04/13] * etc/styles/README: Update Copyright year --- etc/styles/README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/styles/README b/etc/styles/README index bdebef3f3..206f3a26b 100644 --- a/etc/styles/README +++ b/etc/styles/README @@ -1,7 +1,7 @@ The files OrgOdtContentTemplate.xml and OrgOdtStyles.xml have the following copyright information: -Copyright (C) 2010-2011 Free Software Foundation, Inc. +Copyright (C) 2010-2012 Free Software Foundation, Inc. These files are part of GNU Emacs. From fef07abefb8cb955a39a1bd495af2cd47c5dfa4d Mon Sep 17 00:00:00 2001 From: Jambunathan K Date: Fri, 20 Apr 2012 22:23:43 +0530 Subject: [PATCH 05/13] org-odt.el: Fix handling of internal links * lisp/org-odt.el (org-odt-format-org-link): Pay no heed to whether the internal links destined for headlines provide a description or not. In fact, the `org-store-link' and `org-insert-link' create internal links which do have a description. This fixes an issue where internal links terminating at an invisible target (that is bound to a headline) was badly rendered. Refer following thread: http://lists.gnu.org/archive/html/emacs-orgmode/2012-04/msg00757.html --- lisp/org-odt.el | 1 - 1 file changed, 1 deletion(-) diff --git a/lisp/org-odt.el b/lisp/org-odt.el index 234272a37..2e984a575 100644 --- a/lisp/org-odt.el +++ b/lisp/org-odt.el @@ -1689,7 +1689,6 @@ ATTR is a string of other attributes of the a element." (or (not thefile) (string= thefile "")) (plist-get org-lparse-opt-plist :section-numbers) (setq sec-frag fragment) - (org-find-text-property-in-string 'org-no-description fragment) (or (string-match "\\`sec\\(\\(-[0-9]+\\)+\\)" sec-frag) (and (setq sec-frag (loop for alias in org-export-target-aliases do From cde8a35f5440ad0d403db3b3dc53834e5d947f4e Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Fri, 20 Apr 2012 12:38:07 +0200 Subject: [PATCH 06/13] org.el: New face `org-date-selected' for the selected calendar day. * org-faces.el (org-date-selected): New face. * org.el (org-date-ovl): Use `org-date-selected'. This fixes a problem with bold faces enlarging the calendar window unduely. See http://patchwork.newartisans.com/patch/1286/ --- lisp/org-faces.el | 10 ++++++++++ lisp/org.el | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lisp/org-faces.el b/lisp/org-faces.el index 481d662ec..5e984636c 100644 --- a/lisp/org-faces.el +++ b/lisp/org-faces.el @@ -285,6 +285,16 @@ column view defines special faces for each outline level. See the file "Face for date/time stamps." :group 'org-faces) +(defface org-date-selected + (org-compatible-face nil + '((((class color) (min-colors 16) (background light)) (:foreground "Red1" :bold nil)) + (((class color) (min-colors 16) (background dark)) (:foreground "Pink" :bold nil)) + (((class color) (min-colors 8) (background light)) (:foreground "red" :bold nil)) + (((class color) (min-colors 8) (background dark)) (:foreground "red" :bold nil)) + (t (:inverse-video t)))) + "Face for deadlines and TODO keywords." + :group 'org-faces) + (defface org-sexp-date '((((class color) (background light)) (:foreground "Purple")) (((class color) (background dark)) (:foreground "Cyan")) diff --git a/lisp/org.el b/lisp/org.el index c2cc23544..c600896e9 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -14915,7 +14915,7 @@ So these are more for recording a certain time/date." (org-time-stamp arg 'inactive)) (defvar org-date-ovl (make-overlay 1 1)) -(overlay-put org-date-ovl 'face 'org-warning) +(overlay-put org-date-ovl 'face 'org-date-selected) (org-detach-overlay org-date-ovl) (defvar org-ans1) ; dynamically scoped parameter From 628431b06ffcbe38c1a977a97eafe6e7d23d4a1f Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Fri, 20 Apr 2012 11:41:24 +0200 Subject: [PATCH 07/13] org.el (org-mode): Don't use `buffer-face-mode' by default. * org.el (org-mode): Don't use `buffer-face-mode' by default. Still set `org-default' as the face for `buffer-face-mode-face' in case the user turn `buffer-face-mode' on. --- lisp/org.el | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index c600896e9..0b66cb162 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -5057,8 +5057,7 @@ The following commands are available: 'org-parse-arguments) (set (make-local-variable 'pcomplete-termination-string) "") (when (>= emacs-major-version 23) - (set (make-local-variable 'buffer-face-mode-face) 'org-default) - (buffer-face-mode)) + (set (make-local-variable 'buffer-face-mode-face) 'org-default)) ;; If empty file that did not turn on org-mode automatically, make it to. (if (and org-insert-mode-line-in-empty-file From 4e4a7eb029d0a7f4177a207a6f114a06b3396149 Mon Sep 17 00:00:00 2001 From: Zachary Kanfer Date: Mon, 6 Feb 2012 21:22:16 +0000 Subject: [PATCH 08/13] org.el (org-read-date-display): Fix bug when displaying the overlay. * org.el (org-read-date-display): Fix bug when displaying the overlay. TINYCHANGE --- lisp/org.el | 58 ++++++++++++++++++++++++++--------------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 0b66cb162..501989815 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -15130,35 +15130,35 @@ user." (when org-read-date-display-live (when org-read-date-overlay (delete-overlay org-read-date-overlay)) - (let ((p (point))) - (end-of-line 1) - (while (not (equal (buffer-substring - (max (point-min) (- (point) 4)) (point)) - " ")) - (insert " ")) - (goto-char p)) - (let* ((ans (concat (buffer-substring (point-at-bol) (point-max)) - " " (or org-ans1 org-ans2))) - (org-end-time-was-given nil) - (f (org-read-date-analyze ans org-def org-defdecode)) - (fmts (if org-dcst - org-time-stamp-custom-formats - org-time-stamp-formats)) - (fmt (if (or org-with-time - (and (boundp 'org-time-was-given) org-time-was-given)) - (cdr fmts) - (car fmts))) - (txt (concat "=> " (format-time-string fmt (apply 'encode-time f))))) - (when (and org-end-time-was-given - (string-match org-plain-time-of-day-regexp txt)) - (setq txt (concat (substring txt 0 (match-end 0)) "-" - org-end-time-was-given - (substring txt (match-end 0))))) - (when org-read-date-analyze-futurep - (setq txt (concat txt " (=>F)"))) - (setq org-read-date-overlay - (make-overlay (1- (point-at-eol)) (point-at-eol))) - (org-overlay-display org-read-date-overlay txt 'secondary-selection)))) + (when (minibufferp (current-buffer)) + (save-excursion + (end-of-line 1) + (while (not (equal (buffer-substring + (max (point-min) (- (point) 4)) (point)) + " ")) + (insert " "))) + (let* ((ans (concat (buffer-substring (point-at-bol) (point-max)) + " " (or org-ans1 org-ans2))) + (org-end-time-was-given nil) + (f (org-read-date-analyze ans org-def org-defdecode)) + (fmts (if org-dcst + org-time-stamp-custom-formats + org-time-stamp-formats)) + (fmt (if (or org-with-time + (and (boundp 'org-time-was-given) org-time-was-given)) + (cdr fmts) + (car fmts))) + (txt (concat "=> " (format-time-string fmt (apply 'encode-time f))))) + (when (and org-end-time-was-given + (string-match org-plain-time-of-day-regexp txt)) + (setq txt (concat (substring txt 0 (match-end 0)) "-" + org-end-time-was-given + (substring txt (match-end 0))))) + (when org-read-date-analyze-futurep + (setq txt (concat txt " (=>F)"))) + (setq org-read-date-overlay + (make-overlay (1- (point-at-eol)) (point-at-eol))) + (org-overlay-display org-read-date-overlay txt 'secondary-selection))))) (defun org-read-date-analyze (ans org-def org-defdecode) "Analyze the combined answer of the date prompt." From edb7e341d110f4f695ecde9cd620cad80d28f1d8 Mon Sep 17 00:00:00 2001 From: Madan Ramakrishnan Date: Mon, 16 Apr 2012 07:29:49 +0000 Subject: [PATCH 09/13] org-agenda.el: Fix `org-agenda-bulk-toggle'. * org-agenda.el (org-agenda-bulk-mark): Truly make arg optional as advertised by the function. Problem here was that `org-agenda-bulk-toggle' calls `org-agenda-bulk-mark' with no parameters; however, the (max arg 1) call inside `org-agenda-bulk-mark' will fail with no parameter. TINYCHANGE --- lisp/org-agenda.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 3bb0fc848..ddb56ca4b 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -8294,7 +8294,7 @@ This is a command that has to be installed in `calendar-mode-map'." (defun org-agenda-bulk-mark (&optional arg) "Mark the entry at point for future bulk action." (interactive "p") - (dotimes (i (max arg 1)) + (dotimes (i (or arg 1)) (unless (org-get-at-bol 'org-agenda-diary-link) (let* ((m (org-get-at-bol 'org-hd-marker)) ov) From 32bd764573bb685d1549d81ad9ea77edc2a17406 Mon Sep 17 00:00:00 2001 From: Ippei FURUHASHI Date: Fri, 13 Apr 2012 12:28:25 +0900 Subject: [PATCH 10/13] org.texi: Fix typos of function names in Agenda commands * org.texi (Agenda commands): Fix two typos by giving corresponding function names, according to `org-agenda-view-mode-dispatch'. TINYCHANGE --- doc/org.texi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/org.texi b/doc/org.texi index 67633e1ac..cbe04110e 100644 --- a/doc/org.texi +++ b/doc/org.texi @@ -7900,9 +7900,9 @@ Interactively select another agenda view and append it to the current view. Delete other windows. @c @orgcmdkskc{v d,d,org-agenda-day-view} -@xorgcmdkskc{v w,w,org-agenda-day-view} +@xorgcmdkskc{v w,w,org-agenda-week-view} @xorgcmd{v m,org-agenda-month-view} -@xorgcmd{v y,org-agenda-month-year} +@xorgcmd{v y,org-agenda-year-view} @xorgcmd{v SPC,org-agenda-reset-view} @vindex org-agenda-span Switch to day/week/month/year view. When switching to day or week view, this From 60b84d7f4bbe22f314278736536f6a425a6ac376 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Fri, 20 Apr 2012 11:12:44 +0200 Subject: [PATCH 11/13] org-footnote: Fix positionning in HTML export without a footnote section * lisp/org-footnote.el (org-footnote-normalize): Fix positionning in HTML export without a footnote section. --- lisp/org-footnote.el | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lisp/org-footnote.el b/lisp/org-footnote.el index 9319e0813..a9ba8d751 100644 --- a/lisp/org-footnote.el +++ b/lisp/org-footnote.el @@ -716,8 +716,8 @@ Additional note on `org-footnote-insert-pos-for-preprocessor': ((and org-footnote-section (eq major-mode 'org-mode)) (goto-char (point-min)) (if (re-search-forward - (concat "^\\*[ \t]+" (regexp-quote org-footnote-section) - "[ \t]*$") nil t) + (concat "^\\*[ \t]+" (regexp-quote org-footnote-section) + "[ \t]*$") nil t) (delete-region (match-beginning 0) (org-end-of-subtree t t))) ;; A new footnote section is inserted by default at the end of ;; the buffer. @@ -727,7 +727,14 @@ Additional note on `org-footnote-insert-pos-for-preprocessor': (unless (bolp) (newline))) ;; No footnote section set: Footnotes will be added at the end ;; of the section containing their first reference. - ((eq major-mode 'org-mode)) + ;; Nevertheless, in an export situation, set insertion point to + ;; `point-max' by default. + ((eq major-mode 'org-mode) + (when export-props + (goto-char (point-max)) + (skip-chars-backward " \r\t\n") + (forward-line) + (delete-region (point) (point-max)))) (t ;; Remove any left-over tag in the buffer, if one is set up. (when org-footnote-tag-for-non-org-mode-files From 97b0696212515479f95a3354c9131443ab4a0bc7 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Wed, 18 Apr 2012 13:01:44 +0200 Subject: [PATCH 12/13] org-list: Fix bugs relative to item indentation * lisp/org-list.el (org-list-struct-indent): Follow `org-list-demote-modify-bullet' specifications for ordered bullets. (org-list-indent-item-generic, org-indent-item-tree, org-outdent-item-tree): Fix bug when operating on a region. (org-outdent-item, org-indent-item): Allow to operate on a region. * lisp/org.el (org-shiftmetaleft, org-shiftmetaright): Allow to operate on a region. * testing/lisp/test-org-list.el: Add tests. --- lisp/org-list.el | 77 +++++++---- lisp/org.el | 22 +-- testing/lisp/test-org-list.el | 245 ++++++++++++++++++++++++++++++++++ 3 files changed, 313 insertions(+), 31 deletions(-) diff --git a/lisp/org-list.el b/lisp/org-list.el index c37758883..4498280ac 100644 --- a/lisp/org-list.el +++ b/lisp/org-list.el @@ -1484,8 +1484,19 @@ bullets between START and END." (change-bullet-maybe (function (lambda (item) - (let* ((bul (org-trim (org-list-get-bullet item struct))) - (new-bul-p (cdr (assoc bul org-list-demote-modify-bullet)))) + (let ((new-bul-p + (cdr (assoc + ;; Normalize ordered bullets. + (let ((bul (org-trim + (org-list-get-bullet item struct)))) + (cond ((string-match "[A-Z]\\." bul) "A.") + ((string-match "[A-Z])" bul) "A)") + ((string-match "[a-z]\\." bul) "a.") + ((string-match "[a-z])" bul) "a)") + ((string-match "[0-9]\\." bul) "1.") + ((string-match "[0-9])" bul) "1)") + (t bul))) + org-list-demote-modify-bullet)))) (when new-bul-p (org-list-set-bullet item struct new-bul-p)))))) (ind (lambda (cell) @@ -2500,7 +2511,6 @@ STRUCT is the list structure. Return t if successful." (save-excursion - (beginning-of-line) (let* ((regionp (org-region-active-p)) (rbeg (and regionp (region-beginning))) (rend (and regionp (region-end))) @@ -2509,7 +2519,8 @@ Return t if successful." (prevs (org-list-prevs-alist struct)) ;; Are we going to move the whole list? (specialp - (and (= top (point)) + (and (not regionp) + (= top (point-at-bol)) (cdr (assq 'indent org-list-automatic-rules)) (if no-subtree (error @@ -2523,12 +2534,12 @@ Return t if successful." (progn (set-marker org-last-indent-begin-marker rbeg) (set-marker org-last-indent-end-marker rend)) - (set-marker org-last-indent-begin-marker (point)) + (set-marker org-last-indent-begin-marker (point-at-bol)) (set-marker org-last-indent-end-marker (cond (specialp (org-list-get-bottom-point struct)) - (no-subtree (1+ (point))) - (t (org-list-get-item-end (point) struct)))))) + (no-subtree (1+ (point-at-bol))) + (t (org-list-get-item-end (point-at-bol) struct)))))) (let* ((beg (marker-position org-last-indent-begin-marker)) (end (marker-position org-last-indent-end-marker))) (cond @@ -2583,19 +2594,35 @@ Return t if successful." "Outdent a local list item, but not its children. If a region is active, all items inside will be moved." (interactive) - (if (org-at-item-p) - (let ((struct (org-list-struct))) - (org-list-indent-item-generic -1 t struct)) - (error "Not at an item"))) + (let ((regionp (org-region-active-p))) + (cond + ((or (org-at-item-p) + (and regionp + (save-excursion (goto-char (region-beginning)) + (org-at-item-p)))) + (let ((struct (if (not regionp) (org-list-struct) + (save-excursion (goto-char (region-beginning)) + (org-list-struct))))) + (org-list-indent-item-generic -1 t struct))) + (regionp (error "Region not starting at an item")) + (t (error "Not at an item"))))) (defun org-indent-item () "Indent a local list item, but not its children. If a region is active, all items inside will be moved." (interactive) - (if (org-at-item-p) - (let ((struct (org-list-struct))) - (org-list-indent-item-generic 1 t struct)) - (error "Not at an item"))) + (let ((regionp (org-region-active-p))) + (cond + ((or (org-at-item-p) + (and regionp + (save-excursion (goto-char (region-beginning)) + (org-at-item-p)))) + (let ((struct (if (not regionp) (org-list-struct) + (save-excursion (goto-char (region-beginning)) + (org-list-struct))))) + (org-list-indent-item-generic 1 t struct))) + (regionp (error "Region not starting at an item")) + (t (error "Not at an item"))))) (defun org-outdent-item-tree () "Outdent a local list item including its children. @@ -2604,10 +2631,12 @@ If a region is active, all items inside will be moved." (let ((regionp (org-region-active-p))) (cond ((or (org-at-item-p) - (and (org-region-active-p) - (goto-char (region-beginning)) - (org-at-item-p))) - (let ((struct (org-list-struct))) + (and regionp + (save-excursion (goto-char (region-beginning)) + (org-at-item-p)))) + (let ((struct (if (not regionp) (org-list-struct) + (save-excursion (goto-char (region-beginning)) + (org-list-struct))))) (org-list-indent-item-generic -1 nil struct))) (regionp (error "Region not starting at an item")) (t (error "Not at an item"))))) @@ -2619,10 +2648,12 @@ If a region is active, all items inside will be moved." (let ((regionp (org-region-active-p))) (cond ((or (org-at-item-p) - (and (org-region-active-p) - (goto-char (region-beginning)) - (org-at-item-p))) - (let ((struct (org-list-struct))) + (and regionp + (save-excursion (goto-char (region-beginning)) + (org-at-item-p)))) + (let ((struct (if (not regionp) (org-list-struct) + (save-excursion (goto-char (region-beginning)) + (org-list-struct))))) (org-list-indent-item-generic 1 nil struct))) (regionp (error "Region not starting at an item")) (t (error "Not at an item"))))) diff --git a/lisp/org.el b/lisp/org.el index 501989815..838a9a18a 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -17968,28 +17968,34 @@ See the individual commands for more information." (defun org-shiftmetaleft () "Promote subtree or delete table column. -Calls `org-promote-subtree', `org-outdent-item', -or `org-table-delete-column', depending on context. -See the individual commands for more information." +Calls `org-promote-subtree', `org-outdent-item-tree', or +`org-table-delete-column', depending on context. See the +individual commands for more information." (interactive) (cond ((run-hook-with-args-until-success 'org-shiftmetaleft-hook)) ((org-at-table-p) (call-interactively 'org-table-delete-column)) ((org-at-heading-p) (call-interactively 'org-promote-subtree)) - ((org-at-item-p) (call-interactively 'org-outdent-item-tree)) + ((if (not (org-region-active-p)) (org-at-item-p) + (save-excursion (goto-char (region-beginning)) + (org-at-item-p))) + (call-interactively 'org-outdent-item-tree)) (t (org-modifier-cursor-error)))) (defun org-shiftmetaright () "Demote subtree or insert table column. -Calls `org-demote-subtree', `org-indent-item', -or `org-table-insert-column', depending on context. -See the individual commands for more information." +Calls `org-demote-subtree', `org-indent-item-tree', or +`org-table-insert-column', depending on context. See the +individual commands for more information." (interactive) (cond ((run-hook-with-args-until-success 'org-shiftmetaright-hook)) ((org-at-table-p) (call-interactively 'org-table-insert-column)) ((org-at-heading-p) (call-interactively 'org-demote-subtree)) - ((org-at-item-p) (call-interactively 'org-indent-item-tree)) + ((if (not (org-region-active-p)) (org-at-item-p) + (save-excursion (goto-char (region-beginning)) + (org-at-item-p))) + (call-interactively 'org-indent-item-tree)) (t (org-modifier-cursor-error)))) (defun org-shiftmetaup (&optional arg) diff --git a/testing/lisp/test-org-list.el b/testing/lisp/test-org-list.el index d1014ef9e..b056a9a58 100644 --- a/testing/lisp/test-org-list.el +++ b/testing/lisp/test-org-list.el @@ -113,6 +113,251 @@ (org-previous-item) (should (looking-at " - item 1.3")))))) +(ert-deftest test-org-list/indent-item () + "Test `org-indent-item' specifications." + ;; 1. Error when not at an item. + (org-test-with-temp-text "Paragraph." + (should-error (org-indent-item))) + ;; 2. Error when trying to move first item of a list. + (org-test-with-temp-text " +- Item 1 +- Item 2" + (forward-line) + (should-error (org-indent-item))) + ;; 3. Indent a single item, not its children. + (org-test-with-temp-text " +- Item 1 +- Item 2 + - Item 2.1" + (search-forward "- Item 2") + (let (org-list-demote-modify-bullet) (org-indent-item)) + (should (equal (buffer-string) + " +- Item 1 + - Item 2 + - Item 2.1"))) + ;; 4. Follow `org-list-demote-modify-bullet' specifications. + ;; + ;; 4.1. With unordered lists. + (org-test-with-temp-text " +- Item 1 +- Item 2" + (search-forward "- Item 2") + (let ((org-list-demote-modify-bullet '(("-" . "+")))) (org-indent-item)) + (should (equal (buffer-string) + " +- Item 1 + + Item 2"))) + ;; 4.2. and ordered lists. + (org-test-with-temp-text " +1. Item 1 +2. Item 2" + (search-forward "2. Item 2") + (let ((org-plain-list-ordered-item-terminator t) + (org-list-demote-modify-bullet '(("1." . "+")))) + (org-indent-item)) + (should (equal (buffer-string) + " +1. Item 1 + + Item 2"))) + ;; 5. When a region is selected, indent every item within. + (org-test-with-temp-text " +- Item 1 +- Item 2 +- Item 3 +" + (search-forward "- Item 2") + (beginning-of-line) + (transient-mark-mode 1) + (push-mark (point) t t) + (goto-char (point-max)) + (let (org-list-demote-modify-bullet) (org-indent-item)) + (should (equal (buffer-string) + " +- Item 1 + - Item 2 + - Item 3 +")))) + +(ert-deftest test-org-list/indent-item-tree () + "Test `org-indent-item-tree' specifications." + ;; 1. Error when not at an item. + (org-test-with-temp-text "Paragraph." + (should-error (org-indent-item-tree))) + ;; 2. Indent item along with its children. + (org-test-with-temp-text " +- Item 1 +- Item 2 + - Item 2.1" + (search-forward "- Item 2") + (let (org-list-demote-modify-bullet) (org-indent-item-tree)) + (should (equal (buffer-string) + " +- Item 1 + - Item 2 + - Item 2.1"))) + ;; 3. Special case: When indenting top item, move the whole list. + (org-test-with-temp-text " +- Item 1 +- Item 2" + (search-forward "- Item 1") + (let (org-list-demote-modify-bullet org-odd-levels-only) + (org-indent-item-tree)) + (should (equal (buffer-string) + " + - Item 1 + - Item 2"))) + ;; 4. Follow `org-list-demote-modify-bullet' specifications. + ;; + ;; 4.1. With unordered lists. + (org-test-with-temp-text " +- Item 1 +- Item 2 + + Item 2.1" + (search-forward "- Item 2") + (let ((org-list-demote-modify-bullet '(("-" . "+") ("+" . "-")))) + (org-indent-item-tree)) + (should (equal (buffer-string) + " +- Item 1 + + Item 2 + - Item 2.1"))) + ;; 4.2. and ordered lists. + (org-test-with-temp-text " +1. Item 1 +2. Item 2 + + Item 2.1" + (search-forward "2. Item 2") + (let ((org-plain-list-ordered-item-terminator t) + (org-list-demote-modify-bullet '(("1." . "+") ("+" . "1.")))) + (org-indent-item-tree)) + (should (equal (buffer-string) + " +1. Item 1 + + Item 2 + 1. Item 2.1"))) + ;; 5. When a region is selected, indent every item within. + (org-test-with-temp-text " +- Item 1 +- Item 2 + - Item 2.1 +- Item 3 + - Item 3.1 +" + (search-forward "- Item 2") + (beginning-of-line) + (transient-mark-mode 1) + (push-mark (point) t t) + (goto-char (point-max)) + (let (org-list-demote-modify-bullet) (org-indent-item-tree)) + (should (equal (buffer-string) + " +- Item 1 + - Item 2 + - Item 2.1 + - Item 3 + - Item 3.1 +")))) + +(ert-deftest test-org-list/outdent-item () + "Test `org-outdent-item' specifications." + ;; 1. Error when not at an item. + (org-test-with-temp-text "Paragraph." + (should-error (org-outdent-item))) + ;; 2. Error when trying to move first item of a list. + (org-test-with-temp-text " +- Item 1 +- Item 2" + (forward-line) + (should-error (org-outdent-item))) + ;; 3. Error when trying to outdent an item without its children. + (org-test-with-temp-text " +- Item 1 + - Item 1.1 + - Item 1.1.1" + (search-forward "- Item 1.1") + (should-error (org-outdent-item))) + ;; 4. Error when trying to outdent before top item. + (org-test-with-temp-text " + - Item 1 + - Item 2" + (search-forward "- Item 2") + (should-error (org-outdent-item))) + ;; 5. When a region is selected, outdent every item within. + (org-test-with-temp-text " +- Item 1 + - Item 2 + - Item 3 +" + (search-forward "- Item 2") + (beginning-of-line) + (transient-mark-mode 1) + (push-mark (point) t t) + (goto-char (point-max)) + (let (org-list-demote-modify-bullet) (org-outdent-item)) + (should (equal (buffer-string) + " +- Item 1 +- Item 2 +- Item 3 +")))) + +(ert-deftest test-org-list/outdent-item-tree () + "Test `org-outdent-item-tree' specifications." + ;; 1. Error when not at an item. + (org-test-with-temp-text "Paragraph." + (should-error (org-outdent-item-tree))) + ;; 2. Error when trying to outdent before top item. + (org-test-with-temp-text " + - Item 1 + - Item 2" + (search-forward "- Item 2") + (should-error (org-outdent-item-tree))) + ;; 3. Outdent item along with its children. + (org-test-with-temp-text " +- Item 1 + - Item 2 + - Item 2.1" + (search-forward "- Item 2") + (org-outdent-item-tree) + (should (equal (buffer-string) + " +- Item 1 +- Item 2 + - Item 2.1"))) + ;; 3. Special case: When outdenting top item, move the whole list. + (org-test-with-temp-text " + - Item 1 + - Item 2" + (search-forward "- Item 1") + (let (org-odd-levels-only) (org-outdent-item-tree)) + (should (equal (buffer-string) + " +- Item 1 +- Item 2"))) + ;; 5. When a region is selected, outdent every item within. + (org-test-with-temp-text " +- Item 1 + - Item 2 + - Item 2.1 + - Item 3 + - Item 3.1 +" + (search-forward "- Item 2") + (beginning-of-line) + (transient-mark-mode 1) + (push-mark (point) t t) + (goto-char (point-max)) + (org-outdent-item-tree) + (should (equal (buffer-string) + " +- Item 1 +- Item 2 + - Item 2.1 +- Item 3 + - Item 3.1 +")))) + (provide 'test-org-list) ;;; test-org-list.el ends here From 9d01202a7b87cb9ce33208b14cf129ae26690266 Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Sat, 21 Apr 2012 16:03:20 +0200 Subject: [PATCH 13/13] Remove * character in front of variable docstring. * org-ctags.el (org-ctags-new-topic-template): Remove * character in front of variable docstring. * org-protocol.el (org-protocol-protocol-alist): Ditto. See http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=0fc749f9cc4a3c6f36715bb05e03469eee149b15 --- lisp/org-ctags.el | 2 +- lisp/org-protocol.el | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/org-ctags.el b/lisp/org-ctags.el index 48656190a..5874646ff 100644 --- a/lisp/org-ctags.el +++ b/lisp/org-ctags.el @@ -188,7 +188,7 @@ See the ctags documentation for more information.") Created as a local variable in each buffer.") (defcustom org-ctags-new-topic-template - "* <<%t>>\n\n\n\n\n\n" + "<<%t>>\n\n\n\n\n\n" "Text to insert when creating a new org file via opening a hyperlink. The following patterns are replaced in the string: `%t' - replaced with the capitalized title of the hyperlink" diff --git a/lisp/org-protocol.el b/lisp/org-protocol.el index 775f60990..74fc35f2d 100644 --- a/lisp/org-protocol.el +++ b/lisp/org-protocol.el @@ -225,7 +225,7 @@ Consider using the interactive functions `org-protocol-create' and :type 'alist) (defcustom org-protocol-protocol-alist nil - "* Register custom handlers for org-protocol. + "Register custom handlers for org-protocol. Each element of this list must be of the form: