GPR_FILE must be full path to file, normalized.
src_dir, obj_dir will include compiler runtime.
Assumes environment variable ADA_PROJECT_PATH is set properly."
- (save-excursion
- (set-buffer (get-buffer-create "*gnatls*"))
+ (with-current-buffer (get-buffer-create "*gnatls*")
(erase-buffer)
;; this can take a long time; let the user know what's up
(setq command (concat command " -p\"" ada-prj-default-project-file "\""))))
(if (and append (get-buffer ada-gnatfind-buffer-name))
- (save-excursion
- (set-buffer "*gnatfind*")
+ (with-current-buffer "*gnatfind*"
(setq old-contents (buffer-string))))
(let ((compilation-error "reference"))
(compilation-start command 'compilation-mode (lambda (mode) ada-gnatfind-buffer-name)))
;; Hide the "Compilation" menu
- (save-excursion
- (set-buffer ada-gnatfind-buffer-name)
+ (with-current-buffer ada-gnatfind-buffer-name
(local-unset-key [menu-bar compilation-menu])
(if old-contents
command)))
;; Run the command
- (save-excursion
- (set-buffer (get-buffer-create "*run*"))
+ (with-current-buffer (get-buffer-create "*run*")
(set 'buffer-read-only nil)
(erase-buffer)
;; the 'D' lines. This is done repeatedly, in case the direct parent is
;; also a separate.
- (save-excursion
- (set-buffer (get-file-buffer file))
+ (with-current-buffer (get-file-buffer file)
(let ((short-ali-file-name
(concat (file-name-sans-extension (file-name-nondirectory file))
".ali"))
choice
file)
- (save-excursion
-
- ;; Do the grep in all the directories. We do multiple shell
- ;; commands instead of one in case there is no .ali file in one
- ;; of the directory and the shell stops because of that.
+ ;; Do the grep in all the directories. We do multiple shell
+ ;; commands instead of one in case there is no .ali file in one
+ ;; of the directory and the shell stops because of that.
- (set-buffer (get-buffer-create "*grep*"))
+ (with-current-buffer (get-buffer-create "*grep*")
(while dirs
(insert (shell-command-to-string
(concat
(unit-name nil)
(body-name nil)
(ali-name nil))
- (save-excursion
- (set-buffer buffer)
+ (with-current-buffer buffer
(goto-char (point-min))
(re-search-forward "^U \\([^ \t%]+\\)%[bs][ \t]+\\([^ \t]+\\)")
(setq unit-name (match-string 1))
This is a GNAT specific function that uses gnatkrunch."
(let ((krunch-buf (generate-new-buffer "*gkrunch*"))
(cross-prefix (plist-get (cdr (ada-xref-current-project)) 'cross_prefix)))
- (save-excursion
- (set-buffer krunch-buf)
+ (with-current-buffer krunch-buf
;; send adaname to external process `gnatkr'.
;; Add a dummy extension, since gnatkr versions have two different
;; behaviors depending on the version:
" " gnatstub-opts " " filename))
(buffer (get-buffer-create "*gnat stub*")))
- (save-excursion
- (set-buffer buffer)
+ (with-current-buffer buffer
(compilation-minor-mode 1)
(erase-buffer)
(insert gnatstub-cmd)