Skip to content

Commit 99151be

Browse files
committed
my-loccur-menu.el: New
1 parent 6d68a59 commit 99151be

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

my-loccur-menu.el

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
(require 'loccur)
2+
3+
(with-eval-after-load 'loccur
4+
;; defines shortcut for loccur of the current word
5+
(define-key global-map [(control o)] 'loccur-current)
6+
;; defines shortcut for the interactive loccur command
7+
(define-key global-map [(control meta o)] 'loccur)
8+
;; defines shortcut for the loccur of the previously found word
9+
(define-key global-map [(control shift o)] 'loccur-previous-match)
10+
11+
(define-key-after global-map
12+
[menu-bar extra-tools]
13+
(cons "Extra Tools"
14+
(easy-menu-create-menu "Extra Tools" nil))
15+
'tools)
16+
17+
(easy-menu-define my-loccur-menu nil "Menu for Loccur."
18+
'("Loccur" :visible (featurep 'loccur)
19+
["Loccur Current Word" loccur-current :help "Call `loccur' for the current word."]
20+
"--"
21+
["Loccur" loccur :help "Perform a simple grep in current buffer.\n\nThis command hides all lines from the current buffer except those\ncontaining the regular expression REGEX. A second call of the function\nunhides lines again.\n\nWhen called interactively, either prompts the user for REGEXP or,\nwhen called with an active region, uses the content of the\nregion.\n\n(fn REGEX)"]
22+
["Loccur, but Don't Highlight" loccur-no-highlight :help "Perform search like loccur, but temporary removing match highlight.\nREGEX is regexp to search\n\n(fn REGEX)"]
23+
"--"
24+
["Loccur Previous Match" loccur-previous-match :help "Call `loccur' for the previously found word."]
25+
"--"
26+
["Highlight Matches" loccur-toggle-highlight :style toggle :selected loccur-highlight-matching-regexp :help "Toggle the highlighting of the match."]
27+
;; ["Loccur Mode" loccur-mode :style toggle :selected loccur-mode :help "Minor mode for navigating through the file.\nHides all lines without matches like `occur' does, but without opening\na new window.\n\n(fn &optional ARG)"]
28+
))
29+
30+
(easy-menu-add-item (current-global-map) '("menu-bar" "extra-tools") my-loccur-menu))
31+
32+
(provide 'my-loccur-menu)

0 commit comments

Comments
 (0)