]> code.delx.au - gnu-emacs-elpa/commitdiff
Added dabbrev-code option to search all other buffers.
authorNikolaj Schumacher <git@nschum.de>
Fri, 17 Apr 2009 08:02:58 +0000 (10:02 +0200)
committerNikolaj Schumacher <git@nschum.de>
Sat, 18 Apr 2009 11:00:16 +0000 (13:00 +0200)
company-dabbrev-code.el

index 0787e3d8b3bc4faa2f5188267c0259e69ff77aac..4a17e5d5d32ffbb407557c741510293b4558a795 100644 (file)
@@ -37,11 +37,13 @@ Value t means complete in all modes."
 
 (defcustom company-dabbrev-code-other-buffers t
   "*Determines whether `company-dabbrev-code' should search other buffers.
-If t, search all buffers with the same major-mode.
+If 'all, search all other buffers.  If t, search buffers with the same
+major-mode.
 See also `company-dabbrev-code-time-limit'."
   :group 'company
   :type '(choice (const :tag "Off" nil)
-                 (const :tag "Same major mode" t)))
+                 (const :tag "Same major mode" t)
+                 (const :tag "All" all)))
 
 (defcustom company-dabbrev-code-time-limit .5
   "*Determines how long `company-dabbrev-code' should look for matches."
@@ -96,7 +98,8 @@ See also `company-dabbrev-code-time-limit'."
                                                         start limit)))
     (when company-dabbrev-code-other-buffers
       (dolist (buffer (delq (current-buffer) (buffer-list)))
-        (and (eq (buffer-local-value 'major-mode buffer) major-mode)
+        (and (or (eq company-dabbrev-code-other-buffers 'all)
+                 (eq (buffer-local-value 'major-mode buffer) major-mode))
              (with-current-buffer buffer
                (setq symbols
                      (company-dabbrev-code--buffer-symbols regexp nil symbols