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.
This commit is contained in:
parent
d86ef9fc4a
commit
5e9756e4c6
3 changed files with 57 additions and 55 deletions
|
@ -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)))
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 "^[`‘]@['’]"))
|
||||
((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
|
||||
))
|
||||
|
|
Loading…
Add table
Reference in a new issue