Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dot-emacs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stéphane Del Pino
dot-emacs
Commits
94dec687
Commit
94dec687
authored
4 years ago
by
Stéphane Del Pino
Browse files
Options
Downloads
Patches
Plain Diff
Ajoute un simple mode pour pugs
parent
d6a9570f
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitignore
+4
-0
4 additions, 0 deletions
.gitignore
Configuration.org
+7
-0
7 additions, 0 deletions
Configuration.org
extra/pugs.el
+75
-0
75 additions, 0 deletions
extra/pugs.el
snippets/cc-mode/once
+10
-0
10 additions, 0 deletions
snippets/cc-mode/once
with
96 additions
and
0 deletions
.gitignore
+
4
−
0
View file @
94dec687
...
...
@@ -24,3 +24,7 @@ auto-save-list
/custom.el
/Installation.tex
/.last-package-update-day
.lsp-session-v1
forge-database.sqlite
games/
projectile.cache
This diff is collapsed.
Click to expand it.
Configuration.org
+
7
−
0
View file @
94dec687
...
...
@@ -1216,6 +1216,13 @@ statistiques, utiliser la commande ~M-x keyfreq-show~
:ensure t)
#+END_SRC
** Mode pugs
#+BEGIN_SRC emacs-lisp
(load-library "~/.emacs.d/extra/pugs.el")
(add-to-list 'auto-mode-alist '("\\.pgs?\\'" . pugs-mode))
(require 'pugs-mode)
#+END_SRC
* Annexes
** Génération de toute la documentation
...
...
This diff is collapsed.
Click to expand it.
extra/pugs.el
0 → 100644
+
75
−
0
View file @
94dec687
;;; pugs -- simple major mode for pgs files
;;; Commentary:
;;; simple major mode for pugs
;;; Code:
(
define-derived-mode
pugs-output-mode
compilation-mode
"pugs-output"
"Define a special mode for pugs process output."
)
(
defun
pugs-run-file
()
"Execute the current pugs script.
Ask to save the buffer if needed"
(
interactive
)
(
when
(
buffer-modified-p
)
(
save-buffer
))
(
let
((
output-buffer
"*pugs-output*"
)
(
pugs-binary
"~/src/pugs/build/pugs"
)
(
pugs-file
(
buffer-file-name
(
current-buffer
)))
(
pugs-buffer
(
current-buffer
)))
(
when
(
get-buffer
output-buffer
)
(
kill-buffer
output-buffer
))
(
get-buffer-create
output-buffer
)
(
follow-mode
)
(
display-buffer
output-buffer
)
(
set-buffer
output-buffer
)
(
pugs-output-mode
)
(
setq-local
inhibit-read-only
t
)
(
insert
(
format
"started: %s\n"
(
current-time-string
)))
(
insert
(
format
"binary : %s\n"
pugs-binary
))
(
insert
(
format
"script : %s\n\n"
pugs-file
))
;;; run the process
(
process-file
pugs-binary
nil
output-buffer
nil
pugs-file
"--no-color"
)
; (start-process pugs-binary nil output-buffer t pugs-file "--no-color")
;;;
(
insert
(
format
"\nfinished: %s\n"
(
current-time-string
)))
(
insert
(
format
"binary : %s\n"
pugs-binary
))
(
insert
(
format
"script : %s\n"
pugs-file
))
))
(
define-derived-mode
pugs-mode
prog-mode
"pugs"
"pugs mode is a major mode for editing pugs files"
;; define pugs keywords
(
defvar
pugs-keywords
'
(
"import"
"let"
"Z"
"N"
"B"
"R"
"string"
"and"
"or"
"xor"
"not"
"true"
"false"
"let"
"do"
"while"
"for"
"if"
"else"
"break"
"continue"
"cout"
"cerr"
"clog"
"+"
))
(
defvar
pugs-special-symbols
'
(
":"
","
";"
"{"
"}"
"->"
"<="
">="
"="
"+"
"-"
"*"
"/"
"<"
">"
"^"
))
(
defvar
pugs-font-lock-defaults
`
((
;; strings
(
"\"\\.\\*\\?"
.
font-lock-string-face
)
;; keywords
(
,
(
regexp-opt
pugs-keywords
'words
)
.
font-lock-keyword-face
)
;; special symbols
(
,
(
regexp-opt
pugs-special-symbols
)
.
font-lock-constant-face
)
)))
(
setq
font-lock-defaults
pugs-font-lock-defaults
)
;; for comments
(
setq
comment-start
"//"
)
(
setq
comment-end
""
)
(
modify-syntax-entry
?\\
"\\"
pugs-mode-syntax-table
)
(
modify-syntax-entry
?/
". 124b"
pugs-mode-syntax-table
)
(
modify-syntax-entry
?*
". 23"
pugs-mode-syntax-table
)
(
modify-syntax-entry
?\n
"> b"
pugs-mode-syntax-table
)
(
local-set-key
(
kbd
"C-c C-c"
)
'pugs-run-file
)
)
(
provide
'pugs-mode
)
;;; (provide 'pugs-mode)
;;; pugs.el ends here
This diff is collapsed.
Click to expand it.
snippets/cc-mode/once
0 → 100644
+
10
−
0
View file @
94dec687
# -*- mode: snippet -*-
# name: #ifndef XXX; #define XXX; #endif
# key: ONCE
# --
#ifndef ${1:`(let ((case-fold-search nil)) (concat (upcase (replace-regexp-in-string "\\([A-Z][a-z]*\\)" "\\1_" (file-name-nondirectory (file-name-sans-extension (or (buffer-file-name) ""))))) "HPP"))`}
#define $1
$0
#endif // $1
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment