mirror of
https://github.com/pestctrl/emacs-config.git
synced 2026-06-14 12:21:20 +00:00
Future headaches resolved
This commit is contained in:
parent
d5d7503a69
commit
24b6b6b9df
2 changed files with 48 additions and 0 deletions
45
lisp/llvm-lib/llvm-act-on-file/act-on-llvm-dump-file.el
Normal file
45
lisp/llvm-lib/llvm-act-on-file/act-on-llvm-dump-file.el
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
;;; act-on-llvm-dump-file.el --- -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2023 Benson Chu
|
||||
|
||||
;; Author: Benson Chu <bensonchu457@gmail.com>
|
||||
;; Created: [2023-02-01 17:51]
|
||||
|
||||
;; 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:
|
||||
|
||||
(defun ll/is-dump-file (fname)
|
||||
(and (string= "/tmp/"
|
||||
(file-name-directory fname))
|
||||
(string-match-p (rx "/" (+ (not "/")) "-" (= 6 alphanumeric) "." (+ anything))
|
||||
fname)))
|
||||
|
||||
(defun ll/dump-to-sh-file (fname)
|
||||
(expand-file-name
|
||||
(format "%s.sh"
|
||||
(-> fname
|
||||
(file-name-nondirectory)
|
||||
(file-name-sans-extension)))
|
||||
(file-name-directory fname)))
|
||||
|
||||
(defun ll/act-on-llvm-dump-file (fname)
|
||||
(message "You haven't implemented me yet, stoopid"))
|
||||
|
||||
(provide 'act-on-llvm-dump-file)
|
||||
;;; act-on-llvm-dump-file.el ends here
|
||||
|
|
@ -30,6 +30,7 @@
|
|||
(require 'act-on-ll-file)
|
||||
(require 'act-on-obj-file)
|
||||
(require 'act-on-llvm-source-file)
|
||||
(require 'act-on-llvm-dump-file)
|
||||
|
||||
(defun ll/act-on-file (file)
|
||||
(interactive (list (or (and (eq major-mode 'dired-mode)
|
||||
|
|
@ -44,6 +45,8 @@
|
|||
(ll/act-on-test-file file))
|
||||
((and _ (guard (ll/is-llvm-source-file file)))
|
||||
(ll/act-on-llvm-source-file file))
|
||||
((and _ (guard (ll/is-dump-file file)))
|
||||
(ll/act-on-llvm-dump-file file))
|
||||
("o" (ll/act-on-obj-file file))
|
||||
("c" (ll/act-on-c-file file))
|
||||
("ll" (ll/act-on-ll-file file))
|
||||
|
|
|
|||
Loading…
Reference in a new issue