emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Christian Egli <christian.egli@novell.com>
To: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Patch for agenda-mode-map
Date: Thu, 29 Jun 2006 15:43:20 +0200	[thread overview]
Message-ID: <1151588601.8274.26.camel@elrond.zur.novell.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 654 bytes --]

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

[-- Attachment #2: org.el.diff --]
[-- Type: text/x-patch, Size: 2084 bytes --]

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

[-- Attachment #3: Type: text/plain, Size: 149 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

             reply	other threads:[~2006-06-29 13:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-29 13:43 Christian Egli [this message]
2006-06-29 13:52 ` Patch for agenda-mode-map Carsten Dominik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1151588601.8274.26.camel@elrond.zur.novell.com \
    --to=christian.egli@novell.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).