emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] Orgpan: resize the correct window
@ 2012-10-03 13:32 Jonas Bernoulli
  2012-10-03 13:47 ` Jonas Bernoulli
  2012-10-27 20:07 ` [PATCH 0/2] Orgpan: resize " Jonas Bernoulli
  0 siblings, 2 replies; 8+ messages in thread
From: Jonas Bernoulli @ 2012-10-03 13:32 UTC (permalink / raw)
  To: emacs-orgmode

  is resized to four lines not the document buffer.
TINYCHANGE
---
 contrib/lisp/org-panel.el |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/contrib/lisp/org-panel.el b/contrib/lisp/org-panel.el
index 3ffdfaf..1df3847 100644
--- a/contrib/lisp/org-panel.el
+++ b/contrib/lisp/org-panel.el
@@ -598,12 +598,12 @@ button changes the binding of the arrow keys."
                org-mode-map))
  ;;(org-back-to-heading)
  ;;(remove-hook 'window-configuration-change-hook 'orgpan-window-config-change)
- (split-window)
+ (setq orgpan-org-window (selected-window))
+ (setq orgpan-panel-window (split-window nil nil 'below))
+ (select-window orgpan-panel-window)
  (set-window-buffer (selected-window) (orgpan-make-panel-buffer))
- (setq orgpan-panel-window (selected-window))
  ;;(set-window-dedicated-p (selected-window) t)
- (fit-window-to-buffer nil nil 3)
- (setq orgpan-org-window (next-window))
+ (fit-window-to-buffer nil 4 4)
  ;; The minor mode version starts here:
  (when orgpan-minor-mode-version
    (select-window orgpan-org-window)
-- 
1.7.9.5
Message-ID: <87mx03n090.fsf@bernoul.li>

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

* Re: [PATCH] Orgpan: resize the correct window
  2012-10-03 13:32 [PATCH] Orgpan: resize the correct window Jonas Bernoulli
@ 2012-10-03 13:47 ` Jonas Bernoulli
  2012-10-26 13:10   ` Bastien
  2012-10-27 20:07 ` [PATCH 0/2] Orgpan: resize " Jonas Bernoulli
  1 sibling, 1 reply; 8+ messages in thread
From: Jonas Bernoulli @ 2012-10-03 13:47 UTC (permalink / raw)
  To: Jonas Bernoulli; +Cc: emacs-orgmode


Sorry for the corrupted commit message.

I created a patch using git-filter-branch opened the file and turned on
message-mode and hit C-c C-c - obviously that is not enough.  Could
someone enlighten me how to actually submit the patches?

The commit message was supposed to look like this:
,----
| Orgpan: resize the correct window
| 
| * contrib/lisp/org-panel.el (orgpan-panel): Make sure the panel buffer
|   is resized to four lines not the document buffer.
|     
| TINYCHANGE
`----

By the way I have signed the FSF papers for Emacs this spring already.

Jonas

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

* Re: [PATCH] Orgpan: resize the correct window
  2012-10-03 13:47 ` Jonas Bernoulli
@ 2012-10-26 13:10   ` Bastien
  0 siblings, 0 replies; 8+ messages in thread
From: Bastien @ 2012-10-26 13:10 UTC (permalink / raw)
  To: Jonas Bernoulli; +Cc: emacs-orgmode

Hi Jonas,

Jonas Bernoulli <jonas@bernoul.li> writes:

> I created a patch using git-filter-branch opened the file and turned on
> message-mode and hit C-c C-c - obviously that is not enough.  Could
> someone enlighten me how to actually submit the patches?

Quick patch:

1. edit
2. C-x v = 
3. copy the buffer string and send it to the list

More elaborated patch:

1. create a dedicated branch for your patch(es)
2. commit on this branch
3. git format-patch master
4. send the patch to the list

See http://www.kernel.org/pub/software/scm/git/docs/git-format-patch.html

"git send-email" might also be useful:
http://www.kernel.org/pub/software/scm/git/docs/git-send-email.html

Can you resubmit the correct patch and cc Lennart Borgman so that he can
review your patch (as the author of org-panel.el)?

Thanks,

-- 
 Bastien

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

* [PATCH 0/2] Orgpan: resize correct window
  2012-10-03 13:32 [PATCH] Orgpan: resize the correct window Jonas Bernoulli
  2012-10-03 13:47 ` Jonas Bernoulli
@ 2012-10-27 20:07 ` Jonas Bernoulli
  2012-10-27 20:07   ` [PATCH 1/2] Orgpan: resize the " Jonas Bernoulli
  2012-10-27 20:07   ` [PATCH 2/2] Orgpan: quiet byte-compiler Jonas Bernoulli
  1 sibling, 2 replies; 8+ messages in thread
From: Jonas Bernoulli @ 2012-10-27 20:07 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: Jonas Bernoulli, lennart.borgman

Teach orgpan-panel to resize the correct window; that is the newly
created panel window instead of the document window.  I only tested
this with Emacs-24.2.1.

There are a few other outstanding issues:
- search prompts in the minibuffer but selects the document window
- orgpan-panel-buttons:=t causes an error
- indentation is strange

I must say I am not really interested in fixing these myself.

I marked both changes as TINYCHANGE because that's what I think they
are.  Doesn't matter whether you disagree, I signed the fsf papers for
"Emacs" this spring anyway.

@Bastien: Of course I used git-format-patch to create the patch
(git-refilter-branch was a "typo")...  Thanks for the tip about
git-send-email - I did not know about that command, and it appears
most blog posts on the subject neglect mentioning it in addition to
format-patch.  I should not have assumed that message-mode would
either know how to correctly handle the patches/messages created by
format-patch or otherwise fail completely (instead of sending a
corrupted message).

Jonas Bernoulli (2):
  Orgpan: resize the correct window
  Orgpan: quiet byte-compiler

 contrib/lisp/org-panel.el | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

-- 
1.8.0.rc3.331.g5b9a629

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

* [PATCH 1/2] Orgpan: resize the correct window
  2012-10-27 20:07 ` [PATCH 0/2] Orgpan: resize " Jonas Bernoulli
@ 2012-10-27 20:07   ` Jonas Bernoulli
  2012-12-22 15:11     ` Bastien
  2012-10-27 20:07   ` [PATCH 2/2] Orgpan: quiet byte-compiler Jonas Bernoulli
  1 sibling, 1 reply; 8+ messages in thread
From: Jonas Bernoulli @ 2012-10-27 20:07 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: Jonas Bernoulli, lennart.borgman

* contrib/lisp/org-panel.el (orgpan-panel): Make sure the panel buffer
  is resized to four lines not the document buffer.

TINYCHANGE
---
 contrib/lisp/org-panel.el | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/contrib/lisp/org-panel.el b/contrib/lisp/org-panel.el
index 3ffdfaf..95876b4 100644
--- a/contrib/lisp/org-panel.el
+++ b/contrib/lisp/org-panel.el
@@ -598,12 +598,11 @@ button changes the binding of the arrow keys."
                org-mode-map))
  ;;(org-back-to-heading)
  ;;(remove-hook 'window-configuration-change-hook 'orgpan-window-config-change)
- (split-window)
+ (setq orgpan-org-window (selected-window))
+ (setq orgpan-panel-window (split-window nil -4 'below))
+ (select-window orgpan-panel-window)
  (set-window-buffer (selected-window) (orgpan-make-panel-buffer))
- (setq orgpan-panel-window (selected-window))
  ;;(set-window-dedicated-p (selected-window) t)
- (fit-window-to-buffer nil nil 3)
- (setq orgpan-org-window (next-window))
  ;; The minor mode version starts here:
  (when orgpan-minor-mode-version
    (select-window orgpan-org-window)
-- 
1.8.0.rc3.331.g5b9a629

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

* [PATCH 2/2] Orgpan: quiet byte-compiler
  2012-10-27 20:07 ` [PATCH 0/2] Orgpan: resize " Jonas Bernoulli
  2012-10-27 20:07   ` [PATCH 1/2] Orgpan: resize the " Jonas Bernoulli
@ 2012-10-27 20:07   ` Jonas Bernoulli
  2012-12-22 15:13     ` Bastien
  1 sibling, 1 reply; 8+ messages in thread
From: Jonas Bernoulli @ 2012-10-27 20:07 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: Jonas Bernoulli, lennart.borgman

* contrib/lisp/org-panel.el: don't setq undefined and otherwise unused
  variable orgpan-this-panel-window
* contrib/lisp/org-panel.el (orgpan-check-panel-mode): fix format
  string of (error)
* contrib/lisp/org-panel.el: declare variables
  viper-emacs-state-mode-list and viper-new-major-mode-buffer-list
  which are defined in viper.el

TINYCHANGE
---
 contrib/lisp/org-panel.el | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/contrib/lisp/org-panel.el b/contrib/lisp/org-panel.el
index 95876b4..a732027 100644
--- a/contrib/lisp/org-panel.el
+++ b/contrib/lisp/org-panel.el
@@ -133,8 +133,6 @@ active.)"
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Hook functions etc
 
-;;(defvar orgpan-this-panel-window nil)
-
 (defun orgpan-delete-panel ()
  "Remove the panel."
  (interactive)
@@ -203,8 +201,7 @@ active.)"
              (unless (and orgpan-point
                           (= (point) orgpan-point))
                ;; Go backward so it is possible to click on a "button":
-               (orgpan-backward-field)))))
-       (setq orgpan-this-panel-window nil))
+               (orgpan-backward-field))))))
    (error (lwarn 't :warning "orgpan-post: %S" err))))
 
 ;; (defun orgpan-window-config-change ()
@@ -294,7 +291,7 @@ active.)"
 
 (defun orgpan-check-panel-mode ()
  (unless (derived-mode-p 'orgpan-mode)
-   (error "Not orgpan-mode in buffer: " major-mode)))
+   (error "Not orgpan-mode in buffer: %s" major-mode)))
 
 (defun orgpan-display-bindings-help ()
  (orgpan-check-panel-mode)
@@ -401,6 +398,9 @@ There can be only one such buffer at any time.")
 (defvar orgpan-point nil)
 ;;(make-variable-buffer-local 'orgpan-point)
 
+(defvar viper-emacs-state-mode-list)
+(defvar viper-new-major-mode-buffer-list)
+
 (defun orgpan-avoid-viper-in-buffer ()
  ;; Fix-me: This is ugly. However see `this-major-mode-requires-vi-state':
  (set (make-local-variable 'viper-emacs-state-mode-list) '(orgpan-mode))
-- 
1.8.0.rc3.331.g5b9a629

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

* Re: [PATCH 1/2] Orgpan: resize the correct window
  2012-10-27 20:07   ` [PATCH 1/2] Orgpan: resize the " Jonas Bernoulli
@ 2012-12-22 15:11     ` Bastien
  0 siblings, 0 replies; 8+ messages in thread
From: Bastien @ 2012-12-22 15:11 UTC (permalink / raw)
  To: Jonas Bernoulli; +Cc: lennart.borgman, emacs-orgmode

Hi Jonas,

Jonas Bernoulli <jonas@bernoul.li> writes:

> * contrib/lisp/org-panel.el (orgpan-panel): Make sure the panel buffer
>   is resized to four lines not the document buffer.

Applied to master, thanks.

-- 
 Bastien

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

* Re: [PATCH 2/2] Orgpan: quiet byte-compiler
  2012-10-27 20:07   ` [PATCH 2/2] Orgpan: quiet byte-compiler Jonas Bernoulli
@ 2012-12-22 15:13     ` Bastien
  0 siblings, 0 replies; 8+ messages in thread
From: Bastien @ 2012-12-22 15:13 UTC (permalink / raw)
  To: Jonas Bernoulli; +Cc: lennart.borgman, emacs-orgmode

Hi Jonas,

Jonas Bernoulli <jonas@bernoul.li> writes:

> * contrib/lisp/org-panel.el: don't setq undefined and otherwise unused
>   variable orgpan-this-panel-window
> * contrib/lisp/org-panel.el (orgpan-check-panel-mode): fix format
>   string of (error)
> * contrib/lisp/org-panel.el: declare variables
>   viper-emacs-state-mode-list and viper-new-major-mode-buffer-list
>   which are defined in viper.el
>
> TINYCHANGE

Applied to master, thanks.

PS: Commit changelogs should use proper sentences: uppercase letter at
the beginning, full-stop at the end, two spaces between sentences.  Not
that a problem for commits that go into contrib/, but important for 
those going into Org's core.  Thanks for thinking of it!

Also, I added you to the list of FSF-signed contributors on Worg:
http://orgmode.org/worg/org-contribute.html#contributors_with_fsf_papers

-- 
 Bastien

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

end of thread, other threads:[~2012-12-22 23:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-03 13:32 [PATCH] Orgpan: resize the correct window Jonas Bernoulli
2012-10-03 13:47 ` Jonas Bernoulli
2012-10-26 13:10   ` Bastien
2012-10-27 20:07 ` [PATCH 0/2] Orgpan: resize " Jonas Bernoulli
2012-10-27 20:07   ` [PATCH 1/2] Orgpan: resize the " Jonas Bernoulli
2012-12-22 15:11     ` Bastien
2012-10-27 20:07   ` [PATCH 2/2] Orgpan: quiet byte-compiler Jonas Bernoulli
2012-12-22 15:13     ` Bastien

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).