* pandoc-mode
@ 2023-02-13 14:26 Gottfried
2023-02-13 14:40 ` pandoc-mode Jean Louis
2023-02-14 18:35 ` pandoc-mode Bruno Barbier
0 siblings, 2 replies; 24+ messages in thread
From: Gottfried @ 2023-02-13 14:26 UTC (permalink / raw)
To: help-gnu-emacs@gnu.org, Jean Louis
[-- Attachment #1.1.1: Type: text/plain, Size: 11972 bytes --]
Hi,
I loaded the pandoc-mode:
M-x pandoc-mode
and there came up this messages:
Debugger entered--Lisp error: (wrong-type-argument stringp nil)
string-match("markdown" nil)
.................................
Warning (comp): hydra.el:103:1: Warning: defvar
`hydra-amaranth-warn-message' docstring wider than 80 characters Disable
showing Disable logging
Warning (comp): hydra.el:238:1: Warning: Alias for
‘hydra-hint-display-type’ should be declared before its referent Disable
showing Disable logging
Warning (comp): pandoc-mode.el:1166:8: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1167:8: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1255:8: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1239:53: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1251:8: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1252:8: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1253:8: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1254:8: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1282:8: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1279:49: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1288:8: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1285:50: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1303:8: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1304:8: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1305:8: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1343:8: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1337:65: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1337:65: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1337:65: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1337:65: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1337:65: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1337:65: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1337:65: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1337:65: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1337:65: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1337:65: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1337:65: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1337:65: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1337:65: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1337:65: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1352:8: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1346:65: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1346:65: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1346:65: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1346:65: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1346:65: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1346:65: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1346:65: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1346:65: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1346:65: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1346:65: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1346:65: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1346:65: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1346:65: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1346:65: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1370:8: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1355:67: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1355:67: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1355:67: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1355:67: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1355:67: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1355:67: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1355:67: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1355:67: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1355:67: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1355:67: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1355:67: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1355:67: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1355:67: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1355:67: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1367:8: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1368:8: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1369:8: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1379:8: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1373:63: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1373:63: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1373:63: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1373:63: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1373:63: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1373:63: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1373:63: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1388:8: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1382:62: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1382:62: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1382:62: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1382:62: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1397:8: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1391:63: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1391:63: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1391:63: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1391:63: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1391:63: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1391:63: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1406:8: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1400:60: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1400:60: Warning: docstring wider than 80
characters Disable showing Disable logging
Warning (comp): pandoc-mode.el:1167:8: Warning: the function
‘pandoc-output-format-hydra/body’ is not known to be defined. Disable
showing Disable logging
Warning (comp): pandoc-mode.el:1166:8: Warning: the function
‘pandoc-input-format-hydra/body’ is not known to be defined. Disable
showing Disable logging
....................................................................
I don’t know what to do
...............................................................
I have got this about "markdown" in my init.el file:
;; markdown for formatting text
(defun rcd-markdown (text &rest args)
"Markdown processing"
(let ((markdown (executable-find "markdown")))
(cond (markdown
(cond (text
(apply 'rcd-command-output-from-input markdown (append (list text)
args)))
(t ""))
(t (user-error "Command `markdown' not available"))))))
(defun rcd-markdown-preview ()
"Preview Markdown."
(interactive)
(let* ((output (rcd-markdown (buffer-string)))
(file (concat (buffer-file-name) "-MD.html")))
(with-temp-file file (insert output))
(browse-url file)))
...........................................................
Kind regards
Gottfried
[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3191 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: pandoc-mode
2023-02-13 14:26 pandoc-mode Gottfried
@ 2023-02-13 14:40 ` Jean Louis
2023-02-22 14:26 ` pandoc-mode /Asciidoc Gottfried
2023-02-14 18:35 ` pandoc-mode Bruno Barbier
1 sibling, 1 reply; 24+ messages in thread
From: Jean Louis @ 2023-02-13 14:40 UTC (permalink / raw)
To: Gottfried; +Cc: help-gnu-emacs@gnu.org, Jean Louis
Those warnings you may disregard.
I do not know what pandoc-mode does exactly. It is for conversion of
many formats.
--
Jean
Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns
In support of Richard M. Stallman
https://stallmansupport.org/
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: pandoc-mode /Asciidoc
2023-02-13 14:40 ` pandoc-mode Jean Louis
@ 2023-02-22 14:26 ` Gottfried
2023-02-23 11:33 ` Jean Louis
2023-02-23 11:34 ` Jean Louis
0 siblings, 2 replies; 24+ messages in thread
From: Gottfried @ 2023-02-22 14:26 UTC (permalink / raw)
To: Jean Louis, help-gnu-emacs@gnu.org
[-- Attachment #1.1.1: Type: text/plain, Size: 1400 bytes --]
Hi Jean,
Is it possible to solve this error message, even though it is not
important, as You said,
> Am 13.02.23 um 15:40 schrieb Jean Louis:
>> Those warnings you may disregard.
>>
because every time I open emacs it shows up and it does not open the
file I want.
and starting emacs it shows this:
>>
>> Debugger entered--Lisp error: (void-variable SECS)
>> (run-with-timer SECS REPEAT FUNCTION &rest ARGS)
>> load-with-code-conversion("/home/gfp/.config/emacs/init.el"
>> "/home/gfp/.config/emacs/init.el" t t)
>> load("/home/gfp/.config/emacs/init" noerror nomessage)
>> startup--load-user-init-file(#f(compiled-function () #<bytecode
>> 0x1a5d9b48a35c1bee>) #f(compiled-function () #<bytecode
>> 0x4d12c0e0e44348b>) t)
>> command-line()
>> normal-top-level()
you can use Emacs Lisp and install refresh:
>>>
>>> (run-with-timer SECS REPEAT FUNCTION &rest ARGS)
>>> Probably introduced at or before Emacs version 19.31.
>>>
>>> Then I believe there is way to do it:
>>>
>>> (defun rcd-asciidoctor-preview-buffer-as-html ()
>>> "Convert asciidoctor to file `/tmp/my.html'"
>>> (let* ((asciidoc (buffer-string))
>>> (tmp-file "/tmp/my.html")
>>> (html (rcd-asciidoctor asciidoc)))
>>> (with-temp-file tmp-file
>>> (insert html))))
Kind regards
Gottfried
[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3191 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: pandoc-mode /Asciidoc
2023-02-22 14:26 ` pandoc-mode /Asciidoc Gottfried
@ 2023-02-23 11:33 ` Jean Louis
2023-02-23 11:34 ` Jean Louis
1 sibling, 0 replies; 24+ messages in thread
From: Jean Louis @ 2023-02-23 11:33 UTC (permalink / raw)
To: Gottfried; +Cc: help-gnu-emacs
* Gottfried <gottfried@posteo.de> [2023-02-22 17:26]:
> Is it possible to solve this error message, even though it is not important,
> as You said,
I cannot find what you mean. If you quote the message, I can.
--
Jean
Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns
In support of Richard M. Stallman
https://stallmansupport.org/
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: pandoc-mode /Asciidoc
2023-02-22 14:26 ` pandoc-mode /Asciidoc Gottfried
2023-02-23 11:33 ` Jean Louis
@ 2023-02-23 11:34 ` Jean Louis
2023-02-23 14:13 ` Gottfried
1 sibling, 1 reply; 24+ messages in thread
From: Jean Louis @ 2023-02-23 11:34 UTC (permalink / raw)
To: Gottfried; +Cc: help-gnu-emacs@gnu.org
* Gottfried <gottfried@posteo.de> [2023-02-22 18:53]:
>
> > Am 13.02.23 um 15:40 schrieb Jean Louis:
> > > Those warnings you may disregard.
> > >
>
> because every time I open emacs it shows up and it does not open the file I
> want.
>
>
> and starting emacs it shows this:
> >>
> >> Debugger entered--Lisp error: (void-variable SECS)
> >> (run-with-timer SECS REPEAT FUNCTION &rest ARGS)
> >> load-with-code-conversion("/home/gfp/.config/emacs/init.el"
> >> "/home/gfp/.config/emacs/init.el" t t)
> >> load("/home/gfp/.config/emacs/init" noerror nomessage)
> >> startup--load-user-init-file(#f(compiled-function () #<bytecode
> >> 0x1a5d9b48a35c1bee>) #f(compiled-function () #<bytecode
> >> 0x4d12c0e0e44348b>) t)
> >> command-line()
What exactly did you put in init.el ?
--
Jean
Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns
In support of Richard M. Stallman
https://stallmansupport.org/
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: pandoc-mode /Asciidoc
2023-02-23 11:34 ` Jean Louis
@ 2023-02-23 14:13 ` Gottfried
2023-02-23 17:48 ` Jean Louis
2023-02-23 20:17 ` Jean Louis
0 siblings, 2 replies; 24+ messages in thread
From: Gottfried @ 2023-02-23 14:13 UTC (permalink / raw)
To: Jean Louis, help-gnu-emacs@gnu.org
[-- Attachment #1.1.1: Type: text/plain, Size: 3399 bytes --]
Hi,
I put this in my init.el file concerning Asccidoc:
;;Asciidoctor
(defun string-to-file-force (string file)
"Prints string into file, matters not if file exists. Return FILE as
file name."
(with-temp-file file
(insert string))
file)
(defun rcd-command-output-from-input (program input &rest args)
"Return output string from PROGRAM with given INPUT string and
optional ARGS."
(let* ((output (with-temp-buffer
(insert input)
(apply #'call-process-region nil nil program t '(t nil) nil args)
(buffer-string))))
output))
(defun rcd-asciidoctor (string &rest args)
"Return HTML by using Asciidoctor markup STRING."
(let ((asciidoctor (executable-find "asciidoctor")))
(apply 'rcd-command-output-from-input "asciidoctor" string "-" args)))
(defun rcd-asciidoctor-preview ()
"Preview asciidoctor"
(interactive)
(let ((asciidoctor (executable-find "asciidoctor")))
(when asciidoctor
(let* ((output (buffer-string))
(output (rcd-asciidoctor output))
(file (string-to-file-force output "asciidoctor-preview.html")))
(browse-url file)))))
(require 'adoc-mode)
(define-key adoc-mode-map (kbd "C-c a") #'rcd-asciidoctor-preview)
;;Asciidoctor refresh output quickly
(run-with-timer SECS REPEAT FUNCTION &rest ARGS)
(run-with-timer 1 3 #'rcd-asciidoctor-preview-buffer-as-html)
(defun rcd-asciidoctor-preview-buffer-as-html ()
"Convert asciidoctor to file `/tmp/my.html'"
(let* ((asciidoc (buffer-string))
(tmp-file "/tmp/my.html")
(html (rcd-asciidoctor asciidoc)))
(with-temp-file tmp-file
(insert html))))
I put that in my init.el file concerning markdown-mode:
;; markdown for formatting text
(defun rcd-markdown (text &rest args)
"Markdown processing"
(let ((markdown (executable-find "markdown")))
(cond (markdown
(cond (text
(apply 'rcd-command-output-from-input markdown (append (list text)
args)))
(t ""))
(t (user-error "Command `markdown' not available"))))))
(defun rcd-markdown-preview ()
"Preview Markdown."
(interactive)
(let* ((output (rcd-markdown (buffer-string)))
(file (concat (buffer-file-name) "-MD.html")))
(with-temp-file file (insert output))
(browse-url file)))
;;(define-key KEYMAP KEY DEF &optional REMOVE)
(require 'markdown-mode)
(define-key markdown-mode-map (kbd "C-c a") #'rcd-markdown-preview)
Kind regards
Gottfried
Am 23.02.23 um 12:34 schrieb Jean Louis:
> * Gottfried <gottfried@posteo.de> [2023-02-22 18:53]:
>>
>>> Am 13.02.23 um 15:40 schrieb Jean Louis:
>>>> Those warnings you may disregard.
>>>>
>>
>> because every time I open emacs it shows up and it does not open the file I
>> want.
>>
>>
>> and starting emacs it shows this:
>>>>
>>>> Debugger entered--Lisp error: (void-variable SECS)
>>>> (run-with-timer SECS REPEAT FUNCTION &rest ARGS)
>>>> load-with-code-conversion("/home/gfp/.config/emacs/init.el"
>>>> "/home/gfp/.config/emacs/init.el" t t)
>>>> load("/home/gfp/.config/emacs/init" noerror nomessage)
>>>> startup--load-user-init-file(#f(compiled-function () #<bytecode
>>>> 0x1a5d9b48a35c1bee>) #f(compiled-function () #<bytecode
>>>> 0x4d12c0e0e44348b>) t)
>>>> command-line()
>
> What exactly did you put in init.el ?
>
>
--
[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3191 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: pandoc-mode /Asciidoc
2023-02-23 14:13 ` Gottfried
@ 2023-02-23 17:48 ` Jean Louis
2023-02-23 20:17 ` Jean Louis
1 sibling, 0 replies; 24+ messages in thread
From: Jean Louis @ 2023-02-23 17:48 UTC (permalink / raw)
To: Gottfried; +Cc: help-gnu-emacs
This is what you should put:
(defun string-to-file-force (string file)
"Prints string into file, matters not if file exists. Return FILE as file
name."
(with-temp-file file
(insert string))
file)
(defun rcd-command-output-from-input (program input &rest args)
"Return output string from PROGRAM with given INPUT string and optional
ARGS."
(let* ((output (with-temp-buffer
(insert input)
(apply #'call-process-region nil nil program t '(t nil) nil args)
(buffer-string))))
output))
(defun rcd-asciidoctor (string &rest args)
"Return HTML by using Asciidoctor markup STRING."
(let ((asciidoctor (executable-find "asciidoctor")))
(apply 'rcd-command-output-from-input "asciidoctor" string "-" args)))
(defun rcd-asciidoctor-preview ()
"Preview asciidoctor"
(interactive)
(let ((asciidoctor (executable-find "asciidoctor")))
(when asciidoctor
(let* ((output (buffer-string))
(output (rcd-asciidoctor output))
(file (string-to-file-force output "asciidoctor-preview.html")))
(browse-url file)))))
(require 'adoc-mode)
(define-key adoc-mode-map (kbd "C-c a") #'rcd-asciidoctor-preview)
;;Asciidoctor refresh output quickly
(defun rcd-asciidoctor-preview-buffer-as-html ()
"Convert asciidoctor to file `/tmp/my.html'"
(let* ((asciidoc (buffer-string))
(tmp-file "/tmp/my.html")
(html (rcd-asciidoctor asciidoc)))
(with-temp-file tmp-file
(insert html))))
;; Though I would not recommend putting this in init.el as that is
;; too many times preview. It is better turning on and off the timer
;; function only when you need it.
(run-with-timer 1 3 #'rcd-asciidoctor-preview-buffer-as-html)
(defun rcd-markdown (text &rest args)
"Markdown processing"
(let ((markdown (executable-find "markdown")))
(cond (markdown
(cond (text
(apply 'rcd-command-output-from-input markdown (append (list text) args)))
(t ""))
(t (user-error "Command `markdown' not available"))))))
(defun rcd-markdown-preview ()
"Preview Markdown."
(interactive)
(let* ((output (rcd-markdown (buffer-string)))
(file (concat (buffer-file-name) "-MD.html")))
(with-temp-file file (insert output))
(browse-url file)))
;;(define-key KEYMAP KEY DEF &optional REMOVE)
(require 'markdown-mode)
(define-key markdown-mode-map (kbd "C-c a") #'rcd-markdown-preview)
--
Jean
Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns
In support of Richard M. Stallman
https://stallmansupport.org/
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: pandoc-mode /Asciidoc
2023-02-23 14:13 ` Gottfried
2023-02-23 17:48 ` Jean Louis
@ 2023-02-23 20:17 ` Jean Louis
2023-02-25 12:24 ` Gottfried
1 sibling, 1 reply; 24+ messages in thread
From: Jean Louis @ 2023-02-23 20:17 UTC (permalink / raw)
To: Gottfried; +Cc: help-gnu-emacs@gnu.org
It is better that you create some files where you put functions you
need, instead of putting everything in init.el
You can create asciidoc.el file and put inside what is for
Asciidoc. Similar for markdown.
Then in init.el you can put:
(load "markdown.el")
(load "asciidoc.el")
If your files are in some directory /my/directory, then you make sure
that Emacs can find them, to load them.
(add-to-path 'load-path "/my/directory")
(load "markdown.el")
(load "asciidoc.el")
or once you have this setting in init.el:
(add-to-path 'load-path "/my/directory")
and you have got all your other files in that directory, you can load
files when you need by using M-: (load-file "markdown")
or by using `l' in Dired directory, or M-x load-file
Even better is if you use packages or learn how to make them. That
will be most beneficial.
And about setting up timers, I would rather set them up this way:
;; following is mimicing (run-with-timer SECS REPEAT FUNCTION &rest ARGS)
;; by using the variable storing the values
(defvar my-timer '(1 5 my-function))
Then I could have this function to simply toggle the timer:
(defun rcd-toggle-timer (symbol)
"Toggle global SYMBOL timer as TRUE or FALSE."
(cond ((boundp symbol)
(cond ((and (nth 3 (symbol-value symbol))
(timerp (nth 3 (symbol-value symbol))))
(cancel-timer (nth 3 (symbol-value symbol)))
(setf (symbol-value symbol)
(list (nth 0 (symbol-value symbol))
(nth 1 (symbol-value symbol))
(nth 2 (symbol-value symbol)))))
((and (not (nth 3 (symbol-value symbol)))
(nth 2 (symbol-value symbol)))
(setf (symbol-value symbol)
(list
(nth 0 (symbol-value symbol))
(nth 1 (symbol-value symbol))
(nth 2 (symbol-value symbol))
(run-with-timer
(nth 0 (symbol-value symbol))
(nth 1 (symbol-value symbol))
(nth 2 (symbol-value symbol))))))
(t (message "Could not set up timer `%s'" symbol)))
(symbol-value symbol))
(t (user-error "Cannot setup timer `%s'" symbol))))
And then I apply the function:
(rcd-toggle-timer 'my-timer)
Then for automatic preview:
(defvar my-timer '(1 5 my-preview-function))
(defun toggle-markdown-preview ()
(interactive)
(rcd-toggle-timer 'my-timer))
Then I could invoke it as command:
M-x toggle-markdown-preview
and then timer toggles, it turns on or turns off.
Then you could hold your variable with the timer and timer function in separate file, it need not be init.el and you load it when you need it.
--
Jean
Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns
In support of Richard M. Stallman
https://stallmansupport.org/
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: pandoc-mode /Asciidoc
2023-02-23 20:17 ` Jean Louis
@ 2023-02-25 12:24 ` Gottfried
2023-02-26 1:36 ` David Masterson
0 siblings, 1 reply; 24+ messages in thread
From: Gottfried @ 2023-02-25 12:24 UTC (permalink / raw)
To: Jean Louis, help-gnu-emacs@gnu.org
[-- Attachment #1.1.1: Type: text/plain, Size: 4042 bytes --]
Hi,
thank you very much for helping me.
------------------------------------------------------
I did all of that you proposed.
--------------------------------------------------------
and I can open the markdown-mode
--------------------------------------------------------
but
I get this message in opening emacs:
Debugger entered--Lisp error: (void-function add-to-path)
(add-to-path 'load-path
"/home/gfp/.config/emacs/elpa/markdown-mode-2.5/")
load-with-code-conversion("/home/gfp/.config/emacs/init.el"
"/home/gfp/.config/emacs/init.el" t t)
load("/home/gfp/.config/emacs/init" noerror nomessage)
startup--load-user-init-file(#f(compiled-function () #<bytecode
0x12a01b9f1d8c1bee>) #f(compiled-function () #<bytecode
0x4d12c0e0e44348b>) t)
command-line()
normal-top-level()
-------------------------------------------------------------
May be there is something wrong with my path?
I put the "markdown.el" file, which I created, in the directory:
markdown-mode-2.5
/home/gfp/.config/emacs/elpa/markdown-mode-2.5/")
---------------------------------------------------------
So I don’t understand, why I get this error message.
Kind regards
Gottfried
Am 23.02.23 um 21:17 schrieb Jean Louis:
> It is better that you create some files where you put functions you
> need, instead of putting everything in init.el
>
> You can create asciidoc.el file and put inside what is for
> Asciidoc. Similar for markdown.
>
> Then in init.el you can put:
>
> (load "markdown.el")
> (load "asciidoc.el")
>
> If your files are in some directory /my/directory, then you make sure
> that Emacs can find them, to load them.
>
> (add-to-path 'load-path "/my/directory")
> (load "markdown.el")
> (load "asciidoc.el")
>
> or once you have this setting in init.el:
> (add-to-path 'load-path "/my/directory")
>
> and you have got all your other files in that directory, you can load
> files when you need by using M-: (load-file "markdown")
> or by using `l' in Dired directory, or M-x load-file
>
> Even better is if you use packages or learn how to make them. That
> will be most beneficial.
>
> And about setting up timers, I would rather set them up this way:
>
> ;; following is mimicing (run-with-timer SECS REPEAT FUNCTION &rest ARGS)
> ;; by using the variable storing the values
> (defvar my-timer '(1 5 my-function))
>
> Then I could have this function to simply toggle the timer:
>
> (defun rcd-toggle-timer (symbol)
> "Toggle global SYMBOL timer as TRUE or FALSE."
> (cond ((boundp symbol)
> (cond ((and (nth 3 (symbol-value symbol))
> (timerp (nth 3 (symbol-value symbol))))
> (cancel-timer (nth 3 (symbol-value symbol)))
> (setf (symbol-value symbol)
> (list (nth 0 (symbol-value symbol))
> (nth 1 (symbol-value symbol))
> (nth 2 (symbol-value symbol)))))
> ((and (not (nth 3 (symbol-value symbol)))
> (nth 2 (symbol-value symbol)))
> (setf (symbol-value symbol)
> (list
> (nth 0 (symbol-value symbol))
> (nth 1 (symbol-value symbol))
> (nth 2 (symbol-value symbol))
> (run-with-timer
> (nth 0 (symbol-value symbol))
> (nth 1 (symbol-value symbol))
> (nth 2 (symbol-value symbol))))))
> (t (message "Could not set up timer `%s'" symbol)))
> (symbol-value symbol))
> (t (user-error "Cannot setup timer `%s'" symbol))))
>
> And then I apply the function:
>
> (rcd-toggle-timer 'my-timer)
>
> Then for automatic preview:
>
> (defvar my-timer '(1 5 my-preview-function))
>
> (defun toggle-markdown-preview ()
> (interactive)
> (rcd-toggle-timer 'my-timer))
>
> Then I could invoke it as command:
>
> M-x toggle-markdown-preview
>
> and then timer toggles, it turns on or turns off.
>
> Then you could hold your variable with the timer and timer function in separate file, it need not be init.el and you load it when you need it.
>
--
[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3191 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: pandoc-mode /Asciidoc
2023-02-25 12:24 ` Gottfried
@ 2023-02-26 1:36 ` David Masterson
2023-02-26 10:31 ` Gottfried
0 siblings, 1 reply; 24+ messages in thread
From: David Masterson @ 2023-02-26 1:36 UTC (permalink / raw)
To: Gottfried; +Cc: Jean Louis, help-gnu-emacs@gnu.org
Gottfried <gottfried@posteo.de> writes:
> Hi,
>
> thank you very much for helping me.
> ------------------------------------------------------
> I did all of that you proposed.
> --------------------------------------------------------
> and I can open the markdown-mode
> --------------------------------------------------------
> but
> I get this message in opening emacs:
>
> Debugger entered--Lisp error: (void-function add-to-path)
This error means emacs cannot find the "add-to-path" function. Maybe
you want "add-to-list"?
You can (sort of) test an Elisp expression (ie. something surrounded by
parenthesis) by putting it in the *scratch* buffer (see C-x C-b) and
hitting C-j after the last close paren. If it works, copy it to your
init file and restart Emacs.
--
David Masterson
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: pandoc-mode /Asciidoc
2023-02-26 1:36 ` David Masterson
@ 2023-02-26 10:31 ` Gottfried
2023-02-26 10:53 ` Stephen Berman
0 siblings, 1 reply; 24+ messages in thread
From: Gottfried @ 2023-02-26 10:31 UTC (permalink / raw)
To: David Masterson; +Cc: Jean Louis, help-gnu-emacs@gnu.org
[-- Attachment #1.1.1: Type: text/plain, Size: 2295 bytes --]
Hi,
Yes you were right
> This error means emacs cannot find the "add-to-path" function. Maybe
> you want "add-to-list"?
Now I get an other error message and I don’t know why.
> Debugger entered--Lisp error: (file-missing "Cannot open load file" "Datei oder Verzeichnis nicht gefunden" "asciidoc.el")
> load("asciidoc.el")
> load-with-code-conversion("/home/gfp/.config/emacs/init.el" "/home/gfp/.config/emacs/init.el" t t)
> load("/home/gfp/.config/emacs/init" noerror nomessage)
> startup--load-user-init-file(#f(compiled-function () #<bytecode 0x1bd9a952b2a41bee>) #f(compiled-function () #<bytecode 0x4d12c0e0e44348b>) t)
> command-line()
> normal-top-level()
I put the file: "asciidoc.el" in my direcory:
/home/gfp/.config/emacs/Zusatzpakete/selbstinstalliert/Asciidoc/
and in my init.el file it looks like this:
(load "asciidoc.el")
(add-to-list 'load-path
"/home/gfp/.config/emacs/Zusatzpakete/selbstinstalliert/Asciidoc/")
So, where is my mistake?
Why emacs can’t find my file?
Second question
If there is already an error showing up in the backtrace buffer
can I test an other expression in the scratch buffer with hitting C-j?
It seems to me that the first backtrace blocks everything
and I have to get right this one.
How can I get rid of the first backtrace to check other expressions?
Kind regards
Gottfried
Am 26.02.23 um 02:36 schrieb David Masterson:
> Gottfried <gottfried@posteo.de> writes:
>
>> Hi,
>>
>> thank you very much for helping me.
>> ------------------------------------------------------
>> I did all of that you proposed.
>> --------------------------------------------------------
>> and I can open the markdown-mode
>> --------------------------------------------------------
>> but
>> I get this message in opening emacs:
>>
>> Debugger entered--Lisp error: (void-function add-to-path)
>
> This error means emacs cannot find the "add-to-path" function. Maybe
> you want "add-to-list"?
>
> You can (sort of) test an Elisp expression (ie. something surrounded by
> parenthesis) by putting it in the *scratch* buffer (see C-x C-b) and
> hitting C-j after the last close paren. If it works, copy it to your
> init file and restart Emacs.
>
--
[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3191 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: pandoc-mode /Asciidoc
2023-02-26 10:31 ` Gottfried
@ 2023-02-26 10:53 ` Stephen Berman
2023-02-26 16:06 ` Gottfried
0 siblings, 1 reply; 24+ messages in thread
From: Stephen Berman @ 2023-02-26 10:53 UTC (permalink / raw)
To: Gottfried; +Cc: David Masterson, Jean Louis, help-gnu-emacs@gnu.org
On Sun, 26 Feb 2023 10:31:47 +0000 Gottfried <gottfried@posteo.de> wrote:
> Hi,
>
> Yes you were right
>
>> This error means emacs cannot find the "add-to-path" function. Maybe
>> you want "add-to-list"?
>
> Now I get an other error message and I don’t know why.
>
>> Debugger entered--Lisp error: (file-missing "Cannot open load file" "Datei
>> oder Verzeichnis nicht gefunden" "asciidoc.el")
>> load("asciidoc.el")
>> load-with-code-conversion("/home/gfp/.config/emacs/init.el"
>> "/home/gfp/.config/emacs/init.el" t t)
>> load("/home/gfp/.config/emacs/init" noerror nomessage)
>> startup--load-user-init-file(#f(compiled-function () #<bytecode
>> 0x1bd9a952b2a41bee>) #f(compiled-function () #<bytecode 0x4d12c0e0e44348b>)
>> t)
>> command-line()
>> normal-top-level()
>
> I put the file: "asciidoc.el" in my direcory:
>
> /home/gfp/.config/emacs/Zusatzpakete/selbstinstalliert/Asciidoc/
>
>
> and in my init.el file it looks like this:
>
>
> (load "asciidoc.el")
> (add-to-list 'load-path
> "/home/gfp/.config/emacs/Zusatzpakete/selbstinstalliert/Asciidoc/")
>
> So, where is my mistake?
> Why emacs can’t find my file?
Lisp expresssions in a buffer are evaluated sequentially, and load-path
has to include the directory before you try to load a file in in it, so
the order must be this:
(add-to-list 'load-path
"/home/gfp/.config/emacs/Zusatzpakete/selbstinstalliert/Asciidoc/")
(load "asciidoc.el")
> Second question
> If there is already an error showing up in the backtrace buffer
> can I test an other expression in the scratch buffer with hitting C-j?
That should be possible.
> It seems to me that the first backtrace blocks everything
> and I have to get right this one.
The backtrace shouldn't block executing unrelated code.
> How can I get rid of the first backtrace to check other expressions?
Type `q' in the backtrace buffer.
Steve Berman
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: pandoc-mode /Asciidoc
2023-02-26 10:53 ` Stephen Berman
@ 2023-02-26 16:06 ` Gottfried
2023-02-26 16:50 ` Jean Louis
0 siblings, 1 reply; 24+ messages in thread
From: Gottfried @ 2023-02-26 16:06 UTC (permalink / raw)
To: Stephen Berman; +Cc: David Masterson, Jean Louis, help-gnu-emacs@gnu.org
[-- Attachment #1.1.1: Type: text/plain, Size: 2586 bytes --]
Hi,
> Lisp expresssions in a buffer are evaluated sequentially, and load-path
>> has to include the directory before you try to load a file in in it, so
>> the order must be this:
>>
>> (add-to-list 'load-path
>> "/home/gfp/.config/emacs/Zusatzpakete/selbstinstalliert/Asciidoc/")
>> (load "asciidoc.el")
thank you very much.
Your help solved my problem and I have learned a lot through your
explanations.
Kind regards
Gottfried
Am 26.02.23 um 11:53 schrieb Stephen Berman:
> On Sun, 26 Feb 2023 10:31:47 +0000 Gottfried <gottfried@posteo.de> wrote:
>
>> Hi,
>>
>> Yes you were right
>>
>>> This error means emacs cannot find the "add-to-path" function. Maybe
>>> you want "add-to-list"?
>>
>> Now I get an other error message and I don’t know why.
>>
>>> Debugger entered--Lisp error: (file-missing "Cannot open load file" "Datei
>>> oder Verzeichnis nicht gefunden" "asciidoc.el")
>>> load("asciidoc.el")
>>> load-with-code-conversion("/home/gfp/.config/emacs/init.el"
>>> "/home/gfp/.config/emacs/init.el" t t)
>>> load("/home/gfp/.config/emacs/init" noerror nomessage)
>>> startup--load-user-init-file(#f(compiled-function () #<bytecode
>>> 0x1bd9a952b2a41bee>) #f(compiled-function () #<bytecode 0x4d12c0e0e44348b>)
>>> t)
>>> command-line()
>>> normal-top-level()
>>
>> I put the file: "asciidoc.el" in my direcory:
>>
>> /home/gfp/.config/emacs/Zusatzpakete/selbstinstalliert/Asciidoc/
>>
>>
>> and in my init.el file it looks like this:
>>
>> (load "asciidoc.el")
>> (add-to-list 'load-path
>> "/home/gfp/.config/emacs/Zusatzpakete/selbstinstalliert/Asciidoc/")
>>
>> So, where is my mistake?
>> Why emacs can’t find my file?
>
> Lisp expresssions in a buffer are evaluated sequentially, and load-path
> has to include the directory before you try to load a file in in it, so
> the order must be this:
>
> (add-to-list 'load-path
> "/home/gfp/.config/emacs/Zusatzpakete/selbstinstalliert/Asciidoc/")
> (load "asciidoc.el")
>
>> Second question
>> If there is already an error showing up in the backtrace buffer
>> can I test an other expression in the scratch buffer with hitting C-j?
>
> That should be possible.
>
>> It seems to me that the first backtrace blocks everything
>> and I have to get right this one.
>
> The backtrace shouldn't block executing unrelated code.
>
>> How can I get rid of the first backtrace to check other expressions?
>
> Type `q' in the backtrace buffer.
>
> Steve Berman
--
[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3191 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: pandoc-mode /Asciidoc
2023-02-26 16:06 ` Gottfried
@ 2023-02-26 16:50 ` Jean Louis
2023-02-27 8:41 ` Gottfried
` (2 more replies)
0 siblings, 3 replies; 24+ messages in thread
From: Jean Louis @ 2023-02-26 16:50 UTC (permalink / raw)
To: Gottfried; +Cc: Stephen Berman, David Masterson, help-gnu-emacs@gnu.org
* Gottfried <gottfried@posteo.de> [2023-02-26 19:07]:
> Your help solved my problem and I have learned a lot through your
> explanations.
> > > > This error means emacs cannot find the "add-to-path" function. Maybe
> > > > you want "add-to-list"?
That was my mistake. Maybe I should make alias function `add-to-path'
(defun add-to-path (path)
(add-to-list 'load-path (expand-file-name path)))
--
Jean
Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns
In support of Richard M. Stallman
https://stallmansupport.org/
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: pandoc-mode /Asciidoc
2023-02-26 16:50 ` Jean Louis
@ 2023-02-27 8:41 ` Gottfried
2023-03-01 3:24 ` David Masterson
2023-03-02 18:06 ` Gottfried
2 siblings, 0 replies; 24+ messages in thread
From: Gottfried @ 2023-02-27 8:41 UTC (permalink / raw)
To: Stephen Berman, David Masterson, help-gnu-emacs@gnu.org
[-- Attachment #1.1.1: Type: text/plain, Size: 755 bytes --]
Hi,
> That was my mistake. Maybe I should make alias function `add-to-path'
>>
>> (defun add-to-path (path)
>> (add-to-list 'load-path (expand-file-name path)))
>>
no problem,
I am thankful for every help.
So I am learning.
Kind regards
Gottfried
Am 26.02.23 um 17:50 schrieb Jean Louis:
> * Gottfried <gottfried@posteo.de> [2023-02-26 19:07]:
>> Your help solved my problem and I have learned a lot through your
>> explanations.
>
>>>>> This error means emacs cannot find the "add-to-path" function. Maybe
>>>>> you want "add-to-list"?
>
> That was my mistake. Maybe I should make alias function `add-to-path'
>
> (defun add-to-path (path)
> (add-to-list 'load-path (expand-file-name path)))
>
--
[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3191 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: pandoc-mode /Asciidoc
2023-02-26 16:50 ` Jean Louis
2023-02-27 8:41 ` Gottfried
@ 2023-03-01 3:24 ` David Masterson
2023-03-02 18:06 ` Gottfried
2 siblings, 0 replies; 24+ messages in thread
From: David Masterson @ 2023-03-01 3:24 UTC (permalink / raw)
To: Gottfried; +Cc: Stephen Berman, help-gnu-emacs@gnu.org
Jean Louis <bugs@gnu.support> writes:
> * Gottfried <gottfried@posteo.de> [2023-02-26 19:07]:
>> Your help solved my problem and I have learned a lot through your
>> explanations.
>
>> > > > This error means emacs cannot find the "add-to-path" function. Maybe
>> > > > you want "add-to-list"?
>
> That was my mistake. Maybe I should make alias function `add-to-path'
>
> (defun add-to-path (path)
> (add-to-list 'load-path (expand-file-name path)))
I hesitated to correct you as I thought I remembered an add-to-path
function from years ago, but I couldn't find it.
--
David Masterson
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: pandoc-mode /Asciidoc
2023-02-26 16:50 ` Jean Louis
2023-02-27 8:41 ` Gottfried
2023-03-01 3:24 ` David Masterson
@ 2023-03-02 18:06 ` Gottfried
2023-03-02 18:51 ` Gottfried
2 siblings, 1 reply; 24+ messages in thread
From: Gottfried @ 2023-03-02 18:06 UTC (permalink / raw)
To: help-gnu-emacs@gnu.org, Jean Louis
[-- Attachment #1.1.1: Type: text/plain, Size: 4054 bytes --]
Hi Jean,
now I when opening Emacs I am getting this message:
>
> Warning: desktop file appears to be in use by process with PID 10234.
> Using it may cause conflicts if that process still runs.
> Use desktop file anyway? (y or n)
> Error running timer ‘rcd-asciidoctor-preview-buffer-as-html’: (text-read-only) [187 times]
I was checking the PID with:
ps -fp 10234
and I am getting this message:
UID PID PPID C STIME TTY TIME CMD
Interestingly in htop this PID doesn’t show up. I don’t know why.
Is there a way to solve this problem?
Kind regards
Gottfried
> It is better that you create some files where you put functions you
> need, instead of putting everything in init.el
>
> You can create asciidoc.el file and put inside what is for
> Asciidoc. Similar for markdown.
>
> Then in init.el you can put:
>
> (load "markdown.el")
> (load "asciidoc.el")
>
> If your files are in some directory /my/directory, then you make sure
> that Emacs can find them, to load them.
>
> (add-to-path 'load-path "/my/directory")
> (load "markdown.el")
> (load "asciidoc.el")
>
> or once you have this setting in init.el:
> (add-to-path 'load-path "/my/directory")
>
> and you have got all your other files in that directory, you can load
> files when you need by using M-: (load-file "markdown")
> or by using `l' in Dired directory, or M-x load-file
>
> Even better is if you use packages or learn how to make them. That
> will be most beneficial.
>
> And about setting up timers, I would rather set them up this way:
>
> ;; following is mimicing (run-with-timer SECS REPEAT FUNCTION &rest ARGS)
> ;; by using the variable storing the values
> (defvar my-timer '(1 5 my-function))
>
> Then I could have this function to simply toggle the timer:
>
> (defun rcd-toggle-timer (symbol)
> "Toggle global SYMBOL timer as TRUE or FALSE."
> (cond ((boundp symbol)
> (cond ((and (nth 3 (symbol-value symbol))
> (timerp (nth 3 (symbol-value symbol))))
> (cancel-timer (nth 3 (symbol-value symbol)))
> (setf (symbol-value symbol)
> (list (nth 0 (symbol-value symbol))
> (nth 1 (symbol-value symbol))
> (nth 2 (symbol-value symbol)))))
> ((and (not (nth 3 (symbol-value symbol)))
> (nth 2 (symbol-value symbol)))
> (setf (symbol-value symbol)
> (list
> (nth 0 (symbol-value symbol))
> (nth 1 (symbol-value symbol))
> (nth 2 (symbol-value symbol))
> (run-with-timer
> (nth 0 (symbol-value symbol))
> (nth 1 (symbol-value symbol))
> (nth 2 (symbol-value symbol))))))
> (t (message "Could not set up timer `%s'" symbol)))
> (symbol-value symbol))
> (t (user-error "Cannot setup timer `%s'" symbol))))
>
> And then I apply the function:
>
> (rcd-toggle-timer 'my-timer)
>
> Then for automatic preview:
>
> (defvar my-timer '(1 5 my-preview-function))
>
> (defun toggle-markdown-preview ()
> (interactive)
> (rcd-toggle-timer 'my-timer))
>
> Then I could invoke it as command:
>
> M-x toggle-markdown-preview
>
> and then timer toggles, it turns on or turns off.
>
> Then you could hold your variable with the timer and timer function in separate file, it need not be init.el and you load it when you need it.
>
> --
> Jean
>
> Take action in Free Software Foundation campaigns:
> https://www.fsf.org/campaigns
>
> In support of Richard M. Stallman
> https://stallmansupport.org/
Am 26.02.23 um 17:50 schrieb Jean Louis:
> * Gottfried <gottfried@posteo.de> [2023-02-26 19:07]:
>> Your help solved my problem and I have learned a lot through your
>> explanations.
>
>>>>> This error means emacs cannot find the "add-to-path" function. Maybe
>>>>> you want "add-to-list"?
>
> That was my mistake. Maybe I should make alias function `add-to-path'
>
> (defun add-to-path (path)
> (add-to-list 'load-path (expand-file-name path)))
>
--
[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3191 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: pandoc-mode /Asciidoc
2023-03-02 18:06 ` Gottfried
@ 2023-03-02 18:51 ` Gottfried
2023-03-13 4:17 ` Jean Louis
0 siblings, 1 reply; 24+ messages in thread
From: Gottfried @ 2023-03-02 18:51 UTC (permalink / raw)
To: help-gnu-emacs@gnu.org, Jean Louis
[-- Attachment #1.1.1: Type: text/plain, Size: 381 bytes --]
Hi Jean,
I managed to stop the programme Emacs and also Ascii
so this message with PID doesn’t show up
but
there are problems with the timer
When using dired and after pressing f to open a file
emacs stopps and nothing can be done.
Then I have to stop the programme in htop e.g.
So the timer makes a mass in my whole emacs programme
Kind regards
Gottfried
[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3191 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: pandoc-mode /Asciidoc
2023-03-02 18:51 ` Gottfried
@ 2023-03-13 4:17 ` Jean Louis
2023-03-15 15:42 ` Gottfried
0 siblings, 1 reply; 24+ messages in thread
From: Jean Louis @ 2023-03-13 4:17 UTC (permalink / raw)
To: Gottfried; +Cc: help-gnu-emacs@gnu.org, Jean Louis
* Gottfried <gottfried@posteo.de> [2023-03-02 21:53]:
> So the timer makes a mass in my whole emacs programme
Don't use timer, set up local mode key and use function key for
preview.
M-x local-set-key RET F5 name-of-my-function
--
Jean
Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns
In support of Richard M. Stallman
https://stallmansupport.org/
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: pandoc-mode /Asciidoc
2023-03-13 4:17 ` Jean Louis
@ 2023-03-15 15:42 ` Gottfried
2023-03-15 16:37 ` Emanuel Berg
0 siblings, 1 reply; 24+ messages in thread
From: Gottfried @ 2023-03-15 15:42 UTC (permalink / raw)
To: help-gnu-emacs@gnu.org, Jean Louis
[-- Attachment #1.1.1: Type: text/plain, Size: 854 bytes --]
Hi,
thanks a lot.
If I want a shortcut key for markdown-mode
do I have to:
M-x local-set-key RET F5 markdown-mode
............................................
If I want a shortcut key for adoc-mode
do I have to:
M-x local-set-key RET F5 adoc-mode
............................................
If I want a key for both,
what do I have to do?
The one F5 and the other e.g. F6 ??
.................................................
I am careful, so I am asking before doing something.
Kind regards
Gottfried
Am 13.03.23 um 05:17 schrieb Jean Louis:
> * Gottfried <gottfried@posteo.de> [2023-03-02 21:53]:
>> So the timer makes a mass in my whole emacs programme
>
> Don't use timer, set up local mode key and use function key for
> preview.
>
> M-x local-set-key RET F5 name-of-my-function
>
--
[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3191 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: pandoc-mode /Asciidoc
2023-03-15 15:42 ` Gottfried
@ 2023-03-15 16:37 ` Emanuel Berg
0 siblings, 0 replies; 24+ messages in thread
From: Emanuel Berg @ 2023-03-15 16:37 UTC (permalink / raw)
To: help-gnu-emacs
Gottfried wrote:
> If I want a shortcut key for markdown-mode
Actually, you shouldn't need a shortcut for that since .md
files should land in that mode automatically, if you also want
it for other files that don't have that suffix/extension there
are other methods to automate that as well, see some Elisp
last in this file for an example.
> M-x local-set-key RET F5 markdown-mode
It's better to use Elisp for keys, see `define-key'.
Here is an example
(define-key gnus-server-mode-map "i" #'previous-line)
> The one F5 and the other e.g. F6 ??
Hint, avoid the function keys. Make you fingers move to much,
reduces speed/ergonomics.
> I am careful, so I am asking before doing something.
Sure, ask!
But don't be too careful, you won't screw it up, trust
a person who as done that one zillion times and is still
kicking ...
```emacs-lisp
;;; -*- lexical-binding: t -*-
;;
;; this file:
;; https://dataswamp.org/~incal/emacs-init/mode-by-filename.el
(setq auto-mode-alist `(
("\\.bal\\'" . balance-mode)
("\\.cl\\'" . common-lisp-mode)
("\\.dat\\'" . gnuplot-mode)
("\\.gpi\\'" . gnuplot-mode)
("\\.grm\\'" . sml-mode)
("\\.lu\\'" . lua-mode)
("\\.nqp\\'" . perl-mode)
("\\.php\\'" . html-mode)
("\\.pic\\'" . nroff-mode)
("\\.pl\\'" . prolog-mode)
("\\.sed\\'" . conf-mode)
("\\.service\\'" . conf-mode)
("\\.tap\\'" . gcode-mode)
("\\.tex\\'" . latex-mode)
("\\.xr\\'" . conf-xdefaults-mode)
("torrc\\'" . conf-mode)
("keys\\'" . conf-mode)
("*" . text-mode)
,@auto-mode-alist) )
(provide 'mode-by-filename)
```
--
underground experts united
https://dataswamp.org/~incal
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: pandoc-mode
2023-02-13 14:26 pandoc-mode Gottfried
2023-02-13 14:40 ` pandoc-mode Jean Louis
@ 2023-02-14 18:35 ` Bruno Barbier
2023-02-14 19:52 ` pandoc-mode Joost Kremers
1 sibling, 1 reply; 24+ messages in thread
From: Bruno Barbier @ 2023-02-14 18:35 UTC (permalink / raw)
To: Gottfried, help-gnu-emacs@gnu.org, Jean Louis
Gottfried <gottfried@posteo.de> writes:
> Hi,
>
> I loaded the pandoc-mode:
>
> M-x pandoc-mode
>
> and there came up this messages:
>
> Debugger entered--Lisp error: (wrong-type-argument stringp nil)
> string-match("markdown" nil)
You should have other lines below this one, that might help us help you.
Note that pandoc-mode is not part of Emacs and that it has its own
mailing list:
https://groups.google.com/g/pandoc-discuss
Else, FWIW, turning pandoc-mode ON doesn't raise any error in my Emacs.
Bruno
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: pandoc-mode
2023-02-14 18:35 ` pandoc-mode Bruno Barbier
@ 2023-02-14 19:52 ` Joost Kremers
2023-02-22 14:13 ` pandoc-mode Gottfried
0 siblings, 1 reply; 24+ messages in thread
From: Joost Kremers @ 2023-02-14 19:52 UTC (permalink / raw)
To: Bruno Barbier; +Cc: Gottfried, help-gnu-emacs
On Tue, Feb 14 2023, Bruno Barbier wrote:
> Gottfried <gottfried@posteo.de> writes:
>> I loaded the pandoc-mode:
>>
>> M-x pandoc-mode
>>
>> and there came up this messages:
>>
>> Debugger entered--Lisp error: (wrong-type-argument stringp nil)
>> string-match("markdown" nil)
>
> You should have other lines below this one, that might help us help you.
Yes, there should be more, or otherwise do `M-x toggle-debug-on-error` before
running pandoc-mode. That should pop up a backtrace buffer, the contents of that
buffer should provide more insight.
> Note that pandoc-mode is not part of Emacs and that it has its own
> mailing list:
>
> https://groups.google.com/g/pandoc-discuss
Actually, that's the mailing list for Pandoc itself, not for pandoc-mode, which
doesn't have a mailing list. If you have a Github account, it's best to open an
issue here: <https://github.com/joostkremers/pandoc-mode/issues>. Otherwise, you
might as well contact me directly. (I'm the pandoc-mode maintainer;
unfortunately, work is taking up a lot of my time, so I haven't been able to
dedicate as much time to pandoc-mode as I should...)
> Else, FWIW, turning pandoc-mode ON doesn't raise any error in my Emacs.
It doesn't for me, either.
HTH
--
Joost Kremers
Life has its moments
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: pandoc-mode
2023-02-14 19:52 ` pandoc-mode Joost Kremers
@ 2023-02-22 14:13 ` Gottfried
0 siblings, 0 replies; 24+ messages in thread
From: Gottfried @ 2023-02-22 14:13 UTC (permalink / raw)
To: Joost Kremers, Bruno Barbier; +Cc: help-gnu-emacs
[-- Attachment #1.1.1: Type: text/plain, Size: 1636 bytes --]
Hi,
interestingly when I now turn on pandoc-mode there is no error-message.
I don’t know why, but it is like this.
I have not used it yet, I just installed it, in case I will use it.
Thanks for help.
Kind regards
Gottfried
Am 14.02.23 um 20:52 schrieb Joost Kremers:
> On Tue, Feb 14 2023, Bruno Barbier wrote:
>> Gottfried <gottfried@posteo.de> writes:
>>> I loaded the pandoc-mode:
>>>
>>> M-x pandoc-mode
>>>
>>> and there came up this messages:
>>>
>>> Debugger entered--Lisp error: (wrong-type-argument stringp nil)
>>> string-match("markdown" nil)
>>
>> You should have other lines below this one, that might help us help you.
>
> Yes, there should be more, or otherwise do `M-x toggle-debug-on-error` before
> running pandoc-mode. That should pop up a backtrace buffer, the contents of that
> buffer should provide more insight.
>
>> Note that pandoc-mode is not part of Emacs and that it has its own
>> mailing list:
>>
>> https://groups.google.com/g/pandoc-discuss
>
> Actually, that's the mailing list for Pandoc itself, not for pandoc-mode, which
> doesn't have a mailing list. If you have a Github account, it's best to open an
> issue here: <https://github.com/joostkremers/pandoc-mode/issues>. Otherwise, you
> might as well contact me directly. (I'm the pandoc-mode maintainer;
> unfortunately, work is taking up a lot of my time, so I haven't been able to
> dedicate as much time to pandoc-mode as I should...)
>
>> Else, FWIW, turning pandoc-mode ON doesn't raise any error in my Emacs.
>
> It doesn't for me, either.
>
> HTH
>
>
--
[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3191 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
end of thread, other threads:[~2023-03-15 16:37 UTC | newest]
Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-13 14:26 pandoc-mode Gottfried
2023-02-13 14:40 ` pandoc-mode Jean Louis
2023-02-22 14:26 ` pandoc-mode /Asciidoc Gottfried
2023-02-23 11:33 ` Jean Louis
2023-02-23 11:34 ` Jean Louis
2023-02-23 14:13 ` Gottfried
2023-02-23 17:48 ` Jean Louis
2023-02-23 20:17 ` Jean Louis
2023-02-25 12:24 ` Gottfried
2023-02-26 1:36 ` David Masterson
2023-02-26 10:31 ` Gottfried
2023-02-26 10:53 ` Stephen Berman
2023-02-26 16:06 ` Gottfried
2023-02-26 16:50 ` Jean Louis
2023-02-27 8:41 ` Gottfried
2023-03-01 3:24 ` David Masterson
2023-03-02 18:06 ` Gottfried
2023-03-02 18:51 ` Gottfried
2023-03-13 4:17 ` Jean Louis
2023-03-15 15:42 ` Gottfried
2023-03-15 16:37 ` Emanuel Berg
2023-02-14 18:35 ` pandoc-mode Bruno Barbier
2023-02-14 19:52 ` pandoc-mode Joost Kremers
2023-02-22 14:13 ` pandoc-mode Gottfried
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.