* backquote quote pair notation: What does it mean in Emacs document?
@ 2012-12-18 10:56 ziqianggeoffreychen
2012-12-18 11:49 ` Jambunathan K
0 siblings, 1 reply; 14+ messages in thread
From: ziqianggeoffreychen @ 2012-12-18 10:56 UTC (permalink / raw)
To: help-gnu-emacs
Hi all,
When I read Emacs documents, I often see this kind of notation:
`'
For example, `q' in the following sentence:
setq does not evaluate symbol; it sets the symbol that you write. We say that this argument is automatically quoted. The `q' in setq stands for "quoted." (source: http://www.delorie.com/gnu/docs/elisp-manual-21/elisp_146.html)
One more example, `#level' in the following sentence:
Emacs detects such recursion and prints `#level' instead of recursively printing an object already being printed. (source: http://www.delorie.com/gnu/docs/elisp-manual-21/elisp_267.html)
Anybody knows the philosophy? Thank you for your reply.
Best regards,
Geoffrey Chen
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: backquote quote pair notation: What does it mean in Emacs document?
2012-12-18 10:56 backquote quote pair notation: What does it mean in Emacs document? ziqianggeoffreychen
@ 2012-12-18 11:49 ` Jambunathan K
2012-12-18 14:40 ` backquote quote pair notation: What does it mean in Emacsdocument? Drew Adams
2012-12-18 15:02 ` backquote quote pair notation: What does it mean in Emacs document? Thien-Thi Nguyen
0 siblings, 2 replies; 14+ messages in thread
From: Jambunathan K @ 2012-12-18 11:49 UTC (permalink / raw)
To: ziqianggeoffreychen; +Cc: help-gnu-emacs
> Hi all,
>
> When I read Emacs documents, I often see this kind of notation:
>
> `'
>
> For example, `q' in the following sentence:
>
> setq does not evaluate symbol; it sets the symbol that you write. We
> say that this argument is automatically quoted. The `q' in setq stands
> for "quoted." (source:
> http://www.delorie.com/gnu/docs/elisp-manual-21/elisp_146.html)
>
> One more example, `#level' in the following sentence:
>
> Emacs detects such recursion and prints `#level' instead of
> recursively printing an object already being printed. (source:
> http://www.delorie.com/gnu/docs/elisp-manual-21/elisp_267.html)
>
> Anybody knows the philosophy? Thank you for your reply.
It helps with speed-reading. As you become more experienced with Emacs,
you will find yourself resorting to the info manual.
Once you know that all the configuration variables, commands etc. are in
quotes, you can skip over most of English and take a quick shortcut to
the Point-Of-Interest and work back from there.
ps: Think about why we need paragraphs, why we indent the first line of
paragraph, why we need to indent list items etc. We take these as
matter of course and adopt the convention handed down to us, without
even thinking about how people of yore tried to bring sense out of a
wall of text.
> Best regards,
> Geoffrey Chen
>
--
^ permalink raw reply [flat|nested] 14+ messages in thread
* RE: backquote quote pair notation: What does it mean in Emacsdocument?
2012-12-18 11:49 ` Jambunathan K
@ 2012-12-18 14:40 ` Drew Adams
2012-12-18 15:29 ` Drew Adams
2012-12-18 18:57 ` Oleksandr Gavenko
2012-12-18 15:02 ` backquote quote pair notation: What does it mean in Emacs document? Thien-Thi Nguyen
1 sibling, 2 replies; 14+ messages in thread
From: Drew Adams @ 2012-12-18 14:40 UTC (permalink / raw)
To: 'Jambunathan K', ziqianggeoffreychen; +Cc: help-gnu-emacs
[-- Attachment #1: Type: text/plain, Size: 1419 bytes --]
> > Anybody knows the philosophy? Thank you for your reply.
>
> It helps with speed-reading. As you become more experienced
> with Emacs, you will find yourself resorting to the info manual.
Think of it as a simple quotation mechanism or rudimentary highlighting that
works with even the simplest plain-text editor or mode. It makes the quoted
text stand out - nothing more.
It is also relatively easy for code to parse, to treat the quoted passages in
various ways - in particular, highlighting them (color etc.).
Compare the two attached screenshots, for instance. See how the quoted text
stands out more when it is highlighted, and how that can help readability.
Look at how key sequences are handled in different ways here: as strings
("<f5>", "C-c y"), single-quoted: `C-c n', and using vector syntax: ([?\C-=],
[f7]). Each of these notations/syntaxes has a different meaning for Emacs and
Emacs Lisp.
> Once you know that all the configuration variables, commands etc.
> are in quotes, you can skip over most of English and take a quick
> shortcut to the Point-Of-Interest and work back from there.
>
> ps: Think about why we need paragraphs, why we indent the
> first line of paragraph, why we need to indent list items etc.
> We take these as matter of course and adopt the convention handed
> down to us, without even thinking about how people of yore tried
> to bring sense out of a wall of text.
[-- Attachment #2: throw-highlighted-quoted.png --]
[-- Type: image/png, Size: 87696 bytes --]
[-- Attachment #3: throw-unhighlighted-quoted.png --]
[-- Type: image/png, Size: 77032 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: backquote quote pair notation: What does it mean in Emacs document?
2012-12-18 11:49 ` Jambunathan K
2012-12-18 14:40 ` backquote quote pair notation: What does it mean in Emacsdocument? Drew Adams
@ 2012-12-18 15:02 ` Thien-Thi Nguyen
1 sibling, 0 replies; 14+ messages in thread
From: Thien-Thi Nguyen @ 2012-12-18 15:02 UTC (permalink / raw)
To: ziqianggeoffreychen; +Cc: help-gnu-emacs
[-- Attachment #1: Type: text/plain, Size: 1706 bytes --]
() Jambunathan K <kjambunathan@gmail.com>
() Tue, 18 Dec 2012 17:19:06 +0530
It helps with speed-reading.
Additionally, it distinguishes names used in code from common words.
E.g.: The point of `point' is to "point between" characters.
Collectively, this markup is called "quoting". There are many styles.
The particular pair ` (U+60) and ' (U+27) originated w/ ASCII, which was
practically all that was available when Emacs and, to a lesser extent,
the Info system, were initially written.
These days, i personally prefer ‘ (U+2018) and ’ (U+2019) [1], which is
symptomatic of the problem (there are many styles); other people prefer
differently, and every so often debate arises on which style is best
going forward.
And that's only talking about technical documents. In literature, you
can find even more styles. For example, quoting is often used in a
novel to delimit the words spoken (or thought) by the characters.
Recently i read a book where this was done not by surrounding that text
with such pairs, but by inserting a long hyphen (em-dash) between spoken
text and other text.
Anyway, <http://www.emacswiki.org/emacs/TypographicalPunctuationMarks>
and Emacswiki, in gneneral, have more info.
[1] http://lists.gnu.org/archive/html/gnu-emacs-sources/2010-04/msg00010.html
--
Thien-Thi Nguyen ..................................... GPG key: 4C807502
. NB: ttn at glug dot org is not me .
. (and has not been since 2007 or so) .
. ACCEPT NO SUBSTITUTES .
........... please send technical questions to mailing lists ...........
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* RE: backquote quote pair notation: What does it mean in Emacsdocument?
2012-12-18 14:40 ` backquote quote pair notation: What does it mean in Emacsdocument? Drew Adams
@ 2012-12-18 15:29 ` Drew Adams
2012-12-18 18:57 ` Oleksandr Gavenko
1 sibling, 0 replies; 14+ messages in thread
From: Drew Adams @ 2012-12-18 15:29 UTC (permalink / raw)
To: 'Jambunathan K', ziqianggeoffreychen; +Cc: help-gnu-emacs
[-- Attachment #1: Type: text/plain, Size: 366 bytes --]
> Compare the two attached screenshots, for instance. See how
> the quoted text stands out more when it is highlighted, and how
> that can help readability.
I should have added this screenshot (attached), where quoting has been removed.
Compare this with the quoted but unhighlighted image in my previous post to see
how even simple quoting can help readability.
[-- Attachment #2: throw-unquoted.png --]
[-- Type: image/png, Size: 75820 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: backquote quote pair notation: What does it mean in Emacsdocument?
2012-12-18 14:40 ` backquote quote pair notation: What does it mean in Emacsdocument? Drew Adams
2012-12-18 15:29 ` Drew Adams
@ 2012-12-18 18:57 ` Oleksandr Gavenko
2012-12-18 19:11 ` Jambunathan K
1 sibling, 1 reply; 14+ messages in thread
From: Oleksandr Gavenko @ 2012-12-18 18:57 UTC (permalink / raw)
To: help-gnu-emacs
On 2012-12-18, Drew Adams wrote:
> Compare the two attached screenshots, for instance. See how the quoted text
> stands out more when it is highlighted, and how that can help readability.
How can I add such highlighting for Info buffers in my config?
I think that it is done through some standard configuration...
Please share!
--
Best regards!
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: backquote quote pair notation: What does it mean in Emacsdocument?
2012-12-18 18:57 ` Oleksandr Gavenko
@ 2012-12-18 19:11 ` Jambunathan K
2012-12-19 0:40 ` Drew Adams
2012-12-19 19:57 ` backquote quote pair notation: What does it mean in Emacsdocument? Oleksandr Gavenko
0 siblings, 2 replies; 14+ messages in thread
From: Jambunathan K @ 2012-12-18 19:11 UTC (permalink / raw)
To: Oleksandr Gavenko; +Cc: help-gnu-emacs
Oleksandr Gavenko <gavenkoa@gmail.com> writes:
> On 2012-12-18, Drew Adams wrote:
>
>> Compare the two attached screenshots, for instance. See how the quoted text
>> stands out more when it is highlighted, and how that can help readability.
>
> How can I add such highlighting for Info buffers in my config?
>
> I think that it is done through some standard configuration...
Drew's may be more elaborate.
Here is a simple one that I cooked up. It can be simplified and be made
more elegant though.
(add-hook 'Info-mode-hook
(lambda nil
;; Add a FIXME face.
(font-lock-add-keywords
nil '(("\\(?:`[^']+'\\)" 0 'font-lock-variable-name-face t)
("\\(?:\"[^\"]*\"\\)" 0 'font-lock-string-face t)))))
> Please share!
--
^ permalink raw reply [flat|nested] 14+ messages in thread
* RE: backquote quote pair notation: What does it mean in Emacsdocument?
2012-12-18 19:11 ` Jambunathan K
@ 2012-12-19 0:40 ` Drew Adams
2012-12-19 0:42 ` Drew Adams
2012-12-19 17:15 ` Request for highlighting back-quote/quote pair notation Oleksandr Gavenko
2012-12-19 19:57 ` backquote quote pair notation: What does it mean in Emacsdocument? Oleksandr Gavenko
1 sibling, 2 replies; 14+ messages in thread
From: Drew Adams @ 2012-12-19 0:40 UTC (permalink / raw)
To: 'Jambunathan K', 'Oleksandr Gavenko'; +Cc: help-gnu-emacs
> >> Compare the two attached screenshots, for instance. See
> >> how the quoted text stands out more when it is highlighted,
> >> and how that can help readability.
> >
> > How can I add such highlighting for Info buffers in my config?
> >
> > I think that it is done through some standard configuration...
> > Please share!
>
> Drew's may be more elaborate.
> Here is a simple one that I cooked up. It can be simplified
> and be made more elegant though.
> (add-hook 'Info-mode-hook
> (lambda nil
> ;; Add a FIXME face.
> (font-lock-add-keywords
> nil '(("\\(?:`[^']+'\\)" 0
> 'font-lock-variable-name-face t)
> ("\\(?:\"[^\"]*\"\\)" 0
> 'font-lock-string-face t)))))
No, there is no standard configuration that does this. I offered it to Emacs
Dev several times starting a long time ago (and it is still offered), but there
has never been insufficient interest.
But you can get it here - just load library `info+.el'. It should work with GNU
Emacs versions 20 through 24. A few of the features, such as breadcrumbs, have
been added to Emacs, but not the highlighting.
overview: http://www.emacswiki.org/cgi-bin/wiki/InfoPlus
code: http://www.emacswiki.org/emacs-en/download/info%2b.el
^ permalink raw reply [flat|nested] 14+ messages in thread
* RE: backquote quote pair notation: What does it mean in Emacsdocument?
2012-12-19 0:40 ` Drew Adams
@ 2012-12-19 0:42 ` Drew Adams
2012-12-19 17:15 ` Request for highlighting back-quote/quote pair notation Oleksandr Gavenko
1 sibling, 0 replies; 14+ messages in thread
From: Drew Adams @ 2012-12-19 0:42 UTC (permalink / raw)
To: 'Jambunathan K', 'Oleksandr Gavenko'; +Cc: help-gnu-emacs
> has never been insufficient interest.
^^^^^^^^^^^^
(I meant sufficent.)
^ permalink raw reply [flat|nested] 14+ messages in thread
* Request for highlighting back-quote/quote pair notation.
2012-12-19 0:40 ` Drew Adams
2012-12-19 0:42 ` Drew Adams
@ 2012-12-19 17:15 ` Oleksandr Gavenko
2012-12-19 17:49 ` Drew Adams
[not found] ` <mailman.15693.1355939373.855.help-gnu-emacs@gnu.org>
1 sibling, 2 replies; 14+ messages in thread
From: Oleksandr Gavenko @ 2012-12-19 17:15 UTC (permalink / raw)
To: help-gnu-emacs; +Cc: bug-gnu-emacs
From:
Subject: RE: backquote quote pair notation: What does it mean in Emacsdocument?
Newsgroups: gmane.emacs.help
Cc: help-gnu-emacs@gnu.org
Date: 2012-12-19 02:40:13+0200 Wed
Archived-At: <http://permalink.gmane.org/gmane.emacs.help/88208>
On 2012-12-19, Drew Adams wrote:
> >> Compare the two attached screenshots, for instance. See
> >> how the quoted text stands out more when it is highlighted,
> >> and how that can help readability.
> >
> > How can I add such highlighting for Info buffers in my config?
> >
> > I think that it is done through some standard configuration...
> > Please share!
> No, there is no standard configuration that does this. I offered it to Emacs
> Dev several times starting a long time ago (and it is still offered), but there
> has never been insufficient interest.
From "info texinfo":
> 14.2 Inserting Quote Characters
> ===============================
> As explained in the early section on general Texinfo input conventions
> (*note Conventions::), Texinfo source files use the ASCII character ``'
> (96 decimal) to produce a left quote (`), and ASCII `'' (39 decimal) to
> produce a right quote ('). Doubling these input characters (```' and
> `''') produces double quotes (" and "). These are the conventions used
> by TeX.
So `' quoting style is common for info files. I checked it was used for
function selection in libc and readline info files. Also it was used in GNU
Make, R, Autotool and other manuals.
So having highlighting for `' in info mode is good thing for Emacs user
(compare with emacs-lisp-mode, where it was highlighted).
This is my vote up.
--
Best regards!
^ permalink raw reply [flat|nested] 14+ messages in thread
* RE: Request for highlighting back-quote/quote pair notation.
2012-12-19 17:15 ` Request for highlighting back-quote/quote pair notation Oleksandr Gavenko
@ 2012-12-19 17:49 ` Drew Adams
[not found] ` <mailman.15693.1355939373.855.help-gnu-emacs@gnu.org>
1 sibling, 0 replies; 14+ messages in thread
From: Drew Adams @ 2012-12-19 17:49 UTC (permalink / raw)
To: 'Oleksandr Gavenko', help-gnu-emacs; +Cc: bug-gnu-emacs
> So `' quoting style is common for info files. I checked it
> was used for function selection in libc and readline info files.
> Also it was used in GNU Make, R, Autotool and other manuals.
>
> So having highlighting for `' in info mode is good thing for
> Emacs user (compare with emacs-lisp-mode, where it was highlighted).
>
> This is my vote up.
Here is a 2004 thread about this, for reference:
http://lists.gnu.org/archive/html/emacs-devel/2004-10/msg00045.html
Be aware that it is not feasible for such highlighting to be foolproof. There
are sometimes isolated occurrences of characters such as ` and " that do not
indicate quotation bounds, for instance. And some nested or overlapping
quotations are not handled correctly, such as this from `(eintr) else':
`"It's a tiger!"'; but when you evaluate `(type-of-animal 'zebra)',
you will see `"It's not fierce!"'.
However, last time (2004) I checked in detail, there were "only *4* nodes of the
Elisp Manual that exhibit any highlighting problem at all, and those pbs are
minor. This is a big manual." That's not bad.
http://lists.gnu.org/archive/html/emacs-devel/2004-10/msg00197.html
At that time I also checked other manuals, with the findings detailed here:
http://lists.gnu.org/archive/html/emacs-devel/2004-10/msg00206.html
http://lists.gnu.org/archive/html/emacs-devel/2004-10/msg00234.html
A subsequent version of the code fixed some of those problems.
Here is my last message in that thread:
http://lists.gnu.org/archive/html/emacs-devel/2004-10/msg00301.html
Among other things, this highlighting can be helpful in finding certain bugs in
the manuals. During that thread several such bugs were found and corrected.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: backquote quote pair notation: What does it mean in Emacsdocument?
2012-12-18 19:11 ` Jambunathan K
2012-12-19 0:40 ` Drew Adams
@ 2012-12-19 19:57 ` Oleksandr Gavenko
2012-12-19 20:31 ` Jambunathan K
1 sibling, 1 reply; 14+ messages in thread
From: Oleksandr Gavenko @ 2012-12-19 19:57 UTC (permalink / raw)
To: help-gnu-emacs
On 2012-12-18, Jambunathan K wrote:
> Here is a simple one that I cooked up. It can be simplified and be made
> more elegant though.
>
> (add-hook 'Info-mode-hook
> (lambda nil
> ;; Add a FIXME face.
> (font-lock-add-keywords
> nil '(("\\(?:`[^']+'\\)" 0 'font-lock-variable-name-face t)
> ("\\(?:\"[^\"]*\"\\)" 0 'font-lock-string-face t)))))
Why do you use "shy group" in refex? You reference to all excretion in any
case...
--
Best regards!
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: backquote quote pair notation: What does it mean in Emacsdocument?
2012-12-19 19:57 ` backquote quote pair notation: What does it mean in Emacsdocument? Oleksandr Gavenko
@ 2012-12-19 20:31 ` Jambunathan K
0 siblings, 0 replies; 14+ messages in thread
From: Jambunathan K @ 2012-12-19 20:31 UTC (permalink / raw)
To: Oleksandr Gavenko; +Cc: help-gnu-emacs
Oleksandr Gavenko <gavenkoa@gmail.com> writes:
> On 2012-12-18, Jambunathan K wrote:
>
>> Here is a simple one that I cooked up. It can be simplified and be made
>> more elegant though.
>>
>> (add-hook 'Info-mode-hook
>> (lambda nil
>> ;; Add a FIXME face.
>> (font-lock-add-keywords
>> nil '(("\\(?:`[^']+'\\)" 0 'font-lock-variable-name-face t)
>> ("\\(?:\"[^\"]*\"\\)" 0 'font-lock-string-face t)))))
>
> Why do you use "shy group" in refex? You reference to all excretion in any
> case...
Regexp is created with `rx-to-string'. Above recipe is something that
works. You shouldn't dissect in to it too much.
For my previous recipe on `rx-to-string', see
http://lists.gnu.org/archive/html/help-gnu-emacs/2012-12/msg00085.html
--
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Request for highlighting back-quote/quote pair notation.
[not found] ` <mailman.15693.1355939373.855.help-gnu-emacs@gnu.org>
@ 2012-12-20 13:26 ` Ted Zlatanov
0 siblings, 0 replies; 14+ messages in thread
From: Ted Zlatanov @ 2012-12-20 13:26 UTC (permalink / raw)
To: help-gnu-emacs
On Wed, 19 Dec 2012 09:49:08 -0800 "Drew Adams" <drew.adams@oracle.com> wrote:
DA> Among other things, this highlighting can be helpful in finding certain bugs in
DA> the manuals. During that thread several such bugs were found and corrected.
I agree, and thank you for that work. I would support its inclusion in
Emacs.
Ted
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2012-12-20 13:26 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-18 10:56 backquote quote pair notation: What does it mean in Emacs document? ziqianggeoffreychen
2012-12-18 11:49 ` Jambunathan K
2012-12-18 14:40 ` backquote quote pair notation: What does it mean in Emacsdocument? Drew Adams
2012-12-18 15:29 ` Drew Adams
2012-12-18 18:57 ` Oleksandr Gavenko
2012-12-18 19:11 ` Jambunathan K
2012-12-19 0:40 ` Drew Adams
2012-12-19 0:42 ` Drew Adams
2012-12-19 17:15 ` Request for highlighting back-quote/quote pair notation Oleksandr Gavenko
2012-12-19 17:49 ` Drew Adams
[not found] ` <mailman.15693.1355939373.855.help-gnu-emacs@gnu.org>
2012-12-20 13:26 ` Ted Zlatanov
2012-12-19 19:57 ` backquote quote pair notation: What does it mean in Emacsdocument? Oleksandr Gavenko
2012-12-19 20:31 ` Jambunathan K
2012-12-18 15:02 ` backquote quote pair notation: What does it mean in Emacs document? Thien-Thi Nguyen
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).