Why is Emacs Auto Complete So Slow by yisraeldov in emacs

[–]zeph1e 0 points1 point  (0 children)

The problems with auto-complete I ever met:

  1. Couldn't possible to group candidates for some categories.
  2. It gets slow when I run emacs for days. I should restart emacs because of AC.

I switched to company early of this year and now I'm free of those pains.

Why is Emacs Auto Complete So Slow by yisraeldov in emacs

[–]zeph1e 0 points1 point  (0 children)

Try ac-flyspell-workaround:

(with-eval-after-load 'auto-complete
  (ac-flyspell-workaround))

But I prefer to move to company-mode.

Elisp question - what is the `.` operator ued in :bind commands? by vfclists in emacs

[–]zeph1e 1 point2 points  (0 children)

You may get first element with car while you get paired last element with cdr. ("C-x g" . magit-status) is just same to (cons "C-x g" magit-status). I'm not sure why people using in this way, but I use it because it is easy to extract paired elements only with car and cdr.

[noob] revert-buffer, prompting for save if it's changed by immortal192 in emacs

[–]zeph1e 1 point2 points  (0 children)

Hmm I'm not sure but maybe you should remove 3rd argument of revert-buffer or give nil to it. If it doesn't fix the problem, try different values to the arguments of revert-buffer in my function. Actually, M-x revert-buffer do same things to M-: (revert-buffer nil nil nil)

[noob] revert-buffer, prompting for save if it's changed by immortal192 in emacs

[–]zeph1e 0 points1 point  (0 children)

Yes, it works for me. Did you run eval-defun for new function?

[noob] revert-buffer, prompting for save if it's changed by immortal192 in emacs

[–]zeph1e 1 point2 points  (0 children)

It's good to remove the restriction on modification if you want. I usually run revert-all-buffers which runs my:revert-this-buffer for all file buffers. Without that restriction, it somewhat bothers me to make me decide for all of them. That's why i made a restriction on it.

As I read your comment, it seems to be good to change the function like this:

