]> git.eshelyaron.com Git - emacs.git/commitdiff
Support quotes 'like this' in info files
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 3 Jun 2015 05:50:57 +0000 (22:50 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 3 Jun 2015 05:52:44 +0000 (22:52 -0700)
This is possible when 'makeinfo --disable-encoding' is used
in Texinfo 5.
* lisp/calc/calc-help.el (calc-describe-thing):
* lisp/gnus/gnus-art.el (gnus-button-alist):
* lisp/info.el (Info-find-index-name):
* lisp/vc/ediff-help.el (ediff-help-for-quick-help):
Also support quotes 'like this'.
* lisp/calc/calc-help.el (calc-describe-thing): Simplify.
* lisp/finder.el (finder-font-lock-keywords): Remove var that
hasn't been used in years, instead of bothering to fix its quoting.

lisp/calc/calc-help.el
lisp/finder.el
lisp/gnus/gnus-art.el
lisp/info.el
lisp/vc/ediff-help.el

index aace2a95585fa97ece78c0d5bbe665d4187af9a9..b2e7df1b7183614ed5faae1c4f9a5dde02984213 100644 (file)
@@ -364,25 +364,21 @@ C-w  Describe how there is no warranty for Calc."
          (error "Can't find `%s' in %s" thing where)))
     (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)
-             (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 (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)
-             (search-forward (or target thing) nil t))))
+    (let* ((string-target (or target thing))
+           (quoted (format "['`‘]%s['’]" (regexp-quote string-target)))
+           (bracketed (format "\\[%s\\]\\|(%s)\\|\\<The[ \n]%s"
+                              quoted quoted quoted)))
+      (or (let ((case-fold-search nil))
+            (or (re-search-forward bracketed nil t)
+                (and not-quoted
+                     (let ((case-fold-search t))
+                       (search-forward string-target nil t)))
+                (re-search-forward quoted nil t)
+                (search-forward string-target nil t)))
+          (let ((case-fold-search t))
+            (or (re-search-forward bracketed nil t)
+                (re-search-forward quoted nil t)
+                (search-forward string-target nil t)))))
     (beginning-of-line)
     (message "Found `%s' in %s" thing where)))
 
index 306f2e27d57b7150d624377d18bcb13259a44985..1ab59f175b826621c304c2d43b314e67385a72cd 100644 (file)
@@ -114,10 +114,6 @@ Each element has the form (KEYWORD . DESCRIPTION).")
     st)
   "Syntax table used while in `finder-mode'.")
 
-(defvar finder-font-lock-keywords
-  '(("[`‘]\\([^'`‘’]+\\)['’]" 1 font-lock-constant-face prepend))
-  "Font-lock keywords for Finder mode.")
-
 (defvar finder-headmark nil
   "Internal Finder mode variable, local in Finder buffer.")
 
index 0ac9fb5b4de3b30ad23acb0944ab40983960bd8e..d83eaddf16535d7985b91a3c663a2fbda0bd53b9 100644 (file)
@@ -7827,11 +7827,11 @@ positives are possible."
     ("/\\([a-z][-a-z0-9]+\\.el\\)\\>[^.?]"
      ;; Exclude [.?] for URLs in gmane.emacs.cvs
      1 (>= gnus-button-emacs-level 8) gnus-button-handle-library 1)
-    ("[`‘]\\([a-z][-a-z0-9]+\\.el\\)['’]"
+    ("['`‘]\\([a-z][-a-z0-9]+\\.el\\)['’]"
      1 (>= gnus-button-emacs-level 8) gnus-button-handle-library 1)
-    ("[`‘]\\([a-z][a-z0-9]+-[a-z0-9]+-[-a-z0-9]*[a-z]\\|\\(gnus\\|message\\)-[-a-z]+\\)['’]"
+    ("['`‘]\\([a-z][a-z0-9]+-[a-z0-9]+-[-a-z0-9]*[a-z]\\|\\(gnus\\|message\\)-[-a-z]+\\)['’]"
      0 (>= gnus-button-emacs-level 8) gnus-button-handle-symbol 1)
-    ("[`‘]\\([a-z][a-z0-9]+-[a-z]+\\)['’]"
+    ("['`‘]\\([a-z][a-z0-9]+-[a-z]+\\)['’]"
      0 (>= gnus-button-emacs-level 9) gnus-button-handle-symbol 1)
     ("(setq[ \t\n]+\\([a-z][a-z0-9]+-[-a-z0-9]+\\)[ \t\n]+.+)"
      1 (>= gnus-button-emacs-level 7) gnus-button-handle-describe-variable 1)
@@ -7841,7 +7841,7 @@ positives are possible."
      0 (>= gnus-button-emacs-level 1) gnus-button-handle-describe-function 2)
     ("\\b\\(C-h\\|<?[Ff]1>?\\)[ \t\n]+v[ \t\n]+\\([^ \t\n]+\\)[ \t\n]+RET\\>"
      0 (>= gnus-button-emacs-level 1) gnus-button-handle-describe-variable 2)
-    ("[`‘]\\(\\(C-h\\|<?[Ff]1>?\\)[ \t\n]+k[ \t\n]+\\([^'’]+\\)\\)['’]"
+    ("['`‘]\\(\\(C-h\\|<?[Ff]1>?\\)[ \t\n]+k[ \t\n]+\\([^'’]+\\)\\)['’]"
      ;; Unlike the other regexps we really have to require quoting
      ;; here to determine where it ends.
      1 (>= gnus-button-emacs-level 1) gnus-button-handle-describe-key 3)
index 80428e700a0a051be395f2090124e5ea17494257..59ce465f5aa648143117226d5a5be619702f8f99 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
index 67acc6663a31feb81cf860cdc1a30fd6b2744c40..3d46869b2529141f5a08a74380aac5eac5a523e7 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
     ))