Skip to content

Commit

Permalink
help overlay setup in pop-up buffer
Browse files Browse the repository at this point in the history
* twittering-mode.el (twittering-edit-setup-help): add to setup
help overlay in pop-up buffer
(twittering-edit-next-history, twittering-edit-previous-history):
use twittering-edit-setup-help
  • Loading branch information
hayamiz committed Jan 15, 2010
1 parent 402e815 commit ec9d973
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 12 deletions.
7 changes: 7 additions & 0 deletions ChangeLog
Expand Up @@ -145,6 +145,13 @@
(twittering-tinyurl-get): `buffer' are killed even if
`search-forward-regexp' fails.

2010-01-09 Yuto Hayamizu <y.hayamizu@gmail.com>

* twittering-mode.el (twittering-edit-setup-help): add to setup
help overlay in pop-up buffer
(twittering-edit-next-history, twittering-edit-previous-history):
use twittering-edit-setup-help

2010-01-08 Yuto Hayamizu <y.hayamizu@gmail.com>

* twittering-mode.el (twittering-percent-encode): bug fix:
Expand Down
35 changes: 23 additions & 12 deletions twittering-mode.el
Expand Up @@ -913,16 +913,8 @@ Return nil if STR is invalid as a timeline spec."
(goto-char (point-min))
(setq buffer-undo-list nil)
(make-local-variable 'twittering-help-overlay)
(let ((help-overlay (make-overlay (- (point-max) 1) (point-max) nil t t)))
(overlay-put help-overlay 'face 'font-lock-comment-face)
(overlay-put help-overlay 'display
"---- text under this line is ignored ----
Keymap:
C-c C-c: post a tweet
C-c C-k: cancel a tweet
M-n : next history element
M-p : previous history element")
(setq twittering-help-overlay help-overlay))
(setq twittering-help-overlay nil)
(twittering-edit-setup-help)

(make-local-variable 'twittering-edit-local-history)
(setq twittering-edit-local-history (cons (buffer-string)
Expand All @@ -943,6 +935,21 @@ Keymap:
(define-key km (kbd "M-p") 'twittering-edit-previous-history)
(define-key km (kbd "F4") 'twittering-tinyurl-replace-at-point)))

(defun twittering-edit-setup-help ()
(let ((help-overlay
(or twittering-help-overlay
(make-overlay (- (point-max) 1) (point-max) nil t t))))
(move-overlay help-overlay (- (point-max) 1) (point-max))
(overlay-put help-overlay 'face 'font-lock-comment-face)
(overlay-put help-overlay 'display
"---- text under this line is ignored ----
Keymap:
C-c C-c: post a tweet
C-c C-k: cancel a tweet
M-n : next history element
M-p : previous history element")
(setq twittering-help-overlay help-overlay)))

(defun twittering-edit-close ()
(kill-buffer (current-buffer))
(when twittering-pre-edit-window-configuration
Expand Down Expand Up @@ -984,7 +991,9 @@ Keymap:
(decf twittering-edit-local-history-idx)
(erase-buffer)
(insert (nth twittering-edit-local-history-idx
twittering-edit-local-history)))))
twittering-edit-local-history))
(twittering-edit-setup-help)
(goto-char (point-min)))))

(defun twittering-edit-previous-history ()
(interactive)
Expand All @@ -997,7 +1006,9 @@ Keymap:
(incf twittering-edit-local-history-idx)
(erase-buffer)
(insert (nth twittering-edit-local-history-idx
twittering-edit-local-history))))
twittering-edit-local-history))
(twittering-edit-setup-help)
(goto-char (point-min))))
)

(defun twittering-update-mode-line ()
Expand Down

0 comments on commit ec9d973

Please sign in to comment.