wolray / symbol-overlay Goto Github PK
View Code? Open in Web Editor NEWHighlight symbols with keymap-enabled overlays
Highlight symbols with keymap-enabled overlays
如何在c中高亮 use-modules
Some advice here, you can put the change log into ChangeLog file ; )
In Emacs, press C-x 4 a
.
test*t?
in scratch buffersymbol-overlay-put
and symbol-overlay-rename
test*t?
but get test\*t\?
Plugin ver: ff16ccf
Emacs ver: 26
I think your README would benefit from a screenshot and a use case description.
The messages buffer gets flooded with every symbol navigation step.
defun: 1/42 <-- jump-first
defun: 42/42 <-- jump-last
interactive: 17/17 <-- switch-forward
defun: 42/42 <-- switch- backward
defun: 41/42 <-- jump-prev
defun: 40/42
defun: 39/42
defun: 38/42
defun: 37/42
defun: 36/42
defun: 37/42 <-- jump-next
defun: 38/42
defun: 39/42
defun: 40/42
This can be prevented by wrapping (let (message-log-max nil) BODY)
around the navigation code. Then the messages only appear in the minibuffer, but they won't be written to the messages buffer.
It might be enough to just wrap these commands:
symbol-overlay-jump-next, ..-prev, ..-first, ..-last
symbol-overlay-switch-forward, ..-backward
symbol-overlay.el
;; Version: 4.1
;; Package-Version: 20190305.1643
GNU Emacs 26.2 (build 1, x86_64-w64-mingw32) of 2019-04-13
Windows 10 Version 1803
I am happy with symbol-overlay
and hl-todo. But hl-todo
uses font-lock
while not overlay
, so it is slow. Can you please integrate these functionalities into symbol-overlay
? I think only highlight the keywords in comments for prog-mode
, and all for text-mode
. Thank you!
when I opened multiple buffers side by side, it would be helpful to highlight all the symbols across these buffers.
Hi, thanks for this great package! Using iedit
and multiple-cursor
you can toggle hiding unmatched lines which is sometimes useful to get an overview of all matches without having to navigate through the symbols. If you are interested I could try to implement it.
I get the following error in a python buffer:
Error running timer ‘symbol-overlay-maybe-put-temp’: (wrong-type-argument stringp python-font-lock-keywords-level-1)
Running latest symbol-overlay
on Emacs master.
I think this line is not correct anymore for the latest python-mode.
Hi, I love this amazing package and I'm enjoying!
I have two requirements. Can you think about them?
(defun symbol-overlay-switch-first ()
(interactive)
(let* ((symbol (symbol-overlay-get-symbol))
(keyword (symbol-overlay-assoc symbol))
(a-symbol (car keyword))
(before (symbol-overlay-get-list a-symbol 'car))
(count (length before)))
(symbol-overlay-jump-call 'symbol-overlay-basic-jump (- count))))
(defun symbol-overlay-switch-last ()
(interactive)
(let* ((symbol (symbol-overlay-get-symbol))
(keyword (symbol-overlay-assoc symbol))
(a-symbol (car keyword))
(after (symbol-overlay-get-list a-symbol 'cdr))
(count (length after)))
(symbol-overlay-jump-call 'symbol-overlay-basic-jump (- count 1))))
I bind to <
and >
in symbol-overlay-map
.
I can make a PR if you agree.
h
.BTW: doom-modeline
supports symbol-overlay
. Refer to https://emacs-china.org/t/package-symbol-overlay-symbol/7706/18?u=seagle0128.
I think the highlight-symbol is able to highlight the current symbol under point.
Would be great to have the same functionality for symbol-overlay!
Thanks.
不能像C-s一样展开折叠项
I'm using (trying out) eglot
with python-mode
and it highlights the symbol-at-point
with an overlay. I used symbol-overlay-put
and other occurrences of the symbol highlighted (more clearly), but the keymap symbol-overlay
installs didn't work. If I typed n
the character was just inserted (eglot's overlay had a modification-hooks
property if that matters), it didn't run symbol-overlay-jump-next
.
I assumed it was because of conflicting overlays and added a 'priority 100 to the symbol-overlay
overlay and it worked great. I don't know as there's a good solution (there was also a flymake
overlay at point) but I think it would help if symbol-overlay
included a priority in the overlays it uses and gives the user a symbol-overlay-priority
user option to customize. That way we could resolve whatever conflicts we come across.
Assuming symbol-overlay is installed:
emacs -Q --eval "(progn (package-initialize) (c++-mode) (insert \"return return\") (symbol-overlay-mode))"
(Emacs window should appear with scratch buffer with return return
text).return
wordBoth return
s gets highlighted
Nothing happens.
Emacs version 27.0.50, built from git
symbol-overlay version 20190305.1643
from elpa.
upd: simplified steps.
I think it would be better if the symbol-overlay-put command can be case insensitive.
hi, thanks for this package!
idea:
it would be nice if the automatic temporary overlays would support a blacklist, to avoid highlighting common symbols such as if
and for
in programming languages which basically cause the screen to flicker in most cases. :)
According to the docstring of after-change-functions
,
If an unhandled error happens in running these functions,
the variable’s value remains nil. That prevents the error
from happening repeatedly and making Emacs nonfunctional.
symbol-overlay/symbol-overlay.el
Line 426 in e40a7c4
see #18
I've found it confusing that symbol-overlay-mode
doesn't highlight the symbol if the other occurrences aren't visible.
This was a feature I loved with highlight-symbol-mode
-- I could see if a function was used by just by putting point on it.
Is this intentional, or can it be configured? I can see a mention of this behaviour in the docstring of symbol-overlay-maybe-put-temp
.
Please create a release tag. That would make this package available to users of Melpa Stable.
我的配置
(use-package symbol-overlay
:defer t
:config
(symbol-overlay-mode +1)
(global-set-key (kbd "M-i") #'symbol-overlay-put)
)
复现:
emacs -Q
(add-to-list 'load-path "/Users/lukertty/.emacs.d/elpa-25.2.1/symbol-overlay-20170604.2240")
(require 'symbol-overlay)
(symbol-overlay-mode +1)
M-x eval-buffer
结果:
不是所有的symbol 都高亮,比如
with-current-buffer
compilation-scroll-output
point-max
page-break-lines-mode
"127.0.0.1"
等symbol 并没有高亮
When point is on an active/overlaid word, pressing s
invokes symbol-overlay-isearch-literally
(and that's not ideal for some of us). If you use ivy/swiper-isearch (or maybe helm) instead of isearch, you're stuck in an awkward isearch.
It'd be nicer if instead pressing s
would invoke a configurable searcher.
I use symbol-overlay-rename
infrequently and when I do it prompts me with "Rename:" and the current name of the symbol. I'm never sure if behaves like replace-string
and I'm supposed to first enter the current name and then it will prompt me for the new name; or if I'm just supposed to enter the new name. Adding " to" to the prompt would make this clear.
Symbol-overlay-mode will cause Emacs to freeze with haskell-mode enabled,I am not sure it is cause by haskell-mode
or symbol-overlay
.
Steps to reproduce the issue:
.emacs.d
file with another name.emacs
file in the current user's HOME
directory (for example, my HOME
is the C:\Users\Aqua
directory), and copy the following code to the .emacs
file.(require 'package)
(add-to-list 'package-archives '( "melpa" . "https://melpa.org/packages/") t)
(package-initialize)
(require 'symbol-overlay)
(global-set-key (kbd "M-i") 'symbol-overlay-put)
(global-set-key (kbd "M-n") 'symbol-overlay-switch-forward)
(global-set-key (kbd "M-p") 'symbol-overlay-switch-backward)
(global-set-key (kbd "<f7>") 'symbol-overlay-mode)
(global-set-key (kbd "<f8>") 'symbol-overlay-remove-all)
(require 'haskell-mode)
(add-hook 'haskell-mode-hook 'interactive-haskell-mode)
haskell-mode
and symbol-overlay
M-x package-refresh-contents
M-x package-install RET haskell-mode
M-x package-install RET symbol-overlay
Restart Emacs, now it can start normally.
C-x, C-f
Create a test.hs
file in any directory, press to turn on symbol-overlay-mode. Enter the following content from the beginning in the empty test.hs
file.
triples = [(a,b,c) | c <- [1..10], a <- [1..c], b <- [1..a]]
When I input the third 1
, and then input a space
or .
It will be stuck (as shown in the figure below, the cursor now is at the position indicated by the red arrow).
press C-g
can go back to normal , and get error from Messages :
Symbol-Overlay mode enabled in current buffer
Error during redisplay: (internal--syntax-propertize 44) signaled (quit)
Error during redisplay: (internal--syntax-propertize 57) signaled (quit)
1
, and delete ..c
, and input ..c
again.Tested on:
Emacs 28.0.50 native compile and Emacs 27.2
OS: macOS Big Sur 11.5 and Windows 10
Would be nice if, eg, point is on foo
and symbol-overlay-put
is called and it's able to also match foo-bar
in same group.
Not sure if it's also useful to exclude a head/beginning boundary. Actually, it probably is for things like clojure keys that you want to match to a similarly named function. So :some-fn
is matched when point is on some-fn
.
Hi, I like the package, especially since highlight-symbol doesn't seem to be maintained anymore.
I always use highlight-symbol-mode
which is a minor mode that always
highlights automatically the symbol under the cursor.
Would be a nice feature for symbol-overlay as well.
Also how comes o and u are default bindings for next and prev?
Would have expected either n/p or maybe f/b.
Thanks :)
For what it's worth, I've been very happily using this transient for symbol-overlay for a while. It could be bound to any key but I have a super- key configured and am binding this to s-.
which I find nicely parallels M-.
.
(define-transient-command symbol-overlay-transient ()
"Symbol Overlay transient"
["Symbol Overlay"
["Overlays"
("." "Add/Remove at point" symbol-overlay-put)
("k" "Remove All" symbol-overlay-remove-all)
]
["Move to Symbol"
("n" "Next" symbol-overlay-switch-forward)
("p" "Previous" symbol-overlay-switch-backward)
]
["Other"
("m" "Highlight symbol-at-point" symbol-overlay-mode)
]
]
)
(global-set-key (kbd "s-.") 'symbol-overlay-transient)
Mostly, these are just "coincidental", and don't need to be brought to the user's attention. Most major modes highlight string literals, so there should be some way to detect and avoid them.
Rather than hardcoding a ,color background and a black foreground, allow for customization of the overlay face.
The defaults might not look good in all themes, and might override decorations from other features, so please allow users to override the defaults.
I find myself using SOM so much that I often ask: what have I actually highlighted in this buffer?? Then I jump all around to inspect those important symbols. It'd be nice to just see a simple list (maybe in minibuffer).
Because usually the face 'region
is inherit from highlight
.
I think should change. Because when I want to region select a string, symbol-overlay auto highlight symbol will cover my region selection.
让他不仅搜索当前buffer
而是其他的buffer
比如
https://github.com/manateelazycat/color-rg
得到的buffer
The behavior of symbol-overlay is not right in sh-mode.I cannot jump from a variable like "$sample" to "$sample/$somethingelse".
I've been trying symbol-overlay as an alternative to symbol-highlight, and it works really well. One feature I'm missing is the ability to go the first or last instance of a symbol in a buffer.
Would you be interested in a PR for this?
Highlight selection is also very common
It would be nice to have something like this
but a bit more generic so someone can write "modules" for different languages so it's not only js2-mode specific.
This should probably be an extra function, so someone could highlight all words anywhere
(via regex) like now or highlight only in the current scope.
Imho, it would be really useful for refactoring.
I see that it's quite different from what symbol-overlay internally does now,
you can close this issue if you feel this is out of the scope of this package.
Can we also add/edit overlay's help-echo property when highlight a symbol? This would be helpful when working on new code base.
Thanks
When I execute command symbol-overlay-put
command, get this error:
Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
symbol-overlay-count("\\_<report\\_>" "salmon")
symbol-overlay-put()
funcall-interactively(symbol-overlay-put)
call-interactively(symbol-overlay-put nil nil)
command-execute(symbol-overlay-put)
Hi,
first of all thanks for this package, one of the most used ones for me.
I updated it this morning, and in a Clojure buffer now I get this:
Debugger entered--Lisp error: (void-variable clojure-font-lock-extra-keywords)
(append clojure-font-lock-extra-keywords '("defn" "def" "let" "deftest" "is"))
(symbol-overlay-match-keyword-list symbol (append clojure-font-lock-extra-keywords '("defn" "def" "let" "deftest" "is")))
symbol-overlay-ignore-function-clojure(#("cases.details/get-details" 0 13 (face font-lock-type-face cider-locals ("woz-check-type" "previous-user-flow" "case-id" "request" "body" "ctx" "valuation-config" "woz-scraper" "db" "params" "case-details" "prev-input" "woz-year" "tax-year" "case-ref" "property-id") fontified t help-echo cider--help-echo) 13 25 (cider-locals ("woz-check-type" "previous-user-flow" "case-id" "request" "body" "ctx" "valuation-config" "woz-scraper" "db" "params" "case-details" "prev-input" "woz-year" "tax-year" "case-ref" "property-id") fontified t help-echo cider--help-echo)))
funcall(symbol-overlay-ignore-function-clojure #("cases.details/get-details" 0 13 (face font-lock-type-face cider-locals ("woz-check-type" "previous-user-flow" "case-id" "request" "body" "ctx" "valuation-config" "woz-scraper" "db" "params" "case-details" "prev-input" "woz-year" "tax-year" "case-ref" "property-id") fontified t help-echo cider--help-echo) 13 25 (cider-locals ("woz-check-type" "previous-user-flow" "case-id" "request" "body" "ctx" "valuation-config" "woz-scraper" "db" "params" "case-details" "prev-input" "woz-year" "tax-year" "case-ref" "property-id") fontified t help-echo cider--help-echo)))
(progn (funcall f symbol))
(if f (progn (funcall f symbol)))
(let ((f (cdr (assoc major-mode symbol-overlay-ignore-functions)))) (if f (progn (funcall f symbol))))
symbol-overlay-ignored-p(#("cases.details/get-details" 0 13 (face font-lock-type-face cider-locals ("woz-check-type" "previous-user-flow" "case-id" "request" "body" "ctx" "valuation-config" "woz-scraper" "db" "params" "case-details" "prev-input" "woz-year" "tax-year" "case-ref" "property-id") fontified t help-echo cider--help-echo) 13 25 (cider-locals ("woz-check-type" "previous-user-flow" "case-id" "request" "body" "ctx" "valuation-config" "woz-scraper" "db" "params" "case-details" "prev-input" "woz-year" "tax-year" "case-ref" "property-id") fontified t help-echo cider--help-echo)))
(not (symbol-overlay-ignored-p symbol))
(and symbol (not (symbol-overlay-assoc symbol)) (not (symbol-overlay-ignored-p symbol)))
(if (and symbol (not (symbol-overlay-assoc symbol)) (not (symbol-overlay-ignored-p symbol))) (progn (symbol-overlay-remove-temp) (save-excursion (save-restriction (symbol-overlay-narrow symbol-overlay-scope symbol-overlay-displayed-window) (goto-char (point-min)) (let ((re (symbol-overlay-regexp symbol))) (re-search-forward re nil t) (let ((save-match-data-internal ...)) (unwind-protect (progn ...) (set-match-data save-match-data-internal ...))) (if p (progn (symbol-overlay-put-one symbol) (setq symbol-overlay-temp-symbol symbol))))))))
(let* ((case-fold-search nil) (symbol (symbol-overlay-get-symbol t)) p) (if (and symbol (not (symbol-overlay-assoc symbol)) (not (symbol-overlay-ignored-p symbol))) (progn (symbol-overlay-remove-temp) (save-excursion (save-restriction (symbol-overlay-narrow symbol-overlay-scope symbol-overlay-displayed-window) (goto-char (point-min)) (let ((re ...)) (re-search-forward re nil t) (let (...) (unwind-protect ... ...)) (if p (progn ... ...))))))))
(progn (let* ((case-fold-search nil) (symbol (symbol-overlay-get-symbol t)) p) (if (and symbol (not (symbol-overlay-assoc symbol)) (not (symbol-overlay-ignored-p symbol))) (progn (symbol-overlay-remove-temp) (save-excursion (save-restriction (symbol-overlay-narrow symbol-overlay-scope symbol-overlay-displayed-window) (goto-char (point-min)) (let (...) (re-search-forward re nil t) (let ... ...) (if p ...))))))))
(if symbol-overlay-mode (progn (let* ((case-fold-search nil) (symbol (symbol-overlay-get-symbol t)) p) (if (and symbol (not (symbol-overlay-assoc symbol)) (not (symbol-overlay-ignored-p symbol))) (progn (symbol-overlay-remove-temp) (save-excursion (save-restriction (symbol-overlay-narrow symbol-overlay-scope symbol-overlay-displayed-window) (goto-char ...) (let ... ... ... ...))))))))
symbol-overlay-maybe-put-temp()
(save-current-buffer (set-buffer buf) (symbol-overlay-maybe-put-temp))
(progn (save-current-buffer (set-buffer buf) (symbol-overlay-maybe-put-temp)))
(if (and (buffer-live-p buf) (eq (window-buffer) buf)) (progn (save-current-buffer (set-buffer buf) (symbol-overlay-maybe-put-temp))))
symbol-overlay-idle-timer(#<buffer public_api.clj>)
apply(symbol-overlay-idle-timer #<buffer public_api.clj>)
timer-event-handler([t 0 0 500000 t symbol-overlay-idle-timer (#<buffer public_api.clj>) idle 0])
These are some extra details about my system to add more context:
GNU Emacs 28.0.50
➤ Master branch commit:
b215e83a784be1118bb5d729f17597c4f1c62b52
Improve support for the Cham script and languages
➤ Configured with the following options:
--with-harfbuzz
--with-json
--with-mailutils
➤ Configured with the following features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM
GSETTINGS GTK3 HARFBUZZ INOTIFY JPEG JSON LCMS2 LIBOTF LIBSELINUX
LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY PDUMPER PNG RSVG SOUND
THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XPM ZLIB
➤ Running on:
Ubuntu 20.04 LTS
GNOME Shell 3.36.4 (x11)
GTK+ Version 3.24.18, cairo version 1.16.0
Hello, first, thanks for this highlight package that uses overlays, and thus allows to highlight the line, while still being visible!!
Now, just played with it, and the M-n/p key bindings, with common words such as "in" and "if" in a buffer. It's weird, it's skipping some patterns.
(It's good that you can move from one highlight to the next highlighted occurrence, whichever the pattern -- very nice!)
Debugger entered--Lisp error: (args-out-of-range 1 226)
symbol-overlay-narrow(nil t)
symbol-overlay-maybe-put-temp()
apply(symbol-overlay-maybe-put-temp nil)
timer-event-handler([t 0 0 100000 t symbol-overlay-maybe-put-temp nil idle 0])
accept-process-output(#<process emacsql-sqlite> 30)
#f(compiled-function (connection &optional timeout) "Block until CONNECTION is waiting for further input." #<bytecode 0x1ffbed32b0d9>)(#<forge-database forge-database-1ffbee23a43c>)
apply(#f(compiled-function (connection &optional timeout) "Block until CONNECTION is waiting for further input." #<bytecode 0x1ffbed32b0d9>) #<forge-database forge-database-1ffbee23a43c> nil)
emacsql-wait(#<forge-database forge-database-1ffbee23a43c>)
#f(compiled-function (connection sql &rest args) "Send SQL s-expression to CONNECTION and return the results." #<bytecode 0x1ffbed32d8ed>)(#<forge-database forge-database-1ffbee23a43c> [:select * :from repository :where (and (= forge $s1) (= owner $s2) (= name $s3))] "github.com" "ztlevi" "python-test2")
apply(#f(compiled-function (connection sql &rest args) "Send SQL s-expression to CONNECTION and return the results." #<bytecode 0x1ffbed32d8ed>) (#<forge-database forge-database-1ffbee23a43c> [:select * :from repository :where (and (= forge $s1) (= owner $s2) (= name $s3))] "github.com" "ztlevi" "python-test2"))
#f(compiled-function (&rest cnm-args) #<bytecode 0x1ffbe0738bed>)(#<forge-database forge-database-1ffbee23a43c> [:select * :from repository :where (and (= forge $s1) (= owner $s2) (= name $s3))] "github.com" "ztlevi" "python-test2")
apply(#f(compiled-function (&rest cnm-args) #<bytecode 0x1ffbe0738bed>) #<forge-database forge-database-1ffbee23a43c> [:select * :from repository :where (and (= forge $s1) (= owner $s2) (= name $s3))] ("github.com" "ztlevi" "python-test2"))
#f(compiled-function (connection sql &rest args) #<bytecode 0x1ffbee2caea1>)(#f(compiled-function (&rest cnm-args) #<bytecode 0x1ffbe0738bed>) #<forge-database forge-database-1ffbee23a43c> [:select * :from repository :where (and (= forge $s1) (= owner $s2) (= name $s3))] "github.com" "ztlevi" "python-test2")
apply(#f(compiled-function (connection sql &rest args) #<bytecode 0x1ffbee2caea1>) #f(compiled-function (&rest cnm-args) #<bytecode 0x1ffbe0738bed>) (#<forge-database forge-database-1ffbee23a43c> [:select * :from repository :where (and (= forge $s1) (= owner $s2) (= name $s3))] "github.com" "ztlevi" "python-test2"))
#f(compiled-function (&rest args) #<bytecode 0x1ffbeea0db81>)(#<forge-database forge-database-1ffbee23a43c> [:select * :from repository :where (and (= forge $s1) (= owner $s2) (= name $s3))] "github.com" "ztlevi" "python-test2")
apply(#f(compiled-function (&rest args) #<bytecode 0x1ffbeea0db81>) #<forge-database forge-database-1ffbee23a43c> ([:select * :from repository :where (and (= forge $s1) (= owner $s2) (= name $s3))] "github.com" "ztlevi" "python-test2"))
emacsql(#<forge-database forge-database-1ffbee23a43c> [:select * :from repository :where (and (= forge $s1) (= owner $s2) (= name $s3))] "github.com" "ztlevi" "python-test2")
apply(emacsql #<forge-database forge-database-1ffbee23a43c> [:select * :from repository :where (and (= forge $s1) (= owner $s2) (= name $s3))] ("github.com" "ztlevi" "python-test2"))
forge-sql([:select * :from repository :where (and (= forge $s1) (= owner $s2) (= name $s3))] "github.com" "ztlevi" "python-test2")
#f(compiled-function (&rest rest) "((host owner name) &optional remote demand)\n\nReturn the repository identified by HOST, OWNER and NAME." #<bytecode 0x1ffbec4c96c5>)(("github.com" "ztlevi" "python-test2") "origin" full)
apply(#f(compiled-function (&rest rest) "((host owner name) &optional remote demand)\n\nReturn the repository identified by HOST, OWNER and NAME." #<bytecode 0x1ffbec4c96c5>) ("github.com" "ztlevi" "python-test2") ("origin" full))
forge-get-repository(("github.com" "ztlevi" "python-test2") "origin" full)
#f(compiled-function (url &optional remote demand) "Return the repository at URL." #<bytecode 0x1ffbec4c9659>)("https://github.com/ztlevi/python-test2.git" "origin" full)
apply(#f(compiled-function (url &optional remote demand) "Return the repository at URL." #<bytecode 0x1ffbec4c9659>) "https://github.com/ztlevi/python-test2.git" ("origin" full))
forge-get-repository("https://github.com/ztlevi/python-test2.git" "origin" full)
#f(compiled-function (demand &optional remote) "Return the current forge repository.\n\nIf the `forge-buffer-repository' is non-nil, then return that.\nOtherwise if `forge-buffer-topic' is non-nil, then return the\nrepository for that. Finally if both variables are nil, then\nreturn the forge repository corresponding to the current Git\nrepository, if any." #<bytecode 0x1ffbec4c9641>)(full)
apply(#f(compiled-function (demand &optional remote) "Return the current forge repository.\n\nIf the `forge-buffer-repository' is non-nil, then return that.\nOtherwise if `forge-buffer-topic' is non-nil, then return the\nrepository for that. Finally if both variables are nil, then\nreturn the forge repository corresponding to the current Git\nrepository, if any." #<bytecode 0x1ffbec4c9641>) full nil)
forge-get-repository(full)
forge-bug-reference-setup()
run-hooks(find-file-hook)
after-find-file(nil t)
find-file-noselect-1(#<buffer test.py> "~/src/python-test2/test.py" nil nil "~/src/python-test2/test.py" (14531044 16777223))
find-file-noselect("/Users/nd/src/python-test2/test.py")
#f(compiled-function (files proc &optional nowait) "Find FILES and return a list of buffers created.\nFILES is an alist whose elements are (FILENAME . FILEPOS)\nwhere FILEPOS can be nil or a pair (LINENUMBER . COLUMNNUMBER).\nPROC is the client that requested this operation.\nNOWAIT non-nil means this client is not waiting for the results,\nso don't mark these buffers specially, just visit them normally." #<bytecode 0x1ffbe8c41019>)((("/Users/nd/src/python-test2/test.py")) #<process server <3>> t)
apply(#f(compiled-function (files proc &optional nowait) "Find FILES and return a list of buffers created.\nFILES is an alist whose elements are (FILENAME . FILEPOS)\nwhere FILEPOS can be nil or a pair (LINENUMBER . COLUMNNUMBER).\nPROC is the client that requested this operation.\nNOWAIT non-nil means this client is not waiting for the results,\nso don't mark these buffers specially, just visit them normally." #<bytecode 0x1ffbe8c41019>) ((("/Users/nd/src/python-test2/test.py")) #<process server <3>> t))
server-visit-files((("/Users/nd/src/python-test2/test.py")) #<process server <3>> t)
server-execute(#<process server <3>> (("/Users/nd/src/python-test2/test.py")) t nil t nil nil)
#f(compiled-function () #<bytecode 0x1ffbede94e61>)()
server-execute-continuation(#<process server <3>>)
server-process-filter(#<process server <3>> "-dir /Users/nd/src/python-test2/ -nowait -current-...")
e.g. i only want to highlight the overlay
part of the symbol symbol-overlay-put
, so, i will set mark and highlight that region first, then run symbol-overlay-put
, but, it still highlight entire symbol-overlay-put
part.
Following is the same effect when use with iedit package, it works as expected.
thank you.
I haven't tested this a ton but it seems to work and seems useful. Perhaps there are better ways to implement it. I'm sure you don't want to add a dependency on avy
, but if the user has it installed, I think it would be useful to bind this to symbol-overlay-map
for them.
(defun symbol-overlay-jump-avy ()
"Jump to another occurance of symbol with avy."
(interactive)
(avy-with symbol-overlay-jump-avy
(avy-process
(avy--regex-candidates (regexp-quote (thing-at-point 'symbol t))))))
(define-key symbol-overlay-map (kbd "'") 'symbol-overlay-jump-avy)
Like highlight-regexp
, but with overlay functionality.
sample code extracted for illustration from https://raw.githubusercontent.com/bbatsov/prelude/master/utils/installer.sh
install_prelude() {
printf " Cloning Emacs Prelude's GitHub repository...\n$RESET"
if [ x$PRELUDE_VERBOSE != x ]; then
/usr/bin/env git clone $PRELUDE_URL "$PRELUDE_INSTALL_DIR"
else
/usr/bin/env git clone $PRELUDE_URL "$PRELUDE_INSTALL_DIR" >/dev/null
fi
if ! [ $? -eq 0 ]; then
printf "$RED A fatal error occurred during Prelude's installation. Aborting..."
exit 1
fi
}
make_prelude_dirs() {
printf " Creating the required directories.\n$RESET"
mkdir -p "$PRELUDE_INSTALL_DIR/savefile"
}
When overlay string PRELUDE_INSTALL_DIR
inside "$PRELUDE_INSTALL_DIR"
with symbol-overlay-put
, it would not highlight $PRELUDE_INSTALL_DIR
inside "$PRELUDE_INSTALL_DIR/savefile"
When I mark an active region and use symbol-overlay, it doesn't highlight the region, is it supported? If yes, how can I do it?
Thanks!
So next time, when the file is reopened, those overlay still exists.
Would there be any interest in having symbol-overlay added to NonGNU ELPA?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.