mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-13 09:30:24 -08:00
Remove a few redundant `:group` arguments as well. * lisp/cedet/ede.el: Use lexical-binding. Don't load `ede/files` at compile-time. (ede-speedbar): Declare function. (ede-load-project-file): Allow `rootreturn` to be a reference rather than a symbol. (ede-initialize-state-current-buffer): Pass `ROOT` as a reference rather than a symbol to `ede-directory-get-open-project` and `ede-load-project-file` so we don't need to make it dynamically scoped. (ede-flush-deleted-projects): Avoid `add-to-list` on a local var. * lisp/cedet/ede/files.el: Use lexical-binding. (ede-directory-get-open-project): Allow `rootreturn` to be a reference rather than a symbol. (ede-project-root-directory): Remove unused var `root`. (ede-expand-filename-impl): Remove unused vars `path` and `proj`. * lisp/cedet/cedet-idutils.el: Use lexical-binding. (cedet-idutils-search): Remove always-nil variable `scopeflags`. * lisp/cedet/data-debug.el: Use lexical-binding. (data-debug-insert-overlay-button, data-debug-insert-overlay-list-button) (data-debug-insert-buffer-button, data-debug-insert-buffer-list-button) (data-debug-insert-process-button): Remove always-nil variable `tip`. (data-debug-insert-ring-button): Remove unused var `ringthing`. (data-debug-insert-widget-properties): Remove unused var `type`. * lisp/cedet/semantic.el: Use lexical-binding. (semantic-mode): Strength-reduce `eval` to `symbol-value`. * lisp/cedet/ede/custom.el: Use lexical-binding. (ede-project-sort-targets): Remove unused vars `count`, `current`, and `order`. * lisp/cedet/ede/pconf.el: Use lexical-binding. (ede-proj-configure-synchronize): Remove unused var `add-missing`. * lisp/cedet/ede/pmake.el (ede-proj-makefile-garbage-patterns): Simplify via η-reduction. (ede-proj-makefile-dependencies): Use `seq-some` rather than `eval+or`. * lisp/cedet/ede/proj-elisp.el: Use lexical-binding. (project-compile-target): Remove unused var `elc`. (ede-update-version-in-source): Remove unused var `match`. (project-compile-target): Declare function `cedet-update-autoloads` from file we don't have. * lisp/cedet/cedet-cscope.el: Use lexical-binding. * lisp/cedet/cedet-files.el: Use lexical-binding. * lisp/cedet/cedet-global.el: Use lexical-binding. * lisp/cedet/cedet.el: Use lexical-binding. * lisp/cedet/ede/auto.el: Use lexical-binding. * lisp/cedet/ede/autoconf-edit.el: Use lexical-binding. * lisp/cedet/ede/config.el: Use lexical-binding. * lisp/cedet/ede/cpp-root.el: Use lexical-binding. * lisp/cedet/ede/detect.el: Use lexical-binding. * lisp/cedet/ede/generic.el: Use lexical-binding. * lisp/cedet/ede/linux.el: Use lexical-binding. * lisp/cedet/ede/locate.el: Use lexical-binding. * lisp/cedet/ede/makefile-edit.el: Use lexical-binding. * lisp/cedet/ede/proj-info.el: Use lexical-binding. * lisp/cedet/ede/proj-obj.el: Use lexical-binding. * lisp/cedet/ede/proj-prog.el: Use lexical-binding. * lisp/cedet/ede/proj-shared.el: Use lexical-binding. * lisp/cedet/ede/proj.el: Use lexical-binding. * lisp/cedet/ede/shell.el: Use lexical-binding. * lisp/cedet/ede/simple.el: Use lexical-binding. * lisp/cedet/ede/source.el: Use lexical-binding. * lisp/cedet/ede/speedbar.el: Use lexical-binding. * lisp/cedet/ede/util.el: Use lexical-binding.
91 lines
3.1 KiB
EmacsLisp
91 lines
3.1 KiB
EmacsLisp
;;; ede/dired.el --- EDE extensions to dired. -*- lexical-binding: t -*-
|
|
|
|
;; Copyright (C) 1998-2000, 2003, 2009-2021 Free Software Foundation,
|
|
;; Inc.
|
|
|
|
;; Author: Eric M. Ludlam <zappo@gnu.org>
|
|
;; Old-Version: 0.4
|
|
;; Keywords: project, make
|
|
|
|
;; This file is part of GNU Emacs.
|
|
|
|
;; GNU Emacs is free software: you can redistribute it and/or modify
|
|
;; it under the terms of the GNU General Public License as published by
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
;; (at your option) any later version.
|
|
|
|
;; GNU Emacs is distributed in the hope that it will be useful,
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
;; GNU General Public License for more details.
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
|
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
;;; Commentary:
|
|
;;
|
|
;; This provides a dired interface to EDE, allowing users to modify
|
|
;; their project file by adding files (or whatever) directly from a
|
|
;; dired buffer.
|
|
|
|
;;; Code:
|
|
|
|
(require 'dired)
|
|
(require 'ede)
|
|
|
|
(defvar ede-dired-keymap
|
|
(let ((map (make-sparse-keymap)))
|
|
(define-key map ".a" #'ede-dired-add-to-target)
|
|
(define-key map ".t" #'ede-new-target)
|
|
(define-key map ".s" #'ede-speedbar)
|
|
(define-key map ".C" #'ede-compile-project)
|
|
(define-key map ".d" #'ede-make-dist)
|
|
|
|
(easy-menu-define
|
|
ede-dired-menu map "EDE Dired Minor Mode Menu"
|
|
'("Project"
|
|
[ "Add files to target" ede-dired-add-to-target (ede-current-project) ]
|
|
( "Build" :filter ede-build-forms-menu)
|
|
"-"
|
|
[ "Create Project" ede-new (not (ede-current-project)) ]
|
|
[ "Create Target" ede-new-target (ede-current-project) ]
|
|
"-"
|
|
( "Customize Project" :filter ede-customize-forms-menu )
|
|
[ "View Project Tree" ede-speedbar (ede-current-project) ]
|
|
))
|
|
map)
|
|
"Keymap used for ede dired minor mode.")
|
|
|
|
;;;###autoload
|
|
(define-minor-mode ede-dired-minor-mode
|
|
"A minor mode that should only be activated in DIRED buffers."
|
|
:lighter " EDE" :keymap ede-dired-keymap
|
|
(unless (derived-mode-p 'dired-mode)
|
|
(setq ede-dired-minor-mode nil)
|
|
(error "Not in DIRED mode"))
|
|
(unless (or (ede-directory-project-p default-directory)
|
|
(called-interactively-p 'any))
|
|
(setq ede-dired-minor-mode nil)))
|
|
|
|
(defun ede-dired-add-to-target (target)
|
|
"Add a file, or all marked files into a TARGET."
|
|
(interactive (list
|
|
(let ((ede-object (ede-current-project)))
|
|
(ede-invoke-method 'project-interactive-select-target
|
|
"Add files to Target: "))))
|
|
(dolist (file (dired-get-marked-files t))
|
|
(project-add-file target file)
|
|
;; Find the buffer for this files, and set its ede-object
|
|
(if (get-file-buffer file)
|
|
(with-current-buffer (get-file-buffer file)
|
|
(setq ede-object nil)
|
|
(setq ede-object (ede-buffer-object (current-buffer)))))))
|
|
|
|
(provide 'ede/dired)
|
|
|
|
;; Local variables:
|
|
;; generated-autoload-file: "loaddefs.el"
|
|
;; generated-autoload-load-name: "ede/dired"
|
|
;; End:
|
|
|
|
;;; ede/dired.el ends here
|