Compare commits

...

3 commits

Author SHA1 Message Date
Benson Chu
4599bd9cba Allow extra flags to be passed 2025-07-02 10:30:10 -05:00
Benson Chu
0a0f467494 Semicolon too 2025-07-02 10:29:17 -05:00
Benson Chu
e85124c4d9 Automatically update org-agenda-files at work 2025-07-02 10:28:59 -05:00
6 changed files with 69 additions and 47 deletions

View file

@ -79,12 +79,14 @@
:compiler compiler
:file file
:action compiler-action
:output output)
(pcase action
('debug (format "-mllvm -debug-only=%s" (ll/read-pass-name "Which pass? ")))
('before-after (let ((pass (ll/read-pass-name "Which pass? ")))
(format "-mllvm -print-before=%s -mllvm -print-after=%s" pass pass)))
('changed "-mllvm -print-before-all"))
:output output
:flags
(list
(pcase action
('debug (format "-mllvm -debug-only=%s" (ll/read-pass-name "Which pass? ")))
('before-after (let ((pass (ll/read-pass-name "Which pass? ")))
(format "-mllvm -print-before=%s -mllvm -print-after=%s" pass pass)))
('changed "-mllvm -print-before-all"))))
" ")
" "))))

View file

@ -247,8 +247,8 @@
(apply (lls/conf-get 'dis-command-fun) args))
;; ========================= LLVM Build Dirs =========================
(cl-defun lls/default-comp-fun (&key compiler file action output rest)
(string-join
(cl-defun lls/default-comp-fun (&key compiler file action output flags)
(-->
(list compiler
(lls/get-clang-options)
(string-join rest " ")
@ -259,11 +259,13 @@
('preprocess "-E")
('llvm-ir "-S -emit-llvm")
('executable ""))
flags
"-o -"
(or (and output
(format "| tee %s" output))
""))
" "))
(flatten-list it)
(string-join it " ")))
(defun ll/read-pass ()
(completing-read "Which pass? "

View file

@ -45,7 +45,7 @@
`(,(regexp-opt '("nnan" "ninf" "nsz" "arcp" "contract" "afn" "reassoc" "fast") 'symbols) . 'shadow)))
(add-to-list 'llvm-font-lock-keywords
`(,(rx line-start (optional "# ") "***" (+ nonl) "***" (optional ":") "\n") . 'llvm-separator-face))
`(,(rx line-start (optional (any "#;") " ") "***" (+ nonl) "***" (optional ":") "\n") . 'llvm-separator-face))
(-->
"\\b[-]?[0-9]+\\b"

View file

@ -24,7 +24,7 @@
;;; Code:
(require 'my-plaintext-files)
(require 'org-roam-util)
(require 'org-roam-update-agenda)
(defconst my/org-folder
(my/plaintext-file "org"))
@ -59,34 +59,15 @@
`(,(my/agenda-file "vrchat_things.org")
,(my/org-file "journal2.gpg")))
(custom-set-variables
`(org-agenda-files
'(,(my/agenda-file "plan.org")
,(my/agenda-file "thoughts.org")
,(my/agenda-file "refile.org")
,(my/agenda-file "sandbox.org")
,(my/agenda-file "dev.org")
,(my/agenda-file "prod.org")
,(my/agenda-file "habits.org")
,(my/agenda-file "calendars/production.org"))))
(defun my/update-org-agenda-files ()
(interactive)
(setq org-agenda-files
(append
`(,(my/agenda-file "plan.org")
,(my/agenda-file "thoughts.org")
,(my/agenda-file "refile.org")
,(my/agenda-file "sandbox.org")
,(my/agenda-file "dev.org")
,(my/agenda-file "prod.org")
,(my/agenda-file "habits.org")
,(my/agenda-file "calendars/production.org"))
(my/get-org-roam-files-by-tags '("Project" "active")))))
(advice-add #'org-agenda
:before
#'my/update-org-agenda-files)
(setq orua/agenda-files
`(,(my/agenda-file "plan.org")
,(my/agenda-file "thoughts.org")
,(my/agenda-file "refile.org")
,(my/agenda-file "sandbox.org")
,(my/agenda-file "dev.org")
,(my/agenda-file "prod.org")
,(my/agenda-file "habits.org")
,(my/agenda-file "calendars/production.org")))
(defconst my/all-agenda-files
(cons (my/agenda-file "eternal.org")

View file

@ -0,0 +1,42 @@
;;; org-roam-update-agenda.el --- -*- lexical-binding: t -*-
;; Copyright (C) 2025 Benson Chu
;; Author: Benson Chu <bensonchu457@gmail.com>
;; Created: [2025-07-02 10:25]
;; This file is not part of GNU Emacs
;; This program 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.
;; This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
;;; Code:
(require 'org-roam-util)
(defvar orua/agenda-files nil)
(defun my/update-org-agenda-files ()
(interactive)
(setq org-agenda-files
(append
orua/agenda-files
(my/get-org-roam-files-by-tags '("Project" "active")))))
(advice-add #'org-agenda
:before
#'my/update-org-agenda-files)
(provide 'org-roam-update-agenda)
;;; org-roam-update-agenda.el ends here

View file

@ -252,17 +252,12 @@
(setq org-outline-path-complete-in-steps nil)
(setq org-refile-use-outline-path t)
(setq org-agenda-files
(require 'org-roam-update-agenda)
(setq orua/agenda-files
(list "~/org/refile.org"
"~/org/all.org"))
(defun my/update-org-agenda-files ()
(interactive)
(setq org-agenda-files
(cons "~/org/refile.org"
(cons "~/org/all.org"
(my/get-org-roam-files-by-tags '("Project" "active"))))))
(setq org-refile-targets `((nil :maxlevel . 9)
(org-agenda-files :maxlevel . 9)))