emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* A crummy little popup for org keybindings help
@ 2009-02-28 22:46 Alan E. Davis
  2009-03-01  9:50 ` Alan E. Davis
  2009-03-02  0:30 ` Daniel Clemente
  0 siblings, 2 replies; 3+ messages in thread
From: Alan E. Davis @ 2009-02-28 22:46 UTC (permalink / raw)
  To: emacs-orgmode Mailinglist


[-- Attachment #1.1: Type: text/plain, Size: 3673 bytes --]

Some time ago, the idea of an instant reference card was bantered about on
the list.  I presented a file called org-help.org.  I have worked on it from
time to time, and it's changed quite a bit.  My most recent idea is to have
it available on a keystroke, completely folded, and each line would
instantly display some of the most commonly used keys for that topic, then
by opening that headline, a tree would be revealed with more detailed
keybindings.  I've played with it, and it's helpful, and I'll make it
available RSN, hoping others will find ways to make it more useful.  My
final touch would be to incorporate a link for each topic to the relevant
topics in the org-mode info manual.  What's missing is the convenience of
info mode, of being able to stuff it away with "q" and call it up again at
the same point.  That would be more convenient.  I'm unable to go forth on
that part of the quest, because I haven't gotten my head around texinfo
(yet?).

Meanwhile, I remembered a little help popup I made to remember all my
keybindings, long years ago.  Here's a quick popup to get a transient
display of some keybindings above the current line.  I didn't understand how
to wire it into org-mode-map's keybindings, so I bound it, for now, to
\C-cp.  The beauty of this gem is to be able to type the keys right away,
and they work.

Please feel free to improve it.  Maybe another two or three of these would
provide a person with his own frequently used keys.

;;;;;; org-popup-help
;;----------------
;; Org Popup Help
;;----------------------
(defun org-popup-help ()
  "Inserts a reminder of my org keybindings momentarily
above the current line, until the next keystroke."
  (interactive)
  (save-excursion
    (momentary-string-display
     org-keys (save-excursion (beginning-of-line) (point))
     nil "Type SPC or any command to erase help.")))                      ;;

(defvar org-keys
  (concat "   |
\n"
          "   |
\n"
;;;
      "  | Visibility Cycling               TAB    C-i \n"
      "  | Motion                           C-c C-n/p / C-c C-f/b / C-c C-u
/ C-c C-j \n"
      "  | Structure Editing                M-RET  /   M-L/R  /  M-S-L/R \n"
      "  | Sorting                          C-c ^ \n"
      "  | Converting to headlines/removing stars     C-c * \n"
      "  | Checkboxes                       M-S-RET\n"
      "  | Archiving [manual]               C-c C-x a \n"
      "  | Filtering and Sparse Trees       C-c / \n"
      "  | Links                            C-c l    /    C-c C-l \n"
      "  | TODO Items                       M-S-RET         C-c C-t \n"
      "  | Tags                             C-c C-q  /  C-c C-c  /  C-c \\n"
      "  | Properties and Column View       C-c C-x p \n"
      "  | Timestamps                       C-c .  /   C-c ! \n"
      "  | *Schedule and Deadline*          C-c C-s  /  C-c C-d\n"
      "  | Clocking time                    C-c C-x C-i  /  C-c C-x C-o \n"
      "  | Relative time clock              C-c C-x .  /  C-c C-x - \n"
      "  | Exporting and Publishing         C-c C-e \n"
      "  | Attachments Dispatcher Commands:  C-c C-a \n"
)
  "*String displayed above current line by \\org-popup-help].")

;(define-key org-mode-map "p" 'org-popup-help)
(global-set-key "\C-cp" 'org-popup-help)
;;;;;;;;;;;;;END org-popup-help.

I'll provide it as a file as well, in case the tabs/spaces get blown away in
the mail.

Alan
-- 
Alan Davis

It is undesirable to believe a proposition when
there is no ground whatsoever for supposing it is true.
    ---- Bertrand Russell
They are ill discoverers that think there is no land, when they can see
nothing but sea.
    ----   Sir Francis Bacon

[-- Attachment #1.2: Type: text/html, Size: 4368 bytes --]

[-- Attachment #2: PopupForOrg.el --]
[-- Type: text/x-emacs-lisp, Size: 1797 bytes --]

(defun org-popup-help ()
  "Inserts a reminder of my org keybindings momentarily 
above the current line, until the next keystroke."
  (interactive)
  (save-excursion
    (momentary-string-display
     org-keys (save-excursion (beginning-of-line) (point))
     nil "Type SPC or any command to erase help.")))                      ;;

(defvar org-keys
  (concat "   |                                                             \n"
          "   |                                                             \n"
;;;
	  "  | Visibility Cycling               TAB    C-i \n"
	  "  | Motion                           C-c C-n/p / C-c C-f/b / C-c C-u / C-c C-j \n"
	  "  | Structure Editing                M-RET  /   M-L/R  /  M-S-L/R \n"
	  "  | Sorting                          C-c ^ \n"
	  "  | Converting to headlines/removing stars     C-c * \n"
	  "  | Checkboxes                       M-S-RET\n"
	  "  | Archiving [manual]               C-c C-x a \n"
	  "  | Filtering and Sparse Trees       C-c / \n"
	  "  | Links                            C-c l    /    C-c C-l \n"
	  "  | TODO Items                       M-S-RET         C-c C-t \n"
	  "  | Tags                             C-c C-q  /  C-c C-c  /  C-c \\n"
	  "  | Properties and Column View       C-c C-x p \n"
	  "  | Timestamps                       C-c .  /   C-c ! \n"
	  "  | *Schedule and Deadline*          C-c C-s  /  C-c C-d\n"
	  "  | Clocking time                    C-c C-x C-i  /  C-c C-x C-o \n"
	  "  | Relative time clock              C-c C-x .  /  C-c C-x - \n"
	  "  | Exporting and Publishing         C-c C-e \n"
	  "  | Attachments Dispatcher Commands:  C-c C-a \n"
)
  "*String displayed above current line by \\org-popup-help].")

;(define-key org-mode-map "p" 'org-popup-help)
(global-set-key "\C-cp" 'org-popup-help)

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

_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: A crummy little popup for org keybindings help
  2009-02-28 22:46 A crummy little popup for org keybindings help Alan E. Davis
@ 2009-03-01  9:50 ` Alan E. Davis
  2009-03-02  0:30 ` Daniel Clemente
  1 sibling, 0 replies; 3+ messages in thread
From: Alan E. Davis @ 2009-03-01  9:50 UTC (permalink / raw)
  To: emacs-orgmode Mailinglist


[-- Attachment #1.1: Type: text/plain, Size: 5518 bytes --]

Will you forgive me for drifting off topic for a moment?  John Wiegley just
posted a reference to "unfuddle".  I admit I have been a bit befuddled for a
couple of hours, diving into some simple elisp.  I have no idea what
unfuddle is about, but I think I just experienced it.  Immediately after
seeing his message, I stumbled upon his "momentary.el".  Just the ticket,
because I was trying to use my crummy popup to popup a screen full of
remember templates; and that apparently cannot be done because of the
control characters in that string.

Momentary.el can do it.

Perhaps I should put this together into something more polished, and I now
think I can.  But I will share what I have done now for three screenfuls of
instantaneous popups.  Only the template popup is now done with
momentary.el.  It will be interesting if some of the keys displayed are
bindings for a more comprehensive bunch of little screens full of help
screens from the org-mode reference card.

There's more than one way to skin a cat.  This could be done either with a
properly designed event function or with my crummy interface as the first
screen.  The event function is far to be preferred, since my function is
really flakey when the cursor is at in importune place on the window.

Attached.

Alan



On Sun, Mar 1, 2009 at 8:46 AM, Alan E. Davis <lngndvs@gmail.com> wrote:

> Some time ago, the idea of an instant reference card was bantered about on
> the list.  I presented a file called org-help.org.  I have worked on it
> from time to time, and it's changed quite a bit.  My most recent idea is to
> have it available on a keystroke, completely folded, and each line would
> instantly display some of the most commonly used keys for that topic, then
> by opening that headline, a tree would be revealed with more detailed
> keybindings.  I've played with it, and it's helpful, and I'll make it
> available RSN, hoping others will find ways to make it more useful.  My
> final touch would be to incorporate a link for each topic to the relevant
> topics in the org-mode info manual.  What's missing is the convenience of
> info mode, of being able to stuff it away with "q" and call it up again at
> the same point.  That would be more convenient.  I'm unable to go forth on
> that part of the quest, because I haven't gotten my head around texinfo
> (yet?).
>
> Meanwhile, I remembered a little help popup I made to remember all my
> keybindings, long years ago.  Here's a quick popup to get a transient
> display of some keybindings above the current line.  I didn't understand how
> to wire it into org-mode-map's keybindings, so I bound it, for now, to
> \C-cp.  The beauty of this gem is to be able to type the keys right away,
> and they work.
>
> Please feel free to improve it.  Maybe another two or three of these would
> provide a person with his own frequently used keys.
>
> ;;;;;; org-popup-help
> ;;----------------
> ;; Org Popup Help
> ;;----------------------
> (defun org-popup-help ()
>   "Inserts a reminder of my org keybindings momentarily
> above the current line, until the next keystroke."
>   (interactive)
>   (save-excursion
>     (momentary-string-display
>      org-keys (save-excursion (beginning-of-line) (point))
>      nil "Type SPC or any command to erase help.")))
> ;;
>
> (defvar org-keys
>   (concat "   |
> \n"
>           "   |
> \n"
> ;;;
>       "  | Visibility Cycling               TAB    C-i \n"
>       "  | Motion                           C-c C-n/p / C-c C-f/b / C-c C-u
> / C-c C-j \n"
>       "  | Structure Editing                M-RET  /   M-L/R  /  M-S-L/R
> \n"
>       "  | Sorting                          C-c ^ \n"
>       "  | Converting to headlines/removing stars     C-c * \n"
>       "  | Checkboxes                       M-S-RET\n"
>       "  | Archiving [manual]               C-c C-x a \n"
>       "  | Filtering and Sparse Trees       C-c / \n"
>       "  | Links                            C-c l    /    C-c C-l \n"
>       "  | TODO Items                       M-S-RET         C-c C-t \n"
>       "  | Tags                             C-c C-q  /  C-c C-c  /  C-c
> \\n"
>       "  | Properties and Column View       C-c C-x p \n"
>       "  | Timestamps                       C-c .  /   C-c ! \n"
>       "  | *Schedule and Deadline*          C-c C-s  /  C-c C-d\n"
>       "  | Clocking time                    C-c C-x C-i  /  C-c C-x C-o \n"
>       "  | Relative time clock              C-c C-x .  /  C-c C-x - \n"
>       "  | Exporting and Publishing         C-c C-e \n"
>       "  | Attachments Dispatcher Commands:  C-c C-a \n"
> )
>   "*String displayed above current line by \\org-popup-help].")
>
> ;(define-key org-mode-map "p" 'org-popup-help)
> (global-set-key "\C-cp" 'org-popup-help)
> ;;;;;;;;;;;;;END org-popup-help.
>
> I'll provide it as a file as well, in case the tabs/spaces get blown away
> in the mail.
>
> Alan
> --
> Alan Davis
>
> It is undesirable to believe a proposition when
> there is no ground whatsoever for supposing it is true.
>     ---- Bertrand Russell
> They are ill discoverers that think there is no land, when they can see
> nothing but sea.
>     ----   Sir Francis Bacon
>
>


-- 
Alan Davis

"An inviscid theory of flow renders the screw useless, but the need for one
non-existent."                     ---Lord Raleigh (John William Strutt), or
else his son, who was also a scientist.

It is undesirable to believe a proposition when
there is no ground whatsoever for supposing it is true.
    ---- Bertrand Russell

[-- Attachment #1.2: Type: text/html, Size: 6530 bytes --]

[-- Attachment #2: org-popup-help.el --]
[-- Type: text/x-emacs-lisp, Size: 6007 bytes --]



(global-set-key "\C-cp" 'org-popup-help)
(defun org-popup-help ()
  "Inserts a reminder of my org keybindings momentarily 
above the current line, until the next keystroke."
  (interactive)
  (save-excursion
    (momentary-string-display
     org-keys (save-excursion (beginning-of-line) (point))
     nil "Type SPC or any command to erase help.")))                      ;;

(defvar org-keys
  (concat "  |                                                             \n"
          "  |                                                             \n"
;;;
          "  | Visibility Cycling               TAB    C-i \n"
          "  | Motion                           C-c C-n/p / C-c C-f/b / C-c C-u / C-c C-j \n"
          "  | Structure Editing                M-RET  /   M-L/R  /  M-S-L/R \n"
          "  | Sorting                          C-c ^ \n"
          "  | Converting to headlines/removing stars     C-c * \n"
          "  | Checkboxes                       M-S-RET\n"
          "  | Archiving [manual]               C-c C-x a \n"
          "  | Filtering and Sparse Trees       C-c / \n"
          "  | Links                            C-c l    /    C-c C-l \n"
          "  | TODO Items                       M-S-RET         C-c C-t \n"
          "  | Tags                             C-c C-q  /  C-c C-c  /  C-c \\n"
          "  | Properties and Column View       C-c C-x p \n"
          "  | Timestamps                       C-c .  /   C-c ! \n"
          "  | *Schedule and Deadline*          C-c C-s  /  C-c C-d\n"
          "  | Clocking time                    C-c C-x C-i  /  C-c C-x C-o \n"
          "  | Relative time clock              C-c C-x .  /  C-c C-x - \n"
          "  | Exporting and Publishing         C-c C-e \n"
          "  | Attachments Dispatcher Commands:  C-c C-a \n"
	  "  |  `%'-escapes for org-remember-templates: C-c 8 \n"
	  )
  "*String displayed above current line by \\org-popup-help].")


(global-set-key "\C-c9" 'org-agenda-popup-help)
(defun org-agenda-popup-help ()
  "Inserts a reminder of my org keybindings momentarily 
above the current line, until the next keystroke."
  (interactive)
  (save-excursion
    (momentary-string-display
     org-agenda-keys (save-excursion (beginning-of-line) (point))
     nil "Type SPC or any command to erase help.")))                      ;;


(defvar org-agenda-keys
  (concat " |                                                             \n"
          " |                                                             \n"
;;;
	  " |Agenda Dispatcher (suggested)                      C-c a\n"
	  " |  compile agenda for the current week           C-c a a \n"
	  " |  compile global TODO list                      C-c a t \n"
	  " |  compile TODO list for specific keyword        C-c a T \n"
	  " |  match tags, TODO kwds, properties             C-c a m \n"
	  " |  match only in TODO entries                    C-c a M \n"
	  " |  show timeline view of current org file        C-c a L \n"
	  " |                                      (time-sorted view)\n"
	  " |  match boolean expression                       C-c a s\n"
	  " |  configure custom commands                      C-c a C\n"
	  " |  search agenda files for regular expression     C-c a /\n"
	  " |  find stuck projects                  C-c a # ; C-c a !\n"
	  " |  restrict to current buffer    C-c a < (then character)\n"
	  " |  agenda for date at cursor                     C-c C-o \n")
  "*String displayed above current line by \\org-popup-help].")



(defvar org-template-popup
  (concat " |                                                             \n"
          " |                                                             \n"
;
	  " | \%^{prompt}  prompt the user for a string and replace this sequence with it. \n"
	  " |             \%^{prompt|default|completion2|completion3...} \n"
	  " | \%a          annotation, normally the link created with `org-store-link' \n"
	  " | \%A          like `%a', but prompt for the description part \n"
	  " | \%i          the region when remember is called with C-u. \n"
	  " | \%t, \%T      time stamp,  (date only | date and time) \n"
	  " | \%u, \%U      inactive time stamps,  (date only | date and time)  \n"
	  " | \%^t,\%^u,\%^T,\%^U   prompt for date.  (idea:  `%^{Birthday}t') \n"
	  " | \%n          user name (taken from `user-full-name') \n"
	  " | \%c          Current kill ring head. \n"
	  " | \%x          Content of the X clipboard. \n"
	  " | \%^C         Interactive selection of which kill or clip to use. \n"
	  " | \%^L         Like `%^C',  insert as link. \n"
	  " | \%^g         prompt for tags, with completion on tags in target file. \n"
	  " | \%k          title of currently clocked task \n"
	  " | \%K          link to currently clocked task \n"
	  " | \%^G         prompt for tags, with completion on tags fr all agenda files. \n"
	  " | \%^{prop}p   Prompt the user for a value for property `prop' \n"
	  " | \%:keyword   specific information for certain link types \n"
	  " | \%[pathname] insert the contents of the file given by `pathname' \n"
	  " | \%(sexp)     evaluate elisp `(sexp)' and replace with the result \n"
	  " | \%!          skip 'C-c C-c': immediately store note  after completing template \n"
	  " | \%&          jump to target location immediately after storing note  \n")
  "*String displayed above current line by org-template-help.")
 


(global-set-key "\C-c8" 'display-templates-popup)  
(defun display-templates-popup ()
  "Doc String"
  (interactive)
 (with-output-to-momentary-buffer "*sample*"
     (princ org-template-popup)))

;(define-key org-mode-map "p" 'org-popup-help)




;   (function
;    (lambda (event)
;      (if (event-matches-key-specifier-p event ?q)
;          (message "Happy days are here again!"))))) 
;




















;(define-key org-mode-map "p" 'org-popup-help)
(global-set-key "\C-cp" 'org-popup-help)
(global-set-key "\C-c9" 'org-agenda-popup-help)
(global-set-key "\C-c8" 'org-remember-template-popup-help)

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

_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: A crummy little popup for org keybindings help
  2009-02-28 22:46 A crummy little popup for org keybindings help Alan E. Davis
  2009-03-01  9:50 ` Alan E. Davis
@ 2009-03-02  0:30 ` Daniel Clemente
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Clemente @ 2009-03-02  0:30 UTC (permalink / raw)
  To: Alan E. Davis; +Cc: emacs-orgmode Mailinglist


El sáb, feb 28 2009, Alan E. Davis va escriure:
> Meanwhile, I remembered a little help popup I made to remember all my
> keybindings, long years ago.  Here's a quick popup to get a transient display

  This is also done by Icicles (http://www.emacswiki.org/emacs/Icicles).
  In any moment you can press S+TAB and get the list of key sequences for the current modes, and then you may complete keys while you type in the minibuffer, look for one, describe their functions, apply logic operations to the result set, …
  Icicles does many other things but is not intrusive, so you may use just one function without noticing the others.

-- Daniel

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

end of thread, other threads:[~2009-03-02  0:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-28 22:46 A crummy little popup for org keybindings help Alan E. Davis
2009-03-01  9:50 ` Alan E. Davis
2009-03-02  0:30 ` Daniel Clemente

Code repositories for project(s) associated with this 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).