269 |
(defun help-do-arg-highlight (doc args) |
(defun help-do-arg-highlight (doc args) |
270 |
(with-syntax-table (make-syntax-table emacs-lisp-mode-syntax-table) |
(with-syntax-table (make-syntax-table emacs-lisp-mode-syntax-table) |
271 |
(modify-syntax-entry ?\- "w") |
(modify-syntax-entry ?\- "w") |
272 |
(while args |
(dolist (arg args doc) |
273 |
(let ((arg (prog1 (car args) (setq args (cdr args))))) |
(setq doc (replace-regexp-in-string |
274 |
(setq doc (replace-regexp-in-string |
;; This is heuristic, but covers all common cases |
275 |
;; This is heuristic, but covers all common cases |
;; except ARG1-ARG2 |
276 |
;; except ARG1-ARG2 |
(concat "\\<" ; beginning of word |
277 |
(concat "\\<" ; beginning of word |
"\\(?:[a-z-]*-\\)?" ; for xxx-ARG |
278 |
"\\(?:[a-z-]*-\\)?" ; for xxx-ARG |
"\\(" |
279 |
"\\(" |
(regexp-quote arg) |
280 |
(regexp-quote arg) |
"\\)" |
281 |
"\\)" |
"\\(?:es\\|s\\|th\\)?" ; for ARGth, ARGs |
282 |
"\\(?:es\\|s\\|th\\)?" ; for ARGth, ARGs |
"\\(?:-[a-z0-9-]+\\)?" ; for ARG-xxx, ARG-n |
283 |
"\\(?:-[a-z-]+\\)?" ; for ARG-xxx |
"\\>") ; end of word |
284 |
"\\>") ; end of word |
(help-default-arg-highlight arg) |
285 |
(help-default-arg-highlight arg) |
doc t t 1))))) |
|
doc t t 1)))) |
|
|
doc)) |
|
286 |
|
|
287 |
(defun help-highlight-arguments (usage doc &rest args) |
(defun help-highlight-arguments (usage doc &rest args) |
288 |
(when usage |
(when usage |
710 |
(dotimes (i 95) |
(dotimes (i 95) |
711 |
(let ((elt (aref docs i))) |
(let ((elt (aref docs i))) |
712 |
(when elt |
(when elt |
713 |
(insert (+ i ?\ ) ": " elt "\n")))) |
(insert (+ i ?\s) ": " elt "\n")))) |
714 |
(while (setq table (char-table-parent table)) |
(while (setq table (char-table-parent table)) |
715 |
(insert "\nThe parent category table is:") |
(insert "\nThe parent category table is:") |
716 |
(describe-vector table 'help-describe-category-set)))))))) |
(describe-vector table 'help-describe-category-set)))))))) |