From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?iso-8859-1?Q?Vincent_Bela=EFche?= Newsgroups: gmane.emacs.devel Subject: RE: cal-tex.el landscape patch Date: Fri, 25 Aug 2017 17:58:51 +0000 Message-ID: References: , , NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="_000_AM5PR10MB0676E753153FFD716D334543849B0AM5PR10MB0676EURP_" X-Trace: blaine.gmane.org 1503683989 17339 195.159.176.226 (25 Aug 2017 17:59:49 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 25 Aug 2017 17:59:49 +0000 (UTC) Cc: emacs-devel To: Glenn Morris Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Aug 25 19:59:43 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 1dlItG-0003ZA-Ag for ged-emacs-devel@m.gmane.org; Fri, 25 Aug 2017 19:59:31 +0200 Original-Received: from localhost ([::1]:54409 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dlItM-0004F7-Ty for ged-emacs-devel@m.gmane.org; Fri, 25 Aug 2017 13:59:36 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51187) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dlIsk-0004F1-3H for emacs-devel@gnu.org; Fri, 25 Aug 2017 13:58:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dlIsg-0007Fp-4v for emacs-devel@gnu.org; Fri, 25 Aug 2017 13:58:58 -0400 Original-Received: from mail-oln040092070091.outbound.protection.outlook.com ([40.92.70.91]:26125 helo=EUR03-AM5-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dlIsf-0007Fb-PF; Fri, 25 Aug 2017 13:58:54 -0400 Original-Received: from DB5EUR03FT021.eop-EUR03.prod.protection.outlook.com (10.152.20.59) by DB5EUR03HT236.eop-EUR03.prod.protection.outlook.com (10.152.20.186) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1341.15; Fri, 25 Aug 2017 17:58:51 +0000 Original-Received: from AM5PR10MB0676.EURPRD10.PROD.OUTLOOK.COM (10.152.20.55) by DB5EUR03FT021.mail.protection.outlook.com (10.152.20.238) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1341.15 via Frontend Transport; Fri, 25 Aug 2017 17:58:51 +0000 Original-Received: from AM5PR10MB0676.EURPRD10.PROD.OUTLOOK.COM ([fe80::7809:87f5:3097:fd25]) by AM5PR10MB0676.EURPRD10.PROD.OUTLOOK.COM ([fe80::7809:87f5:3097:fd25%13]) with mapi id 15.01.1385.010; Fri, 25 Aug 2017 17:58:51 +0000 Thread-Topic: cal-tex.el landscape patch Thread-Index: AQHTGod4AUzM6bbSVkywIfPXHbKr+KKUSM/QgACExcWAAJSvKA== In-Reply-To: Accept-Language: fr-FR, en-US Content-Language: fr-FR X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: gnu.org; dkim=none (message not signed) header.d=none;gnu.org; dmarc=none action=none header.from=hotmail.fr; x-incomingtopheadermarker: OriginalChecksum:72C7544787302023ADA0EDB75E956DD4F040ED24D9148D8D52A3D3A11D1DEB6F; UpperCasedChecksum:2C81653F67E67EF07003F83016BDAA9105F0953042341A5CEEC39F7B860D0FC0; SizeAsReceived:7207; Count:47 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [UZh0X/P+RCe/af+Trlt+9S3DrqGbwgIO] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB5EUR03HT236; 6:36yhkZOlZXiQumylKnF3/qCfCGephtp/1kNhS3lrwYhmJYcnHe4N0M7V+Rm141JDMQVw1XVjXoTPa2MuUjrh8DglJE7ECFSqTFyIDURa89EOUDed1in/zhiqsO1bPYjkkk9jEISuvG5OapKoFL5LZxsCy71LmC0jwTZvQEUn/5zMpKf6ATbvYZ9HR8JvAg172CZfBuWEorcMAq90bebdJ/Wqvrscr35AbUcdwOlOhQx4gIMyB8xQ5cMm4sPlotS7FGrNmLQhnNExLTrB5lErVVofxqCYEc3nx8N3zAtRvqRJ472qvgDA/qPGtgUhHeK1RGTlHdqrCURcOFUAaYlPGA==; 5:doxQB89Um7aAQLVqhhf7zX49o//uYJXBzEE9vhu80fa4PXRmnyk5WTS+Ja4+UgyV5nmNUQS/KRKwz7A+Yiw0usN6ryuotvchkRMks2gaHOtXU57UGQSCX6+zmBODg/4RYUD0GxrbrghDR9I8A9csWw==; 24:cG7HLnuOjCABIaaR5FXGgonYrT+qhk1E42ojMZJlWnCXgqRdC5YmkX45vGvomwj2e9QyWhhOfncHnZmgoS2t8P0OO+S2XVDaJGGQbe/UN/A=; 7:nqTfE4TKg0OdDweQSJi4Kq5ePPl4iOxBOibW5igtA/7ES4zG+kQ+xCYnGRHHGIzgHPU7RY7j8e0LILcaabBp0YW6ghUwOWnHW6R5/fCkbxDciUFE1zBiwbxyyC3d+ur8t/ImOUyyc2KBNyej4DwrBt47dn7UhOlWX8qKkgZJtZ1qIM15/Ra1JP/zUHQ7p7yfltUVYNiKN1U5GfUIgp2nBt0o72d6Xu1Ol x-incomingheadercount: 47 x-eopattributedmessage: 0 x-forefront-antispam-report: EFV:NLI; SFV:NSPM; SFS:(7070007)(98901004); DIR:OUT; SFP:1901; SCL:1; SRVR:DB5EUR03HT236; H:AM5PR10MB0676.EURPRD10.PROD.OUTLOOK.COM; FPR:; SPF:None; LANG:en; x-ms-office365-filtering-correlation-id: 89b84ed0-1d9d-4e94-76da-08d4ebe2f1bb x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(300000503095)(300135400095)(201702061074)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031324274)(2017031323274)(2017031322404)(1603101448)(1601125374)(1701031045)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:DB5EUR03HT236; x-ms-traffictypediagnostic: DB5EUR03HT236: x-exchange-antispam-report-test: UriScan:(22074186197030)(170290950945281); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(444000031); SRVR:DB5EUR03HT236; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DB5EUR03HT236; x-forefront-prvs: 041032FF37 spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Aug 2017 17:58:51.6344 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5EUR03HT236 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.92.70.91 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:217814 Archived-At: --_000_AM5PR10MB0676E753153FFD716D334543849B0AM5PR10MB0676EURP_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Oops... sorry for my mistake, class-options is not optional in cal-tex-inse= rt-preamble. I will make it options as you suggest. Vincent. ________________________________ De : Vincent Bela=EFche Envoy=E9 : vendredi 25 ao=FBt 2017 11:07 =C0 : Glenn Morris Cc : emacs-devel Objet : RE: cal-tex.el landscape patch Answers below. De : Glenn Morris Envoy=E9 : vendredi 25 ao=FBt 2017 03:10 =C0 : Vincent Bela=EFche 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 c= lass." >> +Optional string CLASS-OPTIONS are included as options for the article d= ocument 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 "\\" clas= s-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 --_000_AM5PR10MB0676E753153FFD716D334543849B0AM5PR10MB0676EURP_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

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=EFche &= lt;vincent.b.1@hotmail.fr>
Envoy=E9 : vendredi 25 ao=FBt 2017 11:07
=C0 : Glenn Morris
Cc : emacs-devel
Objet : RE: cal-tex.el landscape patch
 

Answers below.


De : Glenn Morris <rgm@gnu.org>
Envoy=E9 : vendredi 25 ao=FBt 2017 03:10
=C0 : Vincent Bela=EFche
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 `c= al-tex-buffer'.
>>  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= article document class."
>>    (set-buffer (generate-new-buffer cal-tex-buffer)= )
>>    (insert (format "\\documentclass%s{article}\n"
>> -           = ;       (if (stringp args)
>> -           = ;           (format "= ;[%s]" args)
>> +          &= nbsp;       (if (stringp class-options)
>> +          &= nbsp;           (format &= quot;[%s]" class-options)
>>           &= nbsp;          "")))=
>> +  (if (and (stringp class-options) (string-match "\= \<landscape\\>" 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 &optiona= l append)
>> +(defun cal-tex-insert-preamble (weeks class-options &opti= onal append)
>>    "Initialize the output LaTeX calendar buffe= r, `cal-tex-buffer'.
>>  Select the output buffer, and insert the preamble for a cale= ndar
>> -of WEEKS weeks.  Insert code for landscape mode if LANDSCAPE= is
>> -non-nil.  Use point-size SIZE.  Optional argument APPEN= D, if
>> -non-nil, means add to end of buffer without erasing current conte= nts."
>> -  (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 buf= fer
>> +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.

  Vincent
--_000_AM5PR10MB0676E753153FFD716D334543849B0AM5PR10MB0676EURP_--