[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 5e9756e: Handle curved quotes in info files
From: |
Paul Eggert |
Subject: |
[Emacs-diffs] master 5e9756e: Handle curved quotes in info files |
Date: |
Tue, 26 May 2015 19:30:33 +0000 |
branch: master
commit 5e9756e4c68a199f051c2b9998c07a683ff479ff
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>
Handle curved quotes in info files
* lisp/calc/calc-help.el (calc-describe-thing):
* lisp/info.el (Info-find-index-name)
(Info-try-follow-nearest-node, Info-fontify-node):
* lisp/vc/ediff-help.el (ediff-help-for-quick-help):
In info files, process quotes ‘like this’ the same way we process
quotes `like this'. This catches a few places we missed earlier.
---
lisp/calc/calc-help.el | 22 +++++++------
lisp/info.el | 8 ++--
lisp/vc/ediff-help.el | 82 ++++++++++++++++++++++++------------------------
3 files changed, 57 insertions(+), 55 deletions(-)
diff --git a/lisp/calc/calc-help.el b/lisp/calc/calc-help.el
index 17e5b0f..aace2a9 100644
--- a/lisp/calc/calc-help.el
+++ b/lisp/calc/calc-help.el
@@ -365,21 +365,23 @@ C-w Describe how there is no warranty for Calc."
(let (Info-history)
(Info-goto-node (buffer-substring (match-beginning 1) (match-end 1))))
(or (let ((case-fold-search nil))
- (or (re-search-forward (format "\\[`%s'\\]\\|(`%s')\\|\\<The[ \n]`%s'"
- (or target (regexp-quote thing))
- (or target (regexp-quote thing))
- (or target (regexp-quote thing))) nil
t)
+ (or (re-search-forward
+ (format "\\[[`‘]%s['’]\\]\\|([`‘]%s['’])\\|\\<The[
\n][`‘]%s['’]"
+ (or target (regexp-quote thing))
+ (or target (regexp-quote thing))
+ (or target (regexp-quote thing))) nil t)
(and not-quoted
(let ((case-fold-search t))
(search-forward (or target thing) nil t)))
- (search-forward (format "`%s'" (or target thing)) nil t)
+ (search-forward (format "[`‘]%s['’]" (or target thing)) nil t)
(search-forward (or target thing) nil t)))
(let ((case-fold-search t))
- (or (re-search-forward (format "\\[`%s'\\]\\|(`%s')\\|\\<The[ \n]`%s'"
- (or target (regexp-quote thing))
- (or target (regexp-quote thing))
- (or target (regexp-quote thing))) nil
t)
- (search-forward (format "`%s'" (or target thing)) nil t)
+ (or (re-search-forward
+ (format "\\[[`‘]%s['’]\\]\\|([`‘]%s['’])\\|\\<The[
\n][`‘]%s['’]"
+ (or target (regexp-quote thing))
+ (or target (regexp-quote thing))
+ (or target (regexp-quote thing))) nil t)
+ (search-forward (format "[`‘]%s['’]" (or target thing)) nil t)
(search-forward (or target thing) nil t))))
(beginning-of-line)
(message "Found `%s' in %s" thing where)))
diff --git a/lisp/info.el b/lisp/info.el
index d635819..ab2497d 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -3378,10 +3378,10 @@ Give an empty topic name to go to the Index node
itself."
(re-search-forward (format
"[a-zA-Z]+: [a-zA-Z0-9_ *&]+ %s\\( \\|$\\)"
(regexp-quote name)) nil t)
- (search-forward (format "`%s'" name) nil t)
+ (search-forward (format "[`‘]%s['’]" name) nil t)
(and (string-match "\\`.*\\( (.*)\\)\\'" name)
(search-forward
- (format "`%s'" (substring name 0 (match-beginning 1)))
+ (format "[`‘]%s['’]" (substring name 0 (match-beginning 1)))
nil t))
(search-forward name nil t)
;; Try again without the " <1>" makeinfo can append
@@ -3894,7 +3894,7 @@ If FORK is non-nil, it is passed to `Info-goto-node'."
(let (node)
(cond
((setq node (Info-get-token (point) "[hf]t?tps?://"
- "\\([hf]t?tps?://[^ \t\n\"`({<>})']+\\)"))
+ "\\([hf]t?tps?://[^ \t\n\"`‘({<>})’']+\\)"))
(browse-url node)
(setq node t))
((setq node (Info-get-token (point) "\\*note[ \n\t]+"
@@ -4979,7 +4979,7 @@ first line or header line, and for breadcrumb links.")
;; Fontify http and ftp references
(goto-char (point-min))
(when not-fontified-p
- (while (re-search-forward "\\(https?\\|ftp\\)://[^ \t\n\"`({<>})']+"
+ (while (re-search-forward "\\(https?\\|ftp\\)://[^ \t\n\"`‘({<>})’']+"
nil t)
(add-text-properties (match-beginning 0) (match-end 0)
'(font-lock-face info-xref
diff --git a/lisp/vc/ediff-help.el b/lisp/vc/ediff-help.el
index c981d89..67acc66 100644
--- a/lisp/vc/ediff-help.el
+++ b/lisp/vc/ediff-help.el
@@ -195,47 +195,47 @@ the value of this variable and the variables
`ediff-help-message-*' in
(ediff-documentation "Quick Help Commands")
(let (case-fold-search)
- (cond ((string= cmd "?") (re-search-forward "^`\\?'"))
- ((string= cmd "G") (re-search-forward "^`G'"))
- ((string= cmd "E") (re-search-forward "^`E'"))
- ((string= cmd "wd") (re-search-forward "^`wd'"))
- ((string= cmd "wx") (re-search-forward "^`wa'"))
- ((string= cmd "a/b") (re-search-forward "^`a'"))
- ((string= cmd "x") (re-search-forward "^`a'"))
- ((string= cmd "xy") (re-search-forward "^`ab'"))
- ((string= cmd "p,DEL") (re-search-forward "^`p'"))
- ((string= cmd "n,SPC") (re-search-forward "^`n'"))
- ((string= cmd "j") (re-search-forward "^`j'"))
- ((string= cmd "gx") (re-search-forward "^`ga'"))
- ((string= cmd "!") (re-search-forward "^`!'"))
- ((string= cmd "*") (re-search-forward "^`\\*'"))
- ((string= cmd "m") (re-search-forward "^`m'"))
- ((string= cmd "|") (re-search-forward "^`|'"))
- ((string= cmd "@") (re-search-forward "^`@'"))
- ((string= cmd "h") (re-search-forward "^`h'"))
- ((string= cmd "r") (re-search-forward "^`r'"))
- ((string= cmd "rx") (re-search-forward "^`ra'"))
- ((string= cmd "##") (re-search-forward "^`##'"))
- ((string= cmd "#c") (re-search-forward "^`#c'"))
- ((string= cmd "#f/#h") (re-search-forward "^`#f'"))
- ((string= cmd "X") (re-search-forward "^`A'"))
- ((string= cmd "v/V") (re-search-forward "^`v'"))
- ((string= cmd "</>") (re-search-forward "^`<'"))
- ((string= cmd "~") (re-search-forward "^`~'"))
- ((string= cmd "i") (re-search-forward "^`i'"))
- ((string= cmd "D") (re-search-forward "^`D'"))
- ((string= cmd "R") (re-search-forward "^`R'"))
- ((string= cmd "M") (re-search-forward "^`M'"))
- ((string= cmd "z/q") (re-search-forward "^`z'"))
- ((string= cmd "%") (re-search-forward "^`%'"))
- ((string= cmd "C-l") (re-search-forward "^`C-l'"))
- ((string= cmd "$$") (re-search-forward "^`\\$\\$'"))
- ((string= cmd "$*") (re-search-forward "^`\\$\\*'"))
- ((string= cmd "/") (re-search-forward "^`/'"))
- ((string= cmd "&") (re-search-forward "^`&'"))
- ((string= cmd "s") (re-search-forward "^`s'"))
- ((string= cmd "+") (re-search-forward "^`\\+'"))
- ((string= cmd "=") (re-search-forward "^`='"))
+ (cond ((string= cmd "?") (re-search-forward "^[`‘]\\?['’]"))
+ ((string= cmd "G") (re-search-forward "^[`‘]G['’]"))
+ ((string= cmd "E") (re-search-forward "^[`‘]E['’]"))
+ ((string= cmd "wd") (re-search-forward "^[`‘]wd['’]"))
+ ((string= cmd "wx") (re-search-forward "^[`‘]wa['’]"))
+ ((string= cmd "a/b") (re-search-forward "^[`‘]a['’]"))
+ ((string= cmd "x") (re-search-forward "^[`‘]a['’]"))
+ ((string= cmd "xy") (re-search-forward "^[`‘]ab['’]"))
+ ((string= cmd "p,DEL") (re-search-forward "^[`‘]p['’]"))
+ ((string= cmd "n,SPC") (re-search-forward "^[`‘]n['’]"))
+ ((string= cmd "j") (re-search-forward "^[`‘]j['’]"))
+ ((string= cmd "gx") (re-search-forward "^[`‘]ga['’]"))
+ ((string= cmd "!") (re-search-forward "^[`‘]!['’]"))
+ ((string= cmd "*") (re-search-forward "^[`‘]\\*['’]"))
+ ((string= cmd "m") (re-search-forward "^[`‘]m['’]"))
+ ((string= cmd "|") (re-search-forward "^[`‘]|['’]"))
+ ((string= cmd "@") (re-search-forward "address@hidden'’]"))
+ ((string= cmd "h") (re-search-forward "^[`‘]h['’]"))
+ ((string= cmd "r") (re-search-forward "^[`‘]r['’]"))
+ ((string= cmd "rx") (re-search-forward "^[`‘]ra['’]"))
+ ((string= cmd "##") (re-search-forward "^[`‘]##['’]"))
+ ((string= cmd "#c") (re-search-forward "^[`‘]#c['’]"))
+ ((string= cmd "#f/#h") (re-search-forward "^[`‘]#f['’]"))
+ ((string= cmd "X") (re-search-forward "^[`‘]A['’]"))
+ ((string= cmd "v/V") (re-search-forward "^[`‘]v['’]"))
+ ((string= cmd "</>") (re-search-forward "^[`‘]<['’]"))
+ ((string= cmd "~") (re-search-forward "^[`‘]~['’]"))
+ ((string= cmd "i") (re-search-forward "^[`‘]i['’]"))
+ ((string= cmd "D") (re-search-forward "^[`‘]D['’]"))
+ ((string= cmd "R") (re-search-forward "^[`‘]R['’]"))
+ ((string= cmd "M") (re-search-forward "^[`‘]M['’]"))
+ ((string= cmd "z/q") (re-search-forward "^[`‘]z['’]"))
+ ((string= cmd "%") (re-search-forward "^[`‘]%['’]"))
+ ((string= cmd "C-l") (re-search-forward "^[`‘]C-l['’]"))
+ ((string= cmd "$$") (re-search-forward "^[`‘]\\$\\$['’]"))
+ ((string= cmd "$*") (re-search-forward "^[`‘]\\$\\*['’]"))
+ ((string= cmd "/") (re-search-forward "^[`‘]/['’]"))
+ ((string= cmd "&") (re-search-forward "^[`‘]&['’]"))
+ ((string= cmd "s") (re-search-forward "^[`‘]s['’]"))
+ ((string= cmd "+") (re-search-forward "^[`‘]\\+['’]"))
+ ((string= cmd "=") (re-search-forward "^[`‘]=['’]"))
(t (error "Undocumented command! Type `G' in Ediff Control Panel to
drop a note to the Ediff maintainer")))
) ; let case-fold-search
))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 5e9756e: Handle curved quotes in info files,
Paul Eggert <=