Bonjour =E0 tous,
J'ai mis au point une petite fonction qui g=E9n=E8re un fichier .tex, et je
voudrais que la date de cr=E9ation soit rajout=E9e au nom du fichier; mais
(write-file "mocr'%d%m%y'.tex"), ou
(write-file "mocr%d%m%y.tex")
me donnent des fichiers dont le nom est verbatim celui que j'=E9cris dans la
fonction... Je ne trouve pas comment appeler la date en elisp?? Ni "date"
ni "today" ne sont compris. Pourtant ce doit =EAtre facile, alors merci
d'avance...
--=20
Jean=20
Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
Bastien
Jean Magnan de Bornier writes:
Bonjour à tous, J'ai mis au point une petite fonction qui génère un fichier .tex, et je voudrais que la date de création soit rajoutée au nom du fichier; mais
,----[ format-time-string ] | format-time-string is a built-in function in `C source code'. | (format-time-string FORMAT-STRING &optional TIME UNIVERSAL) | | Use FORMAT-STRING to format the time TIME, or now if omitted. | TIME is specified as (HIGH LOW . IGNORED), as returned by | `current-time' or `file-attributes'. The obsolete form (HIGH . LOW) | is also still accepted. | The third, optional, argument UNIVERSAL, if non-nil, means describe TIME | as Universal Time; nil means describe TIME in the local time zone. | The value is a copy of FORMAT-STRING, but with certain constructs replaced | by text that describes the specified date and time in TIME: `----
-- Bastien
Jean Magnan de Bornier <jean@bornier.net> writes:
Bonjour à tous,
J'ai mis au point une petite fonction qui génère un fichier .tex, et je
voudrais que la date de création soit rajoutée au nom du fichier; mais
,----[ format-time-string ]
| format-time-string is a built-in function in `C source code'.
| (format-time-string FORMAT-STRING &optional TIME UNIVERSAL)
|
| Use FORMAT-STRING to format the time TIME, or now if omitted.
| TIME is specified as (HIGH LOW . IGNORED), as returned by
| `current-time' or `file-attributes'. The obsolete form (HIGH . LOW)
| is also still accepted.
| The third, optional, argument UNIVERSAL, if non-nil, means describe TIME
| as Universal Time; nil means describe TIME in the local time zone.
| The value is a copy of FORMAT-STRING, but with certain constructs replaced
| by text that describes the specified date and time in TIME:
`----
Bonjour à tous, J'ai mis au point une petite fonction qui génère un fichier .tex, et je voudrais que la date de création soit rajoutée au nom du fichier; mais
,----[ format-time-string ] | format-time-string is a built-in function in `C source code'. | (format-time-string FORMAT-STRING &optional TIME UNIVERSAL) | | Use FORMAT-STRING to format the time TIME, or now if omitted. | TIME is specified as (HIGH LOW . IGNORED), as returned by | `current-time' or `file-attributes'. The obsolete form (HIGH . LOW) | is also still accepted. | The third, optional, argument UNIVERSAL, if non-nil, means describe TIME | as Universal Time; nil means describe TIME in the local time zone. | The value is a copy of FORMAT-STRING, but with certain constructs replaced | by text that describes the specified date and time in TIME: `----
-- Bastien
Jean Magnan de Bornier
Le 01 mai à 15:57:47 Bastien écrit notamment:
| Jean Magnan de Bornier writes:
| > Bonjour à tous, | > J'ai mis au point une petite fonction qui génère un fichier .tex, e t je | > voudrais que la date de création soit rajoutée au nom du fichier; m ais | > | > (write-file "mocr'%d%m%y'.tex"), ou | > | > (write-file "mocr%d%m%y.tex")
Excellent! Je subodorais que concat devrait intervenir, mais je ne savais pas trop comment... Au final, j'ai donc: (write-file (concat "mocr" (format-time-string "%d%m%Y") ".tex"))
et un grand merci! à+, -- Jean
Le 01 mai à 15:57:47 Bastien <bastien@xxx.fr> écrit notamment:
| Jean Magnan de Bornier <jean@bornier.net> writes:
| > Bonjour à tous,
| > J'ai mis au point une petite fonction qui génère un fichier .tex, e t je
| > voudrais que la date de création soit rajoutée au nom du fichier; m ais
| >
| > (write-file "mocr'%d%m%y'.tex"), ou
| >
| > (write-file "mocr%d%m%y.tex")
Excellent! Je subodorais que concat devrait intervenir, mais je ne
savais pas trop comment...
Au final, j'ai donc:
(write-file (concat "mocr" (format-time-string "%d%m%Y") ".tex"))
| > Bonjour à tous, | > J'ai mis au point une petite fonction qui génère un fichier .tex, e t je | > voudrais que la date de création soit rajoutée au nom du fichier; m ais | > | > (write-file "mocr'%d%m%y'.tex"), ou | > | > (write-file "mocr%d%m%y.tex")
Excellent! Je subodorais que concat devrait intervenir, mais je ne savais pas trop comment... Au final, j'ai donc: (write-file (concat "mocr" (format-time-string "%d%m%Y") ".tex"))