[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/arduino-mode a468e63 035/107: Add basic support for file v
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/arduino-mode a468e63 035/107: Add basic support for file variables |
Date: |
Sun, 29 Aug 2021 10:58:12 -0400 (EDT) |
branch: elpa/arduino-mode
commit a468e636b9fd79a1b686e15909e1bdf8fee18208
Author: Bernd Wachter <bwachter-spam@lart.info>
Commit: Bernd Wachter <bwachter-spam@lart.info>
Add basic support for file variables
---
ede-arduino.el | 62 +++++++++++++++++++++++++++++++++++-----------------------
1 file changed, 37 insertions(+), 25 deletions(-)
diff --git a/ede-arduino.el b/ede-arduino.el
index fe221d9..18c39cb 100644
--- a/ede-arduino.el
+++ b/ede-arduino.el
@@ -338,32 +338,44 @@ Argument COMMAND is the command to use for compiling the
target."
"Guess which libraries this sketch use."
(interactive)
(let* ((libs nil)
- (libdir nil)
(sketch (ede-arduino-guess-sketch))
- (orig-buffer (get-file-buffer sketch))
- (buff nil)
- (tmp nil))
- (save-current-buffer
- (setq buff (find-file-noselect sketch))
- (set-buffer buff)
- (save-excursion
- (goto-char (point-min))
- (while (re-search-forward "#include <\\([[:word:]_]+\\).h>" nil t)
- (setq tmp (match-string 1))
- (unless (file-exists-p (concat tmp ".h"))
- ;; TODO: realpath
- (let* ((lib (match-string 1))
- (libdir (ede-arduino-libdir lib))
- (util (expand-file-name "utility" libdir)))
- ;; Some libraries need a utility added to the library list.
- (when (file-exists-p util)
- (push (concat lib "/utility") libs))
- ;; Push real lib after the utility
- (push lib libs)
- )))))
- (when (not orig-buffer) (kill-buffer buff))
- libs))
-
+ (sketch-buffer (find-file-noselect sketch))
+ (arduino-libraries
+ (save-current-buffer
+ (set-buffer sketch-buffer)
+ (if (boundp 'arduino-libraries)
+ arduino-libraries
+ nil)))
+ )
+ (cond
+ (arduino-libraries
+ (dolist (lib (split-string arduino-libraries))
+ (push lib libs)))
+ (t
+ (let* ((libdir nil)
+ (orig-buffer (get-file-buffer sketch))
+ (buff nil)
+ (tmp nil))
+ (save-current-buffer
+ (setq buff (find-file-noselect sketch))
+ (set-buffer buff)
+ (save-excursion
+ (goto-char (point-min))
+ (while (re-search-forward "#include <\\([[:word:]_]+\\).h>" nil t)
+ (setq tmp (match-string 1))
+ (unless (file-exists-p (concat tmp ".h"))
+ ;; TODO: realpath
+ (let* ((lib (match-string 1))
+ (libdir (ede-arduino-libdir lib))
+ (util (expand-file-name "utility" libdir)))
+ ;; Some libraries need a utility added to the library list.
+ (when (file-exists-p util)
+ (push (concat lib "/utility") libs))
+ ;; Push real lib after the utility
+ (push lib libs)
+ )))))
+ (when (not orig-buffer) (kill-buffer buff)))))
+ libs))
(defun ede-arduino-guess-sketch ()
"Return the file that is the core of the current project sketch."
- [nongnu] elpa/arduino-mode dbb523c 005/107: Include additional keywords found in Arduino version 0018., (continued)
- [nongnu] elpa/arduino-mode dbb523c 005/107: Include additional keywords found in Arduino version 0018., ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode 16e1d57 010/107: Add init file., ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode f4fd0e8 017/107: added autoload on .ino files, ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode 68c1661 019/107: Add Version header., ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode 1fc4b2a 020/107: Add missing autoload cookie, ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode effb0bc 024/107: Sync with the language reference as of 20150503, ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode 44c2728 025/107: Add to languages customisation group., ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode bb89ac8 030/107: Merge pull request #11 from bookest/bug/undefined-cl-macroexpand-all, ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode 241b179 032/107: Merge https://github.com/mavit/arduino-mode, ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode aed4acb 034/107: Add additional customization, ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode a468e63 035/107: Add basic support for file variables,
ELPA Syncer <=
- [nongnu] elpa/arduino-mode d1233b1 036/107: Use configured preferences file for ede signature, ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode 9a168aa 038/107: fix void function `ede-project-autoload`, ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode 1424952 039/107: add new keywords, ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode 411815d 041/107: change arduino-upload keybinding to [C-c C-c], ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode 20e284a 042/107: format code, ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode 59806cc 043/107: add .ino file extension to auto-mode-alist, ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode a95ebba 044/107: remove XEmacs support part, ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode 3d8aa47 045/107: improve and add some commands for command-line arduino., ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode 3fc0851 046/107: use define-derived-mode for arduino-mode, ELPA Syncer, 2021/08/29
- [nongnu] elpa/arduino-mode 0150970 050/107: support org-mode babel Arduino src block, ELPA Syncer, 2021/08/29