summaryrefslogtreecommitdiff
path: root/lisp/progmodes/ruby-mode.el
diff options
context:
space:
mode:
authorDmitry Gutov <dgutov@yandex.ru>2021-03-02 15:16:34 +0200
committerDmitry Gutov <dgutov@yandex.ru>2021-03-02 15:16:34 +0200
commit6dee194535b4841714a33bb888bb94da6e1e9b1c (patch)
treeceedd4779259c0d51024e670999bcfbe44e3ce7a /lisp/progmodes/ruby-mode.el
parent2b069c67d7410703898dfab8b337359322fcf123 (diff)
downloademacs-6dee194535b4841714a33bb888bb94da6e1e9b1c.tar.gz
(ruby-find-library-file): Also recognize 'gem' statements
* lisp/progmodes/ruby-mode.el (ruby-find-library-file): Also recognize 'gem' statements.
Diffstat (limited to 'lisp/progmodes/ruby-mode.el')
-rw-r--r--lisp/progmodes/ruby-mode.el4
1 files changed, 2 insertions, 2 deletions
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index e7f407b6367..3f8afd97050 100644
--- a/lisp/progmodes/ruby-mode.el
+++ b/lisp/progmodes/ruby-mode.el
@@ -1802,12 +1802,12 @@ FEATURE-NAME is a relative file name, file extension is optional.
This commands delegates to `gem which', which searches both
installed gems and the standard library. When called
interactively, defaults to the feature name in the `require'
-statement around point."
+or `gem' statement around point."
(interactive)
(unless feature-name
(let ((init (save-excursion
(forward-line 0)
- (when (looking-at "require [\"']\\(.*\\)[\"']")
+ (when (looking-at "\\(?:require\\| *gem\\) [\"']\\(.*?\\)[\"']")
(match-string 1)))))
(setq feature-name (read-string "Feature name: " init))))
(let ((out