Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Using svg-thing once silences some minibuffer for the entire Emacs session #1

Closed
smithzvk opened this Issue · 5 comments

2 participants

@smithzvk

I decided to give this a try and found that it changes something to make the incremental search in Emacs no longer provide feedback in the minibuffer area. This happens throughout Emacs and persists even after the svg-thing buffer is closed. A new instance of Emacs does not display this kind of behavior (i.e. normal activity is restored by closing Emacs and starting it again).

The mechanics of incremental search still seems to work and all other minibuffer output seems to remain visible, i.e. finding files, M-x, etc.

@sabof
Owner

I can't confirm. I've tested by running this code in emacs -Q

(progn
  (setq package-user-dir "/tmp/tempelpa")
  (setq package-archives
        '(("melpa" . "http://melpa.milkbox.net/packages/")))
  (package-initialize)
  (package-refresh-contents)
  (ignore-errors
    (package-install 'es-lib)
    (load "es-lib-buffer-local-set-key.el"))
  (require 'es-lib)
  (save-window-excursion
    (switch-to-buffer
     (url-retrieve-synchronously
      "https://raw.github.com/sabof/svg-thing/master/svg-thing.el" ))
    (goto-char (point-min))
    (search-forward "\n\n")
    (delete-region (point-min) (point))
    (eval-buffer))
  (svg-thing)
  (delete-other-windows))
@smithzvk

Indeed, you are correct. I will try to look through my .emacs file and figure out what the bad interaction is. Sorry for the poor bug report.

@sabof
Owner

I've found a bug in es-lib, where the byte-compiled version of a file didn't load properly. Though, I don't see how loading this package could have caused the behavior you've described, with or without it.

@smithzvk

Okay, I found the offending bit of ELisp. It is something that I pulled off of Emacs Wiki and tailored in order to, drum roll please, silence certain messages! Seems like the first place that one would look, but you do these things 5 years ago and never have an issue with them and then, bam! they get you.

I don't understand why this is causing problems it is a bit of advice telling Emacs not to display certain gratuitous messages:

;; Filter annoying messages
(defvar message-filter-regexp-list '("^Starting new Ispell process \\[.+\\] \\.\\.\\.$"
                                     "^Ispell process killed$"
                                     "^Desktop saved in .+$")
  "filter formatted message string to remove noisy messages")

(defadvice message (around message-filter-by-regexp activate)
  (if (not (ad-get-arg 0))
      ad-do-it
      (let ((formatted-string (apply 'format (ad-get-args 0))))
        (if (and (stringp formatted-string)
                 (some (lambda (re) (string-match re formatted-string))
                       message-filter-regexp-list))
            (save-excursion
              (set-buffer "*Messages*")
              (goto-char (point-max))
              (insert formatted-string "\n"))
            (progn
              (ad-set-args 0 `("%s" ,formatted-string))
              ad-do-it)))))

Then again, I don't understand advice that well anyway. I think you can mark this as closed if you like as the fault seems to be outside of your program. I won't as I still don't understand why this causes problems with svg-thing.

@sabof
Owner

Seems correct to me. The most likely function that could cause the interaction is this:

(defun st-win-config-hook ()
  (with-current-buffer (window-buffer)
    (when is-svg-thing
      (st-setup-buffer))))

You could try running the following, and see if things get back to normal:

(remove-hook
   'window-configuration-change-hook
   'st-win-config-hook)
@sabof sabof closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.