all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] calendar/todo-mode.el: todo-expert-mode, New variable
@ 2008-12-11 18:37 Jari Aalto
  2008-12-11 19:26 ` Glenn Morris
  0 siblings, 1 reply; 2+ messages in thread
From: Jari Aalto @ 2008-12-11 18:37 UTC (permalink / raw)
  To: emacs-devel


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

Jari

2008-12-11  Jari Aalto  <jari.aalto@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@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))





^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] calendar/todo-mode.el: todo-expert-mode, New variable
  2008-12-11 18:37 [PATCH] calendar/todo-mode.el: todo-expert-mode, New variable Jari Aalto
@ 2008-12-11 19:26 ` Glenn Morris
  0 siblings, 0 replies; 2+ messages in thread
From: Glenn Morris @ 2008-12-11 19:26 UTC (permalink / raw)
  To: Jari Aalto; +Cc: emacs-devel


Thanks. Recorded as wishlist item #1539 for consideration after the
current feature freeze.

http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=1539




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-12-11 19:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-11 18:37 [PATCH] calendar/todo-mode.el: todo-expert-mode, New variable Jari Aalto
2008-12-11 19:26 ` Glenn Morris

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.