emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 8e06d22 1/2: Support quotes 'like this' in info fil


From: Paul Eggert
Subject: [Emacs-diffs] master 8e06d22 1/2: Support quotes 'like this' in info files
Date: Wed, 03 Jun 2015 05:52:49 +0000

branch: master
commit 8e06d22bb654c649da6f32bd235a84eb2f4d188d
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>

    Support quotes 'like this' in info files
    
    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 |   34 +++++++++-----------
 lisp/finder.el         |    4 --
 lisp/gnus/gnus-art.el  |    8 ++--
 lisp/info.el           |    4 +-
 lisp/vc/ediff-help.el  |   82 ++++++++++++++++++++++++------------------------
 5 files changed, 62 insertions(+), 70 deletions(-)

diff --git a/lisp/calc/calc-help.el b/lisp/calc/calc-help.el
index aace2a9..b2e7df1 100644
--- a/lisp/calc/calc-help.el
+++ b/lisp/calc/calc-help.el
@@ -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)))
 
diff --git a/lisp/finder.el b/lisp/finder.el
index 306f2e2..1ab59f1 100644
--- a/lisp/finder.el
+++ b/lisp/finder.el
@@ -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.")
 
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index 0ac9fb5..d83eadd 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -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)
diff --git a/lisp/info.el b/lisp/info.el
index 80428e7..59ce465 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
diff --git a/lisp/vc/ediff-help.el b/lisp/vc/ediff-help.el
index 67acc66..3d46869 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 "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 "^[`‘]=['’]"))
+      (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
     ))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]