journal
all ![]() | Rob is 20,118 days old today. |
June 2017 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
Aug 2017 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 2016 jan feb mar apr may jun jul aug sep oct nov dec
2018 jan feb mar apr may jun jul aug sep oct nov dec |< << more >> >| |
Entries this day: dear-r-emacs dear-summer work dear r emacs 14:23 Saturday 08 July 2017 JSTDear /r/emacs I use Emacs to prepare text files that will be processed by a static site generator (Hugo). The YAML topmatter can include multiple tags, so I would like the option of entering more tags into my file preparation function. My functions ask me for Title, Tag, and date.. then produce output like this: --- title: reddit emacs tags: [ "emacs" ] author: Rob Nugen date: 2017-07-08T14:23:30+09:00 --- ## 14:23 Saturday 08 July 2017 JST I would like emacs to keep asking me for tags so it could produce output like this, for example: --- title: reddit emacs tags: [ "emacs", "programming", "tag3", "tag4" ] author: Rob Nugen date: 2017-07-08T14:23:30+09:00 --- ## 14:23 Saturday 08 July 2017 JST The full code I have so far is here https://gist.github.com/thunderrabbit/b6a3d157fd4a916d23bea75f1d10b58f You can just save it as (find-file "~/path/to/file") The relevant code is here: (interactive (list (read-string "Title: ") (read-string "Tag: ") ) ) How can I have emacs keep asking for tags until I enter an empty tag? 18:46 Saturday 08 July 2017 JSTThank you /u/wasamasa! https://www.reddit.com/r/emacs/comments/6lzpre/use_interactive_list_readstring_to_read_arbitrary/djxuzst/ Easy, write a helper function that constructs such a list: (defun my-read-tags () (let (tags tag done) (while (not done) (setq tag (read-string "Tag: ")) (if (string-empty-p tag) (setq done t) (push tag tags))) (nreverse tags))) You can then use it in your command: (defun my-test (title tags) (interactive (list (read-string "Title: ") (my-read-tags))) (message "%s: %s" title tags)) 20:55 Saturday 08 July 2017 JSTNice. I tweaked the code a bit and now I have multiple tags per journal entry. permalinkdear summer 14:28 Saturday 08 July 2017 JSTWhile preparing to post my question to /r/emacs, the power went off in our house. The circuit breaker flipped. Lin's AC and my computer + monitors are apparently on the same circuit, which seems weird, but I guess it was not the neighborhood losing power. Oh, so while my computer battery is still fine, I cannot post the post while the router has no power. 14:36 Saturday 08 July 2017 JSTNevermind. It is the whole house. I am just going to leave it off to save energy. 16:35 Saturday 08 July 2017 JSTThe breakerbox has three types of breakers. One type I have never seen before looks like a normal lightswitch, but also features two little buttons near it, red and white. After leaving the power off for a while the first time, Lin pushed the white button and flipped the breaker back on. Just a moment ago, when she turned her AC on the breaker flipped again. Now (after not waiting as long), when she pushed the white button, the big breaker still won't stay on. She is calling the company from which we bought the house, who offer 2 years of support, like a maintenance contract. 16:42Warranty covers different stuff like foundation shifts (earthquakes?) permalinkwork 21:37 Saturday 08 July 2017 JSTHaving trouble getting work done for AB. I finished the one thing they wanted done, but cannot seem to figure out the thing I really want to do. permalinkprev day next day |