Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Improved quiet save buffer #4

Merged
merged 10 commits into from

2 participants

@elim
  • call (save-buffer) from inside.

    • enable "before-save-hook" and "after-save-hook".
  • call (clear-visited-file-modtime) at the end.

    • suppress the message "changed on disk; really edit the buffer?"
@kentaro kentaro merged commit 4acafab into from
@kentaro
Owner

I missed it! Thanks!!!!!!!!!!!!!!!!!!!!!111

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 22, 2012
  1. @elim

    Added a 'quiet save' mode

    elim authored
  2. @elim

    Add a 'quiet save' mode

    elim authored
  3. @elim
  4. @elim
  5. @elim
  6. @elim

    Fix a condition order

    elim authored
  7. @elim

    Merge branch 'master' of github.com:elim/auto-save-buffers-enhanced

    elim authored
    Conflicts:
    	auto-save-buffers-enhanced.el
  8. @elim

    Merge branch 'master' of github.com:elim/auto-save-buffers-enhanced

    elim authored
    Conflicts:
    	auto-save-buffers-enhanced.el
Commits on Aug 27, 2012
  1. @elim

    Fix 'change on disk' message

    elim authored
Commits on Sep 1, 2012
  1. @elim

    Improved quiet save

    elim authored
    - call (save-buffer) from inside.
      enable "before-save-hook" and "after-save-hook".
    
    - call (clear-visited-file-modtime) at the end.
      suppress the message "changed on disk; really edit the buffer?"
This page is out of date. Refresh to see the latest.
Showing with 11 additions and 4 deletions.
  1. +11 −4 auto-save-buffers-enhanced.el
View
15 auto-save-buffers-enhanced.el
@@ -247,12 +247,19 @@ the directories under VCS."
(insert content))
(set-buffer-modified-p nil)))
(auto-save-buffers-enhanced-quiet-save-p
- (progn
- (write-region nil nil buffer-file-name nil -1)
- (set-buffer-modified-p nil)
- (set-visited-file-modtime (current-time))))
+ (auto-save-buffers-enhanced-quiet-save-buffer))
(t (save-buffer))))
+(defun auto-save-buffers-enhanced-quiet-save-buffer ()
+ (fset 'original-write-region (symbol-function 'write-region))
+ (flet
+ ((write-region (start end filename &optional append visit lockname mustbenew)
+ (original-write-region start end filename append -1 lockname mustbenew))
+ (message (format-string &rest args) t))
+ (save-buffer)
+ (set-buffer-modified-p nil)
+ (clear-visited-file-modtime)))
+
(defun auto-save-buffers-enhanced-regexps-match-p (regexps string)
(catch 'matched
(dolist (regexp regexps)
Something went wrong with that request. Please try again.