tcw165 / history Goto Github PK
View Code? Open in Web Editor NEWEmacs - History utility for source code navigation.
License: MIT License
Emacs - History utility for source code navigation.
License: MIT License
I use nlinum-mode instead of linum-mode, when I use history-prev-history after I reach the oldest or newest mark, it happened.
Maybe there should be a customization variable as on/off switch of reviving closed buffers.
Is there any advantage over helm-all-mark-rings?
Hi!
I've just started using history-mode
and I like it a lot, thanks!
I find the messages in the echo area (that shows you where in the history you are) distracting however.
Would it be possible to add a defcustom
to disable that?
Thanks again for a great mode!
To avoid duplicates.
This will be especially useful if you advise core functions to call history-add-history
automatically.
You have a typo at the end of history-add-history-internal
.
I have an issue where the history gets corrupted when I go history-prev-history
then history-next-history
.
I investigated and It seems to happen when (window-start)
returns 1 when it should have returned > 1 in the advice after jump.
I debugged by adding some (message "..." ...)
to a few functions, and annotated the output to hopefully explain what happens:
;; - starting in file test.rs, at char 136
;; - jumping to marker.rs@10630:
history-add-history ;; advice before jump
history-create/push-history (:marker #<at 136 in test.rs> :window-start 1)
racer-find-definition ;; jump
history-add-history ;; advice after jump
history-create/push-history (:marker #<at 10630 in marker.rs> :window-start 1)
;; >> WRONG (window-start) returned 1, should have returned 8718
;; - here, now running `M-: (window-start)` returns the right value of 8718, not 1
;; - go back to test.rs@136:
history-prev-history
history-use-current-history: (:marker #<at 136 in test.rs> :window-start 1)
;; - go next, return to marker.rs@10630:
history-next-history
history-use-current-history: (:marker #<at 10630 in marker.rs> :window-start 1)
;; >> now we are at wrong location: jumped at marker.rs@1153 instead of 10630,
;; probably because (set-window-start nil 1) should have been 8718
;; and then (goto-char 10630) somehow didn't work properly ??
;; - now at marker.rs@1153 instead of 10630
I don't have much idea what I'm doing here, poked around, I couldn't get (window-start)
to return the right value, so tried something else and this seems to fix the issue for me, without breaking #6 :
diff --git a/history.el b/history.el
index f8aa91d9010d..d1faea30ece9 100644
--- a/history.el
+++ b/history.el
@@ -374,7 +374,7 @@ whether `history-window-local-history' is true or false."
(set-window-buffer (history-window) buffer)
(set-buffer buffer)
;; Update window-start.
- (set-window-start nil wpos)
+ (set-window-start nil wpos 'noforce)
;; Update point.
(goto-char pos)))
Not ideal I think, window-start
/wpos
is still invalid, but set-window-start
with NOFORCE
seems to not make goto-char
go to the wrong location.
Note: It happens with all the jump functions I use; here is my config:
(require 'history)
(add-to-list 'history-advised-before-functions 'rtags-find-symbol-at-point t)
(add-to-list 'history-advised-after-functions 'rtags-find-symbol-at-point t)
(add-to-list 'history-advised-before-functions 'godef-jump t)
(add-to-list 'history-advised-after-functions 'godef-jump t)
(add-to-list 'history-advised-before-functions 'racer-find-definition t)
(add-to-list 'history-advised-after-functions 'racer-find-definition t)
(setq-default history-window-local-history t)
(history-mode 1)
emacs --version
: GNU Emacs 26.1
Is it possible to integrate history
tool with ctags/etags built-in tools.
Scenario:
M-x history-add-history
.M-x history-prev-history
.M-x history-add-history
.Result: two history entries, the newer after the older.
Expected result: just one history entry, the new one.
It's quite useful to restore the previous window scroll position, as well as point.
Especially when otherwise point, when restored, would move to somewhere around the bottom of the current window.
When navigating between entries in history-goto-history
in graphical Emacs the cursor moves to indicate the line in the buffer associated with the history record. However, there is only one cursor in terminal mode, and it is on the history navigator in the minibuffer. This means that there is no indication of which buffer line to look at.
Perhaps the cursor could be moved to the buffer, or perhaps the entire line could be highlighted (which would be useful even in graphical Emacs)?
I'd really prefer if the history wasn't stored in a global variable, but in a window parameter. Then you can have different histories in different windows (for separate trains of thought).
Here's an example implementation:
https://github.com/dgutov/point-stack/blob/master/point-stack.el#L83-L94
Following code is repeated in two locations to determine whether a buffer can be marked:
(dolist (ignore history-ignore-buffer-names)
(when (string-match ignore (buffer-name))
Relocate the code into a function such as ignore-buffer? so that users can advice it.
I want to preserve current functionality, but make an exception for ielm buffer.
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.