Commit 8e06d22b authored by Paul Eggert's avatar Paul Eggert
Browse files

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.
parent f2211e51
......@@ -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)))
......
......@@ -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.")
......
......@@ -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)
......
......@@ -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
......
......@@ -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
))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment