From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Edward Reingold Newsgroups: gmane.emacs.devel Subject: Re: cal-tex.el landscape patch Date: Fri, 25 Aug 2017 18:25:51 +0000 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="089e0822704cc517b705579813c8" X-Trace: blaine.gmane.org 1503685690 11841 195.159.176.226 (25 Aug 2017 18:28:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 25 Aug 2017 18:28:10 +0000 (UTC) Cc: emacs-devel To: Glenn Morris , =?UTF-8?Q?Vincent_Bela=C3=AFche?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Aug 25 20:28:04 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dlJKc-0001ol-Kd for ged-emacs-devel@m.gmane.org; Fri, 25 Aug 2017 20:27:46 +0200 Original-Received: from localhost ([::1]:54490 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dlJKh-0003q5-Pe for ged-emacs-devel@m.gmane.org; Fri, 25 Aug 2017 14:27:51 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60955) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dlJJ4-0003N3-9f for emacs-devel@gnu.org; Fri, 25 Aug 2017 14:26:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dlJJ3-0001ii-0H for emacs-devel@gnu.org; Fri, 25 Aug 2017 14:26:10 -0400 Original-Received: from mail-qt0-f174.google.com ([209.85.216.174]:33191) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dlJIy-0001cG-1M; Fri, 25 Aug 2017 14:26:04 -0400 Original-Received: by mail-qt0-f174.google.com with SMTP id e2so3020725qta.0; Fri, 25 Aug 2017 11:26:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wBqHC2gCqhsAx1taZg08VUwLgVBsmy2TGpc5q4WQXeE=; b=nQb92k4Z77Sv2a2De1uU3pKd6sX9NtFl8j7ojX6/vWDLlSyO/nlDJAP94I7jYXpOvg wRMcC8wgujwt0KZBb8UT2/lLFDHZzciC/hvi/cfNa7U8fkoj+KBpHceUmmBjOmdUs0Pq oua6Em9qZreypEasyJLIXrp5ZvK6QqGxGcC6xostCjsvPgUjQoc2n3oPDSWmDz/HF86P iRpIY4Jh8qwHAfuP4wV2nTMOb/4OcbVw7bVH/ATc1Es+y7RVpNi8ObHnx/5ubqYmx/XG SLnKCqbBUZVuKQf2h1b3dr9JRwaSuII5lsK1cjF4kLFf7ZFztkO8Wsj4q0B2xQRBcvsJ GAHg== X-Gm-Message-State: AHYfb5gMufVU45lm9le4afJnxKG6kdxtkev7zCB4wTNouyiaVrjyOVx4 8MSDJymSfxugnsG+22t1Qafkk9J3ZQ== X-Received: by 10.200.10.199 with SMTP id g7mr14182206qti.13.1503685561880; Fri, 25 Aug 2017 11:26:01 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.216.174 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:217815 Archived-At: --089e0822704cc517b705579813c8 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I would add easy optional use of colors for, say, holidays (red) and/or diary entries (blue). Fri, Aug 25, 2017 at 12:59 PM Vincent Bela=C3=AFche wrote: > Oops... sorry for my mistake, class-options is not optional in > cal-tex-insert-preamble. I will make it options as you suggest. > > > Vincent. > ------------------------------ > *De :* Vincent Bela=C3=AFche > *Envoy=C3=A9 :* vendredi 25 ao=C3=BBt 2017 11:07 > *=C3=80 :* Glenn Morris > *Cc :* emacs-devel > *Objet :* RE: cal-tex.el landscape patch > > > Answers below. > > > De : Glenn Morris > Envoy=C3=A9 : vendredi 25 ao=C3=BBt 2017 03:10 > =C3=80 : Vincent Bela=C3=AFche > Cc : emacs-devel > Objet : Re: cal-tex.el landscape patch > > > > > >Fine by me, thanks. Trivial comments below. > > > >> -(defun cal-tex-preamble (&optional args) > >> +(defun cal-tex-preamble (&optional class-options) > >> "Insert the LaTeX calendar preamble into `cal-tex-buffer'. > >> Preamble includes initial definitions for various LaTeX commands. > >> -Optional string ARGS are included as options for the article document > class." > >> +Optional string CLASS-OPTIONS are included as options for the article > document class." > >> (set-buffer (generate-new-buffer cal-tex-buffer)) > >> (insert (format "\\documentclass%s{article}\n" > >> - (if (stringp args) > >> - (format "[%s]" args) > >> + (if (stringp class-options) > >> + (format "[%s]" class-options) > >> ""))) > >> + (if (and (stringp class-options) (string-match "\\" > class-options)) > >> + (insert "\\usepackage{geometry}\n")) > > > > > >I'd prefer if the argument did not get renamed. > > No problem, I will revert the prior name. > > > > > >> -(defun cal-tex-insert-preamble (weeks landscape size &optional append= ) > >> +(defun cal-tex-insert-preamble (weeks class-options &optional append) > >> "Initialize the output LaTeX calendar buffer, `cal-tex-buffer'. > >> Select the output buffer, and insert the preamble for a calendar > >> -of WEEKS weeks. Insert code for landscape mode if LANDSCAPE is > >> -non-nil. Use point-size SIZE. Optional argument APPEND, if > >> -non-nil, means add to end of buffer without erasing current contents.= " > >> - (let ((width "18cm") > >> +of WEEKS weeks. Insert code for landscape mode if CLASS-OPTIONS > >> +contains landscape option. > >> +Optional argument APPEND, if non-nil, means add to end of buffer > >> +without erasing current contents." > > > >"Insert code for landscape mode if CLASS-OPTIONS contains landscape > >option." seems a bit vague to me. Maybe something like > > > >"Pass string CLASS-OPTIONS as options for the article document class. > >If it contains \"landscape\", use the geometry package to produce > >landscape format." > > You are fully right, your proposed docstring is quite more clear. I will > take it. > > > >Maybe class-options could be optional, and default to "12pt"? > > > It is already optional, I will make it default to "12pt", that is a good > idea. > > Vincent > --089e0822704cc517b705579813c8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I would add easy optional use of colors for, say, ho= lidays (red) and/or diary entries (blue).=C2=A0

=C2=A0Fri, Aug 25, 2017 at 12:59 PM Vincent Bela=C3=AFche <= ;vincent.b.1@hotmail.fr> w= rote:

Oops... sorry for my mistake, class-options is not optional in cal= -tex-insert-preamble. I will make it options as you suggest.


=C2=A0 Vincent.


De : Vincent Bel= a=C3=AFche <= vincent.b.1@hotmail.fr>
Envoy=C3=A9 : vendredi 25 ao=C3=BBt 2017 11:07
=C3=80 : Glenn Morris
Cc=C2=A0: emacs-devel
Objet : RE: cal-tex.el landscape patch
=C2=A0

Answers below.


De : Glenn Morris <rgm@= gnu.org>
Envoy=C3=A9 : vendredi 25 ao=C3=BBt 2017 03:10
=C3=80 : Vincent Bela=C3=AFche
Cc : emacs-devel
Objet : Re: cal-tex.el landscape patch
>
>
>Fine by me, thanks. Trivial comments below.
>
>> -(defun cal-tex-preamble (&optional args)
>> +(defun cal-tex-preamble (&optional class-options)
>>=C2=A0=C2=A0=C2=A0 "Insert the LaTeX calendar preamble into `c= al-tex-buffer'.
>>=C2=A0 Preamble includes initial definitions for various LaTeX comm= ands.
>> -Optional string ARGS are included as options for the article docu= ment class."
>> +Optional string CLASS-OPTIONS are included as options for the art= icle document class."
>>=C2=A0=C2=A0=C2=A0 (set-buffer (generate-new-buffer cal-tex-buffer)= )
>>=C2=A0=C2=A0=C2=A0 (insert (format "\\documentclass%s{artic= le}\n"
>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (if (stringp args)
>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (format &qu= ot;[%s]" args)
>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (if (stringp class-options)
>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (format &qu= ot;[%s]" class-options)
>>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ""))= )
>> +=C2=A0 (if (and (stringp class-options) (string-match "\\<= ;landscape\\>" class-options))
>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (insert "\\usepackage{geom= etry}\n"))
>
>
>I'd prefer if the argument did not get renamed.

No problem, I will revert the prior name.
>
>
>> -(defun cal-tex-insert-preamble (weeks landscape size &optiona= l append)
>> +(defun cal-tex-insert-preamble (weeks class-options &optional= append)
>>=C2=A0=C2=A0=C2=A0 "Initialize the output LaTeX calendar buffe= r, `cal-tex-buffer'.
>>=C2=A0 Select the output buffer, and insert the preamble for a cale= ndar
>> -of WEEKS weeks.=C2=A0 Insert code for landscape mode if LANDSCAPE= is
>> -non-nil.=C2=A0 Use point-size SIZE.=C2=A0 Optional argument APPEN= D, if
>> -non-nil, means add to end of buffer without erasing current conte= nts."
>> -=C2=A0 (let ((width "18cm")
>> +of WEEKS weeks.=C2=A0 Insert code for landscape mode if CLASS-OPT= IONS
>> +contains landscape option.
>> +Optional argument APPEND, if non-nil, means add to end of buffer<= br> >> +without erasing current contents."
>
>"Insert code for landscape mode if CLASS-OPTIONS contains landscap= e
>option." seems a bit vague to me. Maybe something like
>
>"Pass string CLASS-OPTIONS as options for the article document cla= ss.
>If it contains \"landscape\", use the geometry package to pro= duce
>landscape format."

You are fully right, your proposed docstring is quite more clear. I will take it.
>
>Maybe class-options could be optional, and default to "12pt"?=
>
It is already optional, I will make it default to "12pt", that is= a good
idea.

=C2=A0 Vincent
--089e0822704cc517b705579813c8--