* Patch for agenda-mode-map
@ 2006-06-29 13:43 Christian Egli
2006-06-29 13:52 ` Carsten Dominik
0 siblings, 1 reply; 2+ messages in thread
From: Christian Egli @ 2006-06-29 13:43 UTC (permalink / raw)
To: emacs-orgmode
[-- 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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Patch for agenda-mode-map
2006-06-29 13:43 Patch for agenda-mode-map Christian Egli
@ 2006-06-29 13:52 ` Carsten Dominik
0 siblings, 0 replies; 2+ messages in thread
From: Carsten Dominik @ 2006-06-29 13:52 UTC (permalink / raw)
To: Christian Egli; +Cc: emacs-orgmode
Hi Chris,
I like saving all buffers, and I even like the key for it.
Calendar functions are mostly upper keys anyway, so the "s" is
available.
However, the "r" for revert/redo I will keep - is deep in my bloed.
Please use the org-load-hook to change this for yourself.
I also like org-buffer-p.... :-)
Thanks
- Carsten
On Jun 29, 2006, at 15:43, Christian Egli wrote:
> 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
> <org.el.diff>_______________________________________________
> Emacs-orgmode mailing list
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>
--
Carsten Dominik
Sterrenkundig Instituut "Anton Pannekoek"
Universiteit van Amsterdam
Kruislaan 403
NL-1098SJ Amsterdam
phone: +31 20 525 7477
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-06-29 13:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-29 13:43 Patch for agenda-mode-map Christian Egli
2006-06-29 13:52 ` Carsten Dominik
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.