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: Sat, 26 Aug 2017 15:06:46 +0000 Message-ID: References: , NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="_000_AM5PR10MB0676EEB601C9A44D0E408B7984980AM5PR10MB0676EURP_" X-Trace: blaine.gmane.org 1503760029 5408 195.159.176.226 (26 Aug 2017 15:07:09 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 26 Aug 2017 15:07:09 +0000 (UTC) Cc: emacs-devel To: Edward Reingold , Glenn Morris Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Aug 26 17:07:03 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 1dlcfo-0000kv-7N for ged-emacs-devel@m.gmane.org; Sat, 26 Aug 2017 17:06:56 +0200 Original-Received: from localhost ([::1]:57860 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dlcfu-0006Iw-Vg for ged-emacs-devel@m.gmane.org; Sat, 26 Aug 2017 11:07:03 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52763) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dlcfo-0006Im-CU for emacs-devel@gnu.org; Sat, 26 Aug 2017 11:06:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dlcfm-0001Be-Nr for emacs-devel@gnu.org; Sat, 26 Aug 2017 11:06:56 -0400 Original-Received: from mail-oln040092071068.outbound.protection.outlook.com ([40.92.71.68]:29462 helo=EUR03-DB5-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 1dlcfh-0001Aj-St; Sat, 26 Aug 2017 11:06:50 -0400 Original-Received: from AM5EUR03FT046.eop-EUR03.prod.protection.outlook.com (10.152.16.54) by AM5EUR03HT037.eop-EUR03.prod.protection.outlook.com (10.152.17.121) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1341.15; Sat, 26 Aug 2017 15:06:46 +0000 Original-Received: from AM5PR10MB0676.EURPRD10.PROD.OUTLOOK.COM (10.152.16.53) by AM5EUR03FT046.mail.protection.outlook.com (10.152.16.164) 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; Sat, 26 Aug 2017 15:06:46 +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.012; Sat, 26 Aug 2017 15:06:46 +0000 Thread-Topic: cal-tex.el landscape patch Thread-Index: AQHTGod4AUzM6bbSVkywIfPXHbKr+KKUSM/QgACExcWAAJSvKIAAB9aAgAFXIAo= In-Reply-To: Accept-Language: fr-FR, en-US Content-Language: fr-FR X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: iit.edu; dkim=none (message not signed) header.d=none;iit.edu; dmarc=none action=none header.from=hotmail.fr; x-incomingtopheadermarker: OriginalChecksum:08D790E3C62EA32785AD5CD05F40A4480B7AE7623B0DF5D375DF359DB1D2AE39; UpperCasedChecksum:6E2703F9E3701AAFBDC136DCAB27FFED1372075DC445C6031062275C181178B8; SizeAsReceived:7414; Count:47 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [5ppoUcLRglJ3ArHKOvXqsTJp4lf93WUY] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM5EUR03HT037; 6:fVv5PylSa2iWu8QS8oxH4dlpYC5mhFI/Qjgk+hONgj5YQ896pwUY2B/1gFP4o1WWvJPsUzH4kry8IGhEd+QEG0AOsjjul8F0VNV5KAI2iuiJW+w+sR+CJRjxaUUHR+cg9TiilT8gLPnsscN00A8VuR9cxL/nFPA5TMLjoKhNxmWB0++GJPhE5EdKcRh6FL0uieqaJVlmFhzEoQAPMNckIcgX/aMQaNgz1ZbJB+yl16kfAGVab0Qh737OI501T2RBGfSFEkxRJjEZyxhfteaKmWewoNQrt3WaloMtHm6B5veG5tyU7wAaOTsYo73K0Vljj7ncZ+4PaLW02MiE0wfe6w==; 5:5RkxLR8xefwP3rnMFaEb/t1/tFxTpZU+3nJQZlkeFEsi0WSHUfW4txEwqNMm5gaPStLPLBBDZ7MUoqUbTRbrcZ7PKHCkmYFm1j/XeDfwSmygrthVkGADxd2nKywMwINlSuKNxUMPpbBKp8m6EoQz2g==; 24:y6YhcaxaMk3QTqgv3F2dWCGU/3JaHNpXwRcWUN4qxaDu0WOGfgH00uf2cf4ulr5ybuc4MMnK7emRggve7vhMLk6Xrk/cLYDUO60liYL0DKo=; 7:b6DClcxz5rElYoHCrcKR3ZyUgnMK6P2gHhmPJLdpNop3RLz3tsAaggf6buGw28K4iYUeJ/AbG11BE3pFVjxcUBKUBvXmWLtwotN1Afu/MjZZveXRLJdvwcTgxEinrtLdPIhnaACcCCRWz6S6xd7BWr65dNl2bdE8QMYXQHw8U6S3dgjStIPZFT+Vq5CGQMxeUm6cBmv9Am6slOToQfzIRH3nzz3Cri267 x-incomingheadercount: 47 x-eopattributedmessage: 0 x-forefront-antispam-report: EFV:NLI; SFV:NSPM; SFS:(7070007)(98901004); DIR:OUT; SFP:1901; SCL:1; SRVR:AM5EUR03HT037; H:AM5PR10MB0676.EURPRD10.PROD.OUTLOOK.COM; FPR:; SPF:None; LANG:en; x-ms-office365-filtering-correlation-id: 10438c33-0fd6-4b19-8e61-08d4ec9411fe x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(201702061074)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031324274)(2017031323274)(2017031322404)(1603101448)(1601125374)(1701031045)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:AM5EUR03HT037; x-ms-traffictypediagnostic: AM5EUR03HT037: 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:AM5EUR03HT037; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:AM5EUR03HT037; x-forefront-prvs: 04111BAC64 spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Aug 2017 15:06:46.6355 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5EUR03HT037 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.92.71.68 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:217833 Archived-At: --_000_AM5PR10MB0676EEB601C9A44D0E408B7984980AM5PR10MB0676EURP_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable That is a great idea. The LaTeX code generated by cal-tex.el could have som= e formatter macro defined by \providecommand as identity by default. Then t= he user could change the definition by inserting some custom LaTeX code tha= t would for instance define the formatter as #1->\textcolor{red}{#1}. Another idea is that the code generator for the diary could cusotomized to = use OrgMode translation instead of cal-tex-LaTeXify-string, so you would wr= ite in the diary an entry as : @@latex:\textcolor{red}{@@My important appointment@@latex:}@@ This second idea would make it easier to have different colors or formattin= g for different items. Vincent. ________________________________ De : Edward Reingold Envoy=E9 : vendredi 25 ao=FBt 2017 20:25:51 =C0 : Glenn Morris; Vincent Bela=EFche Cc : emacs-devel Objet : Re: cal-tex.el landscape patch I would add easy optional use of colors for, say, holidays (red) and/or dia= ry entries (blue). Fri, Aug 25, 2017 at 12:59 PM Vincent Bela=EFche > wrote: 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_AM5PR10MB0676EEB601C9A44D0E408B7984980AM5PR10MB0676EURP_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

That is a great idea. The LaTeX code generated by cal-tex.el could have = some formatter macro defined by \providecommand as identity by default. The= n the user could change the definition by inserting some custom LaTeX code = that would for instance define the formatter as #1->\textcolor{red}{#1}.


Another idea is that the code generator for the diary could cusotomized = to use OrgMode translation instead of cal-tex-LaTeXify-string, so you would write in the diary an en= try as :


@@latex:\textcolor{red}{@@My important appointment@@latex:}@@


This second idea would make it easier to have different colors or format= ting for different items.


   Vincent.


De : Edward Reingold <re= ingold@iit.edu>
Envoy=E9 : vendredi 25 ao=FBt 2017 20:25:51
=C0 : Glenn Morris; Vincent Bela=EFche
Cc : emacs-devel
Objet : Re: cal-tex.el landscape patch
 
I would add easy optional use of colors for, say, holiday= s (red) and/or diary entries (blue). 

 Fri, Aug 25, 2017 at 12:59 PM Vincent Bela=EFche <vincent.b.1@hotmail.fr> 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 Bel= a=EFche <vin= cent.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{artic= le}\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_AM5PR10MB0676EEB601C9A44D0E408B7984980AM5PR10MB0676EURP_--