GNU bug report logs - #25022
25.1.50; Different highlighting for different citation level in message-mode

Previous Next

Package: emacs;

Reported by: Hong Xu <hong <at> topbug.net>

Date: Thu, 24 Nov 2016 23:23:02 UTC

Severity: minor

Tags: fixed, patch

Merged with 25124

Found in version 25.1.50

Fixed in version 27.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 25022 in the body.
You can then email your comments to 25022 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#25022; Package emacs. (Thu, 24 Nov 2016 23:23:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Hong Xu <hong <at> topbug.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 24 Nov 2016 23:23:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Hong Xu <hong <at> topbug.net>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.1.50;
 Different highlighting for different citation level in message-mode
Date: Thu, 24 Nov 2016 15:22:15 -0800
Currently in message-mode all cited texts are highlighted in the same
way. It would be nicer if the highlighting of different citation levels
can be easily customized.

In GNU Emacs 25.1.50.13 (x86_64-unknown-linux-gnu, GTK+ Version 3.14.5)
 of 2016-11-24 built on home
Repository revision: 7f43d7c0101256b120ead3ddae6ee47327d231c9
Windowing system distributor 'The X.Org Foundation', version 11.0.11604000
System Description:	Debian GNU/Linux 8.6 (jessie)

Configured using:
 'configure --with-modules --with-xwidgets
 --prefix=/home/hong/.local/opt/emacs/
 '--program-transform-name=s/^ctags$/ctags.emacs/''

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS
NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 MODULES XWIDGETS





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25022; Package emacs. (Tue, 06 Dec 2016 06:10:02 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Hong Xu <hong <at> topbug.net>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: 25.1.50;
 Different highlighting for different citation level in message-mode
Date: Mon, 05 Dec 2016 22:08:46 -0800
[message-cited-text-color.png (image/png, attachment)]
[Message part 2 (text/plain, inline)]
On 2016-11-24 Thu 15:22 GMT-0800, Hong Xu <hong <at> topbug.net> wrote:

> Currently in message-mode all cited texts are highlighted in the same
> way. It would be nicer if the highlighting of different citation levels
> can be easily customized.
>

Here is a patch and a screenshot. The default colors I chose may not be
optimal -- but I guess I'll leave that part to professionals.

Add support for different faces for different citation levels in message-mode.

	* message.el (message-font-lock-keywords)
	(message-font-lock-make-cited-text-matcher): Add support for
	different faces for different citation levels.  The faces are
	defined in the faces named `message-cited-text-N': N of the
	Mth citation level will be M mod 4.
	(message-cited-text-1, message-cited-text-2)
	(message-cited-text-3, message-cited-text-4): Add customization
	for the faces of 4 different citation level.  In the future, the
	number of faces may increase, as the code is flexible enough to
	automatically deal with that.
	(message-cite-level-function): Add a function to customize the
	determination of cite levels given the prefix of the cited text.

[message.patch (text/x-diff, inline)]
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 448ba7b99718..a61ced374aaf 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -649,6 +649,11 @@ message-cite-prefix-regexp
 	       (setq gnus-message-cite-prefix-regexp
 		     (concat "^\\(?:" value "\\)"))))))
 
+(defcustom message-cite-level-function
+  (lambda (s) (cl-count ?> s))
+  "A function to determine the level of cited text.  The function
+  accepts 1 parameter which is the matched prefix.")
+
 (defcustom message-cancel-message "I am canceling my own article.\n"
   "Message to be inserted in the cancel message."
   :group 'message-interface
@@ -1548,18 +1553,57 @@ message-separator
 (put 'message-separator-face 'face-alias 'message-separator)
 (put 'message-separator-face 'obsolete-face "22.1")
 
-(defface message-cited-text
+(defface message-cited-text-1
   '((((class color)
       (background dark))
      (:foreground "LightPink1"))
     (((class color)
       (background light))
-     (:foreground "red"))
+     (:foreground "red1"))
+    (t
+     (:bold t)))
+  "Face used for displaying 1st-level cited text."
+  :group 'message-faces)
+
+(defface message-cited-text-2
+  '((((class color)
+      (background dark))
+     (:foreground "forest green"))
+    (((class color)
+      (background light))
+     (:foreground "red4"))
     (t
      (:bold t)))
-  "Face used for displaying cited text names."
+  "Face used for displaying 2nd-level cited text."
   :group 'message-faces)
+
+(defface message-cited-text-3
+  '((((class color)
+      (background dark))
+     (:foreground "goldenrod3"))
+    (((class color)
+      (background light))
+     (:foreground "OliveDrab4"))
+    (t
+     (:bold t)))
+  "Face used for displaying 3rd-level cited text."
+  :group 'message-faces)
+
+(defface message-cited-text-4
+  '((((class color)
+      (background dark))
+     (:foreground "chocolate3"))
+    (((class color)
+      (background light))
+     (:foreground "SteelBlue4"))
+    (t
+     (:bold t)))
+  "Face used for displaying 4th-level cited text."
+  :group 'message-faces)
+
 ;; backward-compatibility alias
+(put 'message-cited-text 'face-alias 'message-cited-text-1)
+(put 'message-cited-text 'obsolete-face "26.1")
 (put 'message-cited-text-face 'face-alias 'message-cited-text)
 (put 'message-cited-text-face 'obsolete-face "22.1")
 
@@ -1596,45 +1640,83 @@ message-font-lock-make-header-matcher
 	(byte-compile form)
       form)))
 
+(defun message-font-lock-make-cited-text-matcher (level maxlevel)
+  "Generate the matcher for cited text.  LEVEL is the citation
+level to be matched and MAXLEVEL is the number of levels
+specified in the faces `message-cited-text-*'."
+  (byte-compile
+   `(lambda (limit)
+      (let (matched)
+        ;; Keep search until `message-cite-level-function' returns the level
+        ;; we want to match.
+        (while
+            (and (re-search-forward (concat "^\\("
+                                            message-cite-prefix-regexp
+                                            "\\).*")
+                                    limit t)
+                 (not (setq matched
+                            (save-match-data
+                              (= ,(1- level)
+                                 (mod
+                                  (1- (funcall message-cite-level-function
+                                               (match-string 1)))
+                                  ,maxlevel)))))))
+        matched))))
+
 (defvar message-font-lock-keywords
-  (let ((content "[ \t]*\\(.+\\(\n[ \t].*\\)*\\)\n?"))
-    `((,(message-font-lock-make-header-matcher
-	 (concat "^\\([Tt]o:\\)" content))
-       (1 'message-header-name)
-       (2 'message-header-to nil t))
-      (,(message-font-lock-make-header-matcher
-	 (concat "^\\(^[GBF]?[Cc][Cc]:\\|^[Rr]eply-[Tt]o:\\)" content))
-       (1 'message-header-name)
-       (2 'message-header-cc nil t))
-      (,(message-font-lock-make-header-matcher
-	 (concat "^\\([Ss]ubject:\\)" content))
-       (1 'message-header-name)
-       (2 'message-header-subject nil t))
-      (,(message-font-lock-make-header-matcher
-	 (concat "^\\([Nn]ewsgroups:\\|Followup-[Tt]o:\\)" content))
-       (1 'message-header-name)
-       (2 'message-header-newsgroups nil t))
-      (,(message-font-lock-make-header-matcher
-	 (concat "^\\(X-[A-Za-z0-9-]+:\\|In-Reply-To:\\)" content))
-       (1 'message-header-name)
-       (2 'message-header-xheader))
-      (,(message-font-lock-make-header-matcher
-	 (concat "^\\([A-Z][^: \n\t]+:\\)" content))
-       (1 'message-header-name)
-       (2 'message-header-other nil t))
-      ,@(if (and mail-header-separator
-		 (not (equal mail-header-separator "")))
-	    `((,(concat "^\\(" (regexp-quote mail-header-separator) "\\)$")
-	       1 'message-separator))
-	  nil)
-      ((lambda (limit)
-	 (re-search-forward (concat "^\\("
-				    message-cite-prefix-regexp
-				    "\\).*")
-			    limit t))
-       (0 'message-cited-text))
-      ("<#/?\\(multipart\\|part\\|external\\|mml\\|secure\\)[^>]*>"
-       (0 'message-mml))))
+  (nconc
+   (let ((content "[ \t]*\\(.+\\(\n[ \t].*\\)*\\)\n?"))
+     `((,(message-font-lock-make-header-matcher
+          (concat "^\\([Tt]o:\\)" content))
+        (1 'message-header-name)
+        (2 'message-header-to nil t))
+       (,(message-font-lock-make-header-matcher
+          (concat "^\\(^[GBF]?[Cc][Cc]:\\|^[Rr]eply-[Tt]o:\\)" content))
+        (1 'message-header-name)
+        (2 'message-header-cc nil t))
+       (,(message-font-lock-make-header-matcher
+          (concat "^\\([Ss]ubject:\\)" content))
+        (1 'message-header-name)
+        (2 'message-header-subject nil t))
+       (,(message-font-lock-make-header-matcher
+          (concat "^\\([Nn]ewsgroups:\\|Followup-[Tt]o:\\)" content))
+        (1 'message-header-name)
+        (2 'message-header-newsgroups nil t))
+       (,(message-font-lock-make-header-matcher
+          (concat "^\\(X-[A-Za-z0-9-]+:\\|In-Reply-To:\\)" content))
+        (1 'message-header-name)
+        (2 'message-header-xheader))
+       (,(message-font-lock-make-header-matcher
+          (concat "^\\([A-Z][^: \n\t]+:\\)" content))
+        (1 'message-header-name)
+        (2 'message-header-other nil t))
+       ,@(if (and mail-header-separator
+                  (not (equal mail-header-separator "")))
+             `((,(concat "^\\(" (regexp-quote mail-header-separator) "\\)$")
+                1 'message-separator))
+           nil)
+       ("<#/?\\(multipart\\|part\\|external\\|mml\\|secure\\)[^>]*>"
+        (0 'message-mml))))
+   ;; Additional font locks to highlight different levels of cited text
+   (let ((maxlevel 1)
+         (level 1)
+         cited-text-face
+         keywords)
+     ;; Compute the max level.
+     (while (setq cited-text-face
+                  (intern-soft (format "message-cited-text-%d" maxlevel)))
+       (setq maxlevel (1+ maxlevel)))
+     (setq maxlevel (1- maxlevel))
+     ;; Generate the keywords.
+     (while (setq cited-text-face
+                  (intern-soft (format "message-cited-text-%d" level)))
+       (setq keywords
+             (cons
+              `(,(message-font-lock-make-cited-text-matcher level maxlevel)
+                (0 ',cited-text-face))
+              keywords))
+       (setq level (1+ level)))
+     keywords))
   "Additional expressions to highlight in Message mode.")
 
 (defvar message-face-alist
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25022; Package emacs. (Tue, 06 Dec 2016 07:40:02 GMT) Full text and rfc822 format available.

Message #11 received at 25022 <at> debbugs.gnu.org (full text, mbox):

From: Katsumi Yamaoka <yamaoka <at> jpl.org>
To: Hong Xu <hong <at> topbug.net>
Cc: 25022 <at> debbugs.gnu.org
Subject: Re: bug#25022: 25.1.50;
 Different highlighting for different citation level in message-mode
Date: Tue, 06 Dec 2016 16:39:45 +0900
[Message part 1 (text/plain, inline)]
On Mon, 05 Dec 2016 22:08:46 -0800, Hong Xu wrote:
> On 2016-11-24 Thu 15:22 GMT-0800, Hong Xu <hong <at> topbug.net> wrote:
>> Currently in message-mode all cited texts are highlighted in the same
>> way. It would be nicer if the highlighting of different citation levels
>> can be easily customized.

> Here is a patch and a screenshot. The default colors I chose may not be
> optimal -- but I guess I'll leave that part to professionals.

> Add support for different faces for different citation levels in message-mode.

Isn't it redundant as there is this already? ;-)

(defcustom gnus-message-highlight-citation
  t ;; gnus-treat-highlight-citation ;; gnus-cite dependency
  "Enable highlighting of different citation levels in message-mode."
  :version "23.1" ;; No Gnus
  :group 'gnus-cite
  :group 'gnus-message
  :type 'boolean)

Here is my message-mode view:
[message-cited-text-color-2.png (image/png, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25022; Package emacs. (Tue, 06 Dec 2016 08:54:01 GMT) Full text and rfc822 format available.

Message #14 received at 25022 <at> debbugs.gnu.org (full text, mbox):

From: Hong Xu <hong <at> topbug.net>
To: Katsumi Yamaoka <yamaoka <at> jpl.org>
Cc: 25022 <at> debbugs.gnu.org
Subject: Re: bug#25022: 25.1.50;
 Different highlighting for different citation level in message-mode
Date: Tue, 06 Dec 2016 00:52:29 -0800
[Message part 1 (text/plain, inline)]
On 2016-12-05 Mon 23:39 GMT-0800, Katsumi Yamaoka <yamaoka <at> jpl.org> wrote:

> On Mon, 05 Dec 2016 22:08:46 -0800, Hong Xu wrote:
>> On 2016-11-24 Thu 15:22 GMT-0800, Hong Xu <hong <at> topbug.net> wrote:
>>> Currently in message-mode all cited texts are highlighted in the same
>>> way. It would be nicer if the highlighting of different citation levels
>>> can be easily customized.
>
>> Here is a patch and a screenshot. The default colors I chose may not be
>> optimal -- but I guess I'll leave that part to professionals.
>
>> Add support for different faces for different citation levels in message-mode.
>
> Isn't it redundant as there is this already? ;-)
>
> (defcustom gnus-message-highlight-citation
>   t ;; gnus-treat-highlight-citation ;; gnus-cite dependency
>   "Enable highlighting of different citation levels in message-mode."
>   :version "23.1" ;; No Gnus
>   :group 'gnus-cite
>   :group 'gnus-message
>   :type 'boolean)
>
> Here is my message-mode view:

Thank you pointing it out. However, it seems that
gnus-message-citation-mode does not work for me when using message-mode
from mu4e. I'm not sure whether it relies on the whole gnus to work or
simply I missed something...
[signature.asc (application/pgp-signature, inline)]

Reply sent to Hong Xu <hong <at> topbug.net>:
You have taken responsibility. (Tue, 06 Dec 2016 09:19:02 GMT) Full text and rfc822 format available.

Notification sent to Hong Xu <hong <at> topbug.net>:
bug acknowledged by developer. (Tue, 06 Dec 2016 09:19:02 GMT) Full text and rfc822 format available.

Message #19 received at 25022-done <at> debbugs.gnu.org (full text, mbox):

From: Hong Xu <hong <at> topbug.net>
To: Katsumi Yamaoka <yamaoka <at> jpl.org>
Cc: 25022-done <at> debbugs.gnu.org
Subject: Re: bug#25022: 25.1.50;
 Different highlighting for different citation level in message-mode
Date: Tue, 06 Dec 2016 01:17:35 -0800
[Message part 1 (text/plain, inline)]
On 2016-12-05 Mon 23:39 GMT-0800, Katsumi Yamaoka <yamaoka <at> jpl.org> wrote:

> On Mon, 05 Dec 2016 22:08:46 -0800, Hong Xu wrote:
>> On 2016-11-24 Thu 15:22 GMT-0800, Hong Xu <hong <at> topbug.net> wrote:
>>> Currently in message-mode all cited texts are highlighted in the same
>>> way. It would be nicer if the highlighting of different citation levels
>>> can be easily customized.
>
>> Here is a patch and a screenshot. The default colors I chose may not be
>> optimal -- but I guess I'll leave that part to professionals.
>
>> Add support for different faces for different citation levels in message-mode.
>
> Isn't it redundant as there is this already? ;-)
>
> (defcustom gnus-message-highlight-citation
>   t ;; gnus-treat-highlight-citation ;; gnus-cite dependency
>   "Enable highlighting of different citation levels in message-mode."
>   :version "23.1" ;; No Gnus
>   :group 'gnus-cite
>   :group 'gnus-message
>   :type 'boolean)
>
> Here is my message-mode view:

I see the reason: gnus-message-citation-mode should see whether the
current major mode is derived from message-mode, rather than equal. I'll
probably find another fix later.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25022; Package emacs. (Tue, 06 Dec 2016 10:09:02 GMT) Full text and rfc822 format available.

Message #22 received at 25022 <at> debbugs.gnu.org (full text, mbox):

From: Katsumi Yamaoka <yamaoka <at> jpl.org>
To: Hong Xu <hong <at> topbug.net>
Cc: 25022 <at> debbugs.gnu.org
Subject: Re: bug#25022: 25.1.50;
 Different highlighting for different citation level in message-mode
Date: Tue, 06 Dec 2016 19:08:14 +0900
;; This might not be Cc'd to the bug list, but that's ok. ;-)

On Tue, 06 Dec 2016 00:52:29 -0800, Hong Xu wrote:
> Thank you pointing it out. However, it seems that
> gnus-message-citation-mode does not work for me when using message-mode
> from mu4e. I'm not sure whether it relies on the whole gnus to work or
> simply I missed something...

With `emacs -Q' I tried:

(setq mail-user-agent 'gnus-user-agent)
(compose-mail)

However, I saw that `gnus-message-citation-mode' does not run.
I realized it is because `compose-mail' runs `gnus-msg-mail' that
calls `message-mail' directly if Gnus is not running then.  It
doesn't differ from the case `mail-user-agent' is the default.
I vaguely think this is the key to improve it.  Anyway, I believe
improving `message-mode' so as to run `gnus-message-citation-mode'
is worthwhile especially for the case where Gnus is not running.

Regards,




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25022; Package emacs. (Tue, 06 Dec 2016 15:32:02 GMT) Full text and rfc822 format available.

Message #25 received at 25022 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Hong Xu <hong <at> topbug.net>
Cc: 25022 <at> debbugs.gnu.org
Subject: Re: bug#25022: 25.1.50;
 Different highlighting for different citation level in message-mode
Date: Tue, 06 Dec 2016 17:31:26 +0200
> From: Hong Xu <hong <at> topbug.net>
> Date: Tue, 06 Dec 2016 01:17:35 -0800
> Cc: 25022-done <at> debbugs.gnu.org
> 
> I see the reason: gnus-message-citation-mode should see whether the
> current major mode is derived from message-mode, rather than equal. I'll
> probably find another fix later.

If you change the condition to be true for any mode derived from
message-mode, then all of them will inherit this feature.  Are we sure
those other modes all want that?  For example, gnus-art.el defines one
such mode; up until now, that mode didn't use this feature, maybe that
was for a good reason?

(Caveat: I don't use Gnus, nor message-mode.)

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25022; Package emacs. (Tue, 06 Dec 2016 15:52:01 GMT) Full text and rfc822 format available.

Message #28 received at 25022 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 25022 <at> debbugs.gnu.org, Hong Xu <hong <at> topbug.net>
Subject: Re: bug#25022: 25.1.50;
 Different highlighting for different citation level in message-mode
Date: Tue, 06 Dec 2016 16:51:09 +0100
Eli Zaretskii <eliz <at> gnu.org> writes:

> If you change the condition to be true for any mode derived from
> message-mode, then all of them will inherit this feature.  Are we sure
> those other modes all want that?  For example, gnus-art.el defines one
> such mode; up until now, that mode didn't use this feature, maybe that
> was for a good reason?

No, I don't think that was on purpose.  I probably just didn't know
about derived-mode-p at the time...

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Forcibly Merged 25022 25124. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Tue, 06 Dec 2016 17:36:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25022; Package emacs. (Tue, 06 Dec 2016 19:58:02 GMT) Full text and rfc822 format available.

Message #33 received at 25022 <at> debbugs.gnu.org (full text, mbox):

From: Hong Xu <hong <at> topbug.net>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 25022 <at> debbugs.gnu.org
Subject: Re: bug#25022: 25.1.50;
 Different highlighting for different citation level in message-mode
Date: Tue, 06 Dec 2016 11:57:27 -0800
[Message part 1 (text/plain, inline)]
On 2016-12-06 Tue 07:51 GMT-0800, Lars Ingebrigtsen <larsi <at> gnus.org> wrote:

> Eli Zaretskii <eliz <at> gnu.org> writes:
>
>> If you change the condition to be true for any mode derived from
>> message-mode, then all of them will inherit this feature.  Are we sure
>> those other modes all want that?  For example, gnus-art.el defines one
>> such mode; up until now, that mode didn't use this feature, maybe that
>> was for a good reason?
>
> No, I don't think that was on purpose.  I probably just didn't know
> about derived-mode-p at the time...

I've already proposed the one-line change in #25124. You can commit
directly since this is just one line...

I saw a comment "FIXME: use derived-mode-p" but I'm not sure why it
wasn't changed directly on the code itself.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25022; Package emacs. (Tue, 06 Dec 2016 20:05:01 GMT) Full text and rfc822 format available.

Message #36 received at 25022 <at> debbugs.gnu.org (full text, mbox):

From: Hong Xu <hong <at> topbug.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 25022 <at> debbugs.gnu.org
Subject: Re: bug#25022: 25.1.50;
 Different highlighting for different citation level in message-mode
Date: Tue, 06 Dec 2016 12:04:09 -0800
[Message part 1 (text/plain, inline)]
On 2016-12-06 Tue 07:31 GMT-0800, Eli Zaretskii <eliz <at> gnu.org> wrote:

>> From: Hong Xu <hong <at> topbug.net>
>> Date: Tue, 06 Dec 2016 01:17:35 -0800
>> Cc: 25022-done <at> debbugs.gnu.org
>>
>> I see the reason: gnus-message-citation-mode should see whether the
>> current major mode is derived from message-mode, rather than equal. I'll
>> probably find another fix later.
>
> If you change the condition to be true for any mode derived from
> message-mode, then all of them will inherit this feature.  Are we sure
> those other modes all want that?  For example, gnus-art.el defines one
> such mode; up until now, that mode didn't use this feature, maybe that
> was for a good reason?

I don't think it's a big problem -- the minor mode isn't automatically
enabled anyway. If someone derives message-mode to a mode that isn't
compatible with gnus-message-citation-mode, she can just disable the
minor mode.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25022; Package emacs. (Mon, 24 Jun 2019 23:23:02 GMT) Full text and rfc822 format available.

Message #39 received at 25022 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Hong Xu <hong <at> topbug.net>
Cc: 25124 <at> debbugs.gnu.org, 25022 <at> debbugs.gnu.org
Subject: Re: bug#25124: [PATCH] gnus-message-citation-mode should fontify if
 derived from message-mode.
Date: Tue, 25 Jun 2019 01:22:45 +0200
Hong Xu <hong <at> topbug.net> writes:

> 	* gnus-cite.el (gnus-message-citation-mode): Fontify if the major
> 	mode is derived from message-mode (not necessarily equal to
> 	message-mode).

Thanks; applied to the Emacs trunk.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25022; Package emacs. (Mon, 24 Jun 2019 23:31:02 GMT) Full text and rfc822 format available.

Message #42 received at 25022 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Katsumi Yamaoka <yamaoka <at> jpl.org>
Cc: 25022 <at> debbugs.gnu.org, Hong Xu <hong <at> topbug.net>
Subject: Re: bug#25022: 25.1.50;
 Different highlighting for different citation level in message-mode
Date: Tue, 25 Jun 2019 01:30:49 +0200
Katsumi Yamaoka <yamaoka <at> jpl.org> writes:

> (setq mail-user-agent 'gnus-user-agent)
> (compose-mail)
>
> However, I saw that `gnus-message-citation-mode' does not run.
> I realized it is because `compose-mail' runs `gnus-msg-mail' that
> calls `message-mail' directly if Gnus is not running then.  It
> doesn't differ from the case `mail-user-agent' is the default.
> I vaguely think this is the key to improve it.  Anyway, I believe
> improving `message-mode' so as to run `gnus-message-citation-mode'
> is worthwhile especially for the case where Gnus is not running.

Yes, we should refactor the gnus-cite code, perhaps, to be able to be
used in Message when Gnus isn't running.

Hm...

OK, I had a look at it, and it does seem possible, but it would take
extensive untangling.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25022; Package emacs. (Mon, 23 Sep 2019 11:13:02 GMT) Full text and rfc822 format available.

Message #45 received at 25022 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Hong Xu <hong <at> topbug.net>
Cc: 25022 <at> debbugs.gnu.org
Subject: Re: bug#25022: 25.1.50; Different highlighting for different
 citation level in message-mode
Date: Mon, 23 Sep 2019 13:12:05 +0200
Hong Xu <hong <at> topbug.net> writes:

> Add support for different faces for different citation levels in
> message-mode.

I had another look at reusing the gnus-cite code for this instead, but
it's just too much code to inflict on non-Gnus users.

So I've applied your patch now to Emacs 27, and it seems to look nice to
me, but of course, since virtually all my mails are generated from a
Gnus context, I won't be seeing these citation faces a lot.

If anybody else wants to tweak the faces, please go ahead.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 23 Sep 2019 11:13:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 27.1, send any further explanations to 25022 <at> debbugs.gnu.org and Hong Xu <hong <at> topbug.net> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 23 Sep 2019 11:13:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 21 Oct 2019 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 160 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.