// regex patter for finding the "key line" that classifies the email as "call for papers"
var REGEX_KEY_LINE = /((call\s+for\s+(paper|papers))|submission|deadline)/i; //ignore case
// regex for the line which contains paper submission deadline information
var REGEX_PAPER_DEADLINE = /(paper(s)?)*(submission|deadline)(paper(s)?)*/i;

// verifies if a line contains the information of a call for paper email,
// returning a true value in positive case
function has_key_line(line){
    return REGEX_KEY_LINE.test(line);
}

// verifies if the line contain the keywords for paper submission deadline date,
// returning a true value in positive case
function is_paper_deadline(line){
    return REGEX_PAPER_DEADLINE.test(line);
}

// takes a GmailMessage object and process it, extracting
function process_email(gmail_message){
    var subject = get_subject_text(gmail_message);
    Logger.log("\tProcessing email '%s'", subject);
    var lines_of_interest = break_lines(get_message_text(gmail_message)).filter(has_date).filter(is_paper_deadline);
    // process only one entry of lines of interest
    if (lines_of_interest.length > 0){
        var date = get_date(get_literal_date(lines_of_interest[0]));
        Logger.log("\t\tExtracted Date: %s", date);
        // var calendar_event = create_event(subject, date);
        // if (calendar_event == null){
        //     Logger.log("It was not possible to create an event with the following details:\n\tSubject: %s\n\tDate: %s", subject, date);
        //     gmail_message.star();
        // }
        // else{
        //     Logger.log("\t\tMarking email as read.");
        //     gmail_message.markRead();
        // }
    }
}

@@ -871,60 +871,8 @@
 e);%0A
-    Logger.log(%22%5CtProcessing email '%25s'%22, subject);%0A
     
@@ -1154,63 +1154,8 @@
     
- Logger.log(%22%5Ct%5CtExtracted Date: %25s%22, date);%0A        //
  var
@@ -1208,19 +1208,16 @@
 %0A       
- //
  if (cal
@@ -1237,35 +1237,32 @@
 = null)%7B%0A       
- //
      Logger.log(
@@ -1373,35 +1373,32 @@
 , date);%0A       
- //
      gmail_messa
@@ -1411,27 +1411,24 @@
 r();%0A       
- //
  %7D%0A        /
@@ -1425,19 +1425,16 @@
 %0A       
- //
  else%7B%0A 
@@ -1443,68 +1443,8 @@
     
- //     Logger.log(%22%5Ct%5CtMarking email as read.%22);%0A        //
     
@@ -1477,19 +1477,16 @@
 %0A       
- //
  %7D%0A    %7D

Clean up of the code