emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs/lisp ChangeLog hippie-exp.el


From: Stefan Monnier
Subject: [Emacs-diffs] emacs/lisp ChangeLog hippie-exp.el
Date: Thu, 03 Dec 2009 01:34:02 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Stefan Monnier <monnier>        09/12/03 01:34:01

Modified files:
        lisp           : ChangeLog hippie-exp.el 

Log message:
        (try-expand-dabbrev-visible): Preserve point in the
        buffers visited.  Remove redundant current-buffer-saving.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/ChangeLog?cvsroot=emacs&r1=1.16800&r2=1.16801
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/hippie-exp.el?cvsroot=emacs&r1=1.43&r2=1.44

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.16800
retrieving revision 1.16801
diff -u -b -r1.16800 -r1.16801
--- ChangeLog   2 Dec 2009 18:31:26 -0000       1.16800
+++ ChangeLog   3 Dec 2009 01:33:56 -0000       1.16801
@@ -1,3 +1,8 @@
+2009-12-03  Stefan Monnier  <address@hidden>
+
+       * hippie-exp.el (try-expand-dabbrev-visible): Preserve point in the
+       buffers visited.  Remove redundant current-buffer-saving.
+
 2009-12-02  Stefan Monnier  <address@hidden>
 
        Use completion-in-buffer and remove uses of dynamic scoping.

Index: hippie-exp.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/hippie-exp.el,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -b -r1.43 -r1.44
--- hippie-exp.el       13 Nov 2009 22:19:52 -0000      1.43
+++ hippie-exp.el       3 Dec 2009 01:34:01 -0000       1.44
@@ -81,7 +81,7 @@
 ;;      slow, don't use it unless you are really fond of `hippie-expand'.)
 ;;    `try-expand-list' : Tries to expand the text back to the nearest
 ;;      open delimiter, to a whole list from the buffer. Convenient for
-;;      example when writing lisp or TeX.
+;;      example when writing Lisp or TeX.
 ;;    `try-expand-list-all-buffers' : Like `try-expand-list' but searches
 ;;      in all buffers (except the current).
 ;;    `try-expand-dabbrev' : works exactly as dabbrev-expand (but of
@@ -928,7 +928,7 @@
          t))))
 
 (defun try-expand-dabbrev-all-buffers (old)
-  "Tries to expand word \"dynamically\", searching all other buffers.
+  "Try to expand word \"dynamically\", searching all other buffers.
 The argument OLD has to be nil the first call of this function, and t
 for subsequent calls (for further possible expansions of the same
 string).  It returns t if a new expansion is found, nil otherwise."
@@ -986,39 +986,37 @@
 for subsequent calls (for further possible expansions of the same
 string).  It returns t if a new expansion is found, nil otherwise."
   (let ((expansion ())
-       (buf (current-buffer))
        (flag (if (frame-visible-p (window-frame (selected-window)))
                  'visible t)))
-    (if (not old)
-       (progn
+    (unless old
           (he-init-string (he-dabbrev-beg) (point))
           (setq he-search-window (selected-window))
           (set-marker he-search-loc
                       (window-start he-search-window)
-                      (window-buffer he-search-window))))
+                  (window-buffer he-search-window)))
 
     (while (and (not (equal he-search-string ""))
                (marker-position he-search-loc)
                (not expansion))
       (with-current-buffer (marker-buffer he-search-loc)
+        (save-excursion
        (goto-char he-search-loc)
        (setq expansion (he-dabbrev-search he-search-string ()
                                           (window-end he-search-window)))
        (if (and expansion
                 (eq (marker-buffer he-string-beg) (current-buffer))
                 (eq (marker-position he-string-beg) (match-beginning 0)))
-           (setq expansion (he-dabbrev-search he-search-string ()
+              (setq expansion
+                    (he-dabbrev-search he-search-string ()
                                               (window-end he-search-window))))
-       (set-marker he-search-loc (point) (current-buffer)))
-      (if (not expansion)
-         (progn
+          (set-marker he-search-loc (point) (current-buffer))))
+      (unless expansion
            (setq he-search-window (next-window he-search-window nil flag))
            (if (eq he-search-window (selected-window))
                (set-marker he-search-loc nil)
              (set-marker he-search-loc (window-start he-search-window)
-                         (window-buffer he-search-window))))))
+                      (window-buffer he-search-window)))))
 
-    (set-buffer buf)
     (if (not expansion)
        (progn
          (if old (he-reset-string))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]