[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 37/39: Use with-current-buffer
From: |
Phillip Lord |
Subject: |
[elpa] 37/39: Use with-current-buffer |
Date: |
Mon, 20 Oct 2014 08:22:47 +0000 |
phillord pushed a commit to branch externals/pabbrev
in repository elpa.
commit 817d298697e9d5af794f3f484d2422a5d1947cbd
Author: Phillip Lord <address@hidden>
Date: Tue Sep 16 22:56:23 2014 +0100
Use with-current-buffer
Replaces save-excursion, set-buffer combination which produces a byte
compile warning now.
---
pabbrev.el | 22 ++++++++++------------
1 files changed, 10 insertions(+), 12 deletions(-)
diff --git a/pabbrev.el b/pabbrev.el
index b8aca46..7cbe0d2 100644
--- a/pabbrev.el
+++ b/pabbrev.el
@@ -1103,8 +1103,8 @@ before the command gets run.")
(setq suggestions pabbrev-suggestions-done-suggestions)
(let
((window-width (- (window-width) 1)))
- (save-excursion
- (set-buffer (get-buffer " *pabbrev suggestions*"))
+ (with-current-buffer
+ (get-buffer " *pabbrev suggestions*")
(pabbrev-suggestions-setup)`
(princ
(concat;;"Current Word: " prefix " "
@@ -1219,8 +1219,8 @@ self inserting commands."
(defun pabbrev-suggestions-insert(insertion)
"Actually insert the suggestion."
(let ((point))
- (save-excursion
- (set-buffer pabbrev-suggestions-from-buffer)
+ (with-current-buffer
+ pabbrev-suggestions-from-buffer
(let ((bounds (pabbrev-bounds-of-thing-at-point)))
(progn
(delete-region (car bounds) (cdr bounds))
@@ -1420,8 +1420,8 @@ See `pabbrev-long-idle-timer'.")
(defun pabbrev-short-idle-timer(&optional buffer)
"Add a few words to the dictionary."
- (save-excursion
- (set-buffer (or buffer (current-buffer)))
+ (with-current-buffer
+ (or buffer (current-buffer))
;; remember which buffer we have just looked at.
(setq pabbrev-timer-buffer (current-buffer))
(if (and pabbrev-mode (not pabbrev-disable-timers))
@@ -1436,8 +1436,8 @@ See `pabbrev-long-idle-timer'.")
(defun pabbrev-idle-timer-function(&optional buffer)
;; so this only works on the current buffer. Might want to scavenge
;; over other buffers
- (save-excursion
- (set-buffer (or buffer pabbrev-timer-buffer (current-buffer)))
+ (with-current-buffer
+ (or buffer pabbrev-timer-buffer (current-buffer))
(if (and pabbrev-mode (not pabbrev-disable-timers))
(pabbrev-idle-timer-function-0)
(pabbrev-debug-message "idle running in non pabbrev-mode"))))
@@ -1511,9 +1511,8 @@ If this takes up too much processor power, see
`pabbrev-scavenge-some-chunk-size
`(if pabbrev-debug-enabled
(let ((insert
(concat (format ,@body) "\n")))
- (save-excursion
- (set-buffer
- (pabbrev-debug-get-buffer))
+ (with-current-buffer
+ (pabbrev-debug-get-buffer)
(goto-char (point-max))
(insert insert)
(pabbrev-debug-frame-scroll)))))
@@ -1733,6 +1732,5 @@ to the dictionary."
(setq ref1 (1+ ref1)))
(put 'working-status-forms 'lisp-indent-function 2)))))
-
(provide 'pabbrev)
;;; pabbrev.el ends here
- [elpa] 27/39: Add cider-nrepl mode to ignored., (continued)
- [elpa] 27/39: Add cider-nrepl mode to ignored., Phillip Lord, 2014/10/20
- [elpa] 24/39: Keywords, Status added., Phillip Lord, 2014/10/20
- [elpa] 32/39: README.md added., Phillip Lord, 2014/10/20
- [elpa] 34/39: Version 4.0, Phillip Lord, 2014/10/20
- [elpa] 02/39: Initial checking to mercurial, Phillip Lord, 2014/10/20
- [elpa] 33/39: README.md update for version 4.0, Phillip Lord, 2014/10/20
- [elpa] 01/39: Initial checkin to Mercurial, Phillip Lord, 2014/10/20
- [elpa] 39/39: Set version to 0 for ELPA., Phillip Lord, 2014/10/20
- [elpa] 35/39: Prepare for next iteration., Phillip Lord, 2014/10/20
- [elpa] 38/39: Updated copyright date., Phillip Lord, 2014/10/20
- [elpa] 37/39: Use with-current-buffer,
Phillip Lord <=
- [elpa] 28/39: Whitespace cleanup!, Phillip Lord, 2014/10/20
- [elpa] 36/39: set-overlays appeared twice., Phillip Lord, 2014/10/20
- [elpa] 31/39: Checkdoc completed., Phillip Lord, 2014/10/20
- [elpa] 30/39: COPYING added., Phillip Lord, 2014/10/20
- [elpa] 29/39: Moving pabbrev to its own repository., Phillip Lord, 2014/10/20