unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#24645: [PATCH] hexl-mode does not fontify buffer
@ 2016-10-08 18:39 Wilfred Hughes
  2016-10-08 18:42 ` Dmitry Gutov
  0 siblings, 1 reply; 4+ messages in thread
From: Wilfred Hughes @ 2016-10-08 18:39 UTC (permalink / raw)
  To: 24645

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

hexl-mode does not ensure font-lock is enabled, so the faces
hexl-address-region and hexl-ascii-region are not applied.

See patch attached.

[-- Attachment #2: 0001-Apply-font-lock-in-hexl-mode-buffers.patch --]
[-- Type: text/x-patch, Size: 683 bytes --]

From e51c63256862967977450d836bcc250cdd357fc9 Mon Sep 17 00:00:00 2001
From: Wilfred Hughes <me@wilfred.me.uk>
Date: Sat, 8 Oct 2016 14:25:43 -0400
Subject: [PATCH] Apply font-lock in hexl-mode buffers.

* lisp/hexl.el (hexl-mode): After setting font-lock-defaults, we need to
  call `font-lock-ensure' to apply hexl-mode faces.
---
 lisp/hexl.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lisp/hexl.el b/lisp/hexl.el
index 5f099a5..b421f15 100644
--- a/lisp/hexl.el
+++ b/lisp/hexl.el
@@ -402,6 +402,7 @@ hexl-mode
 			  "hexl-current-address")
 
     (if hexl-follow-ascii (hexl-follow-ascii 1)))
+  (font-lock-ensure)
   (run-mode-hooks 'hexl-mode-hook))
 
 
-- 
2.10.0


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

* bug#24645: [PATCH] hexl-mode does not fontify buffer
  2016-10-08 18:39 bug#24645: [PATCH] hexl-mode does not fontify buffer Wilfred Hughes
@ 2016-10-08 18:42 ` Dmitry Gutov
  2016-11-02  4:34   ` Wilfred Hughes
  0 siblings, 1 reply; 4+ messages in thread
From: Dmitry Gutov @ 2016-10-08 18:42 UTC (permalink / raw)
  To: Wilfred Hughes, 24645

On 08.10.2016 21:39, Wilfred Hughes wrote:
> hexl-mode does not ensure font-lock is enabled, so the faces
> hexl-address-region and hexl-ascii-region are not applied.

Would a user who disabled global-font-lock-mode really want that?






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

* bug#24645: [PATCH] hexl-mode does not fontify buffer
  2016-10-08 18:42 ` Dmitry Gutov
@ 2016-11-02  4:34   ` Wilfred Hughes
  2019-06-27 11:30     ` bug#14194: " Lars Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Wilfred Hughes @ 2016-11-02  4:34 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: 24645

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

Fair enough. Here's an updated patch that respects global-font-lock-mode.

On 8 October 2016 at 14:42, Dmitry Gutov <dgutov@yandex.ru> wrote:
> On 08.10.2016 21:39, Wilfred Hughes wrote:
>>
>> hexl-mode does not ensure font-lock is enabled, so the faces
>> hexl-address-region and hexl-ascii-region are not applied.
>
>
> Would a user who disabled global-font-lock-mode really want that?
>

[-- Attachment #2: 0001-Apply-font-lock-in-hexl-mode-buffers.patch --]
[-- Type: text/x-patch, Size: 719 bytes --]

From 9b2cf43f673d8317df86270a40320909d4e6c186 Mon Sep 17 00:00:00 2001
From: Wilfred Hughes <me@wilfred.me.uk>
Date: Sat, 8 Oct 2016 14:25:43 -0400
Subject: [PATCH] Apply font-lock in hexl-mode buffers.

* lisp/hexl.el (hexl-mode): After setting font-lock-defaults, we need to
  call `font-lock-ensure' to apply hexl-mode faces.
---
 lisp/hexl.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lisp/hexl.el b/lisp/hexl.el
index 5f099a5..519b052 100644
--- a/lisp/hexl.el
+++ b/lisp/hexl.el
@@ -402,6 +402,8 @@ hexl-mode
 			  "hexl-current-address")
 
     (if hexl-follow-ascii (hexl-follow-ascii 1)))
+  (when global-font-lock-mode
+    (font-lock-ensure))
   (run-mode-hooks 'hexl-mode-hook))
 
 
-- 
2.10.1


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

* bug#14194: bug#24645: [PATCH] hexl-mode does not fontify buffer
  2016-11-02  4:34   ` Wilfred Hughes
@ 2019-06-27 11:30     ` Lars Ingebrigtsen
  0 siblings, 0 replies; 4+ messages in thread
From: Lars Ingebrigtsen @ 2019-06-27 11:30 UTC (permalink / raw)
  To: Wilfred Hughes; +Cc: 14194, 24645, Dmitry Gutov

Wilfred Hughes <me@wilfred.me.uk> writes:

> Fair enough. Here's an updated patch that respects global-font-lock-mode.

Thanks; applied to the Emacs trunk now.

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





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

end of thread, other threads:[~2019-06-27 11:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-08 18:39 bug#24645: [PATCH] hexl-mode does not fontify buffer Wilfred Hughes
2016-10-08 18:42 ` Dmitry Gutov
2016-11-02  4:34   ` Wilfred Hughes
2019-06-27 11:30     ` bug#14194: " Lars Ingebrigtsen

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

	https://git.savannah.gnu.org/cgit/emacs.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).