diff options
| author | Paul Eggert | 2015-05-26 12:29:38 -0700 |
|---|---|---|
| committer | Paul Eggert | 2015-05-26 12:30:27 -0700 |
| commit | 5e9756e4c68a199f051c2b9998c07a683ff479ff (patch) | |
| tree | 40d20ebd53bd74fe6cc9d924b0b5d762e366f45b | |
| parent | d86ef9fc4a45bd1f3c79c4814b9e1e545ce0a07c (diff) | |
| download | emacs-5e9756e4c68a199f051c2b9998c07a683ff479ff.tar.gz emacs-5e9756e4c68a199f051c2b9998c07a683ff479ff.zip | |
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.
| -rw-r--r-- | lisp/calc/calc-help.el | 22 | ||||
| -rw-r--r-- | lisp/info.el | 8 | ||||
| -rw-r--r-- | 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 17e5b0fdead..aace2a95585 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." | |||
| 365 | (let (Info-history) | 365 | (let (Info-history) |
| 366 | (Info-goto-node (buffer-substring (match-beginning 1) (match-end 1)))) | 366 | (Info-goto-node (buffer-substring (match-beginning 1) (match-end 1)))) |
| 367 | (or (let ((case-fold-search nil)) | 367 | (or (let ((case-fold-search nil)) |
| 368 | (or (re-search-forward (format "\\[`%s'\\]\\|(`%s')\\|\\<The[ \n]`%s'" | 368 | (or (re-search-forward |
| 369 | (or target (regexp-quote thing)) | 369 | (format "\\[[`‘]%s['’]\\]\\|([`‘]%s['’])\\|\\<The[ \n][`‘]%s['’]" |
| 370 | (or target (regexp-quote thing)) | 370 | (or target (regexp-quote thing)) |
| 371 | (or target (regexp-quote thing))) nil t) | 371 | (or target (regexp-quote thing)) |
| 372 | (or target (regexp-quote thing))) nil t) | ||
| 372 | (and not-quoted | 373 | (and not-quoted |
| 373 | (let ((case-fold-search t)) | 374 | (let ((case-fold-search t)) |
| 374 | (search-forward (or target thing) nil t))) | 375 | (search-forward (or target thing) nil t))) |
| 375 | (search-forward (format "`%s'" (or target thing)) nil t) | 376 | (search-forward (format "[`‘]%s['’]" (or target thing)) nil t) |
| 376 | (search-forward (or target thing) nil t))) | 377 | (search-forward (or target thing) nil t))) |
| 377 | (let ((case-fold-search t)) | 378 | (let ((case-fold-search t)) |
| 378 | (or (re-search-forward (format "\\[`%s'\\]\\|(`%s')\\|\\<The[ \n]`%s'" | 379 | (or (re-search-forward |
| 379 | (or target (regexp-quote thing)) | 380 | (format "\\[[`‘]%s['’]\\]\\|([`‘]%s['’])\\|\\<The[ \n][`‘]%s['’]" |
| 380 | (or target (regexp-quote thing)) | 381 | (or target (regexp-quote thing)) |
| 381 | (or target (regexp-quote thing))) nil t) | 382 | (or target (regexp-quote thing)) |
| 382 | (search-forward (format "`%s'" (or target thing)) nil t) | 383 | (or target (regexp-quote thing))) nil t) |
| 384 | (search-forward (format "[`‘]%s['’]" (or target thing)) nil t) | ||
| 383 | (search-forward (or target thing) nil t)))) | 385 | (search-forward (or target thing) nil t)))) |
| 384 | (beginning-of-line) | 386 | (beginning-of-line) |
| 385 | (message "Found `%s' in %s" thing where))) | 387 | (message "Found `%s' in %s" thing where))) |
diff --git a/lisp/info.el b/lisp/info.el index d63581911c5..ab2497dbe16 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." | |||
| 3378 | (re-search-forward (format | 3378 | (re-search-forward (format |
| 3379 | "[a-zA-Z]+: [a-zA-Z0-9_ *&]+ %s\\( \\|$\\)" | 3379 | "[a-zA-Z]+: [a-zA-Z0-9_ *&]+ %s\\( \\|$\\)" |
| 3380 | (regexp-quote name)) nil t) | 3380 | (regexp-quote name)) nil t) |
| 3381 | (search-forward (format "`%s'" name) nil t) | 3381 | (search-forward (format "[`‘]%s['’]" name) nil t) |
| 3382 | (and (string-match "\\`.*\\( (.*)\\)\\'" name) | 3382 | (and (string-match "\\`.*\\( (.*)\\)\\'" name) |
| 3383 | (search-forward | 3383 | (search-forward |
| 3384 | (format "`%s'" (substring name 0 (match-beginning 1))) | 3384 | (format "[`‘]%s['’]" (substring name 0 (match-beginning 1))) |
| 3385 | nil t)) | 3385 | nil t)) |
| 3386 | (search-forward name nil t) | 3386 | (search-forward name nil t) |
| 3387 | ;; Try again without the " <1>" makeinfo can append | 3387 | ;; Try again without the " <1>" makeinfo can append |
| @@ -3894,7 +3894,7 @@ If FORK is non-nil, it is passed to `Info-goto-node'." | |||
| 3894 | (let (node) | 3894 | (let (node) |
| 3895 | (cond | 3895 | (cond |
| 3896 | ((setq node (Info-get-token (point) "[hf]t?tps?://" | 3896 | ((setq node (Info-get-token (point) "[hf]t?tps?://" |
| 3897 | "\\([hf]t?tps?://[^ \t\n\"`({<>})']+\\)")) | 3897 | "\\([hf]t?tps?://[^ \t\n\"`‘({<>})’']+\\)")) |
| 3898 | (browse-url node) | 3898 | (browse-url node) |
| 3899 | (setq node t)) | 3899 | (setq node t)) |
| 3900 | ((setq node (Info-get-token (point) "\\*note[ \n\t]+" | 3900 | ((setq node (Info-get-token (point) "\\*note[ \n\t]+" |
| @@ -4979,7 +4979,7 @@ first line or header line, and for breadcrumb links.") | |||
| 4979 | ;; Fontify http and ftp references | 4979 | ;; Fontify http and ftp references |
| 4980 | (goto-char (point-min)) | 4980 | (goto-char (point-min)) |
| 4981 | (when not-fontified-p | 4981 | (when not-fontified-p |
| 4982 | (while (re-search-forward "\\(https?\\|ftp\\)://[^ \t\n\"`({<>})']+" | 4982 | (while (re-search-forward "\\(https?\\|ftp\\)://[^ \t\n\"`‘({<>})’']+" |
| 4983 | nil t) | 4983 | nil t) |
| 4984 | (add-text-properties (match-beginning 0) (match-end 0) | 4984 | (add-text-properties (match-beginning 0) (match-end 0) |
| 4985 | '(font-lock-face info-xref | 4985 | '(font-lock-face info-xref |
diff --git a/lisp/vc/ediff-help.el b/lisp/vc/ediff-help.el index c981d89f50a..67acc6663a3 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 | |||
| 195 | (ediff-documentation "Quick Help Commands") | 195 | (ediff-documentation "Quick Help Commands") |
| 196 | 196 | ||
| 197 | (let (case-fold-search) | 197 | (let (case-fold-search) |
| 198 | (cond ((string= cmd "?") (re-search-forward "^`\\?'")) | 198 | (cond ((string= cmd "?") (re-search-forward "^[`‘]\\?['’]")) |
| 199 | ((string= cmd "G") (re-search-forward "^`G'")) | 199 | ((string= cmd "G") (re-search-forward "^[`‘]G['’]")) |
| 200 | ((string= cmd "E") (re-search-forward "^`E'")) | 200 | ((string= cmd "E") (re-search-forward "^[`‘]E['’]")) |
| 201 | ((string= cmd "wd") (re-search-forward "^`wd'")) | 201 | ((string= cmd "wd") (re-search-forward "^[`‘]wd['’]")) |
| 202 | ((string= cmd "wx") (re-search-forward "^`wa'")) | 202 | ((string= cmd "wx") (re-search-forward "^[`‘]wa['’]")) |
| 203 | ((string= cmd "a/b") (re-search-forward "^`a'")) | 203 | ((string= cmd "a/b") (re-search-forward "^[`‘]a['’]")) |
| 204 | ((string= cmd "x") (re-search-forward "^`a'")) | 204 | ((string= cmd "x") (re-search-forward "^[`‘]a['’]")) |
| 205 | ((string= cmd "xy") (re-search-forward "^`ab'")) | 205 | ((string= cmd "xy") (re-search-forward "^[`‘]ab['’]")) |
| 206 | ((string= cmd "p,DEL") (re-search-forward "^`p'")) | 206 | ((string= cmd "p,DEL") (re-search-forward "^[`‘]p['’]")) |
| 207 | ((string= cmd "n,SPC") (re-search-forward "^`n'")) | 207 | ((string= cmd "n,SPC") (re-search-forward "^[`‘]n['’]")) |
| 208 | ((string= cmd "j") (re-search-forward "^`j'")) | 208 | ((string= cmd "j") (re-search-forward "^[`‘]j['’]")) |
| 209 | ((string= cmd "gx") (re-search-forward "^`ga'")) | 209 | ((string= cmd "gx") (re-search-forward "^[`‘]ga['’]")) |
| 210 | ((string= cmd "!") (re-search-forward "^`!'")) | 210 | ((string= cmd "!") (re-search-forward "^[`‘]!['’]")) |
| 211 | ((string= cmd "*") (re-search-forward "^`\\*'")) | 211 | ((string= cmd "*") (re-search-forward "^[`‘]\\*['’]")) |
| 212 | ((string= cmd "m") (re-search-forward "^`m'")) | 212 | ((string= cmd "m") (re-search-forward "^[`‘]m['’]")) |
| 213 | ((string= cmd "|") (re-search-forward "^`|'")) | 213 | ((string= cmd "|") (re-search-forward "^[`‘]|['’]")) |
| 214 | ((string= cmd "@") (re-search-forward "^`@'")) | 214 | ((string= cmd "@") (re-search-forward "^[`‘]@['’]")) |
| 215 | ((string= cmd "h") (re-search-forward "^`h'")) | 215 | ((string= cmd "h") (re-search-forward "^[`‘]h['’]")) |
| 216 | ((string= cmd "r") (re-search-forward "^`r'")) | 216 | ((string= cmd "r") (re-search-forward "^[`‘]r['’]")) |
| 217 | ((string= cmd "rx") (re-search-forward "^`ra'")) | 217 | ((string= cmd "rx") (re-search-forward "^[`‘]ra['’]")) |
| 218 | ((string= cmd "##") (re-search-forward "^`##'")) | 218 | ((string= cmd "##") (re-search-forward "^[`‘]##['’]")) |
| 219 | ((string= cmd "#c") (re-search-forward "^`#c'")) | 219 | ((string= cmd "#c") (re-search-forward "^[`‘]#c['’]")) |
| 220 | ((string= cmd "#f/#h") (re-search-forward "^`#f'")) | 220 | ((string= cmd "#f/#h") (re-search-forward "^[`‘]#f['’]")) |
| 221 | ((string= cmd "X") (re-search-forward "^`A'")) | 221 | ((string= cmd "X") (re-search-forward "^[`‘]A['’]")) |
| 222 | ((string= cmd "v/V") (re-search-forward "^`v'")) | 222 | ((string= cmd "v/V") (re-search-forward "^[`‘]v['’]")) |
| 223 | ((string= cmd "</>") (re-search-forward "^`<'")) | 223 | ((string= cmd "</>") (re-search-forward "^[`‘]<['’]")) |
| 224 | ((string= cmd "~") (re-search-forward "^`~'")) | 224 | ((string= cmd "~") (re-search-forward "^[`‘]~['’]")) |
| 225 | ((string= cmd "i") (re-search-forward "^`i'")) | 225 | ((string= cmd "i") (re-search-forward "^[`‘]i['’]")) |
| 226 | ((string= cmd "D") (re-search-forward "^`D'")) | 226 | ((string= cmd "D") (re-search-forward "^[`‘]D['’]")) |
| 227 | ((string= cmd "R") (re-search-forward "^`R'")) | 227 | ((string= cmd "R") (re-search-forward "^[`‘]R['’]")) |
| 228 | ((string= cmd "M") (re-search-forward "^`M'")) | 228 | ((string= cmd "M") (re-search-forward "^[`‘]M['’]")) |
| 229 | ((string= cmd "z/q") (re-search-forward "^`z'")) | 229 | ((string= cmd "z/q") (re-search-forward "^[`‘]z['’]")) |
| 230 | ((string= cmd "%") (re-search-forward "^`%'")) | 230 | ((string= cmd "%") (re-search-forward "^[`‘]%['’]")) |
| 231 | ((string= cmd "C-l") (re-search-forward "^`C-l'")) | 231 | ((string= cmd "C-l") (re-search-forward "^[`‘]C-l['’]")) |
| 232 | ((string= cmd "$$") (re-search-forward "^`\\$\\$'")) | 232 | ((string= cmd "$$") (re-search-forward "^[`‘]\\$\\$['’]")) |
| 233 | ((string= cmd "$*") (re-search-forward "^`\\$\\*'")) | 233 | ((string= cmd "$*") (re-search-forward "^[`‘]\\$\\*['’]")) |
| 234 | ((string= cmd "/") (re-search-forward "^`/'")) | 234 | ((string= cmd "/") (re-search-forward "^[`‘]/['’]")) |
| 235 | ((string= cmd "&") (re-search-forward "^`&'")) | 235 | ((string= cmd "&") (re-search-forward "^[`‘]&['’]")) |
| 236 | ((string= cmd "s") (re-search-forward "^`s'")) | 236 | ((string= cmd "s") (re-search-forward "^[`‘]s['’]")) |
| 237 | ((string= cmd "+") (re-search-forward "^`\\+'")) | 237 | ((string= cmd "+") (re-search-forward "^[`‘]\\+['’]")) |
| 238 | ((string= cmd "=") (re-search-forward "^`='")) | 238 | ((string= cmd "=") (re-search-forward "^[`‘]=['’]")) |
| 239 | (t (error "Undocumented command! Type `G' in Ediff Control Panel to drop a note to the Ediff maintainer"))) | 239 | (t (error "Undocumented command! Type `G' in Ediff Control Panel to drop a note to the Ediff maintainer"))) |
| 240 | ) ; let case-fold-search | 240 | ) ; let case-fold-search |
| 241 | )) | 241 | )) |