From: Reiner Steib Date: Sun, 16 Mar 2008 15:45:42 +0000 (+0000) Subject: (gnus-button-alist): Extend gnus-button-handle-info-keystrokes entry. X-Git-Url: http://cgit.sxemacs.org/?a=commitdiff_plain;h=67035f6fe0785884c237bd4500ea94f5ebbd4218;p=gnus (gnus-button-alist): Extend gnus-button-handle-info-keystrokes entry. (gnus-button-handle-info-keystrokes): Handle index entries. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index cb84b7b56..f0a7619de 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -3,6 +3,8 @@ * gnus-art.el (gnus-article-browse-html-article): Fix type in doc string. (gnus-button-url-regexp): Improve handling of parenthesis. + (gnus-button-alist): Extend gnus-button-handle-info-keystrokes entry. + (gnus-button-handle-info-keystrokes): Handle index entries. 2008-03-14 Katsumi Yamaoka diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el index 30e84cf77..04b28b6be 100644 --- a/lisp/gnus-art.el +++ b/lisp/gnus-art.el @@ -7345,9 +7345,9 @@ positives are possible." 1 (>= gnus-button-emacs-level 1) gnus-button-handle-info-url-kde 2) ("\\((Info-goto-node\\|(info\\)[ \t\n]*\\(\"[^\"]*\"\\))" 0 (>= gnus-button-emacs-level 1) gnus-button-handle-info-url 2) - ("\\b\\(C-h\\|?\\)[ \t\n]+i[ \t\n]+d?[ \t\n]?m[ \t\n]+\\([^ ]+ ?[^ ]+\\)[ \t\n]+RET" - ;; Info links like `C-h i d m CC Mode RET' - 0 (>= gnus-button-emacs-level 1) gnus-button-handle-info-keystrokes 2) + ("\\b\\(C-h\\|?\\)[ \t\n]+i[ \t\n]+d?[ \t\n]?m[ \t\n]+[^ ]+ ?[^ ]+[ \t\n]+RET\\([ \t\n]+i[ \t\n]+[^ ]+ ?[^ ]+[ \t\n]+RET\\([ \t\n,]*\\)\\)?" + ;; Info links like `C-h i d m Gnus RET' or `C-h i d m Gnus RET i partial RET' + 0 (>= gnus-button-emacs-level 1) gnus-button-handle-info-keystrokes 0) ;; This is custom ("M-x[ \t\n]\\(customize-[^ ]+\\)[ \t\n]RET[ \t\n]\\([^ ]+\\)[ \t\n]RET" 0 (>= gnus-button-emacs-level 1) gnus-button-handle-custom 1 2) @@ -7896,10 +7896,33 @@ url is put as the `gnus-button-url' overlay property on the button." (defun gnus-button-handle-info-keystrokes (url) "Call `info' when pushing the corresponding URL button." - ;; For links like `C-h i d m gnus RET', `C-h i d m CC Mode RET'. - (info) - (Info-directory) - (Info-menu url)) + ;; For links like `C-h i d m gnus RET part RET , ,', `C-h i d m CC Mode RET'. + (let (node indx comma) + (if (string-match + (concat "\\b\\(C-h\\|?\\)[ \t\n]+i[ \t\n]+d?[ \t\n]?m[ \t\n]+" + "\\([^ ]+ ?[^ ]+\\)[ \t\n]+RET" + "\\([ \t\n]+i[ \t\n]+[^ ]+ ?[^ ]+[ \t\n]+RET" + "\\(?:[ \t\n,]*\\)\\)?") + url) + (setq node (match-string 2 url) + indx (match-string 3 url)) + (error "Can't parse %s" url)) + (info) + (Info-directory) + (Info-menu node) + (when (> (length indx) 0) + (string-match (concat "[ \t\n]+i[ \t\n]+\\([^ ]+ ?[^ ]+\\)[ \t\n]+RET" + "\\([ \t\n,]*\\)") + indx) + (setq comma (match-string 2 indx)) + (setq indx (match-string 1 indx)) + (Info-index indx) + (when comma + (dotimes (i (with-temp-buffer + (insert comma) + (how-many "," (point-min) (point-max)))) + (Info-index-next 1))) + nil))) ;; Called after pgg-snarf-keys-region, which autoloads pgg.el. (declare-function pgg-display-output-buffer "pgg" (start end status))