unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH-v2] Don't eat last newline character of citations
@ 2009-12-14  5:41 Kan-Ru Chen
  2009-12-14  5:41 ` [PATCH 1/4] emacs: " Kan-Ru Chen
  0 siblings, 1 reply; 6+ messages in thread
From: Kan-Ru Chen @ 2009-12-14  5:41 UTC (permalink / raw)
  To: notmuch

This patch series fixed the indentation problem of git HEAD and did
some minor cleanup of (- (..) 1) usage.

The second patch connects two citations block if them are blank line
separated, for example:

    > block 1
    > block 1

    > block 2

Will be treat as one citation block. The side effect is that any blank
line following the citation will be hidden, too.

The fourth patch is intend to decorate the citation button with
font-lock-comment-face so that the button can stand out form other
contents.

Cheers,
            Kanru

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

* [PATCH 1/4] emacs: Don't eat last newline character of citations
  2009-12-14  5:41 [PATCH-v2] Don't eat last newline character of citations Kan-Ru Chen
@ 2009-12-14  5:41 ` Kan-Ru Chen
  2009-12-14  5:41   ` [PATCH 2/4] emacs: Connect two hunk of citations if only blank separated Kan-Ru Chen
  0 siblings, 1 reply; 6+ messages in thread
From: Kan-Ru Chen @ 2009-12-14  5:41 UTC (permalink / raw)
  To: notmuch

In case of a citation following immediately new contents. When the citation
was collapsed:

    [1-line citation. Click/Enter to show.]
Lorem ipsum dolor sit amet, consectetur adipisicin

When it was expanded:

    [10-line citation. Click/Enter to show.]
    >
    Lorem ipsum dolor sit amet, consectetur adipisicin

The indentation was wrong.

Signed-off-by: Kan-Ru Chen <kanru@kanru.info>
---
 notmuch.el |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/notmuch.el b/notmuch.el
index 97914f2..5823094 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -606,7 +606,8 @@ which this thread was originally shown."
 	    (while (looking-at citation)
 	      (forward-line)
 	      (move-to-column depth))
-	    (let ((overlay (make-overlay beg-sub (point)))
+	    (end-of-line 0)
+	    (let ((overlay (make-overlay beg-sub  (1+ (point-marker))))
                   (invis-spec (make-symbol "notmuch-citation-region")))
               (add-to-invisibility-spec invis-spec)
 	      (overlay-put overlay 'invisible invis-spec)
-- 
1.6.5.5

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

* [PATCH 2/4] emacs: Connect two hunk of citations if only blank separated
  2009-12-14  5:41 ` [PATCH 1/4] emacs: " Kan-Ru Chen
@ 2009-12-14  5:41   ` Kan-Ru Chen
  2009-12-14  5:41     ` [PATCH 3/4] emacs: Some cleanup Kan-Ru Chen
  0 siblings, 1 reply; 6+ messages in thread
From: Kan-Ru Chen @ 2009-12-14  5:41 UTC (permalink / raw)
  To: notmuch

Also eats extra blanks between citations and content, which may not be
desired behavior.

Signed-off-by: Kan-Ru Chen <kanru@kanru.info>
---
 notmuch.el |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/notmuch.el b/notmuch.el
