Comments (8)
Thanks for your feedback!
Let me know if 75596dd isn't what you were looking for :)
from highlight-thing.el.
I added some notes to the commit. Thanks for a quick response!
from highlight-thing.el.
Thanks again :)
Let me know what you think of the changes!
from highlight-thing.el.
Awesome.
One more thing. You can (and should) also specify the type of the customize option. This enables emacs to
a) do verification on the type (if user sets some nonsensical value it will bug them about it rather than silently fail somewhere)
b) draw the proper UI widget in the customize interface
You can read about that here: https://www.gnu.org/software/emacs/manual/html_node/elisp/Customization-Types.html
Also notice it specifies the :group
option, that's used to group the options related to one package under the same menu.
from highlight-thing.el.
Hm, actually, I tried the new version now and it doesn't seem to limit the highlight to defun. Does it work for you? (I still use emacs 24.3)
from highlight-thing.el.
Ok, figured it out. It uses font-lock to do the highlight, and that simply works on the entire buffer. If we disable font-lock-mode
then it uses overlays and the logic for placing those respects the bounds.
Another weirdity of emacs :D So I changed the defun to
(defun highlight-thing-do ()
(interactive)
(let* ((thing (thing-at-point highlight-thing-what-thing))
(font-lock-mode nil))
(highlight-thing-remove-last)
(when (and (highlight-thing-should-highlight) thing)
(save-excursion
(save-restriction
(widen)
(when highlight-thing-limit-to-defun (narrow-to-defun))
(highlight-regexp (highlight-thing-regexp thing) 'highlight-thing)))
(setq highlight-thing-last-buffer (current-buffer))
(setq highlight-thing-last-thing thing))))
In case no narrowing happens, using font lock is probably much better idea as it is way faster than overlays (especially on large buffers).
from highlight-thing.el.
Took a bit longer this time, but added type and group information to defcustoms in e2f27a6 -- let me know what you think!
Re font-lock-mode: One of my assumptions for this mode is that font-lock-mode is turned off, so added that part as well to make it explicit. Thanks for looking into it :)
from highlight-thing.el.
Sweet, I'll check it out tomorrow, just heading to bed.
from highlight-thing.el.
Related Issues (20)
- Feature request: make the face customizable. HOT 1
- Point moves in ruby when over the `module` keyword HOT 4
- Feature request: highlight text like region only HOT 4
- Controlling case sensitivity HOT 2
- How do I change the highlight color? HOT 2
- Option to highlight only after only double click HOT 2
- Highlight everything like the thing at point but not the thing at point HOT 3
- Ignore list HOT 2
- README outdated HOT 2
- highlight region if any, highlight default thing otherwise HOT 2
- Freeze on big buffers HOT 6
- Add an option to highlight-in-all-visible-buffers HOT 4
- Failed to change highlight-thing face HOT 4
- Feature request: exclude matches in comment blocks HOT 1
- Add screenshot or demo gif
- Selecting a part of a symbol highlights the rest of the symbol. HOT 3
- deprecated positional arguments to 'define-minor-mode' HOT 1
- Emacs freezes when highlighting an empty region HOT 1
- Need help with the "custom regex" option
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from highlight-thing.el.