From: Gottfried <gottfried@posteo.de>
To: "help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>,
Jean Louis <bugs@gnu.support>
Subject: Re: pandoc-mode /Asciidoc
Date: Thu, 2 Mar 2023 18:06:15 +0000 [thread overview]
Message-ID: <438780c9-39c7-5a65-c5bd-63b0f8c62169@posteo.de> (raw)
In-Reply-To: <Y/uN7NBOIMzSPZ5S@protected.localdomain>
[-- 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 --]
next prev parent reply other threads:[~2023-03-02 18:06 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=438780c9-39c7-5a65-c5bd-63b0f8c62169@posteo.de \
--to=gottfried@posteo.de \
--cc=bugs@gnu.support \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).