* [PATCH] Info-mode-font-lock-keywords: Fix-regexp
@ 2015-05-26 6:57 Vaidheeswaran C
2015-05-26 17:08 ` Stefan Monnier
0 siblings, 1 reply; 6+ messages in thread
From: Vaidheeswaran C @ 2015-05-26 6:57 UTC (permalink / raw)
To: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 54 bytes --]
Fontification happens fine with the attached change.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-lisp-info.el-Info-mode-font-lock-keywords-Fix-regexp.patch --]
[-- Type: text/x-patch; name="0001-lisp-info.el-Info-mode-font-lock-keywords-Fix-regexp.patch", Size: 767 bytes --]
From 10f96b207dfdaccb4928e61faea1780f1368e70f Mon Sep 17 00:00:00 2001
From: Vaidheeswaran C <vaidheeswaran.chinnaraju@gmail.com>
Date: Tue, 26 May 2015 12:22:07 +0530
Subject: [PATCH] * lisp/info.el (Info-mode-font-lock-keywords): Fix regexp
---
lisp/info.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lisp/info.el b/lisp/info.el
index d635819..4dd6a33 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -4219,7 +4219,7 @@ With a zero prefix arg, put the name inside a function call to `info'."
"Face used for quoted elements.")
(defvar Info-mode-font-lock-keywords
- '(("‘\\([^’]*\\)’" (1 'Info-quoted))))
+ '(("`\\([^’]*\\)’" (1 'Info-quoted))))
;; Autoload cookie needed by desktop.el
;;;###autoload
--
1.7.10.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] Info-mode-font-lock-keywords: Fix-regexp
2015-05-26 6:57 [PATCH] Info-mode-font-lock-keywords: Fix-regexp Vaidheeswaran C
@ 2015-05-26 17:08 ` Stefan Monnier
2015-05-31 4:12 ` Vaidheeswaran C
2015-05-31 4:21 ` Vaidheeswaran C
0 siblings, 2 replies; 6+ messages in thread
From: Stefan Monnier @ 2015-05-26 17:08 UTC (permalink / raw)
To: Vaidheeswaran C; +Cc: emacs-devel
> (defvar Info-mode-font-lock-keywords
> - '(("\\([^]*\\)" (1 'Info-quoted))))
> + '(("`\\([^]*\\)" (1 'Info-quoted))))
> Fontification happens fine with the attached change.
What exactly do you mean by that? Which problem is that supposed
to fix?
Stefan
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Info-mode-font-lock-keywords: Fix-regexp
2015-05-26 17:08 ` Stefan Monnier
@ 2015-05-31 4:12 ` Vaidheeswaran C
2015-06-01 4:27 ` Stefan Monnier
2015-05-31 4:21 ` Vaidheeswaran C
1 sibling, 1 reply; 6+ messages in thread
From: Vaidheeswaran C @ 2015-05-31 4:12 UTC (permalink / raw)
To: Stefan Monnier; +Cc: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 1001 bytes --]
On Tuesday 26 May 2015 10:38 PM, Stefan Monnier wrote:
>> (defvar Info-mode-font-lock-keywords
>> > - '(("€˜\\([^€™]*\\)€™" (1 'Info-quoted))))
>> > + '(("`\\([^€™]*\\)€™" (1 'Info-quoted))))
>
>> > Fontification happens fine with the attached change.
> What exactly do you mean by that? Which problem is that supposed
> to fix?
It is a feature.
With this change, commands, variables and keystrokes in the Emacs
Manual get highlighted. I believe experienced users usually "skim"
the manual for customizable variables and commands. This
fontification help with skimming.
`font-lock-function-name-face' is what I would personally recommend.
It close to the `info-xref' face.
Screenshots are available are here:
http://en.zimagez.com/zimage/info-mode-font-lock-keywords.php
http://en.zimagez.com/zimage/info-mode-font-lock-keywords-1.php
I am recirculating an updated patch.
----------------
PS: Mixing "courier" fonts with the default font seems
is...Uhh (atleast to my eyes)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-lisp-info.el-Info-mode-font-lock-keywords-Add-a-keyw.patch --]
[-- Type: text/x-patch; name="0001-lisp-info.el-Info-mode-font-lock-keywords-Add-a-keyw.patch", Size: 920 bytes --]
From 0cdbf4e42aeceff1f3abb0d88ee2d4ad08023a7b Mon Sep 17 00:00:00 2001
From: Vaidheeswaran C <vaidheeswaran.chinnaraju@gmail.com>
Date: Sun, 31 May 2015 09:23:41 +0530
Subject: [PATCH] lisp/info.el (Info-mode-font-lock-keywords): Add a keyword
* lisp/info.el (Info-mode-font-lock-keywords): Fontify text
rendered with @code, @kbd etc.
---
lisp/info.el | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lisp/info.el b/lisp/info.el
index 80428e7..1add13c 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -4219,7 +4219,8 @@ With a zero prefix arg, put the name inside a function call to `info'."
"Face used for quoted elements.")
(defvar Info-mode-font-lock-keywords
- '(("‘\\([^’]*\\)’" (1 'Info-quoted))))
+ '(("‘\\([^’]*\\)’" (1 'Info-quoted))
+ ("`\\([^']*\\)'" (1 'font-lock-function-name-face))))
;; Autoload cookie needed by desktop.el
;;;###autoload
--
1.7.10.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] Info-mode-font-lock-keywords: Fix-regexp
2015-05-31 4:12 ` Vaidheeswaran C
@ 2015-06-01 4:27 ` Stefan Monnier
2015-06-01 7:28 ` Vaidheeswaran C
0 siblings, 1 reply; 6+ messages in thread
From: Stefan Monnier @ 2015-06-01 4:27 UTC (permalink / raw)
To: Vaidheeswaran C; +Cc: emacs-devel
>>> > - '(("€˜\\([^€™]*\\)€™" (1 'Info-quoted))))
>>> > + '(("`\\([^€™]*\\)€™" (1 'Info-quoted))))
>>> > Fontification happens fine with the attached change.
>> What exactly do you mean by that? Which problem is that supposed
>> to fix?
> It is a feature.
> With this change, commands, variables and keystrokes in the Emacs
> Manual get highlighted.
I'm having trouble reading your patch because of mis-encoding issues,
but `...' is the quoting used with Texinfo-4, whereas Texinfo uses the
curly quotes. The current code recognizes the curly quotes because that
can be done much more reliably, whereas trying to highlight `...' is
fraught with too many risks of either false positives or false negatives.
While Texinfo 5's performance sucks rocks, the curly quotes output is
The Right Way, in my opinion, so I don't think it's terribly important
to highlight the old-style quotes: if you like this highlighting, then
use Texinfo-5.
> PS: Mixing "courier" fonts with the default font seems
> is...Uhh (atleast to my eyes)
Using font-lock-function-name-face would be a mistake since those quoted
elements aren't function names (in general). So Info-quoted is the
right face to use. Of course maybe this face's default isn't perfect,
but we've discussed changing it already and didn't make much progress.
FWIW, the face's default was chosen to mimick the LaTeX "verbatim
environment" output, which I think makes a lot of sense for
"quoted" text. Of course, it depends on taste, on the set of fonts you
have installed, and on your choice of default font. If this default
looks particularly bad in your case, report it as a bug. Sometimes the
problem is that "courier" does not map to any font, so if you have
a good (and non-proprietary) font to recommend instead, we could add it
to face-font-family-alternatives.
Stefan
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Info-mode-font-lock-keywords: Fix-regexp
2015-06-01 4:27 ` Stefan Monnier
@ 2015-06-01 7:28 ` Vaidheeswaran C
0 siblings, 0 replies; 6+ messages in thread
From: Vaidheeswaran C @ 2015-06-01 7:28 UTC (permalink / raw)
To: emacs-devel
On Monday 01 June 2015 09:57 AM, Stefan Monnier wrote:
>>>>> >>> > - '(("€˜\\([^€™]*\\)€™" (1 'Info-quoted))))
>>>>> >>> > + '(("`\\([^€™]*\\)€™" (1 'Info-quoted))))
>>>>> >>> > Fontification happens fine with the attached change.
>>> >> What exactly do you mean by that? Which problem is that supposed
>>> >> to fix?
>> > PS: Mixing "courier" fonts with the default font seems
>> > is...Uhh (atleast to my eyes)
I want the Info buffer to be colorized, so that I have enough visual
clues to skim it quickly. Some feedback...
1. Info-quoted should be lower-cased, I think
| 13 matches for "\_<defface\_>" in buffer: info.el
| 69:(defface info-node
| 76:(defface info-title-1
| 86:(defface info-title-2
| 93:(defface info-title-3
| 100:(defface info-title-4
| 107:(defface info-menu-header
| 117:(defface info-menu-star
| 124:(defface info-xref
| 129:(defface info-xref-visited
| 158:(defface info-header-xref
| 163:(defface info-header-node
| 168:(defface info-index-match
| 4217:(defface Info-quoted
2. Change the default value of Info-quoted in following ways:
a) __inherit__ from a face like `font-lock-function-name-face'.
b) Reconsider the use of courier family.
(a) above will ensure colorization (by default).
3. Recommend that newer Emacs be compiled with texinfo-5. (Please
ignore, if such recommendation already exists)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Info-mode-font-lock-keywords: Fix-regexp
2015-05-26 17:08 ` Stefan Monnier
2015-05-31 4:12 ` Vaidheeswaran C
@ 2015-05-31 4:21 ` Vaidheeswaran C
1 sibling, 0 replies; 6+ messages in thread
From: Vaidheeswaran C @ 2015-05-31 4:21 UTC (permalink / raw)
To: Stefan Monnier; +Cc: emacs-devel
On Tuesday 26 May 2015 10:38 PM, Stefan Monnier wrote:
>> (defvar Info-mode-font-lock-keywords
>> > - '(("€˜\\([^€™]*\\)€™" (1 'Info-quoted))))
>> > + '(("`\\([^€™]*\\)€™" (1 'Info-quoted))))
>
>> > Fontification happens fine with the attached change.
> What exactly do you mean by that? Which problem is that supposed
> to fix?
The patch I sent has no Euro signs. I hope my IceDove is not mangling
my patch.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-06-01 7:28 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-26 6:57 [PATCH] Info-mode-font-lock-keywords: Fix-regexp Vaidheeswaran C
2015-05-26 17:08 ` Stefan Monnier
2015-05-31 4:12 ` Vaidheeswaran C
2015-06-01 4:27 ` Stefan Monnier
2015-06-01 7:28 ` Vaidheeswaran C
2015-05-31 4:21 ` Vaidheeswaran C
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.