diff options
| author | Stefan Monnier | 2009-10-30 02:16:41 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2009-10-30 02:16:41 +0000 |
| commit | 0816d744fb81400c736c1827b9c4332abd8fbabc (patch) | |
| tree | e4978f1987feb94a10c3301050cfcedd0c7318c9 | |
| parent | ca0a881a3512c1f9495833e15a801f5af5b89893 (diff) | |
| download | emacs-0816d744fb81400c736c1827b9c4332abd8fbabc.tar.gz emacs-0816d744fb81400c736c1827b9c4332abd8fbabc.zip | |
* cedet/srecode/srt-mode.el (semantic-analyze-possible-completions):
* cedet/semantic/symref/list.el (semantic-symref-rb-toggle-expand-tag):
* cedet/semantic/symref/grep.el (semantic-symref-perform-search):
* cedet/semantic/bovine/gcc.el (semantic-gcc-query):
* cedet/semantic/bovine/c.el (semantic-c-parse-lexical-token):
* cedet/semantic/analyze/debug.el (semantic-analyzer-debug-add-buttons)
(semantic-analyzer-debug-global-symbol)
(semantic-analyzer-debug-missing-innertype)
(semantic-analyzer-debug-insert-include-summary):
* cedet/semantic/util.el (semantic-file-tag-table):
(semantic-describe-buffer-var-helper, semantic-something-to-tag-table)
(semantic-recursive-find-nonterminal-by-name):
* cedet/semantic/tag-ls.el (semantic-tag-calculate-parent-default):
* cedet/semantic/tag-file.el (semantic-prototype-file):
* cedet/semantic/symref.el (semantic-symref-parse-tool-output):
* cedet/semantic/sb.el (semantic-sb-fetch-tag-table):
* cedet/semantic/lex-spp.el (semantic-lex-spp-lex-text-string):
* cedet/semantic/idle.el (semantic-idle-work-for-one-buffer):
(semantic-idle-summary-maybe-highlight):
* cedet/semantic/ia-sb.el (semantic-ia-speedbar)
(semantic-ia-sb-tag-info):
* cedet/semantic/grammar.el (semantic-analyze-possible-completions):
* cedet/semantic/find.el (semantic-brute-find-tag-by-position):
* cedet/semantic/ede-grammar.el (project-compile-target):
(ede-proj-makefile-insert-variables):
* cedet/semantic/debug.el (semantic-debug-set-parser-location):
(semantic-debug-set-source-location, semantic-debug-interface-layout)
(semantic-debug-mode, semantic-debug):
* cedet/semantic/db.el (semanticdb-needs-refresh-p):
* cedet/semantic/db-typecache.el (semanticdb-typecache-refresh-for-buffer):
* cedet/semantic/db-javascript.el (semanticdb-equivalent-mode):
* cedet/semantic/db-find.el (semanticdb-find-log-new-search)
(semanticdb-find-translate-path-includes--internal)
(semanticdb-reset-log, semanticdb-find-log-activity):
* cedet/semantic/db-file.el (object-write):
* cedet/semantic/db-el.el (semanticdb-equivalent-mode):
* cedet/semantic/db-ebrowse.el (semanticdb-ebrowse-C-file-p)
(semanticdb-create-ebrowse-database):
* cedet/semantic/db-debug.el (semanticdb-table-sanity-check):
* cedet/semantic/complete.el (semantic-displayor-focus-request)
(semantic-collector-calculate-completions-raw)
(semantic-complete-read-tag-analyzer):
* cedet/semantic/analyze.el (semantic-analyze-pulse):
* cedet/ede/util.el (ede-update-version-in-source):
* cedet/ede/proj.el (project-delete-target):
* cedet/ede/proj-elisp.el (ede-update-version-in-source)
(ede-proj-flush-autoconf):
* cedet/ede/pconf.el (ede-proj-configure-synchronize)
(ede-proj-configure-synchronize):
* cedet/ede/locate.el (ede-locate-file-in-project-impl):
* cedet/ede/linux.el (ede-linux-version):
* cedet/ede/emacs.el (ede-emacs-version):
* cedet/ede/dired.el (ede-dired-add-to-target):
* cedet/ede.el (ede-buffer-header-file, ede-find-target)
(ede-buffer-documentation-files, ede-project-buffers, ede-set)
(ede-target-buffers, ede-buffers, ede-make-project-local-variable):
* cedet/cedet-idutils.el (cedet-idutils-fnid-call):
(cedet-idutils-lid-call, cedet-idutils-expand-filename)
(cedet-idutils-version-check):
* cedet/cedet-global.el (cedet-gnu-global-call):
(cedet-gnu-global-expand-filename, cedet-gnu-global-root)
(cedet-gnu-global-version-check, cedet-gnu-global-scan-hits):
* cedet/cedet-cscope.el (cedet-cscope-call)
(cedet-cscope-expand-filename, cedet-cscope-version-check):
Use with-current-buffer.
* cedet/ede.el (ede-make-project-local-variable)
(ede-set-project-variables, ede-set): Use dolist.
40 files changed, 114 insertions, 208 deletions
diff --git a/lisp/cedet/cedet-cscope.el b/lisp/cedet/cedet-cscope.el index 6bb7508fd60..ee3d75e2240 100644 --- a/lisp/cedet/cedet-cscope.el +++ b/lisp/cedet/cedet-cscope.el | |||
| @@ -77,8 +77,7 @@ SCOPE is the scope of the search, such as 'project or 'subdirs." | |||
| 77 | (let ((b (get-buffer-create "*CEDET CScope*")) | 77 | (let ((b (get-buffer-create "*CEDET CScope*")) |
| 78 | (cd default-directory) | 78 | (cd default-directory) |
| 79 | ) | 79 | ) |
| 80 | (save-excursion | 80 | (with-current-buffer b |
| 81 | (set-buffer b) | ||
| 82 | (setq default-directory cd) | 81 | (setq default-directory cd) |
| 83 | (erase-buffer)) | 82 | (erase-buffer)) |
| 84 | (apply 'call-process cedet-cscope-command | 83 | (apply 'call-process cedet-cscope-command |
| @@ -90,8 +89,8 @@ SCOPE is the scope of the search, such as 'project or 'subdirs." | |||
| 90 | "Expand the FILENAME with CScope. | 89 | "Expand the FILENAME with CScope. |
| 91 | Return a fully qualified filename." | 90 | Return a fully qualified filename." |
| 92 | (interactive "sFile: ") | 91 | (interactive "sFile: ") |
| 93 | (let* ((ans1 (save-excursion | 92 | (let* ((ans1 (with-current-buffer |
| 94 | (set-buffer (cedet-cscope-call (list "-d" "-L" "-7" filename))) | 93 | (cedet-cscope-call (list "-d" "-L" "-7" filename)) |
| 95 | (goto-char (point-min)) | 94 | (goto-char (point-min)) |
| 96 | (if (looking-at "[^ \n]*cscope: ") | 95 | (if (looking-at "[^ \n]*cscope: ") |
| 97 | (error "CScope not available") | 96 | (error "CScope not available") |
| @@ -137,8 +136,7 @@ return nil." | |||
| 137 | (when (interactive-p) | 136 | (when (interactive-p) |
| 138 | (message "CScope not found.")) | 137 | (message "CScope not found.")) |
| 139 | nil) | 138 | nil) |
| 140 | (save-excursion | 139 | (with-current-buffer b |
| 141 | (set-buffer b) | ||
| 142 | (goto-char (point-min)) | 140 | (goto-char (point-min)) |
| 143 | (re-search-forward "cscope: version \\([0-9.]+\\)" nil t) | 141 | (re-search-forward "cscope: version \\([0-9.]+\\)" nil t) |
| 144 | (setq rev (match-string 1)) | 142 | (setq rev (match-string 1)) |
diff --git a/lisp/cedet/cedet-global.el b/lisp/cedet/cedet-global.el index dc3ef815be3..ac96055cc3b 100644 --- a/lisp/cedet/cedet-global.el +++ b/lisp/cedet/cedet-global.el | |||
| @@ -67,8 +67,7 @@ SCOPE is the scope of the search, such as 'project or 'subdirs." | |||
| 67 | "Call GNU Global with the list of FLAGS." | 67 | "Call GNU Global with the list of FLAGS." |
| 68 | (let ((b (get-buffer-create "*CEDET Global*")) | 68 | (let ((b (get-buffer-create "*CEDET Global*")) |
| 69 | (cd default-directory)) | 69 | (cd default-directory)) |
| 70 | (save-excursion | 70 | (with-current-buffer b |
| 71 | (set-buffer b) | ||
| 72 | (setq default-directory cd) | 71 | (setq default-directory cd) |
| 73 | (erase-buffer)) | 72 | (erase-buffer)) |
| 74 | (apply 'call-process cedet-global-command | 73 | (apply 'call-process cedet-global-command |
| @@ -80,8 +79,7 @@ SCOPE is the scope of the search, such as 'project or 'subdirs." | |||
| 80 | "Expand the FILENAME with GNU Global. | 79 | "Expand the FILENAME with GNU Global. |
| 81 | Return a fully qualified filename." | 80 | Return a fully qualified filename." |
| 82 | (interactive "sFile: ") | 81 | (interactive "sFile: ") |
| 83 | (let ((ans (save-excursion | 82 | (let ((ans (with-current-buffer (cedet-gnu-global-call (list "-Pa" filename)) |
| 84 | (set-buffer (cedet-gnu-global-call (list "-Pa" filename))) | ||
| 85 | (goto-char (point-min)) | 83 | (goto-char (point-min)) |
| 86 | (if (looking-at "global: ") | 84 | (if (looking-at "global: ") |
| 87 | (error "GNU Global not available") | 85 | (error "GNU Global not available") |
| @@ -105,8 +103,7 @@ Return a fully qualified filename." | |||
| 105 | If a default starting DIR is not specified, the current buffer's | 103 | If a default starting DIR is not specified, the current buffer's |
| 106 | `default-directory' is used." | 104 | `default-directory' is used." |
| 107 | (let ((default-directory (or dir default-directory))) | 105 | (let ((default-directory (or dir default-directory))) |
| 108 | (save-excursion | 106 | (with-current-buffer (cedet-gnu-global-call (list "-pq")) |
| 109 | (set-buffer (cedet-gnu-global-call (list "-pq"))) | ||
| 110 | (goto-char (point-min)) | 107 | (goto-char (point-min)) |
| 111 | (when (not (eobp)) | 108 | (when (not (eobp)) |
| 112 | (file-name-as-directory | 109 | (file-name-as-directory |
| @@ -128,8 +125,7 @@ return nil." | |||
| 128 | (when (interactive-p) | 125 | (when (interactive-p) |
| 129 | (message "GNU Global not found.")) | 126 | (message "GNU Global not found.")) |
| 130 | nil) | 127 | nil) |
| 131 | (save-excursion | 128 | (with-current-buffer b |
| 132 | (set-buffer b) | ||
| 133 | (goto-char (point-min)) | 129 | (goto-char (point-min)) |
| 134 | (re-search-forward "GNU GLOBAL \\([0-9.]+\\)" nil t) | 130 | (re-search-forward "GNU GLOBAL \\([0-9.]+\\)" nil t) |
| 135 | (setq rev (match-string 1)) | 131 | (setq rev (match-string 1)) |
| @@ -147,8 +143,7 @@ return nil." | |||
| 147 | "Scan all the hits from the GNU Global output BUFFER." | 143 | "Scan all the hits from the GNU Global output BUFFER." |
| 148 | (let ((hits nil) | 144 | (let ((hits nil) |
| 149 | (r1 "^\\([^ ]+\\) +\\([0-9]+\\) \\([^ ]+\\) ")) | 145 | (r1 "^\\([^ ]+\\) +\\([0-9]+\\) \\([^ ]+\\) ")) |
| 150 | (save-excursion | 146 | (with-current-buffer buffer |
| 151 | (set-buffer buffer) | ||
| 152 | (goto-char (point-min)) | 147 | (goto-char (point-min)) |
| 153 | (while (re-search-forward r1 nil t) | 148 | (while (re-search-forward r1 nil t) |
| 154 | (setq hits (cons (cons (string-to-number (match-string 2)) | 149 | (setq hits (cons (cons (string-to-number (match-string 2)) |
diff --git a/lisp/cedet/cedet-idutils.el b/lisp/cedet/cedet-idutils.el index e3cbf0d9ff3..32c2f3264b4 100644 --- a/lisp/cedet/cedet-idutils.el +++ b/lisp/cedet/cedet-idutils.el | |||
| @@ -82,8 +82,7 @@ Return the created buffer with with program output." | |||
| 82 | (let ((b (get-buffer-create "*CEDET fnid*")) | 82 | (let ((b (get-buffer-create "*CEDET fnid*")) |
| 83 | (cd default-directory) | 83 | (cd default-directory) |
| 84 | ) | 84 | ) |
| 85 | (save-excursion | 85 | (with-current-buffer b |
| 86 | (set-buffer b) | ||
| 87 | (setq default-directory cd) | 86 | (setq default-directory cd) |
| 88 | (erase-buffer)) | 87 | (erase-buffer)) |
| 89 | (apply 'call-process cedet-idutils-file-command | 88 | (apply 'call-process cedet-idutils-file-command |
| @@ -97,8 +96,7 @@ Return the created buffer with with program output." | |||
| 97 | (let ((b (get-buffer-create "*CEDET lid*")) | 96 | (let ((b (get-buffer-create "*CEDET lid*")) |
| 98 | (cd default-directory) | 97 | (cd default-directory) |
| 99 | ) | 98 | ) |
| 100 | (save-excursion | 99 | (with-current-buffer b |
| 101 | (set-buffer b) | ||
| 102 | (setq default-directory cd) | 100 | (setq default-directory cd) |
| 103 | (erase-buffer)) | 101 | (erase-buffer)) |
| 104 | (apply 'call-process cedet-idutils-token-command | 102 | (apply 'call-process cedet-idutils-token-command |
| @@ -112,8 +110,7 @@ Return the created buffer with with program output." | |||
| 112 | "Expand the FILENAME with ID Utils. | 110 | "Expand the FILENAME with ID Utils. |
| 113 | Return a filename relative to the default directory." | 111 | Return a filename relative to the default directory." |
| 114 | (interactive "sFile: ") | 112 | (interactive "sFile: ") |
| 115 | (let ((ans (save-excursion | 113 | (let ((ans (with-current-buffer (cedet-idutils-fnid-call (list filename)) |
| 116 | (set-buffer (cedet-idutils-fnid-call (list filename))) | ||
| 117 | (goto-char (point-min)) | 114 | (goto-char (point-min)) |
| 118 | (if (looking-at "[^ \n]*fnid: ") | 115 | (if (looking-at "[^ \n]*fnid: ") |
| 119 | (error "ID Utils not available") | 116 | (error "ID Utils not available") |
| @@ -160,8 +157,7 @@ return nil." | |||
| 160 | (when (interactive-p) | 157 | (when (interactive-p) |
| 161 | (message "ID Utils not found.")) | 158 | (message "ID Utils not found.")) |
| 162 | nil) | 159 | nil) |
| 163 | (save-excursion | 160 | (with-current-buffer b |
| 164 | (set-buffer b) | ||
| 165 | (goto-char (point-min)) | 161 | (goto-char (point-min)) |
| 166 | (re-search-forward "fnid - \\([0-9.]+\\)" nil t) | 162 | (re-search-forward "fnid - \\([0-9.]+\\)" nil t) |
| 167 | (setq rev (match-string 1)) | 163 | (setq rev (match-string 1)) |
diff --git a/lisp/cedet/ede.el b/lisp/cedet/ede.el index 3d05202e7aa..a88589c686d 100644 --- a/lisp/cedet/ede.el +++ b/lisp/cedet/ede.el | |||
| @@ -1467,8 +1467,7 @@ Not all buffers need headers, so return nil if no applicable." | |||
| 1467 | (defmethod ede-buffer-header-file ((this ede-target) buffer) | 1467 | (defmethod ede-buffer-header-file ((this ede-target) buffer) |
| 1468 | "There are no default header files in EDE. | 1468 | "There are no default header files in EDE. |
| 1469 | Do a quick check to see if there is a Header tag in this buffer." | 1469 | Do a quick check to see if there is a Header tag in this buffer." |
| 1470 | (save-excursion | 1470 | (with-current-buffer buffer |
| 1471 | (set-buffer buffer) | ||
| 1472 | (if (re-search-forward "::Header:: \\([a-zA-Z0-9.]+\\)" nil t) | 1471 | (if (re-search-forward "::Header:: \\([a-zA-Z0-9.]+\\)" nil t) |
| 1473 | (buffer-substring-no-properties (match-beginning 1) | 1472 | (buffer-substring-no-properties (match-beginning 1) |
| 1474 | (match-end 1)) | 1473 | (match-end 1)) |
| @@ -1495,8 +1494,7 @@ Some projects may have multiple documentation files, so return a list." | |||
| 1495 | (defmethod ede-buffer-documentation-files ((this ede-target) buffer) | 1494 | (defmethod ede-buffer-documentation-files ((this ede-target) buffer) |
| 1496 | "Check for some documentation files for THIS. | 1495 | "Check for some documentation files for THIS. |
| 1497 | Also do a quick check to see if there is a Documentation tag in this BUFFER." | 1496 | Also do a quick check to see if there is a Documentation tag in this BUFFER." |
| 1498 | (save-excursion | 1497 | (with-current-buffer buffer |
| 1499 | (set-buffer buffer) | ||
| 1500 | (if (re-search-forward "::Documentation:: \\([a-zA-Z0-9.]+\\)" nil t) | 1498 | (if (re-search-forward "::Documentation:: \\([a-zA-Z0-9.]+\\)" nil t) |
| 1501 | (buffer-substring-no-properties (match-beginning 1) | 1499 | (buffer-substring-no-properties (match-beginning 1) |
| 1502 | (match-end 1)) | 1500 | (match-end 1)) |
| @@ -1743,8 +1741,7 @@ could become slow in time." | |||
| 1743 | 1741 | ||
| 1744 | (defmethod ede-find-target ((proj ede-project) buffer) | 1742 | (defmethod ede-find-target ((proj ede-project) buffer) |
| 1745 | "Fetch the target in PROJ belonging to BUFFER or nil." | 1743 | "Fetch the target in PROJ belonging to BUFFER or nil." |
| 1746 | (save-excursion | 1744 | (with-current-buffer buffer |
| 1747 | (set-buffer buffer) | ||
| 1748 | (or ede-object | 1745 | (or ede-object |
| 1749 | (if (ede-buffer-mine proj buffer) | 1746 | (if (ede-buffer-mine proj buffer) |
| 1750 | proj | 1747 | proj |
| @@ -1781,8 +1778,7 @@ This includes buffers controlled by a specific target of PROJECT." | |||
| 1781 | (let ((bl (buffer-list)) | 1778 | (let ((bl (buffer-list)) |
| 1782 | (pl nil)) | 1779 | (pl nil)) |
| 1783 | (while bl | 1780 | (while bl |
| 1784 | (save-excursion | 1781 | (with-current-buffer (car bl) |
| 1785 | (set-buffer (car bl)) | ||
| 1786 | (if (and ede-object (eq (ede-current-project) project)) | 1782 | (if (and ede-object (eq (ede-current-project) project)) |
| 1787 | (setq pl (cons (car bl) pl)))) | 1783 | (setq pl (cons (car bl) pl)))) |
| 1788 | (setq bl (cdr bl))) | 1784 | (setq bl (cdr bl))) |
| @@ -1793,8 +1789,7 @@ This includes buffers controlled by a specific target of PROJECT." | |||
| 1793 | (let ((bl (buffer-list)) | 1789 | (let ((bl (buffer-list)) |
| 1794 | (pl nil)) | 1790 | (pl nil)) |
| 1795 | (while bl | 1791 | (while bl |
| 1796 | (save-excursion | 1792 | (with-current-buffer (car bl) |
| 1797 | (set-buffer (car bl)) | ||
| 1798 | (if (if (listp ede-object) | 1793 | (if (if (listp ede-object) |
| 1799 | (memq target ede-object) | 1794 | (memq target ede-object) |
| 1800 | (eq ede-object target)) | 1795 | (eq ede-object target)) |
| @@ -1807,8 +1802,7 @@ This includes buffers controlled by a specific target of PROJECT." | |||
| 1807 | (let ((bl (buffer-list)) | 1802 | (let ((bl (buffer-list)) |
| 1808 | (pl nil)) | 1803 | (pl nil)) |
| 1809 | (while bl | 1804 | (while bl |
| 1810 | (save-excursion | 1805 | (with-current-buffer (car bl) |
| 1811 | (set-buffer (car bl)) | ||
| 1812 | (if ede-object | 1806 | (if ede-object |
| 1813 | (setq pl (cons (car bl) pl)))) | 1807 | (setq pl (cons (car bl) pl)))) |
| 1814 | (setq bl (cdr bl))) | 1808 | (setq bl (cdr bl))) |
| @@ -1897,22 +1891,18 @@ Return the first non-nil value returned by PROC." | |||
| 1897 | nil | 1891 | nil |
| 1898 | (oset project local-variables (cons (list variable) | 1892 | (oset project local-variables (cons (list variable) |
| 1899 | (oref project local-variables))) | 1893 | (oref project local-variables))) |
| 1900 | (mapcar (lambda (b) (save-excursion | 1894 | (dolist (b (ede-project-buffers project)) |
| 1901 | (set-buffer b) | 1895 | (with-current-buffer b |
| 1902 | (make-local-variable variable))) | 1896 | (make-local-variable variable))))) |
| 1903 | (ede-project-buffers project)))) | ||
| 1904 | 1897 | ||
| 1905 | (defmethod ede-set-project-variables ((project ede-project) &optional buffer) | 1898 | (defmethod ede-set-project-variables ((project ede-project) &optional buffer) |
| 1906 | "Set variables local to PROJECT in BUFFER." | 1899 | "Set variables local to PROJECT in BUFFER." |
| 1907 | (if (not buffer) (setq buffer (current-buffer))) | 1900 | (if (not buffer) (setq buffer (current-buffer))) |
| 1908 | (save-excursion | 1901 | (with-current-buffer buffer |
| 1909 | (set-buffer buffer) | 1902 | (dolist (v (oref project local-variables)) |
| 1910 | (mapcar (lambda (v) | 1903 | (make-local-variable (car v)) |
| 1911 | (make-local-variable (car v)) | 1904 | ;; set it's value here? |
| 1912 | ;; set it's value here? | 1905 | (set (car v) (cdr v))))) |
| 1913 | (set (car v) (cdr v)) | ||
| 1914 | ) | ||
| 1915 | (oref project local-variables)))) | ||
| 1916 | 1906 | ||
| 1917 | (defun ede-set (variable value &optional proj) | 1907 | (defun ede-set (variable value &optional proj) |
| 1918 | "Set the project local VARIABLE to VALUE. | 1908 | "Set the project local VARIABLE to VALUE. |
| @@ -1923,10 +1913,9 @@ is the project to use, instead of `ede-current-project'." | |||
| 1923 | (if (and p (setq a (assoc variable (oref p local-variables)))) | 1913 | (if (and p (setq a (assoc variable (oref p local-variables)))) |
| 1924 | (progn | 1914 | (progn |
| 1925 | (setcdr a value) | 1915 | (setcdr a value) |
| 1926 | (mapc (lambda (b) (save-excursion | 1916 | (dolist (b (ede-project-buffers p)) |
| 1927 | (set-buffer b) | 1917 | (with-current-buffer b |
| 1928 | (set variable value))) | 1918 | (set variable value)))) |
| 1929 | (ede-project-buffers p))) | ||
| 1930 | (set variable value)) | 1919 | (set variable value)) |
| 1931 | (ede-commit-local-variables p)) | 1920 | (ede-commit-local-variables p)) |
| 1932 | value) | 1921 | value) |
diff --git a/lisp/cedet/ede/dired.el b/lisp/cedet/ede/dired.el index 43f821da766..9367121d114 100644 --- a/lisp/cedet/ede/dired.el +++ b/lisp/cedet/ede/dired.el | |||
| @@ -90,8 +90,7 @@ negative, force off." | |||
| 90 | (project-add-file target (car files)) | 90 | (project-add-file target (car files)) |
| 91 | ;; Find the buffer for this files, and set it's ede-object | 91 | ;; Find the buffer for this files, and set it's ede-object |
| 92 | (if (get-file-buffer (car files)) | 92 | (if (get-file-buffer (car files)) |
| 93 | (save-excursion | 93 | (with-current-buffer (get-file-buffer (car files)) |
| 94 | (set-buffer (get-file-buffer (car files))) | ||
| 95 | (setq ede-object nil) | 94 | (setq ede-object nil) |
| 96 | (setq ede-object (ede-buffer-object (current-buffer))))) | 95 | (setq ede-object (ede-buffer-object (current-buffer))))) |
| 97 | ;; Increment. | 96 | ;; Increment. |
diff --git a/lisp/cedet/ede/emacs.el b/lisp/cedet/ede/emacs.el index a38e6a0ef0d..ac8616b1824 100644 --- a/lisp/cedet/ede/emacs.el +++ b/lisp/cedet/ede/emacs.el | |||
| @@ -76,8 +76,7 @@ Return a tuple of ( EMACSNAME . VERSION )." | |||
| 76 | (let ((buff (get-buffer-create " *emacs-query*")) | 76 | (let ((buff (get-buffer-create " *emacs-query*")) |
| 77 | (emacs "Emacs") | 77 | (emacs "Emacs") |
| 78 | (ver "")) | 78 | (ver "")) |
| 79 | (save-excursion | 79 | (with-current-buffer buff |
| 80 | (set-buffer buff) | ||
| 81 | (erase-buffer) | 80 | (erase-buffer) |
| 82 | (setq default-directory (file-name-as-directory dir)) | 81 | (setq default-directory (file-name-as-directory dir)) |
| 83 | ;(call-process "egrep" nil buff nil "-n" "-e" "^version=" "Makefile") | 82 | ;(call-process "egrep" nil buff nil "-n" "-e" "^version=" "Makefile") |
diff --git a/lisp/cedet/ede/linux.el b/lisp/cedet/ede/linux.el index c80902bf0be..7ef03b58301 100644 --- a/lisp/cedet/ede/linux.el +++ b/lisp/cedet/ede/linux.el | |||
| @@ -72,8 +72,7 @@ DIR is the directory to search from." | |||
| 72 | (defun ede-linux-version (dir) | 72 | (defun ede-linux-version (dir) |
| 73 | "Find the Linux version for the Linux src in DIR." | 73 | "Find the Linux version for the Linux src in DIR." |
| 74 | (let ((buff (get-buffer-create " *linux-query*"))) | 74 | (let ((buff (get-buffer-create " *linux-query*"))) |
| 75 | (save-excursion | 75 | (with-current-buffer buff |
| 76 | (set-buffer buff) | ||
| 77 | (erase-buffer) | 76 | (erase-buffer) |
| 78 | (setq default-directory (file-name-as-directory dir)) | 77 | (setq default-directory (file-name-as-directory dir)) |
| 79 | (insert-file-contents "Makefile" nil 0 512) | 78 | (insert-file-contents "Makefile" nil 0 512) |
diff --git a/lisp/cedet/ede/locate.el b/lisp/cedet/ede/locate.el index 3f38dc312c1..8d1bd5a3544 100644 --- a/lisp/cedet/ede/locate.el +++ b/lisp/cedet/ede/locate.el | |||
| @@ -190,15 +190,13 @@ that crated this ede locat object." | |||
| 190 | (b (get-buffer-create "*LOCATE*")) | 190 | (b (get-buffer-create "*LOCATE*")) |
| 191 | (cd default-directory) | 191 | (cd default-directory) |
| 192 | ) | 192 | ) |
| 193 | (save-excursion | 193 | (with-current-buffer b |
| 194 | (set-buffer b) | ||
| 195 | (setq default-directory cd) | 194 | (setq default-directory cd) |
| 196 | (erase-buffer)) | 195 | (erase-buffer)) |
| 197 | (apply 'call-process locate-command | 196 | (apply 'call-process locate-command |
| 198 | nil b nil | 197 | nil b nil |
| 199 | searchstr nil) | 198 | searchstr nil) |
| 200 | (save-excursion | 199 | (with-current-buffer b |
| 201 | (set-buffer b) | ||
| 202 | (split-string (buffer-string) "\n" t)) | 200 | (split-string (buffer-string) "\n" t)) |
| 203 | ) | 201 | ) |
| 204 | ) | 202 | ) |
diff --git a/lisp/cedet/ede/pconf.el b/lisp/cedet/ede/pconf.el index 216da94096f..7f9d92e5781 100644 --- a/lisp/cedet/ede/pconf.el +++ b/lisp/cedet/ede/pconf.el | |||
| @@ -112,10 +112,10 @@ don't do it. A value of nil means to just do it.") | |||
| 112 | ;; Verify that we have a make system. | 112 | ;; Verify that we have a make system. |
| 113 | (if (or (not (ede-expand-filename (ede-toplevel this) "Makefile")) | 113 | (if (or (not (ede-expand-filename (ede-toplevel this) "Makefile")) |
| 114 | ;; Now is this one of our old Makefiles? | 114 | ;; Now is this one of our old Makefiles? |
| 115 | (save-excursion | 115 | (with-current-buffer |
| 116 | (set-buffer (find-file-noselect | 116 | (find-file-noselect |
| 117 | (ede-expand-filename (ede-toplevel this) | 117 | (ede-expand-filename (ede-toplevel this) |
| 118 | "Makefile" t) t)) | 118 | "Makefile" t) t) |
| 119 | (goto-char (point-min)) | 119 | (goto-char (point-min)) |
| 120 | ;; Here is the unique piece for our makefiles. | 120 | ;; Here is the unique piece for our makefiles. |
| 121 | (re-search-forward "For use with: make" nil t))) | 121 | (re-search-forward "For use with: make" nil t))) |
| @@ -128,8 +128,7 @@ don't do it. A value of nil means to just do it.") | |||
| 128 | (accept-process-output) | 128 | (accept-process-output) |
| 129 | (sit-for 1)) | 129 | (sit-for 1)) |
| 130 | 130 | ||
| 131 | (save-excursion | 131 | (with-current-buffer "*compilation*" |
| 132 | (set-buffer "*compilation*") | ||
| 133 | (goto-char (point-max)) | 132 | (goto-char (point-max)) |
| 134 | 133 | ||
| 135 | (when (not (string= mode-line-process ":exit [0]")) | 134 | (when (not (string= mode-line-process ":exit [0]")) |
diff --git a/lisp/cedet/ede/proj-elisp.el b/lisp/cedet/ede/proj-elisp.el index bbee823ba03..a8b16e6ee6c 100644 --- a/lisp/cedet/ede/proj-elisp.el +++ b/lisp/cedet/ede/proj-elisp.el | |||
| @@ -151,9 +151,8 @@ is found, such as a `-version' variable, or the standard header." | |||
| 151 | (let ((vs (oref this versionsource)) | 151 | (let ((vs (oref this versionsource)) |
| 152 | (match nil)) | 152 | (match nil)) |
| 153 | (while vs | 153 | (while vs |
| 154 | (save-excursion | 154 | (with-current-buffer (find-file-noselect |
| 155 | (set-buffer (find-file-noselect | 155 | (ede-expand-filename this (car vs))) |
| 156 | (ede-expand-filename this (car vs)))) | ||
| 157 | (goto-char (point-min)) | 156 | (goto-char (point-min)) |
| 158 | (let ((case-fold-search t)) | 157 | (let ((case-fold-search t)) |
| 159 | (if (re-search-forward "-version\\s-+\"\\([^\"]+\\)\"" nil t) | 158 | (if (re-search-forward "-version\\s-+\"\\([^\"]+\\)\"" nil t) |
| @@ -244,8 +243,7 @@ is found, such as a `-version' variable, or the standard header." | |||
| 244 | (let ((ec (ede-expand-filename this "elisp-comp" 'newfile)) | 243 | (let ((ec (ede-expand-filename this "elisp-comp" 'newfile)) |
| 245 | ) | 244 | ) |
| 246 | (if (and ec (file-exists-p ec)) | 245 | (if (and ec (file-exists-p ec)) |
| 247 | (save-excursion | 246 | (with-current-buffer (find-file-noselect ec t) |
| 248 | (set-buffer (find-file-noselect ec t)) | ||
| 249 | (goto-char (point-min)) | 247 | (goto-char (point-min)) |
| 250 | (while (re-search-forward "(cons \\([^ ]+\\) load-path)" | 248 | (while (re-search-forward "(cons \\([^ ]+\\) load-path)" |
| 251 | nil t) | 249 | nil t) |
diff --git a/lisp/cedet/ede/proj.el b/lisp/cedet/ede/proj.el index 046567fe831..6722fd7b2b7 100644 --- a/lisp/cedet/ede/proj.el +++ b/lisp/cedet/ede/proj.el | |||
| @@ -407,8 +407,7 @@ Argument TARGET is the project we are completing customization on." | |||
| 407 | (let* ((default-directory (oref this path)) | 407 | (let* ((default-directory (oref this path)) |
| 408 | (b (get-file-buffer (car ts)))) | 408 | (b (get-file-buffer (car ts)))) |
| 409 | (if b | 409 | (if b |
| 410 | (save-excursion | 410 | (with-current-buffer b |
| 411 | (set-buffer b) | ||
| 412 | (if (eq ede-object this) | 411 | (if (eq ede-object this) |
| 413 | (progn | 412 | (progn |
| 414 | (setq ede-object nil) | 413 | (setq ede-object nil) |
diff --git a/lisp/cedet/ede/util.el b/lisp/cedet/ede/util.el index 11fbee2eb7a..5dc6a76e3d2 100644 --- a/lisp/cedet/ede/util.el +++ b/lisp/cedet/ede/util.el | |||
| @@ -64,9 +64,8 @@ their sources to VERSION." | |||
| 64 | (oref this versionsource)) | 64 | (oref this versionsource)) |
| 65 | (let ((vs (oref this versionsource))) | 65 | (let ((vs (oref this versionsource))) |
| 66 | (while vs | 66 | (while vs |
| 67 | (save-excursion | 67 | (with-current-buffer (find-file-noselect |
| 68 | (set-buffer (find-file-noselect | 68 | (ede-expand-filename this (car vs))) |
| 69 | (ede-expand-filename this (car vs)))) | ||
| 70 | (goto-char (point-min)) | 69 | (goto-char (point-min)) |
| 71 | (let ((case-fold-search t)) | 70 | (let ((case-fold-search t)) |
| 72 | (if (re-search-forward "version:\\s-*\\([^ \t\n]+\\)" nil t) | 71 | (if (re-search-forward "version:\\s-*\\([^ \t\n]+\\)" nil t) |
diff --git a/lisp/cedet/semantic/analyze.el b/lisp/cedet/semantic/analyze.el index a4d5664f226..d7e18102b81 100644 --- a/lisp/cedet/semantic/analyze.el +++ b/lisp/cedet/semantic/analyze.el | |||
| @@ -710,8 +710,7 @@ Optional argument CTXT is the context to show." | |||
| 710 | (defmethod semantic-analyze-pulse ((context semantic-analyze-context)) | 710 | (defmethod semantic-analyze-pulse ((context semantic-analyze-context)) |
| 711 | "Pulse the region that CONTEXT affects." | 711 | "Pulse the region that CONTEXT affects." |
| 712 | (require 'pulse) | 712 | (require 'pulse) |
| 713 | (save-excursion | 713 | (with-current-buffer (oref context :buffer) |
| 714 | (set-buffer (oref context :buffer)) | ||
| 715 | (let ((bounds (oref context :bounds))) | 714 | (let ((bounds (oref context :bounds))) |
| 716 | (when bounds | 715 | (when bounds |
| 717 | (pulse-momentary-highlight-region (car bounds) (cdr bounds)))))) | 716 | (pulse-momentary-highlight-region (car bounds) (cdr bounds)))))) |
diff --git a/lisp/cedet/semantic/analyze/debug.el b/lisp/cedet/semantic/analyze/debug.el index f7c390784d6..2b5325f848d 100644 --- a/lisp/cedet/semantic/analyze/debug.el +++ b/lisp/cedet/semantic/analyze/debug.el | |||
| @@ -104,8 +104,7 @@ Argument COMP are possible completions here." | |||
| 104 | ;; NOTE: This line is copied from semantic-analyze-current-context. | 104 | ;; NOTE: This line is copied from semantic-analyze-current-context. |
| 105 | ;; You will need to update both places. | 105 | ;; You will need to update both places. |
| 106 | (condition-case err | 106 | (condition-case err |
| 107 | (save-excursion | 107 | (with-current-buffer origbuf |
| 108 | (set-buffer origbuf) | ||
| 109 | (let* ((position (or (cdr-safe (oref ctxt bounds)) (point))) | 108 | (let* ((position (or (cdr-safe (oref ctxt bounds)) (point))) |
| 110 | (prefixtypes nil) ; Used as type return | 109 | (prefixtypes nil) ; Used as type return |
| 111 | (scope (semantic-calculate-scope position)) | 110 | (scope (semantic-calculate-scope position)) |
| @@ -246,13 +245,11 @@ with the command: | |||
| 246 | (princ "\nSemantic has found the datatype ") | 245 | (princ "\nSemantic has found the datatype ") |
| 247 | (semantic-analyzer-debug-insert-tag dt) | 246 | (semantic-analyzer-debug-insert-tag dt) |
| 248 | (if (or (not (semantic-equivalent-tag-p ots dt)) | 247 | (if (or (not (semantic-equivalent-tag-p ots dt)) |
| 249 | (not (save-excursion | 248 | (not (with-current-buffer orig-buffer |
| 250 | (set-buffer orig-buffer) | ||
| 251 | (car (semantic-analyze-dereference-metatype | 249 | (car (semantic-analyze-dereference-metatype |
| 252 | ots (oref ctxt scope)))))) | 250 | ots (oref ctxt scope)))))) |
| 253 | (let ((lasttype ots) | 251 | (let ((lasttype ots) |
| 254 | (nexttype (save-excursion | 252 | (nexttype (with-current-buffer orig-buffer |
| 255 | (set-buffer orig-buffer) | ||
| 256 | (car (semantic-analyze-dereference-metatype | 253 | (car (semantic-analyze-dereference-metatype |
| 257 | ots (oref ctxt scope)))))) | 254 | ots (oref ctxt scope)))))) |
| 258 | (if (eq nexttype lasttype) | 255 | (if (eq nexttype lasttype) |
| @@ -274,8 +271,7 @@ with the command: | |||
| 274 | (princ "\n") | 271 | (princ "\n") |
| 275 | (setq lasttype nexttype | 272 | (setq lasttype nexttype |
| 276 | nexttype | 273 | nexttype |
| 277 | (save-excursion | 274 | (with-current-buffer orig-buffer |
| 278 | (set-buffer orig-buffer) | ||
| 279 | (car (semantic-analyze-dereference-metatype | 275 | (car (semantic-analyze-dereference-metatype |
| 280 | nexttype (oref ctxt scope))))) | 276 | nexttype (oref ctxt scope))))) |
| 281 | ) | 277 | ) |
| @@ -391,21 +387,17 @@ or implementing a version specific to ") | |||
| 391 | (let ((inc (semantic-find-tags-by-class 'include table)) | 387 | (let ((inc (semantic-find-tags-by-class 'include table)) |
| 392 | ;;(path (semanticdb-find-test-translate-path-no-loading)) | 388 | ;;(path (semanticdb-find-test-translate-path-no-loading)) |
| 393 | (unk | 389 | (unk |
| 394 | (save-excursion | 390 | (with-current-buffer (semanticdb-get-buffer table) |
| 395 | (set-buffer (semanticdb-get-buffer table)) | ||
| 396 | semanticdb-find-lost-includes)) | 391 | semanticdb-find-lost-includes)) |
| 397 | (ip | 392 | (ip |
| 398 | (save-excursion | 393 | (with-current-buffer (semanticdb-get-buffer table) |
| 399 | (set-buffer (semanticdb-get-buffer table)) | ||
| 400 | semantic-dependency-system-include-path)) | 394 | semantic-dependency-system-include-path)) |
| 401 | (edeobj | 395 | (edeobj |
| 402 | (save-excursion | 396 | (with-current-buffer (semanticdb-get-buffer table) |
| 403 | (set-buffer (semanticdb-get-buffer table)) | ||
| 404 | (and (boundp 'ede-object) | 397 | (and (boundp 'ede-object) |
| 405 | ede-object))) | 398 | ede-object))) |
| 406 | (edeproj | 399 | (edeproj |
| 407 | (save-excursion | 400 | (with-current-buffer (semanticdb-get-buffer table) |
| 408 | (set-buffer (semanticdb-get-buffer table)) | ||
| 409 | (and (boundp 'ede-object-project) | 401 | (and (boundp 'ede-object-project) |
| 410 | ede-object-project)))) | 402 | ede-object-project)))) |
| 411 | 403 | ||
| @@ -589,9 +581,8 @@ PARENT is a possible parent (by nesting) tag." | |||
| 589 | Look for key expressions, and add push-buttons near them." | 581 | Look for key expressions, and add push-buttons near them." |
| 590 | (let ((orig-buffer (make-marker))) | 582 | (let ((orig-buffer (make-marker))) |
| 591 | (set-marker orig-buffer (point) (current-buffer)) | 583 | (set-marker orig-buffer (point) (current-buffer)) |
| 592 | (save-excursion | 584 | ;; Get a buffer ready. |
| 593 | ;; Get a buffer ready. | 585 | (with-current-buffer "*Help*" |
| 594 | (set-buffer "*Help*") | ||
| 595 | (toggle-read-only -1) | 586 | (toggle-read-only -1) |
| 596 | (goto-char (point-min)) | 587 | (goto-char (point-min)) |
| 597 | (set (make-local-variable 'semantic-analyzer-debug-orig) orig-buffer) | 588 | (set (make-local-variable 'semantic-analyzer-debug-orig) orig-buffer) |
diff --git a/lisp/cedet/semantic/bovine/c.el b/lisp/cedet/semantic/bovine/c.el index de7ed48edfd..064e231c9e9 100644 --- a/lisp/cedet/semantic/bovine/c.el +++ b/lisp/cedet/semantic/bovine/c.el | |||
| @@ -703,8 +703,7 @@ the regular parser." | |||
| 703 | (symtext (semantic-lex-token-text lexicaltoken)) | 703 | (symtext (semantic-lex-token-text lexicaltoken)) |
| 704 | (macros (get-text-property 0 'macros symtext)) | 704 | (macros (get-text-property 0 'macros symtext)) |
| 705 | ) | 705 | ) |
| 706 | (save-excursion | 706 | (with-current-buffer buf |
| 707 | (set-buffer buf) | ||
| 708 | (erase-buffer) | 707 | (erase-buffer) |
| 709 | (when (not (eq major-mode mode)) | 708 | (when (not (eq major-mode mode)) |
| 710 | (save-match-data | 709 | (save-match-data |
diff --git a/lisp/cedet/semantic/bovine/gcc.el b/lisp/cedet/semantic/bovine/gcc.el index 7ad7aba5998..197e9b0065a 100644 --- a/lisp/cedet/semantic/bovine/gcc.el +++ b/lisp/cedet/semantic/bovine/gcc.el | |||
| @@ -40,8 +40,7 @@ to give to the program." | |||
| 40 | ;; | 40 | ;; |
| 41 | (let ((buff (get-buffer-create " *gcc-query*")) | 41 | (let ((buff (get-buffer-create " *gcc-query*")) |
| 42 | (old-lc-messages (getenv "LC_ALL"))) | 42 | (old-lc-messages (getenv "LC_ALL"))) |
| 43 | (save-excursion | 43 | (with-current-buffer buff |
| 44 | (set-buffer buff) | ||
| 45 | (erase-buffer) | 44 | (erase-buffer) |
| 46 | (setenv "LC_ALL" "C") | 45 | (setenv "LC_ALL" "C") |
| 47 | (condition-case nil | 46 | (condition-case nil |
diff --git a/lisp/cedet/semantic/complete.el b/lisp/cedet/semantic/complete.el index 154defb417a..9f68c9f2436 100644 --- a/lisp/cedet/semantic/complete.el +++ b/lisp/cedet/semantic/complete.el | |||
| @@ -947,8 +947,7 @@ Calculate the cache if there isn't one." | |||
| 947 | "Calculate the completions for prefix from completionlist. | 947 | "Calculate the completions for prefix from completionlist. |
| 948 | Output must be in semanticdb Find result format." | 948 | Output must be in semanticdb Find result format." |
| 949 | ;; Must output in semanticdb format | 949 | ;; Must output in semanticdb format |
| 950 | (let ((table (save-excursion | 950 | (let ((table (with-current-buffer (oref obj buffer) |
| 951 | (set-buffer (oref obj buffer)) | ||
| 952 | semanticdb-current-table)) | 951 | semanticdb-current-table)) |
| 953 | (result (semantic-find-tags-for-completion | 952 | (result (semantic-find-tags-for-completion |
| 954 | prefix | 953 | prefix |
| @@ -1227,8 +1226,7 @@ inserted into the current context.") | |||
| 1227 | (semantic-analyze-possible-completions (oref obj context)))) | 1226 | (semantic-analyze-possible-completions (oref obj context)))) |
| 1228 | ;; search our cached completion list. make it look like a semanticdb | 1227 | ;; search our cached completion list. make it look like a semanticdb |
| 1229 | ;; results type. | 1228 | ;; results type. |
| 1230 | (list (cons (save-excursion | 1229 | (list (cons (with-current-buffer (oref (oref obj context) buffer) |
| 1231 | (set-buffer (oref (oref obj context) buffer)) | ||
| 1232 | semanticdb-current-table) | 1230 | semanticdb-current-table) |
| 1233 | (semantic-find-tags-for-completion | 1231 | (semantic-find-tags-for-completion |
| 1234 | prefix | 1232 | prefix |
| @@ -1463,8 +1461,7 @@ one in the source buffer." | |||
| 1463 | (and table (semanticdb-get-buffer table))))) | 1461 | (and table (semanticdb-get-buffer table))))) |
| 1464 | ;; If no buffer is provided, then we can make up a summary buffer. | 1462 | ;; If no buffer is provided, then we can make up a summary buffer. |
| 1465 | (when (not buf) | 1463 | (when (not buf) |
| 1466 | (save-excursion | 1464 | (with-current-buffer (get-buffer-create "*Completion Focus*") |
| 1467 | (set-buffer (get-buffer-create "*Completion Focus*")) | ||
| 1468 | (erase-buffer) | 1465 | (erase-buffer) |
| 1469 | (insert "Focus on tag: \n") | 1466 | (insert "Focus on tag: \n") |
| 1470 | (insert (semantic-format-tag-summarize tag nil t) "\n\n") | 1467 | (insert (semantic-format-tag-summarize tag nil t) "\n\n") |
| @@ -1893,8 +1890,7 @@ prompts. these are calculated from the CONTEXT variable passed in." | |||
| 1893 | :buffer (oref context buffer) | 1890 | :buffer (oref context buffer) |
| 1894 | :context context) | 1891 | :context context) |
| 1895 | (semantic-displayor-traditional-with-focus-highlight "simple") | 1892 | (semantic-displayor-traditional-with-focus-highlight "simple") |
| 1896 | (save-excursion | 1893 | (with-current-buffer (oref context buffer) |
| 1897 | (set-buffer (oref context buffer)) | ||
| 1898 | (goto-char (cdr (oref context bounds))) | 1894 | (goto-char (cdr (oref context bounds))) |
| 1899 | (concat prompt (mapconcat 'identity syms ".") | 1895 | (concat prompt (mapconcat 'identity syms ".") |
| 1900 | (if syms "." "") | 1896 | (if syms "." "") |
diff --git a/lisp/cedet/semantic/db-debug.el b/lisp/cedet/semantic/db-debug.el index 619dd601186..40b311ca285 100644 --- a/lisp/cedet/semantic/db-debug.el +++ b/lisp/cedet/semantic/db-debug.el | |||
| @@ -88,8 +88,7 @@ | |||
| 88 | (let* ((full-filename (semanticdb-full-filename table)) | 88 | (let* ((full-filename (semanticdb-full-filename table)) |
| 89 | (buff (find-buffer-visiting full-filename))) | 89 | (buff (find-buffer-visiting full-filename))) |
| 90 | (if buff | 90 | (if buff |
| 91 | (save-excursion | 91 | (with-current-buffer buff |
| 92 | (set-buffer buff) | ||
| 93 | (semantic-sanity-check)) | 92 | (semantic-sanity-check)) |
| 94 | ;; We can't use the usual semantic validity check, so hack our own. | 93 | ;; We can't use the usual semantic validity check, so hack our own. |
| 95 | (semanticdb-table-oob-sanity-check (semanticdb-get-tags table))))) | 94 | (semanticdb-table-oob-sanity-check (semanticdb-get-tags table))))) |
diff --git a/lisp/cedet/semantic/db-ebrowse.el b/lisp/cedet/semantic/db-ebrowse.el index 9b915935c66..d8f14a765c3 100644 --- a/lisp/cedet/semantic/db-ebrowse.el +++ b/lisp/cedet/semantic/db-ebrowse.el | |||
| @@ -118,8 +118,7 @@ EBROWSE is a C/C++ parser for use with `ebrowse' Emacs program.") | |||
| 118 | (and (string-match "/\\w+$" file) | 118 | (and (string-match "/\\w+$" file) |
| 119 | (not (file-directory-p file)) | 119 | (not (file-directory-p file)) |
| 120 | (let ((tmp (get-buffer-create "*semanticdb-ebrowse-tmp*"))) | 120 | (let ((tmp (get-buffer-create "*semanticdb-ebrowse-tmp*"))) |
| 121 | (save-excursion | 121 | (with-current-buffer tmp |
| 122 | (set-buffer tmp) | ||
| 123 | (condition-case nil | 122 | (condition-case nil |
| 124 | (insert-file-contents file nil 0 100 t) | 123 | (insert-file-contents file nil 0 100 t) |
| 125 | (error (insert-file-contents file nil nil nil t))) | 124 | (error (insert-file-contents file nil nil nil t))) |
| @@ -141,8 +140,7 @@ is specified by `semanticdb-default-save-directory'." | |||
| 141 | (regexp nil) | 140 | (regexp nil) |
| 142 | ) | 141 | ) |
| 143 | ;; Create the input to the ebrowse command | 142 | ;; Create the input to the ebrowse command |
| 144 | (save-excursion | 143 | (with-current-buffer filebuff |
| 145 | (set-buffer filebuff) | ||
| 146 | (buffer-disable-undo filebuff) | 144 | (buffer-disable-undo filebuff) |
| 147 | (setq default-directory (expand-file-name dir)) | 145 | (setq default-directory (expand-file-name dir)) |
| 148 | 146 | ||
| @@ -156,8 +154,7 @@ is specified by `semanticdb-default-save-directory'." | |||
| 156 | (insert "\n"))) | 154 | (insert "\n"))) |
| 157 | files) | 155 | files) |
| 158 | ;; Cleanup the ebrowse output buffer. | 156 | ;; Cleanup the ebrowse output buffer. |
| 159 | (save-excursion | 157 | (with-current-buffer (get-buffer-create "*EBROWSE OUTPUT*") |
| 160 | (set-buffer (get-buffer-create "*EBROWSE OUTPUT*")) | ||
| 161 | (erase-buffer)) | 158 | (erase-buffer)) |
| 162 | ;; Call the EBROWSE command. | 159 | ;; Call the EBROWSE command. |
| 163 | (message "Creating ebrowse file: %s ..." savein) | 160 | (message "Creating ebrowse file: %s ..." savein) |
| @@ -169,8 +166,7 @@ is specified by `semanticdb-default-save-directory'." | |||
| 169 | ;; Create a short LOADER program for loading in this database. | 166 | ;; Create a short LOADER program for loading in this database. |
| 170 | (let* ((lfn (concat savein "-load.el")) | 167 | (let* ((lfn (concat savein "-load.el")) |
| 171 | (lf (find-file-noselect lfn))) | 168 | (lf (find-file-noselect lfn))) |
| 172 | (save-excursion | 169 | (with-current-buffer lf |
| 173 | (set-buffer lf) | ||
| 174 | (erase-buffer) | 170 | (erase-buffer) |
| 175 | (insert "(semanticdb-ebrowse-load-helper \"" | 171 | (insert "(semanticdb-ebrowse-load-helper \"" |
| 176 | (expand-file-name dir) | 172 | (expand-file-name dir) |
diff --git a/lisp/cedet/semantic/db-el.el b/lisp/cedet/semantic/db-el.el index 7e491a21efb..4b232278a39 100644 --- a/lisp/cedet/semantic/db-el.el +++ b/lisp/cedet/semantic/db-el.el | |||
| @@ -109,8 +109,7 @@ For Emacs Lisp, creates a specialized table." | |||
| 109 | "Return non-nil if TABLE's mode is equivalent to BUFFER. | 109 | "Return non-nil if TABLE's mode is equivalent to BUFFER. |
| 110 | Equivalent modes are specified by by `semantic-equivalent-major-modes' | 110 | Equivalent modes are specified by by `semantic-equivalent-major-modes' |
| 111 | local variable." | 111 | local variable." |
| 112 | (save-excursion | 112 | (with-current-buffer buffer |
| 113 | (set-buffer buffer) | ||
| 114 | (eq (or mode-local-active-mode major-mode) 'emacs-lisp-mode))) | 113 | (eq (or mode-local-active-mode major-mode) 'emacs-lisp-mode))) |
| 115 | 114 | ||
| 116 | (defmethod semanticdb-full-filename ((obj semanticdb-table-emacs-lisp)) | 115 | (defmethod semanticdb-full-filename ((obj semanticdb-table-emacs-lisp)) |
diff --git a/lisp/cedet/semantic/db-file.el b/lisp/cedet/semantic/db-file.el index 4bd042ecefe..ec8ffdccb28 100644 --- a/lisp/cedet/semantic/db-file.el +++ b/lisp/cedet/semantic/db-file.el | |||
| @@ -281,8 +281,7 @@ Restore the overlays after writting. | |||
| 281 | Argument OBJ is the object to write." | 281 | Argument OBJ is the object to write." |
| 282 | (when (semanticdb-live-p obj) | 282 | (when (semanticdb-live-p obj) |
| 283 | (when (semanticdb-in-buffer-p obj) | 283 | (when (semanticdb-in-buffer-p obj) |
| 284 | (save-excursion | 284 | (with-current-buffer (semanticdb-in-buffer-p obj) |
| 285 | (set-buffer (semanticdb-in-buffer-p obj)) | ||
| 286 | 285 | ||
| 287 | ;; Make sure all our tag lists are up to date. | 286 | ;; Make sure all our tag lists are up to date. |
| 288 | (semantic-fetch-tags) | 287 | (semantic-fetch-tags) |
diff --git a/lisp/cedet/semantic/db-find.el b/lisp/cedet/semantic/db-find.el index fd5b7706c31..b2ec243f506 100644 --- a/lisp/cedet/semantic/db-find.el +++ b/lisp/cedet/semantic/db-find.el | |||
| @@ -469,12 +469,11 @@ a new path from the provided PATH." | |||
| 469 | incfname (semanticdb-full-filename path)) | 469 | incfname (semanticdb-full-filename path)) |
| 470 | ) | 470 | ) |
| 471 | ((bufferp path) | 471 | ((bufferp path) |
| 472 | (save-excursion | 472 | (with-current-buffer path |
| 473 | (set-buffer path) | ||
| 474 | (semantic-refresh-tags-safe)) | 473 | (semantic-refresh-tags-safe)) |
| 475 | (setq includetags (semantic-find-tags-included path) | 474 | (setq includetags (semantic-find-tags-included path) |
| 476 | curtable (save-excursion (set-buffer path) | 475 | curtable (with-current-buffer path |
| 477 | semanticdb-current-table) | 476 | semanticdb-current-table) |
| 478 | incfname (buffer-file-name path))) | 477 | incfname (buffer-file-name path))) |
| 479 | (t | 478 | (t |
| 480 | (setq includetags (semantic-find-tags-included path)) | 479 | (setq includetags (semantic-find-tags-included path)) |
| @@ -1048,8 +1047,7 @@ Returns result." | |||
| 1048 | "Reset the log buffer." | 1047 | "Reset the log buffer." |
| 1049 | (interactive) | 1048 | (interactive) |
| 1050 | (when semanticdb-find-log-flag | 1049 | (when semanticdb-find-log-flag |
| 1051 | (save-excursion | 1050 | (with-current-buffer (get-buffer-create semanticdb-find-log-buffer-name) |
| 1052 | (set-buffer (get-buffer-create semanticdb-find-log-buffer-name)) | ||
| 1053 | (erase-buffer) | 1051 | (erase-buffer) |
| 1054 | ))) | 1052 | ))) |
| 1055 | 1053 | ||
| @@ -1069,8 +1067,7 @@ Returns result." | |||
| 1069 | (defun semanticdb-find-log-new-search (forwhat) | 1067 | (defun semanticdb-find-log-new-search (forwhat) |
| 1070 | "Start a new search FORWHAT." | 1068 | "Start a new search FORWHAT." |
| 1071 | (when semanticdb-find-log-flag | 1069 | (when semanticdb-find-log-flag |
| 1072 | (save-excursion | 1070 | (with-current-buffer (get-buffer-create semanticdb-find-log-buffer-name) |
| 1073 | (set-buffer (get-buffer-create semanticdb-find-log-buffer-name)) | ||
| 1074 | (insert (format "New Search: %S\n" forwhat)) | 1071 | (insert (format "New Search: %S\n" forwhat)) |
| 1075 | ) | 1072 | ) |
| 1076 | (semanticdb-find-log-move-to-end))) | 1073 | (semanticdb-find-log-move-to-end))) |
| @@ -1078,8 +1075,7 @@ Returns result." | |||
| 1078 | (defun semanticdb-find-log-activity (table result) | 1075 | (defun semanticdb-find-log-activity (table result) |
| 1079 | "Log that TABLE has been searched and RESULT was found." | 1076 | "Log that TABLE has been searched and RESULT was found." |
| 1080 | (when semanticdb-find-log-flag | 1077 | (when semanticdb-find-log-flag |
| 1081 | (save-excursion | 1078 | (with-current-buffer semanticdb-find-log-buffer-name |
| 1082 | (set-buffer semanticdb-find-log-buffer-name) | ||
| 1083 | (insert "Table: " (object-print table) | 1079 | (insert "Table: " (object-print table) |
| 1084 | " Result: " (int-to-string (length result)) " tags" | 1080 | " Result: " (int-to-string (length result)) " tags" |
| 1085 | "\n") | 1081 | "\n") |
diff --git a/lisp/cedet/semantic/db-javascript.el b/lisp/cedet/semantic/db-javascript.el index 8fa3f15f5ba..cfd6575902c 100644 --- a/lisp/cedet/semantic/db-javascript.el +++ b/lisp/cedet/semantic/db-javascript.el | |||
| @@ -147,8 +147,7 @@ Create one of our special tables that can act as an intermediary." | |||
| 147 | "Return non-nil if TABLE's mode is equivalent to BUFFER. | 147 | "Return non-nil if TABLE's mode is equivalent to BUFFER. |
| 148 | Equivalent modes are specified by by `semantic-equivalent-major-modes' | 148 | Equivalent modes are specified by by `semantic-equivalent-major-modes' |
| 149 | local variable." | 149 | local variable." |
| 150 | (save-excursion | 150 | (with-current-buffer buffer |
| 151 | (set-buffer buffer) | ||
| 152 | (eq (or mode-local-active-mode major-mode) 'javascript-mode))) | 151 | (eq (or mode-local-active-mode major-mode) 'javascript-mode))) |
| 153 | 152 | ||
| 154 | ;;; Usage | 153 | ;;; Usage |
diff --git a/lisp/cedet/semantic/db-typecache.el b/lisp/cedet/semantic/db-typecache.el index 4c841494a97..b3ae2540e26 100644 --- a/lisp/cedet/semantic/db-typecache.el +++ b/lisp/cedet/semantic/db-typecache.el | |||
| @@ -540,8 +540,7 @@ If there isn't one, create it. | |||
| 540 | 540 | ||
| 541 | (defun semanticdb-typecache-refresh-for-buffer (buffer) | 541 | (defun semanticdb-typecache-refresh-for-buffer (buffer) |
| 542 | "Refresh the typecache for BUFFER." | 542 | "Refresh the typecache for BUFFER." |
| 543 | (save-excursion | 543 | (with-current-buffer buffer |
| 544 | (set-buffer buffer) | ||
| 545 | (let* ((tab semanticdb-current-table) | 544 | (let* ((tab semanticdb-current-table) |
| 546 | ;(idx (semanticdb-get-table-index tab)) | 545 | ;(idx (semanticdb-get-table-index tab)) |
| 547 | (tc (semanticdb-get-typecache tab))) | 546 | (tc (semanticdb-get-typecache tab))) |
diff --git a/lisp/cedet/semantic/db.el b/lisp/cedet/semantic/db.el index cfde30b7585..48531513ad6 100644 --- a/lisp/cedet/semantic/db.el +++ b/lisp/cedet/semantic/db.el | |||
| @@ -552,8 +552,7 @@ The file associated with OBJ does not need to be in a buffer." | |||
| 552 | (buff (semanticdb-in-buffer-p obj)) | 552 | (buff (semanticdb-in-buffer-p obj)) |
| 553 | ) | 553 | ) |
| 554 | (if buff | 554 | (if buff |
| 555 | (save-excursion | 555 | (with-current-buffer buff |
| 556 | (set-buffer buff) | ||
| 557 | ;; Use semantic's magic tracker to determine of the buffer is up | 556 | ;; Use semantic's magic tracker to determine of the buffer is up |
| 558 | ;; to date or not. | 557 | ;; to date or not. |
| 559 | (not (semantic-parse-tree-up-to-date-p)) | 558 | (not (semantic-parse-tree-up-to-date-p)) |
diff --git a/lisp/cedet/semantic/debug.el b/lisp/cedet/semantic/debug.el index ac8b4b1314e..94cba53b942 100644 --- a/lisp/cedet/semantic/debug.el +++ b/lisp/cedet/semantic/debug.el | |||
| @@ -118,8 +118,7 @@ These buffers are brought into view when layout occurs.") | |||
| 118 | 118 | ||
| 119 | (defmethod semantic-debug-set-parser-location ((iface semantic-debug-interface) point) | 119 | (defmethod semantic-debug-set-parser-location ((iface semantic-debug-interface) point) |
| 120 | "Set the parser location in IFACE to POINT." | 120 | "Set the parser location in IFACE to POINT." |
| 121 | (save-excursion | 121 | (with-current-buffer (oref iface parser-buffer) |
| 122 | (set-buffer (oref iface parser-buffer)) | ||
| 123 | (if (not (slot-boundp iface 'parser-location)) | 122 | (if (not (slot-boundp iface 'parser-location)) |
| 124 | (oset iface parser-location (make-marker))) | 123 | (oset iface parser-location (make-marker))) |
| 125 | (move-marker (oref iface parser-location) point)) | 124 | (move-marker (oref iface parser-location) point)) |
| @@ -127,8 +126,7 @@ These buffers are brought into view when layout occurs.") | |||
| 127 | 126 | ||
| 128 | (defmethod semantic-debug-set-source-location ((iface semantic-debug-interface) point) | 127 | (defmethod semantic-debug-set-source-location ((iface semantic-debug-interface) point) |
| 129 | "Set the source location in IFACE to POINT." | 128 | "Set the source location in IFACE to POINT." |
| 130 | (save-excursion | 129 | (with-current-buffer (oref iface source-buffer) |
| 131 | (set-buffer (oref iface source-buffer)) | ||
| 132 | (if (not (slot-boundp iface 'source-location)) | 130 | (if (not (slot-boundp iface 'source-location)) |
| 133 | (oset iface source-location (make-marker))) | 131 | (oset iface source-location (make-marker))) |
| 134 | (move-marker (oref iface source-location) point)) | 132 | (move-marker (oref iface source-location) point)) |
| @@ -140,8 +138,7 @@ These buffers are brought into view when layout occurs.") | |||
| 140 | ;; Deal with the data buffer | 138 | ;; Deal with the data buffer |
| 141 | (when (slot-boundp iface 'data-buffer) | 139 | (when (slot-boundp iface 'data-buffer) |
| 142 | (let ((lines (/ (frame-height (selected-frame)) 3)) | 140 | (let ((lines (/ (frame-height (selected-frame)) 3)) |
| 143 | (cnt (save-excursion | 141 | (cnt (with-current-buffer (oref iface data-buffer) |
| 144 | (set-buffer (oref iface data-buffer)) | ||
| 145 | (count-lines (point-min) (point-max)))) | 142 | (count-lines (point-min) (point-max)))) |
| 146 | ) | 143 | ) |
| 147 | ;; Set the number of lines to 1/3, or the size of the data buffer. | 144 | ;; Set the number of lines to 1/3, or the size of the data buffer. |
| @@ -307,8 +304,7 @@ Argument ONOFF is non-nil when we are entering debug mode. | |||
| 307 | (let ((iface semantic-debug-current-interface)) | 304 | (let ((iface semantic-debug-current-interface)) |
| 308 | (if onoff | 305 | (if onoff |
| 309 | ;; Turn it on | 306 | ;; Turn it on |
| 310 | (save-excursion | 307 | (with-current-buffer (oref iface parser-buffer) |
| 311 | (set-buffer (oref iface parser-buffer)) | ||
| 312 | ;; Install our map onto this buffer | 308 | ;; Install our map onto this buffer |
| 313 | (use-local-map semantic-debug-mode-map) | 309 | (use-local-map semantic-debug-mode-map) |
| 314 | ;; Make the buffer read only | 310 | ;; Make the buffer read only |
| @@ -323,15 +319,13 @@ Argument ONOFF is non-nil when we are entering debug mode. | |||
| 323 | (run-hooks 'semantic-debug-mode-hook) | 319 | (run-hooks 'semantic-debug-mode-hook) |
| 324 | ) | 320 | ) |
| 325 | ;; Restore old mode information | 321 | ;; Restore old mode information |
| 326 | (save-excursion | 322 | (with-current-buffer |
| 327 | (set-buffer | 323 | (oref semantic-debug-current-interface parser-buffer) |
| 328 | (oref semantic-debug-current-interface parser-buffer)) | ||
| 329 | (use-local-map | 324 | (use-local-map |
| 330 | (oref semantic-debug-current-interface parser-local-map)) | 325 | (oref semantic-debug-current-interface parser-local-map)) |
| 331 | ) | 326 | ) |
| 332 | (save-excursion | 327 | (with-current-buffer |
| 333 | (set-buffer | 328 | (oref semantic-debug-current-interface source-buffer) |
| 334 | (oref semantic-debug-current-interface source-buffer)) | ||
| 335 | (use-local-map | 329 | (use-local-map |
| 336 | (oref semantic-debug-current-interface source-local-map)) | 330 | (oref semantic-debug-current-interface source-local-map)) |
| 337 | ) | 331 | ) |
| @@ -355,8 +349,7 @@ Argument ONOFF is non-nil when we are entering debug mode. | |||
| 355 | (semantic-debug-interface | 349 | (semantic-debug-interface |
| 356 | "Debug Interface" | 350 | "Debug Interface" |
| 357 | :parser-buffer parserb | 351 | :parser-buffer parserb |
| 358 | :parser-local-map (save-excursion | 352 | :parser-local-map (with-current-buffer parserb |
| 359 | (set-buffer parserb) | ||
| 360 | (current-local-map)) | 353 | (current-local-map)) |
| 361 | :source-buffer (current-buffer) | 354 | :source-buffer (current-buffer) |
| 362 | :source-local-map (current-local-map) | 355 | :source-local-map (current-local-map) |
diff --git a/lisp/cedet/semantic/ede-grammar.el b/lisp/cedet/semantic/ede-grammar.el index e0162f52c8d..e19234bb812 100644 --- a/lisp/cedet/semantic/ede-grammar.el +++ b/lisp/cedet/semantic/ede-grammar.el | |||
| @@ -129,8 +129,7 @@ Lays claim to all -by.el, and -wy.el files." | |||
| 129 | (proj (ede-target-parent obj)) | 129 | (proj (ede-target-parent obj)) |
| 130 | (default-directory (oref proj directory))) | 130 | (default-directory (oref proj directory))) |
| 131 | (mapc (lambda (src) | 131 | (mapc (lambda (src) |
| 132 | (save-excursion | 132 | (with-current-buffer (find-file-noselect src) |
| 133 | (set-buffer (find-file-noselect src)) | ||
| 134 | (save-excursion | 133 | (save-excursion |
| 135 | (semantic-grammar-create-package)) | 134 | (semantic-grammar-create-package)) |
| 136 | (save-buffer) | 135 | (save-buffer) |
| @@ -162,8 +161,7 @@ Lays claim to all -by.el, and -wy.el files." | |||
| 162 | (concat (ede-pmake-varname this) "_SEMANTIC_GRAMMAR_EL") | 161 | (concat (ede-pmake-varname this) "_SEMANTIC_GRAMMAR_EL") |
| 163 | (insert | 162 | (insert |
| 164 | (mapconcat (lambda (src) | 163 | (mapconcat (lambda (src) |
| 165 | (save-excursion | 164 | (with-current-buffer (find-file-noselect src) |
| 166 | (set-buffer (find-file-noselect src)) | ||
| 167 | (concat (semantic-grammar-package) ".el"))) | 165 | (concat (semantic-grammar-package) ".el"))) |
| 168 | (oref this source) | 166 | (oref this source) |
| 169 | " "))) | 167 | " "))) |
diff --git a/lisp/cedet/semantic/find.el b/lisp/cedet/semantic/find.el index d9da329bd0b..07377703774 100644 --- a/lisp/cedet/semantic/find.el +++ b/lisp/cedet/semantic/find.el | |||
| @@ -640,8 +640,7 @@ the median calculation, and return nil." | |||
| 640 | (save-excursion | 640 | (save-excursion |
| 641 | (if (markerp position) (set-buffer (marker-buffer position))) | 641 | (if (markerp position) (set-buffer (marker-buffer position))) |
| 642 | (let* ((stream (if (bufferp streamorbuffer) | 642 | (let* ((stream (if (bufferp streamorbuffer) |
| 643 | (save-excursion | 643 | (with-current-buffer streamorbuffer |
| 644 | (set-buffer streamorbuffer) | ||
| 645 | (semantic-fetch-tags)) | 644 | (semantic-fetch-tags)) |
| 646 | streamorbuffer)) | 645 | streamorbuffer)) |
| 647 | (prev nil) | 646 | (prev nil) |
diff --git a/lisp/cedet/semantic/grammar.el b/lisp/cedet/semantic/grammar.el index f4d34def561..3600c1917bf 100644 --- a/lisp/cedet/semantic/grammar.el +++ b/lisp/cedet/semantic/grammar.el | |||
| @@ -1877,8 +1877,7 @@ Optional argument COLOR determines if color is added to the text." | |||
| 1877 | (if (semantic-grammar-in-lisp-p) | 1877 | (if (semantic-grammar-in-lisp-p) |
| 1878 | (with-mode-local emacs-lisp-mode | 1878 | (with-mode-local emacs-lisp-mode |
| 1879 | (semantic-analyze-possible-completions context)) | 1879 | (semantic-analyze-possible-completions context)) |
| 1880 | (save-excursion | 1880 | (with-current-buffer (oref context buffer) |
| 1881 | (set-buffer (oref context buffer)) | ||
| 1882 | (let* ((prefix (car (oref context :prefix))) | 1881 | (let* ((prefix (car (oref context :prefix))) |
| 1883 | (completetext (cond ((semantic-tag-p prefix) | 1882 | (completetext (cond ((semantic-tag-p prefix) |
| 1884 | (semantic-tag-name prefix)) | 1883 | (semantic-tag-name prefix)) |
diff --git a/lisp/cedet/semantic/ia-sb.el b/lisp/cedet/semantic/ia-sb.el index 3b57133d0c3..98eeeeda141 100644 --- a/lisp/cedet/semantic/ia-sb.el +++ b/lisp/cedet/semantic/ia-sb.el | |||
| @@ -104,8 +104,7 @@ DIRECTORY is the current directory, which is ignored, and ZERO is 0." | |||
| 104 | )) | 104 | )) |
| 105 | (error nil)) | 105 | (error nil)) |
| 106 | (select-frame cf) | 106 | (select-frame cf) |
| 107 | (save-excursion | 107 | (with-current-buffer speedbar-buffer |
| 108 | (set-buffer speedbar-buffer) | ||
| 109 | ;; If we have something, do something spiff with it. | 108 | ;; If we have something, do something spiff with it. |
| 110 | (erase-buffer) | 109 | (erase-buffer) |
| 111 | (speedbar-insert-separator "Buffer/Function") | 110 | (speedbar-insert-separator "Buffer/Function") |
| @@ -288,16 +287,14 @@ TEXT, TAG, and INDENT are speedbar function arguments." | |||
| 288 | (setq ob (current-buffer)) | 287 | (setq ob (current-buffer)) |
| 289 | (with-output-to-temp-buffer "*Tag Information*" | 288 | (with-output-to-temp-buffer "*Tag Information*" |
| 290 | ;; Output something about this tag: | 289 | ;; Output something about this tag: |
| 291 | (save-excursion | 290 | (with-current-buffer "*Tag Information*" |
| 292 | (set-buffer "*Tag Information*") | ||
| 293 | (goto-char (point-max)) | 291 | (goto-char (point-max)) |
| 294 | (insert | 292 | (insert |
| 295 | (semantic-format-tag-prototype tag nil t) | 293 | (semantic-format-tag-prototype tag nil t) |
| 296 | "\n") | 294 | "\n") |
| 297 | (let ((typetok | 295 | (let ((typetok |
| 298 | (condition-case nil | 296 | (condition-case nil |
| 299 | (save-excursion | 297 | (with-current-buffer ob |
| 300 | (set-buffer ob) | ||
| 301 | ;; @todo - We need a context to derive a scope from. | 298 | ;; @todo - We need a context to derive a scope from. |
| 302 | (semantic-analyze-tag-type tag nil)) | 299 | (semantic-analyze-tag-type tag nil)) |
| 303 | (error nil)))) | 300 | (error nil)))) |
diff --git a/lisp/cedet/semantic/idle.el b/lisp/cedet/semantic/idle.el index b93ed65c1f5..ec2af3e36be 100644 --- a/lisp/cedet/semantic/idle.el +++ b/lisp/cedet/semantic/idle.el | |||
| @@ -350,8 +350,7 @@ Disable to prevent lots of excessive parsing in idle time." | |||
| 350 | "Do long-processing work for for BUFFER. | 350 | "Do long-processing work for for BUFFER. |
| 351 | Uses `semantic-safe' and returns the output. | 351 | Uses `semantic-safe' and returns the output. |
| 352 | Returns t of all processing succeeded." | 352 | Returns t of all processing succeeded." |
| 353 | (save-excursion | 353 | (with-current-buffer buffer |
| 354 | (set-buffer buffer) | ||
| 355 | (not (and | 354 | (not (and |
| 356 | ;; Just in case | 355 | ;; Just in case |
| 357 | (semantic-safe "Idle Work Parse Error: %S" | 356 | (semantic-safe "Idle Work Parse Error: %S" |
| @@ -845,8 +844,7 @@ visible, then highlight it." | |||
| 845 | (pulse-flag nil) | 844 | (pulse-flag nil) |
| 846 | ) | 845 | ) |
| 847 | (cond ((semantic-overlay-p region) | 846 | (cond ((semantic-overlay-p region) |
| 848 | (save-excursion | 847 | (with-current-buffer (semantic-overlay-buffer region) |
| 849 | (set-buffer (semantic-overlay-buffer region)) | ||
| 850 | (goto-char (semantic-overlay-start region)) | 848 | (goto-char (semantic-overlay-start region)) |
| 851 | (when (pos-visible-in-window-p | 849 | (when (pos-visible-in-window-p |
| 852 | (point) (get-buffer-window (current-buffer) 'visible)) | 850 | (point) (get-buffer-window (current-buffer) 'visible)) |
diff --git a/lisp/cedet/semantic/lex-spp.el b/lisp/cedet/semantic/lex-spp.el index b078a25b28e..d7bbee5d5e6 100644 --- a/lisp/cedet/semantic/lex-spp.el +++ b/lisp/cedet/semantic/lex-spp.el | |||
| @@ -864,8 +864,7 @@ and variable state from the current buffer." | |||
| 864 | semantic-lex-spp-expanded-macro-stack | 864 | semantic-lex-spp-expanded-macro-stack |
| 865 | )) | 865 | )) |
| 866 | ) | 866 | ) |
| 867 | (save-excursion | 867 | (with-current-buffer buf |
| 868 | (set-buffer buf) | ||
| 869 | (erase-buffer) | 868 | (erase-buffer) |
| 870 | ;; Below is a painful hack to make sure everything is setup correctly. | 869 | ;; Below is a painful hack to make sure everything is setup correctly. |
| 871 | (when (not (eq major-mode mode)) | 870 | (when (not (eq major-mode mode)) |
diff --git a/lisp/cedet/semantic/sb.el b/lisp/cedet/semantic/sb.el index 582eea39d8b..277b28a81b3 100644 --- a/lisp/cedet/semantic/sb.el +++ b/lisp/cedet/semantic/sb.el | |||
| @@ -391,8 +391,7 @@ Returns the tag list, or t for an error." | |||
| 391 | ;; Successful DB query. | 391 | ;; Successful DB query. |
| 392 | nil | 392 | nil |
| 393 | ;; No database, do it the old way. | 393 | ;; No database, do it the old way. |
| 394 | (save-excursion | 394 | (with-current-buffer (find-file-noselect file) |
| 395 | (set-buffer (find-file-noselect file)) | ||
| 396 | (if (or (not (featurep 'semantic)) | 395 | (if (or (not (featurep 'semantic)) |
| 397 | (not semantic--parse-table)) | 396 | (not semantic--parse-table)) |
| 398 | (setq out t) | 397 | (setq out t) |
diff --git a/lisp/cedet/semantic/symref.el b/lisp/cedet/semantic/symref.el index 429e9026021..16f351ce15e 100644 --- a/lisp/cedet/semantic/symref.el +++ b/lisp/cedet/semantic/symref.el | |||
| @@ -476,8 +476,7 @@ The symref TOOL should already contain the search criteria." | |||
| 476 | "Parse the entire OUTPUTBUFFER of a symref tool. | 476 | "Parse the entire OUTPUTBUFFER of a symref tool. |
| 477 | Calls the method `semantic-symref-parse-tool-output-one-line' over and | 477 | Calls the method `semantic-symref-parse-tool-output-one-line' over and |
| 478 | over until it returns nil." | 478 | over until it returns nil." |
| 479 | (save-excursion | 479 | (with-current-buffer outputbuffer |
| 480 | (set-buffer outputbuffer) | ||
| 481 | (goto-char (point-min)) | 480 | (goto-char (point-min)) |
| 482 | (let ((result nil) | 481 | (let ((result nil) |
| 483 | (hit nil)) | 482 | (hit nil)) |
diff --git a/lisp/cedet/semantic/symref/grep.el b/lisp/cedet/semantic/symref/grep.el index 08c79ed842e..949a44980ac 100644 --- a/lisp/cedet/semantic/symref/grep.el +++ b/lisp/cedet/semantic/symref/grep.el | |||
| @@ -156,8 +156,7 @@ GREPPATTERN is the pattern used by grep." | |||
| 156 | (ans nil) | 156 | (ans nil) |
| 157 | ) | 157 | ) |
| 158 | 158 | ||
| 159 | (save-excursion | 159 | (with-current-buffer b |
| 160 | (set-buffer b) | ||
| 161 | (erase-buffer) | 160 | (erase-buffer) |
| 162 | (setq default-directory rootdir) | 161 | (setq default-directory rootdir) |
| 163 | 162 | ||
diff --git a/lisp/cedet/semantic/symref/list.el b/lisp/cedet/semantic/symref/list.el index 94114c14f6e..d8f29940c8e 100644 --- a/lisp/cedet/semantic/symref/list.el +++ b/lisp/cedet/semantic/symref/list.el | |||
| @@ -217,8 +217,7 @@ BUTTON is the button that was clicked." | |||
| 217 | (cond | 217 | (cond |
| 218 | ((eq state 'closed) | 218 | ((eq state 'closed) |
| 219 | (toggle-read-only -1) | 219 | (toggle-read-only -1) |
| 220 | (save-excursion | 220 | (with-current-buffer buff |
| 221 | (set-buffer buff) | ||
| 222 | (dolist (H hits) | 221 | (dolist (H hits) |
| 223 | (goto-char (point-min)) | 222 | (goto-char (point-min)) |
| 224 | (forward-line (1- H)) | 223 | (forward-line (1- H)) |
diff --git a/lisp/cedet/semantic/tag-file.el b/lisp/cedet/semantic/tag-file.el index 70d6b9cd688..0be88ea0469 100644 --- a/lisp/cedet/semantic/tag-file.el +++ b/lisp/cedet/semantic/tag-file.el | |||
| @@ -193,12 +193,10 @@ file prototypes belong in." | |||
| 193 | (:override | 193 | (:override |
| 194 | ;; Perform some default behaviors | 194 | ;; Perform some default behaviors |
| 195 | (if (and (fboundp 'ede-header-file) ede-minor-mode) | 195 | (if (and (fboundp 'ede-header-file) ede-minor-mode) |
| 196 | (save-excursion | 196 | (with-current-buffer buffer |
| 197 | (set-buffer buffer) | ||
| 198 | (ede-header-file)) | 197 | (ede-header-file)) |
| 199 | ;; No EDE options for a quick answer. Search. | 198 | ;; No EDE options for a quick answer. Search. |
| 200 | (save-excursion | 199 | (with-current-buffer buffer |
| 201 | (set-buffer buffer) | ||
| 202 | (if (re-search-forward "::Header:: \\([a-zA-Z0-9.]+\\)" nil t) | 200 | (if (re-search-forward "::Header:: \\([a-zA-Z0-9.]+\\)" nil t) |
| 203 | (match-string 1)))))) | 201 | (match-string 1)))))) |
| 204 | 202 | ||
diff --git a/lisp/cedet/semantic/tag-ls.el b/lisp/cedet/semantic/tag-ls.el index 2d12b03e248..3456ce8769b 100644 --- a/lisp/cedet/semantic/tag-ls.el +++ b/lisp/cedet/semantic/tag-ls.el | |||
| @@ -49,8 +49,7 @@ search locally, then semanticdb for that tag (when enabled.)") | |||
| 49 | (defun semantic-tag-calculate-parent-default (tag) | 49 | (defun semantic-tag-calculate-parent-default (tag) |
| 50 | "Attempt to calculate the parent of TAG." | 50 | "Attempt to calculate the parent of TAG." |
| 51 | (when (semantic-tag-in-buffer-p tag) | 51 | (when (semantic-tag-in-buffer-p tag) |
| 52 | (save-excursion | 52 | (with-current-buffer (semantic-tag-buffer tag) |
| 53 | (set-buffer (semantic-tag-buffer tag)) | ||
| 54 | (save-excursion | 53 | (save-excursion |
| 55 | (goto-char (semantic-tag-start tag)) | 54 | (goto-char (semantic-tag-start tag)) |
| 56 | (semantic-current-tag-parent)) | 55 | (semantic-current-tag-parent)) |
diff --git a/lisp/cedet/semantic/util.el b/lisp/cedet/semantic/util.el index 126c587a801..9a4d7dd26ac 100644 --- a/lisp/cedet/semantic/util.el +++ b/lisp/cedet/semantic/util.el | |||
| @@ -67,8 +67,7 @@ If FILE is not loaded, and semanticdb is not available, find the file | |||
| 67 | and parse it." | 67 | and parse it." |
| 68 | (save-match-data | 68 | (save-match-data |
| 69 | (if (find-buffer-visiting file) | 69 | (if (find-buffer-visiting file) |
| 70 | (save-excursion | 70 | (with-current-buffer (find-buffer-visiting file) |
| 71 | (set-buffer (find-buffer-visiting file)) | ||
| 72 | (semantic-fetch-tags)) | 71 | (semantic-fetch-tags)) |
| 73 | ;; File not loaded | 72 | ;; File not loaded |
| 74 | (if (and (require 'semantic/db-mode) | 73 | (if (and (require 'semantic/db-mode) |
| @@ -76,8 +75,7 @@ If FILE is not loaded, and semanticdb is not available, find the file | |||
| 76 | ;; semanticdb is around, use it. | 75 | ;; semanticdb is around, use it. |
| 77 | (semanticdb-file-stream file) | 76 | (semanticdb-file-stream file) |
| 78 | ;; Get the stream ourselves. | 77 | ;; Get the stream ourselves. |
| 79 | (save-excursion | 78 | (with-current-buffer (find-file-noselect file) |
| 80 | (set-buffer (find-file-noselect file)) | ||
| 81 | (semantic-fetch-tags)))))) | 79 | (semantic-fetch-tags)))))) |
| 82 | 80 | ||
| 83 | (semantic-alias-obsolete 'semantic-file-token-stream | 81 | (semantic-alias-obsolete 'semantic-file-token-stream |
| @@ -94,14 +92,12 @@ buffer, or a filename. If SOMETHING is nil return nil." | |||
| 94 | something) | 92 | something) |
| 95 | ;; A buffer | 93 | ;; A buffer |
| 96 | ((bufferp something) | 94 | ((bufferp something) |
| 97 | (save-excursion | 95 | (with-current-buffer something |
| 98 | (set-buffer something) | ||
| 99 | (semantic-fetch-tags))) | 96 | (semantic-fetch-tags))) |
| 100 | ;; A Tag: Get that tag's buffer | 97 | ;; A Tag: Get that tag's buffer |
| 101 | ((and (semantic-tag-with-position-p something) | 98 | ((and (semantic-tag-with-position-p something) |
| 102 | (semantic-tag-in-buffer-p something)) | 99 | (semantic-tag-in-buffer-p something)) |
| 103 | (save-excursion | 100 | (with-current-buffer (semantic-tag-buffer something) |
| 104 | (set-buffer (semantic-tag-buffer something)) | ||
| 105 | (semantic-fetch-tags))) | 101 | (semantic-fetch-tags))) |
| 106 | ;; Tag with a file name in it | 102 | ;; Tag with a file name in it |
| 107 | ((and (semantic-tag-p something) | 103 | ((and (semantic-tag-p something) |
| @@ -148,8 +144,7 @@ The return item is of the form (BUFFER TOKEN) where BUFFER is the buffer | |||
| 148 | in which TOKEN (the token found to match NAME) was found. | 144 | in which TOKEN (the token found to match NAME) was found. |
| 149 | 145 | ||
| 150 | THIS ISN'T USED IN SEMANTIC. DELETE ME SOON." | 146 | THIS ISN'T USED IN SEMANTIC. DELETE ME SOON." |
| 151 | (save-excursion | 147 | (with-current-buffer buffer |
| 152 | (set-buffer buffer) | ||
| 153 | (let* ((stream (semantic-fetch-tags)) | 148 | (let* ((stream (semantic-fetch-tags)) |
| 154 | (includelist (or (semantic-find-tags-by-class 'include stream) | 149 | (includelist (or (semantic-find-tags-by-class 'include stream) |
| 155 | "empty.silly.thing")) | 150 | "empty.silly.thing")) |
| @@ -158,9 +153,8 @@ THIS ISN'T USED IN SEMANTIC. DELETE ME SOON." | |||
| 158 | (while (and (not found) includelist) | 153 | (while (and (not found) includelist) |
| 159 | (let ((fn (semantic-dependency-tag-file (car includelist)))) | 154 | (let ((fn (semantic-dependency-tag-file (car includelist)))) |
| 160 | (if (and fn (not (member fn unfound))) | 155 | (if (and fn (not (member fn unfound))) |
| 161 | (save-excursion | 156 | (with-current-buffer (save-match-data |
| 162 | (save-match-data | 157 | (find-file-noselect fn)) |
| 163 | (set-buffer (find-file-noselect fn))) | ||
| 164 | (message "Scanning %s" (buffer-file-name)) | 158 | (message "Scanning %s" (buffer-file-name)) |
| 165 | (setq stream (semantic-fetch-tags)) | 159 | (setq stream (semantic-fetch-tags)) |
| 166 | (setq found (semantic-find-first-tag-by-name name stream)) | 160 | (setq found (semantic-find-first-tag-by-name name stream)) |
| @@ -287,8 +281,7 @@ If TAG is not specified, use the tag at point." | |||
| 287 | (defun semantic-describe-buffer-var-helper (varsym buffer) | 281 | (defun semantic-describe-buffer-var-helper (varsym buffer) |
| 288 | "Display to standard out the value of VARSYM in BUFFER." | 282 | "Display to standard out the value of VARSYM in BUFFER." |
| 289 | (require 'data-debug) | 283 | (require 'data-debug) |
| 290 | (let ((value (save-excursion | 284 | (let ((value (with-current-buffer buffer |
| 291 | (set-buffer buffer) | ||
| 292 | (symbol-value varsym)))) | 285 | (symbol-value varsym)))) |
| 293 | (cond | 286 | (cond |
| 294 | ((and (consp value) | 287 | ((and (consp value) |
diff --git a/lisp/cedet/srecode/srt-mode.el b/lisp/cedet/srecode/srt-mode.el index d7e4b7b3ff4..645d2d39207 100644 --- a/lisp/cedet/srecode/srt-mode.el +++ b/lisp/cedet/srecode/srt-mode.el | |||
| @@ -629,8 +629,7 @@ section or ? for an ask variable." | |||
| 629 | (define-mode-local-override semantic-analyze-possible-completions | 629 | (define-mode-local-override semantic-analyze-possible-completions |
| 630 | srecode-template-mode (context) | 630 | srecode-template-mode (context) |
| 631 | "Return a list of possible completions based on NONTEXT." | 631 | "Return a list of possible completions based on NONTEXT." |
| 632 | (save-excursion | 632 | (with-current-buffer (oref context buffer) |
| 633 | (set-buffer (oref context buffer)) | ||
| 634 | (let* ((prefix (car (last (oref context :prefix)))) | 633 | (let* ((prefix (car (last (oref context :prefix)))) |
| 635 | (prefixstr (cond ((stringp prefix) | 634 | (prefixstr (cond ((stringp prefix) |
| 636 | prefix) | 635 | prefix) |