;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
+;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; An obvious case of a key substitution:
(save-excursion
(while (re-search-forward
- ;; Assume command name is only word characters
- ;; and dashes to get things like `use M-x foo.'.
- "\\<M-x\\s-+\\(\\sw\\(\\sw\\|-\\)+\\)" nil t)
+ ;; Assume command name is only word and symbol
+ ;; characters to get things like `use M-x foo->bar'.
+ ;; Command required to end with word constituent
+ ;; to avoid `.' at end of a sentence.
+ "\\<M-x\\s-+\\(\\sw\\(\\sw\\|\\s_\\)*\\sw\\)" nil t)
(let ((sym (intern-soft (match-string 1))))
(if (fboundp sym)
(help-xref-button 1 'help-function sym)))))
(end-of-line)
(skip-chars-backward "^ \t\n")
(if (and (>= (current-column) col)
- (looking-at "\\(\\sw\\|-\\)+$"))
+ (looking-at "\\(\\sw\\|\\s_\\)+$"))
(let ((sym (intern-soft (match-string 0))))
(if (fboundp sym)
(help-xref-button 0 'help-function sym))))