Hot answers tagged

11

auto-revert-tail-mode is great, but it has its limits. Therefore I prefer to use an asynchronous shell command. Open the remote directory in dired, position the cursor to the file you want to watch, and apply ! tail -f * &. If you want to suppress Tramp messages, decrease the verbosity. (setq tramp-verbose 1) shall be sufficient.


10

With emacs-snapshot, you can let-bind inhibit-message to t: Non-nil means calls to `message' are not displayed. They are still logged to the Messages buffer.


7

This is what I use. It disables everything that might slow emacs down, makes the buffer read only, and sets up auto-revert-tail-mode: ;; automagically tail log files (add-to-list 'auto-mode-alist '("\\.log\\'" . auto-revert-tail-mode)) (defun etc-log-tail-handler () (end-of-buffer) (make-variable-buffer-local 'auto-revert-interval) (setq auto-revert-...


7

I have the following snippet in my init.el, which was adapted from an original I found in the following Reddit thread: http://www.reddit.com/r/emacs/comments/16tzu9/anyone_know_of_a_reasonable_way_to_timestamp/ (EDIT: modernised to advice-add and removed clumsy read-only buffer handling on advice of @blujay) (defun sh/current-time-microseconds () "Return ...


6

You can't with message. Having looked at the internals of message, only the raw char* is given to the function that actually logs the text, all text properties are lost. You can hack your way around this by writing a function that: calls message with message-log-max let-bound to nil so that it won't log to *Messages* manually inserts the propertized string ...


5

Each buffer has a point, and in addition each window also has a point. The manual explains the relationship: The window point is established when a window is first created; it is initialized from the buffer's point, or from the window point of another window opened on the buffer if such a window exists. Selecting a window sets the value of point in ...


5

The translation of @xinfatang's simple solution to the new advice-add syntax as a wrapper around the message function is: (defun my-message-with-timestamp (old-func fmt-string &rest args) "Prepend current timestamp (with microsecond precision) to a message" (apply old-func (concat (format-time-string "[%F %T.%3N %Z] ") ...


4

Yes! This is command-log-mode which can be installed from Melpa. You have to add the function to whatever modes you want to record, like (add-hook 'python-mode-hook 'command-log-mode) Then, to invoke the log window as shown in the video M-x clm/open-command-log-buffer Open a Python file (in my example) and start manipulating the code to see your ...


3

I have an Org capture template that tracks weight. It is a sub-capture under "health". The relevant snippet for the capture template is: ("h" "Health") ("hW" "Weight" table-line (id "ID-TBL-WEIGHT") "|%?|%u|" :unnarrowed t) And then I have a table that collects the data: :PROPERTIES: :ID: ID-TBL-WEIGHT :END: #+NAME: weights | Weight (...


3

view-lossage (bound to C-h l by default) is limited to a fixed number of events, and doesn't keep time stamps, but it might be good enough for your use case. To store a longer log, you can try open-dribble-file. See also https://stackoverflow.com/questions/9761401 for a similar question.


3

Refer from https://www.emacswiki.org/emacs/DebugMessages: (defadvice message (before when-was-that activate) "Add timestamps to `message' output." (ad-set-arg 0 (concat (format-time-string "[%Y-%m-%d %T %Z] ") (ad-get-arg 0)) )) Finally i still like Stuart Hickinbottom 's answer, because it avoid show timestamp in minibuffer, ...


3

M-x open-dribble-file See the Emacs manual, node Checklist and the Elisp manual, node Recording Input. Start writing all keyboard characters to a dribble file called FILE. If FILE is nil, close any open dribble file. The file will be closed when Emacs exits. Be aware that this records ALL characters you type! This may include sensitive ...


3

It is possible that that you're calling kill-region which is bound to C-w. This is what one would consider the cut command in other applications. If the region is not active it will kill from your point to where the last mark was, which could possibly be the beginning of the buffer. The command view-lossage (bound to C-h l or <f1> l) displays the last ...


2

If you set variable debug-on-error to t then Emacs will show you a detailed backtrace of what function calls led to the error. (This affects only actual errors, not non-error messages, which are also logged to *Messages*.)


2

I have been using https://github.com/re5et/itail with success for a couple of years. It is a tail mode that opens in it's own buffer.


2

I've added [in my fork] the following setup steps to command-log-mode to stash recently typed text in a variable. (defvar clm/log-text t "A non-nil setting means text will be saved to the command log.") (defvar clm/recent-history-string "" "This string will hold recently typed text.") (defun clm/recent-history () (setq clm/recent-history-string (...


2

Set or customize the variable org-log-into-drawer to t.* The doc string of the variable (C-h v org-log-into-drawer RET) states: Non-nil means insert state change notes and time stamps into a drawer. When nil, state changes notes will be inserted after the headline and any scheduling and clock lines, but not inside a drawer. If you want to make this ...


2

Just do it as brother up there said, we are having similar problem here and CRTL + g works swiftly, then just check debug buffer.


1

Is there any package that does that, or a way to achieve it? One such package is Show Key (code: showkey.el). Global minor mode showkey-log-mode keeps a log of such events, in a separate frame. It's refreshed with each new event, and it's kept on top of other frames without stealing the input focus. Various user options control what events get logged, etc.


1

Not exactly what you want, but most of search related functions support similar behaviors. They list filtered result, and you can jump to any point you want from it. You don't really need a special mode to open your log file, just use these search function in your log file buffer. Here are some I know: occur: built-in search buffer function. (check multi-...


1

Noting that this is more or less along the lines of how run-mode-hooks and delay-mode-hooks interact, you could do something similar to that: (defvar scoped-message-p nil) (defvar scoped-messages nil) (defmacro scoped-message (message &rest body) (declare (indent 1)) `(progn (if scoped-message-p (push ,message scoped-messages) (...


1

According to the documentation it should be determined with the TZ environment variable : The default time zone is determined by the TZ environment variable. [...] For example, you can tell Emacs to default to Universal Time with (setenv "TZ" "UTC0"). If TZ is not in the environment, Emacs uses system wall clock time, which is a platform-dependent ...


1

Not exactly the answer you are expecting, but: If you are running on GNU/Linux in a GNOME environment, you could try the upcoming Emacs 26.1. Tramp offers a new method there, gdrive, which allows you to edit the file remotely on the Google drive. Something like C-x C-f /gdrive:michael.albinus@gmail.com:/dir/to/file Replace the account name with yours. If ...


1

You could do something like this: (let (last ov) (while (re-search-forward "[0-9]\\{4\\}-[01][1-9]-[0-3][0-9] [0-2][0-9]:[0-5][0-9]:[0-5][0-9]" nil t) (when last (when (< 2 (- (float-time (date-to-time (match-string 0))) (float-time (date-to-time last)))) (setq ov (make-overlay (line-beginning-position) (line-end-position))) ...


1

See this question and answer, you can do this same thing when opening a log file with ansi colors. https://stackoverflow.com/questions/3072648/cucumbers-ansi-colors-messing-up-emacs-compilation-buffer If this is a running log, I would suggest just opening a shell buffer and tail -fing the file which will handle colors.


1

You can also tell Emacs to move the window-point forward when text is inserted there. This should work at least in simple cases like this. (setq-local window-point-insertion-type t)


1

what is causing this? The problem here is that you seem to consider that the point is associated to a buffer, but this is not exactly the case. Consider for example the case where the same buffer is displayed in two different windows. You'll notice that the buffer contents is the same (i.e. modifying the buffer contents in one window modifies it in the ...


Only top voted, non community-wiki answers of a minimum length are eligible