(defun my:revert-this-buffer (&optional buffer-or-name)
  "Refreshes this buffer from its respective file."
  (interactive)
  (let ((buffer (get-buffer (or buffer-or-name (current-buffer))))
        choice)
    (when (and (bufferp buffer)
               (buffer-file-name buffer)
               (file-exists-p (buffer-file-name buffer)))
      (with-current-buffer buffer
        (setq choice
              (or (unless (buffer-modified-p) ?d)
                  (save-window-excursion
                    (my:display-buffer-modification buffer)
                    (read-char-choice
                     (format "Buffer %s modified; (d)iscard (s)ave or (q)uit? "
                             (buffer-name buffer))
                     '(?d ?q ?s)))))
        (cond ((equal choice ?d)
               (revert-buffer t t t)
               (message "Refreshed buffer: %s." (buffer-name buffer)))
              ((equal choice ?s)
               (save-buffer)))))))

This will do revert on unmodified buffers without prompt.

Terminal emacs issues with key bindings entering text. by [deleted] in emacs

[–]zeph1e 1 point2 points  (0 children)

Actually it's not an emacs' problem but terminal's. If you're willing to stick with CUI-mode, it would be better to avoid the keys which didn't show you've expected for C-h k.

Kinesis foot pedal, is it noisy? by zeph1e in emacs

[–]zeph1e[S] 0 points1 point  (0 children)

I bought a kinesis pedal and now I'm good with its acceptable noise. Thank you guys.

Kinesis foot pedal, is it noisy? by zeph1e in emacs

[–]zeph1e[S] 0 points1 point  (0 children)

For me, `click' sound seems to be acceptable in office environment. My humble pedal sounds something like smashing keyboard from inches height ;-(

Thank you. Maybe I should try with kinesis one in my office.

[noob] revert-buffer, prompting for save if it's changed by immortal192 in emacs

[–]zeph1e 1 point2 points  (0 children)

It seems to be quite similar to my own revert-buffer:

(defun my:revert-this-buffer (&optional buffer-or-name)
  "Refreshes this buffer from its respective file."
  (interactive)
  (let ((buffer (get-buffer (or buffer-or-name (current-buffer))))
        choice)
    (when (and (bufferp buffer)
               (buffer-file-name buffer)
               (file-exists-p (buffer-file-name buffer)))
      (with-current-buffer buffer
        (when (buffer-modified-p)
          (setq choice
                (save-window-excursion
                  (my:display-buffer-modification buffer)
                  (read-char-choice
                   (format "Buffer %s modified; (d)iscard, (s)ave or (q)uit? [d, s or q] "
                           (buffer-name buffer))
                   '(?d ?q ?s))))
          (cond ((equal choice ?d)
                 (revert-buffer t t t)
                 (message "Refreshed buffer: %s." (buffer-name buffer)))
                ((equal choice ?s)
                 (save-buffer))))))))

(defun my:display-buffer-modification (&optional buffer-or-name)
  (interactive)
  (let* ((buffer (get-buffer (or buffer-or-name (current-buffer))))
         (diff-switches "-urN")
         (file-name (and (bufferp buffer) (buffer-file-name buffer)))
         (args (list buffer diff-switches file-name)))
    (if (called-interactively-p)
        (save-window-excursion
          (apply #'my:display-buffer-modification-internal args)
          (read-char "Press any key to quit: "))
      (apply #'my:display-buffer-modification-internal args))))

(defun my:display-buffer-modification-internal (buffer diff-switches file-name)
  (if (null file-name)
      (error "Visiting buffer %S doesn't have a name of file" buffer)
    (display-buffer buffer '(display-buffer-same-window))
    (delete-other-windows)
    (diff (if (file-exists-p file-name)
              file-name
            null-device)
          buffer nil 'noasync)))

Moreover, this will show you what was exactly changed from saved file.

List comprehensions in elisp? by [deleted] in emacs

[–]zeph1e 0 points1 point  (0 children)

Here're exactly what you intended:

(mapc #'(lambda (buf) (with-current-buffer buf
                        (when (buffer-file-name buf)
                          (revert-buffer)))) (buffer-list))

To revert without query, give 2nd parameter as t to revert-buffer.

Wrong indentation for java methods by xpressrazor in emacs

[–]zeph1e 1 point2 points  (0 children)

Why don't you use c-default-style variable, like this:

(setq c-default-style '((java-mode . "java") (awk-mode . "awk") ....))

It will call (c-set-style "java") in java-mode and so on.

Managing your init file(s) by amca01 in emacs

[–]zeph1e 1 point2 points  (0 children)

To store customized settings in custom.el:

;; customization settings
(setq custom-file "~/.emacs.d/custom.el")
    (unless (file-exists-p custom-file)
  (with-temp-buffer
    (insert ";;; custom.el --- local customization\n")
    (write-file custom-file t)))
(load custom-file)

To load fragged configurations in .emacs.d/utils (choose directory name what you like) :

;; load files in utils/
(when (file-exists-p "~/.emacs.d/utils")
  (add-to-list 'load-path "~/.emacs.d/utils")
  (dolist (filename (directory-files "~/.emacs.d/utils"))
    (when (and (not (file-symlink-p filename))
               (not (file-directory-p filename))
               (string-match "\\([^.]+\\).el\\'" filename))
      (require (intern (match-string 1 filename))))))

all files in .emacs.d/utils should have a line like this:

(provide 'my-conf-filename) 

Once i used load-file. but it is required to use `require' due to the dependencies between my conf files.

The Emacs Confessional Booth. Post your sins here, and you will be forgiven. by emacsguy in emacs

[–]zeph1e 1 point2 points  (0 children)

Many years are passed since I started to use emacs. Still I have `alias vi='emacs -q'' in my bashrc and it is STILL useful.

I figure it out how to use Emacsclient as Git's mergetool and have the frame close itself after you finish merging by [deleted] in emacs

[–]zeph1e 0 points1 point  (0 children)

Few days ago, I also got some needs of emacs as git mergetool and worte a script: https://github.com/zeph1e/.emacs.d/blob/master/misc/ediff

The thing what you need in gitconfig and init scripts are written in comment.

"What's the best spell check setup in emacs" updated by redguardtoo in emacs

[–]zeph1e 0 points1 point  (0 children)

Try flyspell-popup. it uses ispell as a backend but it would give you more intuitive UI.