index 5823094..1722474 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -603,7 +603,7 @@ which this thread was originally shown."
       (move-to-column depth)
       (if (looking-at citation)
 	  (progn
-	    (while (looking-at citation)
+	    (while (looking-at (concat citation "\\|^$"))
 	      (forward-line)
 	      (move-to-column depth))
 	    (end-of-line 0)
-- 
1.6.5.5

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

* [PATCH 3/4] emacs: Some cleanup.
  2009-12-14  5:41   ` [PATCH 2/4] emacs: Connect two hunk of citations if only blank separated Kan-Ru Chen
@ 2009-12-14  5:41     ` Kan-Ru Chen
  2009-12-14  5:41       ` [PATCH 4/4] emacs: Use font-lock-comment-face to highlight citation button Kan-Ru Chen
  0 siblings, 1 reply; 6+ messages in thread
From: Kan-Ru Chen @ 2009-12-14  5:41 UTC (permalink / raw)
  To: notmuch


Signed-off-by: Kan-Ru Chen <kanru@kanru.info>
---
 notmuch.el |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/notmuch.el b/notmuch.el
index 1722474..db8f899 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -611,11 +611,10 @@ which this thread was originally shown."
                   (invis-spec (make-symbol "notmuch-citation-region")))
               (add-to-invisibility-spec invis-spec)
 	      (overlay-put overlay 'invisible invis-spec)
-              (let ((p (point-marker))
-                    (cite-button-text
+              (let ((cite-button-text
                      (concat "["  (number-to-string (count-lines beg-sub (point)))
                              "-line citation. Click/Enter to show.]")))
-                (goto-char (- beg-sub 1))
+                (goto-char (1- beg-sub))
                 (insert (concat "\n" indent))
                 (insert-button cite-button-text
                                'invisibility-spec invis-spec
@@ -624,7 +623,7 @@ which this thread was originally shown."
               ))))
       (move-to-column depth)
       (if (looking-at notmuch-show-signature-regexp)
-	  (let ((sig-lines (- (count-lines beg-sub end) 1)))
+	  (let ((sig-lines (1- (count-lines beg-sub end))))
 	    (if (<= sig-lines notmuch-show-signature-lines-max)
 		(progn
                   (let ((invis-spec (make-symbol "notmuch-signature-region")))
@@ -632,7 +631,7 @@ which this thread was originally shown."
                     (overlay-put (make-overlay beg-sub end)
                                  'invisible invis-spec)
                   
-                    (goto-char (- beg-sub 1))
+                    (goto-char (1- beg-sub))
                     (insert (concat "\n" indent))
                     (let ((sig-button-text (concat "[" (number-to-string sig-lines)
                                                    "-line signature. Click/Enter to show.]")))
-- 
1.6.5.5

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

* [PATCH 4/4] emacs: Use font-lock-comment-face to highlight citation button
  2009-12-14  5:41     ` [PATCH 3/4] emacs: Some cleanup Kan-Ru Chen
@ 2009-12-14  5:41       ` Kan-Ru Chen
  2010-02-08 22:34         ` Carl Worth
  0 siblings, 1 reply; 6+ messages in thread
From: Kan-Ru Chen @ 2009-12-14  5:41 UTC (permalink / raw)
  To: notmuch


Signed-off-by: Kan-Ru Chen <kanru@kanru.info>
---
 notmuch.el |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/notmuch.el b/notmuch.el
index db8f899..ed96dfa 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -581,7 +581,7 @@ which this thread was originally shown."
 (define-button-type 'notmuch-button-invisibility-toggle-type
   'action 'notmuch-toggle-invisible-action
   'follow-link t
-  'face "default")
+  'face 'font-lock-comment-face)
 (define-button-type 'notmuch-button-citation-toggle-type 'help-echo "mouse-1, RET: Show citation"
   :supertype 'notmuch-button-invisibility-toggle-type)
 (define-button-type 'notmuch-button-signature-toggle-type 'help-echo "mouse-1, RET: Show signature"
-- 
1.6.5.5

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

* Re: [PATCH 4/4] emacs: Use font-lock-comment-face to highlight citation button
  2009-12-14  5:41       ` [PATCH 4/4] emacs: Use font-lock-comment-face to highlight citation button Kan-Ru Chen
@ 2010-02-08 22:34         ` Carl Worth
  0 siblings, 0 replies; 6+ messages in thread
From: Carl Worth @ 2010-02-08 22:34 UTC (permalink / raw)
  To: Kan-Ru Chen, notmuch

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

On Mon, 14 Dec 2009 13:41:35 +0800, Kan-Ru Chen <kanru@kanru.info> wrote:

[... no detailed commit message ...]

I've pushed this change now. It looked to me like the previous changes
in this series were made obsolete by the patches from David that I just
pushed. Let me know if I'm wrong about that and there's anything more I
should pick up from this series.

-Carl

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

end of thread, other threads:[~2010-02-08 22:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-14  5:41 [PATCH-v2] Don't eat last newline character of citations Kan-Ru Chen
2009-12-14  5:41 ` [PATCH 1/4] emacs: " Kan-Ru Chen
2009-12-14  5:41   ` [PATCH 2/4] emacs: Connect two hunk of citations if only blank separated Kan-Ru Chen
2009-12-14  5:41     ` [PATCH 3/4] emacs: Some cleanup Kan-Ru Chen
2009-12-14  5:41       ` [PATCH 4/4] emacs: Use font-lock-comment-face to highlight citation button Kan-Ru Chen
2010-02-08 22:34         ` Carl Worth

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.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).