malabarba / beacon Goto Github PK
View Code? Open in Web Editor NEWA light that follows your cursor around so you don't lose it!
License: GNU General Public License v3.0
A light that follows your cursor around so you don't lose it!
License: GNU General Public License v3.0
This commit causes this error now:
backtrace.txt
I am on Emacs 25.0.50.1, Debian sid.
I fixed it like this:
(defcustom beacon-dont-blink-major-modes '(magit-status-mode
magit-popup-mode
gnus-summary-mode
gnus-group-mode)
"A list of major-modes where the beacon won't blink.
Whenever the current buffer satisfies `derived-mode-p' for
one of the major-modes on this list, the beacon will not
blink."
:type '(repeat symbol))
This package is great! I was doing something similar in my .emacs.d
extending the built-in pulse
package, but this is much nicer and cleaner implementation.
I'm noticing though that when I'm scrolling via next-page
/ previous-page
(C-n / C-p) and I go under the threshold of my scroll-margin
so that the window starts scrolling, beacon will trigger on each new line, regardless of the value of beacon-blink-when-point-moves-vertically
.
Here are the values of my scrolling customizations for reference:
(setq scroll-margin 24
scroll-conservatively 10000
scroll-preserve-screen-position 'always
auto-window-vscroll nil)
I can't get a clean emacs startup using today's latest version of Beacon (Melpa). Fortunately the GNUS version still works.
The error reads "Beginning of buffer"
When mode-icons mode is on, the beacon stays around until I insert a character or M-x. Very occasionally it disappears on its own. Thanks for any help you could offer in debugging this issue.
Very cool package, thanks!
After upgrading Beacon to the latest master branch from MELPA, I noticed something was changed.
When I move a specific amount of lines down of up, the cursor will blink with beacon. Now it's also blinking when I move a specific amount of words forward or backwards.
I wouldn't do that. Is there any way to disable that?
This function does not exist in my fairly recent Emacs snapshot, and therefore makes beacon
throw errors.
Thank you for this package it's really a nice visual extension :)
I have one problem:
Sometimes the cursor is flickering while the effect is in action. Do you have the same behaviour on your side?
Hey Arthur,
Do you have any idea why package.el would complain that seq
is not installable in Emacs 25 (the emacs-25
branch)?
beacon is an incompatible package.
Status: Incompatible because it depends on uninstallable packages.
Archive: gnu
Version: 0.5.1
Summary: Highlight the cursor whenever the window scrolls
Requires: seq-1.11 (not available)
Homepage: https://github.com/Malabarba/beacon
Keywords: convenience
beacon is an incompatible package.
Status: Incompatible because it depends on uninstallable packages.
Archive: melpa
Version: 20151205.1003
Summary: Highlight the cursor whenever the window scrolls
Requires: seq-1.11 (not available)
Homepage: https://github.com/Malabarba/beacon
Keywords: convenience
All I do have is seq 1.8 built-in Sequence manipulation functions
in the list of packages (but not 2.3 as suggested in melpa/melpa@76b7b90).
GUI version GNU Emacs 25.0.50.1 (x86_64-w64-mingw32)
of 2015-07-25 on KAEL
Beacon, using the latest version of Beacon from MELPA
Windows 7 x64 bit.
Thanks for creating this package! I use the use-package
, and I configured beacon as following:
(use-package beacon
:config
(setq beacon-mode 1)
(setq beacon-blink-delay 0.2)
(setq beacon-blink-duration 0.2)
(setq beacon-blink-when-point-moves 7)
(setq beacon-blink-when-window-changes nil)
(setq beacon-blink-when-window-scrolls nil)
(setq beacon-color "brown")
(setq beacon-push-mark 5)
(setq beacon-size 25)
)
In my dot-Emacs. When I start Emacs, and move around with the cursor, I don't see the beacon. When I disable the beacon-mode and enable it again, then I'll see the beacon. I find that weird, given the fact that beacon-mode is already enabled on startup.
Perhaps a bug?
Let's say a line is just shorter than what can be accommodated on the screen and the cursor is at the end of the line. Then if I move off that line and back, the line appears to grow causing it to wrap and then shrink back at the end of beacon's animation.
I'm guessing this is because as a part of beacon's animation, you /add/ some extra characters on to the end of the line to highlight their background?
This should be t
(string= (format-spec "%s" '((?s . "foo"))) "foo")
but triggers an error with latest beacon commit.
Every time when I do a scroll action (Page up, page down), I get the following message in the minibuffer
Mark set
After bisecting my Emacs configuration, it turned out I get this message when beacon-mode is enabled.
I could never figure out why this message is popping up when beacon-mode is enabled.
Emacs version is (latest snapshot for ubuntu):
GNU Emacs 25.0.50.2 (x86_64-pc-linux-gnu, GTK+ Version 3.16.7) of 2015-10-28
And setup of Beacon is:
(beacon-mode 1)
(setq beacon-dont-blink-major-modes (quote (magit-status-mode dired-mode eshell-mode))
beacon-blink-delay 0.2
beacon-blink-duration 0.2
beacon-blink-when-point-moves 7
beacon-blink-when-window-changes nil
beacon-blink-when-window-scrolls nil
beacon-color "brown"
beacon-push-mark 5
beacon-size 25)
Any suggestion why I get the message "Mark set"?
I am making a small script that should blink beacon as a part of it's execution. I can run 'M-x beacon-blink' and the beacon blinks but if evaluating the function call (beacon-blink) produces no output. Is there a special way I should be calling that function that is different from running the command?
I was trying to customize the beacon color with M-x customize-group. The instructions for doing so are "
If it is a string, it is a color name or specification,
e.g. "#666600"."".
However, when i try to enter "blue" or even your suggestion of "#666600", I get a warning at the bottom that "Saving beacon-color: This field should contain a number (floating point or integer)". I tried to change the types on (defcustom beacon-color :type '(choice number color)) but changing color to string left me no better off.
I've noticed two issues when using info buffers with beacon enabled:
C-p
to move the cursor from the node title to the preceding blank line. This happens irrespective of the setting of beacon-blink-when-point-moves
.C-p
again to move to the node name causes a strange delay (~2-3 s on my machine), and a beacon overlay which is a solid color across the entire line. This occurs only if beacon-blink-when-point-moves
is set to an integer (values I tried were 1 and 20).This is on an X11 frame running under linux with a recent-ish emacs git master. Steps to reproduce:
b-b-w-p-m
is set appropriately)With that hook, one can, say, recenter the cursor after every long distance jump.
It would be good to have an option to flash a beacon when switching focus from another program to emacs.
Caveat: it's possible beacon can already to what I want, and I just don't grok how. Maybe this is a feature request? Hard to say.
A time when beacon could improve my programming life dramatically would be on changing window focus. The scenario goes like so: I have emacs subdivided in to four or five windows; I change window focus to a browser to look up documentation, say; when I re-focus on emacs, I have to find point.
So. Should beacon-blink-when-window-changes
already be doing this? (Beacon fires for me when I change between windows within emacs, but not when I change between application windows.) Would this be possible at all? Another approach would be a defun
to allow a "where is my cursor?" keyboard command -- thoughts?
Thanks for the awesome package!
I recently upgraded from beacon-20160206.917
to beacon-20160321.551
. I’ve noticed that now, at least in mu4e-headers-mode, the blinking beacon will displace text in the first line of the buffer.
This displacement is «animated», i.e., as the beacon blink shrinks away, the displaced text will gradually slide back into its intended position.
This happens only when the buffer is initially constructed. Once it’s open, doing M-x beacon-blink
will blink the beacon without triggering this effect.
So far I’ve only observed this in the mu4e headers list.
The default value for beacon-dont-blink-predicates
includes this line:
(add-hook 'beacon-dont-blink-predicates (lambda () (bound-and-true-p hl-line-mode)))
This makes it harder than it needs to be to combine blinking with hl-line-mode (no way to remove-hook
). Is there a deep reason for this? When I (setq beacon-dont-blink-predicates)
and turn on hl-line-mode
things seem to work fine.
I can see a few ways to change this.
beacon-disable-for-hl-line-mode
, and change the predicate to (lambda () (and beacon-disable-for-hl-line-mode (bound-and-true-p hl-line-mode)))
, so that changing this behavior is as simple as (setq beacon-disable-for-hl-line-mode nil)
remove-hook
worksthanks for writing this, by the way--it's useful.
Right now, spotlight-mode
is immediately deactivated because of the error in the subject. The problem is that spotlight-blink
contains (length spotlight--colors)
but spotlight--colors
is not defined. I guess that's an artifact of an older version and the expression should be changed to spotlight-size
.
When recentering the screen on the cursor at the center, top or bottom of the window the beacon should shine - since the content of the window changes, since we move in the file, and the position of the cursor changes. At least it appears illogical, why it does not shine in this case....
I usually get this when I have beacon enabled and use eww
to open a web page that takes a while to load.
Hey @Malabarba! First off, great tool you wrote here - I've already noticed a difference in not searching around for my cursor so much when navigating files.
I seem to be encountering an issue now whenever beacon is working. I have (setq debug-on-error t)
in my config, which produces the following constantly:
Debugger entered--Lisp error: (wrong-type-argument stringp nil)
string-match("\\`unspecified-" nil)
beacon--color-range()
beacon--shine()
beacon-blink()
beacon--window-scroll-function(#<window 3 on init.el> 9862)
redisplay_internal\ \(C\ function\)()
My config is exactly the same as from your beacon post, but used with use-package
. This was also installed via MELPA.
Let me know if I can help provide anymore info. I had to disable beacon temporarily :-/
Beacon seems to be incompatible with magit-status' buffers.
Could you please tag the current commit so that your package appears on melpa stable? You can do it through github in the "releases" tab or through git tag
. Thanks
It'd be nice if commands like recenter-top-bottom
(aka C-l
) also triggered beacon's feedback.
This looks really cool. I just installed it from MELPA, but it's not working, and I see this in the messages:
beacon-blink: Symbol's function definition is void: seq-find [7 times]
Error in post-command-hook (beacon--post-command): (void-function seq-find)
I upgraded the seq
package and now it works. I guess that function was added in the last few months.
I have beacon enabled in my config:
(use-package beacon
:ensure t
:config
(beacon-mode 1)
(setq beacon-color "cyan"))
When I open a directory with dired, the beacon stays active and does not disappear...
I would like to make a request for a feature I didn't see, apologies if I missed it. It would be nice to be able to have an interactive command that allows the user to pulse the beacon at any time, even without buffer movement.
This would be similar to functionality offered by 'hi-line-flash or 'crosshairs-flash.
Thank you.
Hi,
Would it be a good idea to disable beacon when edebug-active
is t
?
Because right now, the beacon flashes as the cursor jumps to the next form as I hit SPC
during edebug.
I load Beacon via use-package
:
(use-package beacon)
Which takes a while!
Loading package beacon...done (5.682s)
Loading the beacon package (not even enabling the mode) appears to take 5 to 7 seconds on my 2.5 GHz Intel Core i5.
I'd like to use it, but that addition to Emacs' init time is... too much. Any ideas?
This bug as already been reported on your blog here.
Calling emacs --daemon
with beacon
enabled make the daemon to never start, it get stuck in his initialisation phase without complaining or anything else. So doing emacs --daemon --debug-int
doesn't work as it never start.
The solution proposed by @manuel-uberti in the comment's of your blog doesn't work for me.
To reproduce start emacs --daemon
, connect to it with an emacsclient
, load beacon
, evaluate (beacon-mode 1)
, select another window C-x o
then it report Error in post-command-hook (beacon--post-command): (error "Invalid color")
.
Following is the backtrace:
Debugger entered--Lisp error: (error "Invalid color")
color-distance("black" nil)
beacon--color-range()
beacon--shine()
beacon-blink()
beacon--blink-on-focus()
run-hooks(focus-in-hook)
handle-focus-in((focus-in #<frame emacs@noisette 0x670fb68>))
call-interactively(handle-focus-in nil [(focus-in #<frame emacs@noisette 0x670fb68>)])
command-execute(handle-focus-in nil [(focus-in #<frame emacs@noisette 0x670fb68>)] t)
recursive-edit()
debug(debug)
debug--implement-debug-on-entry(1)
apply(debug--implement-debug-on-entry 1)
* other-window(1)
call-interactively(other-window nil nil)
command-execute(other-window)
...
I have this in my init file:
(beacon-mode 1)
(setq beacon-blink-when-point-moves-vertically 1)
(setq beacon-blink-when-point-moves-horizontally 1)
Yet, the beacon only shows when I scroll. I would like it to show up any time I move the cursor using the arrow keys. Not sure if I'm missing something or this is a genuine bug.
For whatever reason, setting beacon-blink-when-window-scrolls nil
seems to have no effect. When I scroll using scroll-up-command
it still blinks. Restarting emacs had no effect. Using beacon 20151025.828
from melpa.
I would like to set my beacon-color to "#721cd4".
How can I set this from my init.el or from my color theme? Is there an example I could use with a string color value?
(My elisp is not very good, so any help is appreciated. I can set a face easily, but I'm having trouble figuring out how to set beacon-color)
After fixing #1 locally, I'm now using spotlight for about half an hour and basically I like it. However, there are some improvements you might want to consider.
(spotlight--after-string)
...I have both Emacs versions, 24.5.3 and 25.1.50.2.
In v24 beacon is loaded well and everything is working good.
In v25 there is Symbol's function definition is void: seq-do
.
My seq.el
version listed in package-list-packages
is latest (2.15).
I've also tried to start without init.el
using emacs -q
and then tried:
(require 'seq)
and then M-x describe-function seq-do
and it shows the documentation which means that it is loaded.
Also, beacon
is not the only package that suffers with this, flycheck
have the same struggle.
Despite your 1.3.2 release, gnu elpa still advertises 1.3.1 as latest. Could you please fix that?
Hello! beacon-mode
is quite nice - I dig it.
Installing had a bit of a hiccup in that I did not already have the seq package installed.
I installed seq
manually, but it should be really included in beacon-mode
's dependencies.
Thanks again!
Hi. This looks fantastic. I saw it on the emacs mailing list and I'm very interested. I'm still not super good at some things, but i cloned your repo and put it in my load path. At the moment, my emacs, (version 24.4) does not like the lines lexical-binding: t
at the top and end of the file. The documentation that I've seen from emacs seems to think that this should be set. Switching the style to (setq lexical-binding t)
solves this issue quite well, but I just wanted to make sure I was doing everything in the manner everything was to meant to be.
It would be useful to let beacon blink when Emacs gains focus over another OS window.
If there is only one eyebrowse workspace the point blinks and has this nice smooth-fading transition. If there is more than one workspace in eyebrowse then the beacon still appears but does not have a transition it just instantly disappears after beacon-blink-duration
runs out.
EDIT:
It seems that sometimes a few workspaces need to exist for the issues to be properly replicated.
Beacon mode causes errors when ediff
is run. Probably everything ediff
related should be put on the beacon-dont-blink-major-modes
list globally.
Thinking about calfw, beacon-blink-when-point-moves
is very handy with respect to vertical movement, but, would it be possible to get the equivalent for columns (horizontal movement) ?
Great package, really useful, thanks !
Starting emacs with --deamon will yield the following error:
Error in post-command-hook (beacon--post-command): (wrong-type-argument number-or-marker-p nil)
Currently, the only supported beacon is a linear decay from the cursor to the right.
I'd like to support other beacons, like a symmetric beacon, a different decay pattern, a circle shape, or a cross-hair shape.
The easiest way to do this would be changing the code to completely recreate all overlays at each frame (current logic creates them once and then moves them around) where the colors are gathered by calling beacon--color-range
with one argument (the curent frame number of the animation).
Then, implementing different beacons should be as simple as providing different beacon--color-range
functions.
My only concern with this approach would be performance, since it would recreate all overlays at each frame.
Hi, I wanted the beacon to blink when I switch buffers also. I see that there's a variable beacon-blink-when-buffer-changes
in the code but it seems it is not used.
Shouldn't it be used in beacon--post-command
?
I use version 20160206.917
from melpa.
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.