emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r117321: * lisp/hippie-exp.el (try-expand-line-all-b


From: Stefan Monnier
Subject: [Emacs-diffs] trunk r117321: * lisp/hippie-exp.el (try-expand-line-all-buffers)
Date: Thu, 12 Jun 2014 13:45:58 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117321
revision-id: address@hidden
parent: address@hidden
author: Emilio C. Lopes <address@hidden>
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Thu 2014-06-12 09:45:52 -0400
message:
  * lisp/hippie-exp.el (try-expand-line-all-buffers)
  (try-expand-list-all-buffers, try-expand-dabbrev-all-buffers):
  Read hippie-expand-only-buffers and hippie-expand-ignore-buffers in the
  original buffer, in case they're buffer-local.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/hippie-exp.el             
hippieexp.el-20091113204419-o5vbwnq5f7feedwu-531
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-06-12 06:04:48 +0000
+++ b/lisp/ChangeLog    2014-06-12 13:45:52 +0000
@@ -1,10 +1,17 @@
+2014-06-12  Emilio C. Lopes  <address@hidden>
+
+       * hippie-exp.el (try-expand-line-all-buffers)
+       (try-expand-list-all-buffers, try-expand-dabbrev-all-buffers):
+       Read hippie-expand-only-buffers and hippie-expand-ignore-buffers in the
+       original buffer, in case they're buffer-local.
+
 2014-06-12  Vincent Belaïche  <address@hidden>
 
        * ses.el (ses-initial-global-parameters-re): New defconst, a
        specific regexp is needed now that ses.el can handle both
-       file-format 2 --- ie. no local printers --- and 3 --- i.e. may have 
local printers.
-       (ses-localvars): Add local variables needed for local printer
-       handling.
+       file-format 2 --- ie. no local printers --- and 3 --- i.e. may have
+       local printers.
+       (ses-localvars): Add local variables needed for local printer handling.
        (ses-set-localvars): Handle hashmap initialisation.
        (ses-paramlines-plist): Add param-line for number of local printers.
        (ses-paramfmt-plist): New defconst, needed for code factorization
@@ -19,10 +26,11 @@
        (ses-printer-validate, ses-call-printer): Add support for local
        printer functions.
        (ses-file-format-extend-paramter-list): New defun.
-       (ses-set-parameter): Use const `ses-paramfmt-plist' for code 
factorization.
-       (ses-load): Add support for local
-       printer functions.
-       (ses-read-printer): Update docstring and add support for local printer 
functions.
+       (ses-set-parameter): Use const `ses-paramfmt-plist' for code
+       factorization.
+       (ses-load): Add support for local printer functions.
+       (ses-read-printer): Update docstring and add support for local printer
+       functions.
        (ses-refresh-local-printer, ses-define-local-printer): New defun.
        (ses-safe-printer): Add support for local printer functions.
 

=== modified file 'lisp/hippie-exp.el'
--- a/lisp/hippie-exp.el        2014-05-23 18:14:24 +0000
+++ b/lisp/hippie-exp.el        2014-06-12 13:45:52 +0000
@@ -639,12 +639,14 @@
 string).  It returns t if a new completion is found, nil otherwise."
   (let ((expansion ())
        (strip-prompt (and (get-buffer-process (current-buffer))
-                          comint-use-prompt-regexp
-                          comint-prompt-regexp))
-       (buf (current-buffer))
-       (orig-case-fold-search case-fold-search))
+               comint-use-prompt-regexp
+               comint-prompt-regexp))
+    (buf (current-buffer))
+        (only-buffers hippie-expand-only-buffers)
+        (ignore-buffers hippie-expand-ignore-buffers)
+    (orig-case-fold-search case-fold-search))
     (if (not old)
-       (progn
+    (progn
          (he-init-string (he-line-beg strip-prompt) (point))
          (setq he-search-bufs (buffer-list))
          (setq he-searched-n-bufs 0)
@@ -654,15 +656,15 @@
        (while (and he-search-bufs
                    (not expansion)
                    (or (not hippie-expand-max-buffers)
-                       (< he-searched-n-bufs hippie-expand-max-buffers)))
-         (set-buffer (car he-search-bufs))
-         (if (and (not (eq (current-buffer) buf))
-                  (if hippie-expand-only-buffers
-                      (he-buffer-member hippie-expand-only-buffers)
-                    (not (he-buffer-member hippie-expand-ignore-buffers))))
-             (save-excursion
-               (save-restriction
-                 (if hippie-expand-no-restriction
+            (< he-searched-n-bufs hippie-expand-max-buffers)))
+      (set-buffer (car he-search-bufs))
+      (if (and (not (eq (current-buffer) buf))
+           (if only-buffers
+               (he-buffer-member only-buffers)
+             (not (he-buffer-member ignore-buffers))))
+          (save-excursion
+        (save-restriction
+          (if hippie-expand-no-restriction
                      (widen))
                  (goto-char he-search-loc)
                  (setq strip-prompt (and (get-buffer-process (current-buffer))
@@ -770,10 +772,12 @@
 for subsequent calls (for further possible completions of the same
 string).  It returns t if a new completion is found, nil otherwise."
   (let ((expansion ())
-       (buf (current-buffer))
-       (orig-case-fold-search case-fold-search))
+        (buf (current-buffer))
+        (only-buffers hippie-expand-only-buffers)
+        (ignore-buffers hippie-expand-ignore-buffers)
+        (orig-case-fold-search case-fold-search))
     (if (not old)
-       (progn
+        (progn
          (he-init-string (he-list-beg) (point))
          (setq he-search-bufs (buffer-list))
          (setq he-searched-n-bufs 0)
@@ -786,9 +790,9 @@
                        (< he-searched-n-bufs hippie-expand-max-buffers)))
          (set-buffer (car he-search-bufs))
          (if (and (not (eq (current-buffer) buf))
-                  (if hippie-expand-only-buffers
-                      (he-buffer-member hippie-expand-only-buffers)
-                    (not (he-buffer-member hippie-expand-ignore-buffers))))
+                  (if only-buffers
+                      (he-buffer-member only-buffers)
+                    (not (he-buffer-member ignore-buffers))))
              (save-excursion
                (save-restriction
                  (if hippie-expand-no-restriction
@@ -811,9 +815,9 @@
        (progn
          (if old (he-reset-string))
          ())
-       (progn
-         (he-substitute-string expansion t)
-         t))))
+      (progn
+        (he-substitute-string expansion t)
+        t))))
 
 (defun he-list-search (str reverse)
   (let ((result ())
@@ -925,10 +929,12 @@
 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))
-       (orig-case-fold-search case-fold-search))
+        (buf (current-buffer))
+        (only-buffers hippie-expand-only-buffers)
+        (ignore-buffers hippie-expand-ignore-buffers)
+        (orig-case-fold-search case-fold-search))
     (if (not old)
-       (progn
+        (progn
          (he-init-string (he-dabbrev-beg) (point))
          (setq he-search-bufs (buffer-list))
          (setq he-searched-n-bufs 0)
@@ -941,9 +947,9 @@
                        (< he-searched-n-bufs hippie-expand-max-buffers)))
          (set-buffer (car he-search-bufs))
          (if (and (not (eq (current-buffer) buf))
-                  (if hippie-expand-only-buffers
-                      (he-buffer-member hippie-expand-only-buffers)
-                    (not (he-buffer-member hippie-expand-ignore-buffers))))
+                  (if only-buffers
+                      (he-buffer-member only-buffers)
+                    (not (he-buffer-member ignore-buffers))))
              (save-excursion
                (save-restriction
                  (if hippie-expand-no-restriction
@@ -966,9 +972,9 @@
        (progn
          (if old (he-reset-string))
          ())
-       (progn
-         (he-substitute-string expansion t)
-         t))))
+      (progn
+        (he-substitute-string expansion t)
+        t))))
 
 ;; Thanks go to Jeff Dairiki <address@hidden> who
 ;; suggested this one.


reply via email to

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