]> git.eshelyaron.com Git - emacs.git/commitdiff
Handle curved quotes in info files
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 26 May 2015 19:29:38 +0000 (12:29 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 26 May 2015 19:30:27 +0000 (12:30 -0700)
* 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
lisp/info.el
lisp/vc/ediff-help.el

index 17e5b0fdead17e90373221c8cfd8ad05d33fac24..aace2a95585fa97ece78c0d5bbe665d4187af9a9 100644 (file)
@@ -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)))
index d63581911c55e8b3e543301434dd0df0aeceed31..ab2497dbe1644ce1cd3317e7ca5a5fe648ae89ec 100644 (file)
@@ -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
index c981d89f50a465dfcb19a86cdd84b9d524490779..67acc6663a31feb81cf860cdc1a30fd6b2744c40 100644 (file)
@@ -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
     ))