GNU bug report logs - #1539
[PATCH] calendar/todo-mode.el: todo-expert-mode, New variable

Previous Next

Package: emacs;

Reported by: Jari Aalto <jari.aalto <at> cante.net>

Date: Thu, 11 Dec 2008 19:25:04 UTC

Severity: wishlist

Tags: moreinfo

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #3 received at quiet <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Jari Aalto <jari.aalto <at> cante.net>
To: quiet <at> debbugs.gnu.org
Subject: [PATCH] calendar/todo-mode.el: todo-expert-mode, New variable
Date: Thu, 11 Dec 2008 20:37:34 +0200
Severity: wishlist

[ resent from
  http://lists.gnu.org/archive/html/emacs-devel/2008-12/msg00455.html ]

Here is patch to suppress questions when todo-expert-mode is set to
non-nil

Jari

2008-12-11  Jari Aalto  <jari.aalto <at> cante.net>

        * calendar/todo-mode.el (todo-expert-mode): New variable.
        (todo-delete-item): Check `todo-expert-mode'.
        (todo-more-important-p): Check `todo-expert-mode'.

 calendar/todo-mode.el |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/calendar/todo-mode.el b/calendar/todo-mode.el
index 8f17a45..7d59cc6 100644
--- a/calendar/todo-mode.el
+++ b/calendar/todo-mode.el
@@ -57,6 +57,8 @@
 ;;          (autoload 'todo-insert-item "todo-mode"
 ;;                    "Add TODO item." t)
 ;;
+;;          (setq todo-expert-mode t)  ;; To suppress questions
+;;
 ;;      You may now enter new items by typing "M-x todo-insert-item",
 ;;      or enter your TODO list file by typing "M-x todo-show".
 ;;
@@ -348,6 +350,11 @@ Automatically generated when `todo-save-top-priorities' is non-nil."
   :type 'boolean
   :group 'todo)
 
+(defcustom todo-expert-mode nil
+  "If Non-nil, suppress questions."
+  :type 'boolean
+  :group 'todo)
+
 ;; Thanks for the ISO time stamp format go to Karl Eichwalder <ke <at> suse.de>
 ;; My format string for the appt.el package is "%3b %2d, %y, %02I:%02M%p".
 ;;
@@ -629,7 +636,9 @@ category."
     (forward-line (1- todo-previous-line))
     (let ((item (todo-item-string-start)))
       (setq todo-previous-answer
-            (y-or-n-p (concat "More important than '" item "'? ")))))
+	    (if todo-expert-mode
+		nil ;; No questions
+	      (y-or-n-p (concat "More important than '" item "'? "))))))
   todo-previous-answer)
 (defalias 'todo-ask-p 'todo-more-important-p)
 
@@ -638,8 +647,9 @@ category."
   (interactive)
   (if (> (count-lines (point-min) (point-max)) 0)
       (let* ((todo-entry (todo-item-string-start))
-             (todo-answer (y-or-n-p (concat "Permanently remove '"
-                                            todo-entry "'? "))))
+             (todo-answer (or todo-expert-mode
+			      (y-or-n-p (concat "Permanently remove '"
+						todo-entry "'? ")))))
         (when todo-answer
           (todo-remove-item)
           (todo-backward-item))




This bug report was last modified 9 years and 80 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.