This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; | |
with Ada.Text_IO; use Ada.Text_IO; | |
with Ada.Text_IO.Unbounded_IO; use Ada.Text_IO.Unbounded_IO; | |
procedure SLList is | |
function "+" (Source : in String) | |
return Unbounded_String renames To_Unbounded_String; | |
type Node; | |
type Node_Ref is access Node; | |
type Node is record |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\ sllist.fs - Singly Linked List implementation in forth using gforth's structs. | |
\G A node contains the address of the next node and the address of a | |
\G counted string. | |
struct | |
cell% field node-text \ address of counted string | |
cell% field node-next \ address of next node | |
end-struct node% | |
\G Initialize a node given the address of a counted string and the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\ sllist-less-comments.fs - Singly Linked List implementation in forth using gforth's structs, less comments. | |
struct | |
cell% field node-text \ address of counted string | |
cell% field node-next \ address of next node | |
end-struct node% | |
: node-init ( text-addr next-addr node-addr -- ) tuck node-next ! node-text ! ; | |
: node-type ( node-addr -- ) node-text @ count type ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun tkb-magit-commit-fill-nobreak-p () | |
"Don't fill on the first line of a magit commit message." | |
(= 1 (line-number-at-pos))) | |
(defun tkb-magit-commit-find-file-hook () | |
(interactive) | |
(when (string-match "COMMIT_EDITMSG\\'" (buffer-file-name)) | |
(make-local-variable 'fill-nobreak-predicate) | |
(add-to-list 'fill-nobreak-predicate #'tkb-magit-commit-fill-nobreak-p))) | |
;; Using add-to-list without specifying APPEND didn't work because |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(when (getenv "WAYLAND_DISPLAY") | |
(message "Running under Wayland") | |
(defvar tkb-beep-sound "/usr/share/sounds/freedesktop/stereo/bell.oga") | |
(defvar tkb-beep-program "ogg123") | |
(defun tkb-bell () | |
"Ring the bell." | |
(interactive) | |
(start-process "Beep" nil tkb-beep-program | |
tkb-beep-sound)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Nikola metadata lines start like this: | |
;; .. keyword: | |
;; They shouldn't be wrapped. | |
(defvar tkb-nikola-metadata-regexp "\\.\\. [a-z]+:") | |
(defun tkb-nikola-rest-fill-nobreak-p () | |
"Don't fill on metadata lines in nikola reST posts." | |
(save-excursion | |
(beginning-of-line) | |
(looking-at tkb-nikola-metadata-regexp))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defvar tkb-beep-sound "/usr/share/sounds/freedesktop/stereo/bell.oga") | |
(defvar tkb-beep-program "ogg123") | |
(defun tkb-bell () | |
(interactive) | |
(start-process "Beep" nil tkb-beep-program | |
tkb-beep-sound)) | |
(setq ring-bell-function #'tkb-bell) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(module get-gemini-atom () | |
(import (scheme)) | |
(import (chicken base)) | |
(import (chicken file)) | |
(import (chicken process-context)) | |
(import (chicken condition)) | |
(import (utf8)) | |
(import args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(load-library "cl-indent") ; defines the common-lisp-indent-function properties | |
(setq lisp-indent-function 'common-lisp-indent-function) | |
(cl-loop for symbol being the symbols | |
for cl-indent-rule = (get symbol 'common-lisp-indent-function) | |
for elisp-equivalent = (intern-soft (concat "cl-" (symbol-name symbol))) | |
when (and cl-indent-rule elisp-equivalent (fboundp elisp-equivalent)) | |
do (put elisp-equivalent 'common-lisp-indent-function cl-indent-rule)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun tkb-select-frame-popup () | |
(interactive) | |
(let* ((frames (cl-loop for frame in (frame-list) | |
collect (cons (frame-parameter frame 'name) | |
frame) | |
into frames finally return frames)) | |
(frame (x-popup-menu t `("Pick a frame" ("frames" ,@frames))))) | |
(when frame | |
(raise-frame frame) | |
(select-frame frame)))) |
NewerOlder