From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Egli Subject: Patch for agenda-mode-map Date: Thu, 29 Jun 2006 15:43:20 +0200 Message-ID: <1151588601.8274.26.camel@elrond.zur.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-98Pt5Ud8nkeuXdcV0X3x" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Fvwom-000314-3b for emacs-orgmode@gnu.org; Thu, 29 Jun 2006 09:44:28 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Fvwok-00030s-9g for emacs-orgmode@gnu.org; Thu, 29 Jun 2006 09:44:26 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fvwok-00030p-4l for emacs-orgmode@gnu.org; Thu, 29 Jun 2006 09:44:26 -0400 Received: from [195.33.99.129] (helo=gwia-smtp.id2.novell.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1Fvx1I-0001cf-Qn for emacs-orgmode@gnu.org; Thu, 29 Jun 2006 09:57:25 -0400 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode --=-98Pt5Ud8nkeuXdcV0X3x Content-Type: text/plain Content-Transfer-Encoding: 7bit Hi all I'm quite used to the key bindings in Gnus where I use 'g' to refresh the overview and 's' to save the state. I wanted to reproduce this in the agenda buffer, so that I can * press 's' in the agenda buffer to save all my org files (the original 's' is also mapped to 'S') * press 'g' to redo the agenda buffer (the original binding for 'g' has been mapped to 'G') I understand that key bindings are a matter of taste and you probably do not want to change them, however the function 'org-agenda-save-all-buffers' is a nice addition (IMHO at least). So check the attached patch and take whatever you can use. Thanks --=-98Pt5Ud8nkeuXdcV0X3x Content-Disposition: attachment; filename=org.el.diff Content-Type: text/x-patch; name=org.el.diff; charset=UTF-8 Content-Transfer-Encoding: 7bit Index: lisp/textmodes/org.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/textmodes/org.el,v retrieving revision 1.99 diff -u -r1.99 org.el --- lisp/textmodes/org.el 29 Jun 2006 10:37:08 -0000 1.99 +++ lisp/textmodes/org.el 29 Jun 2006 13:32:24 -0000 @@ -6228,7 +6228,8 @@ (define-key org-agenda-mode-map "f" 'org-agenda-follow-mode) (define-key org-agenda-mode-map "l" 'org-agenda-log-mode) (define-key org-agenda-mode-map "D" 'org-agenda-toggle-diary) -(define-key org-agenda-mode-map "g" 'org-agenda-toggle-time-grid) +(define-key org-agenda-mode-map "G" 'org-agenda-toggle-time-grid) +(define-key org-agenda-mode-map "g" 'org-agenda-redo) (define-key org-agenda-mode-map "r" 'org-agenda-redo) (define-key org-agenda-mode-map "q" 'org-agenda-quit) (define-key org-agenda-mode-map "x" 'org-agenda-exit) @@ -6248,7 +6249,7 @@ (define-key org-agenda-mode-map "C" 'org-agenda-convert-date) (define-key org-agenda-mode-map "m" 'org-agenda-phases-of-moon) (define-key org-agenda-mode-map "M" 'org-agenda-phases-of-moon) -(define-key org-agenda-mode-map "s" 'org-agenda-sunrise-sunset) +(define-key org-agenda-mode-map "s" 'org-agenda-save-all-buffers) (define-key org-agenda-mode-map "S" 'org-agenda-sunrise-sunset) (define-key org-agenda-mode-map "h" 'org-agenda-holidays) (define-key org-agenda-mode-map "H" 'org-agenda-holidays) @@ -8457,6 +8458,13 @@ (if (fboundp 'fit-window-to-buffer) (fit-window-to-buffer (get-buffer-window "*Dates*"))))) +(defun org-agenda-save-all-buffers () + "Save all Org-mode buffers without user confirmation." + (interactive) + (message "Saving all Org-mode buffers...") + (save-some-buffers t 'org-buffer-p) + (message "Saving all Org-mode buffers... done")) + ;;; Tags (defun org-scan-tags (action matcher &optional todo-only) @@ -16342,6 +16350,10 @@ (org-invisible-p))) (org-show-hierarchy-above))) +(defun org-buffer-p () + "Check if the current buffer is in Org-mode." + (eq major-mode 'org-mode)) + ;;; Experimental code ;;; Finish up --=-98Pt5Ud8nkeuXdcV0X3x Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --=-98Pt5Ud8nkeuXdcV0X3x--