[-] JDRiverRun@alien.top 1 points 10 months ago

This package does nothing with C-n. Smooth scrolling at high speed can certainly take some CPU, nothing new there.

1
submitted 10 months ago by JDRiverRun@alien.top to c/emacs@communick.news

ultra-scroll-mac: scroll like lightning

Emacs-mac is a beautiful port, and was the first to offer pixel-precise smooth scrolling nearly a decade ago. But with modern high-resolution trackpads and high density displays, I found its scrolling handlers just couldn't keep up. On large, full-screen buffers in a heavy mode, trackpad scrolling verged on painful, and, maddeningly, was much worse in one direction than the other. And no wonder: modern trackpads deliver scroll events >50⨉ per second! The other key problem with all known smooth scrolling packages is they tend to stutter and loop back as you try to scroll across images taller than the window.

This package solves both of these problems:

  • Scrolling performance has been increased 25-50⨉ — you move your fingers, the page responds, instantly.
  • Large image handling has been worked around so you can scroll right across them without any hiccups.
  • As a bonus, dumb mice get pretty good smooth(-ish) scrolling too.

I'll be contributing the core scrolling functions upstream, so hopefully pixel-precision-scroll-mode (which inspired this package, and is recommended on other builds) can make use of some of these improvements in the future.

Finally, this was all (to me) surprisingly hard to achieve, which you can read all about if you are a glutton.

[-] JDRiverRun@alien.top 1 points 11 months ago

Did you either succeed with debugpy.listen()? Is that suitable to call interactively then quit (like iPDB)?

[-] JDRiverRun@alien.top 1 points 11 months ago

M-x find-library python, followed by C-s outline- shows what's happening: python-base-mode sets the local outline variables locally, in its mode body. Since mode hooks always run after the body of their mode definitions, you could add a bit of code to the python-base-mode-hook (or a parent of it, like prog-mode-hook) setting your desired outline config there (i.e. overwriting what python mode did).

I do that using outli simply (in a use-package stanza):

 :hook ((prog-mode text-mode) . outli-mode))

BTW, here's a handy guide (from this epic answer) to what runs in which order upon invoking a derived major mode like python-ts-mode:

So when we call (child-mode), the full sequence is:

(run-hooks 'change-major-mode-hook) ;; actually the first thing done by
(kill-all-local-variables)          ;; <-- this function
,@grandparent-body
,@parent-body
,@child-body
(run-hooks 'change-major-mode-after-body-hook)
(run-hooks 'grandparent-mode-hook)
(run-hooks 'parent-mode-hook)
(run-hooks 'child-mode-hook)
(run-hooks 'after-change-major-mode-hook)
[-] JDRiverRun@alien.top 2 points 11 months ago

Not sure your definition of easy, but this kind of setup (and much more) is certainly possible: https://www.masteringemacs.org/article/demystifying-emacs-window-manager

[-] JDRiverRun@alien.top 1 points 11 months ago

Start with the Elisp intro; it’s great. M-x shortdoc buffer gives a nice overview of buffer commands. I love consult-info for general searching of the Elisp (and other) info files. But M-x apropos-function is builtin and useful too.

[-] JDRiverRun@alien.top 1 points 11 months ago

No need for a package, this is a great chance to learn some elisp. To get you started:

(let ((cur (current-indentation)))
  (push-mark nil t t)
  (while (and (not (eobp)) (= (current-indentation) cur))
    (forward-line 1)))
[-] JDRiverRun@alien.top 1 points 11 months ago

Seems like in-process debuggers like iPDB are far more practical for interactive debugging of long running shells.

[-] JDRiverRun@alien.top 1 points 11 months ago

How would you attach a DAP python debugger to a running instance of (i)Python? Is there some import debugpy; debugpy.start() command or similar?

[-] JDRiverRun@alien.top 1 points 11 months ago

Set a window-configuration-change-hook temporarily, see if the (selected-frame) matches. If so do the split, and remove the hook.

[-] JDRiverRun@alien.top 1 points 11 months ago

When I hear of a package that may be interesting, I immediately check its repo page to see how many issues and PRs are still open. I look to see whether they have garnered any responses, especially if the submissions are of high quality. Years of issues building up isn't a good sign. This isn't 100% reliable, as different skilled developers approach issues and PRs quite differently, but it gives you some information. And there are outliers, like multiple-cursors, whose developer is very skilled and motivated, but whose popularity overwhelmed his resources.

For simple package, "no updates" for 5 years is usually fine. But before investing energy in a larger new package, I want to know whether it will still be working well in the next 5 years.

[-] JDRiverRun@alien.top 1 points 11 months ago

There are a variety of "self-quoting" constructs in elisp (including all :keywords!).

(eq (quote nil) nil) ; ==> t  
(eq (quote t) t) ; ==> t  
(eq (quote :some-keyword) :some-keyword) ; ==> t
[-] JDRiverRun@alien.top 1 points 1 year ago

Outline mode works well for this. I use my own small outli package to set this up automatically with nice formatting and “speed key” access at the beginning of headlines. Tab to fold.

view more: next ›

JDRiverRun

joined 1 year ago