unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Patch for PHP5 support for etags
@ 2011-04-16 17:00 james borden
  2011-04-17 13:17 ` Francesco Potortì
  0 siblings, 1 reply; 14+ messages in thread
From: james borden @ 2011-04-16 17:00 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 634 bytes --]

Emacs Development,

Etags in the current Emacs distribution (23.3) does not support the OOP
syntax of PHP5. I found a patch at
http://old.nabble.com/-Patch--etags-support-for-php5-td12843865.html and
applied it to etags.c found in the lib-src of the emacs source code. This
patch applies, compiles and works as-is on my Mac OS X 10.6.7 machine. It
produces a very nice TAGS file for my PHP projects. I think this patch would
make Emacs much more attractive to PHP coders. My question is, why was this
patch not incorporated into the main emacs distribution?  I will gladly
offer any help or support to make this happen!

James Borden

[-- Attachment #2: Type: text/html, Size: 770 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Patch for PHP5 support for etags
  2011-04-16 17:00 Patch for PHP5 support for etags james borden
@ 2011-04-17 13:17 ` Francesco Potortì
  2011-04-17 13:29   ` Lennart Borgman
  0 siblings, 1 reply; 14+ messages in thread
From: Francesco Potortì @ 2011-04-17 13:17 UTC (permalink / raw)
  To: james borden; +Cc: emacs-devel

>Etags in the current Emacs distribution (23.3) does not support the OOP
>syntax of PHP5. I found a patch at
>http://old.nabble.com/-Patch--etags-support-for-php5-td12843865.html and
>applied it to etags.c found in the lib-src of the emacs source code. This
>patch applies, compiles and works as-is on my Mac OS X 10.6.7 machine. It
>produces a very nice TAGS file for my PHP projects. I think this patch would
>make Emacs much more attractive to PHP coders. My question is, why was this
>patch not incorporated into the main emacs distribution?  I will gladly
>offer any help or support to make this happen!

I have this old mail in my archive, to which I never got an answer.

Date: 12 Oct 2009 21:47:01 +0200
From: Francesco Potortì <pot@gnu.org>
To: Jordi Gutiérrez Hermoso <jordigh@gmail.com>,
    Lennart Borgman <lennart.borgman@gmail.com>
CC: Emacs-devel@gnu.org
In-reply-to: <25857155.post@talk.nabble.com> (jordigh@gmail.com)
Subject: Re: [Fwd: [Patch] etags support for php5]

>Lennart Borgman (gmail) wrote:
>> Was this ever added to etags?
>
>Indeed, I'd like to know too. Was this ever added to etags? It doesn't look
>like it was, two years later.
>- Jordi G. H.

No, it wasn't.  I am guilty of not having solicited a response.  This is
a mail I sent long ago to which I did not receive any answer.  Again, my
fault to have forgotten this.  Would someone please reply?

________________________________________________________________
Date: 17 Aug 2008 19:47:47 +0200
From: Francesco Potorti` <Potorti@isti.cnr.it>
To: Lennart Borgman <lennart.borgman@gmail.com>,
    Bas Kok <bakotaco@gmail.com>
Cc: Stefan Monnier <monnier@iro.umontreal.ca>
In-reply-to: <jwv3anz3x0s.fsf-monnier+emacs@gnu.org>
Subject: Re: [Lennart Borgman (gmail)] [Fwd: [Patch] etags support for php5]
Organization: ISTI-CNR, via Moruzzi 1, I-56124 Pisa, +39-0503153058

Dear Lennart and Bas,

thank you for your patch to etags to support php5 keywords, and sorry
for the delay in checking it.  I only managed to test it now, during my
vacations.

However, I obtain strange results from my tests, so I would ask you to
send me a php5 source file together with the expected results.

Just to let you know, I tried your patch on the appended file.  Again,
sorry for the delay, and hope you can follow up to this.


===File ~/gnu/etags/sendmail.php============================
<?php

/*
  Classe creata da Santoro Diego.
  Per aiuti nella programmazione in PHP, PERL, C e ECMAScript contattatemi
  e-Mail vincenza.tralice@tiscali.it oppure santoro.diego@3000.it
  La classe ? ancora in fase beta.
*/

final class sendMail {

  const eMailAddressErrorMessage="L' e-Mail indicata non rispetta un formato valido.";
  const defaultSubject="this is the subject.";
  const defaultTextMessage="this is text message.";
  const defaultHtmlMessage="this is html message.";
  const defaultHeaderMessage="this is a multi-part message in MIME format.";

  private static $messageProperties=array(
    "charset" => array(
        "modifiable" => true,
        "values" => array(
            "iso-8859-1",
            "iso-8859-15",
            "utf-8",
            "utf-16"
        )
    ),
    "content-transfer-encoding" => array(
        "modifiable" => true,
        "values" => array(
            "7bit",
            "8bit",
            "quoted-printable"
        )
    )
  );

  private $attachmentProperties=array(
    "content-type" => array(
        "modifiable" => false,
         "values" => array(
            "application/octet-stream"
        )
    ),
    "content-transfer-encoding" => array(
        "modifiable" => false,
        "values" => array(
            "base64"
        )
    ),
    "content-disposition" => array(
        "modifiable" => true,
        "values" => array(
            "attachment",
            "inline"
        )
    )
  );

  private static $relatedProperties=array(
    "content-transfer-encoding" => array(
        "modifiable" => false,
        "values" => array(
            "base64"
        )
    )
  );

  private $html;
  private $text;

  private $related;
  private $attachments;

  public static function valid_eMailAddress($eMailAddress) {
   if(ereg("^[^@ ]+@[^@ ]+\.[^@ ]+$", $eMailAddress))
    return true;
   else
    return false;
  }

  public static function validContentId($contentId) {
   if(ereg("^[a-zA-Z0-9]+$", $contentId))
    return true;
   else
    return false;
  }

  public static function validContentKey($contentKey) {
   if(ereg("^[a-zA-Z0-9]+$", $contentKey))
    return true;
   else
    return false;
  }

  public static function mime_content_type($filename) {
   $mime=array(
    '.3dmf' => 'x-world/x-3dmf',
    '.a' => 'application/octet-stream',
    '.aab' => 'application/x-authorware-bin',
    '.xwd' => 'image/x-xwd',
    '.xyz' => 'chemical/x-pdb',
    '.z' => 'application/x-compressed',
    '.zip' => 'application/x-zip-compressed',
    '.zoo' => 'application/octet-stream',
    '.zsh' => 'text/x-script.zsh',
    '.css' => 'text/css'
   );
   return $mime[strrchr($filename, '.')];
  }

  private $from;
  private $to;
  private $subject;

  private $finalized;

  private $headerMessage;
  private $bodyMessage;

  private $boundaries;

  public function __construct($from, $to, $subject=self::defaultSubject) {

   // set from
   if(!self::valid_eMailAddress($from))
    die(self::eMailAddressErrorMessage);
   else
    $this->from=$from;

   // set to
   if(!self::valid_eMailAddress($to))
    die(self::eMailAddressErrorMessage);
   else
    $this->to=$to;

   // set subject
   $this->subject=$subject;

   // set text
   $this->text=array(
    "message" => self::defaultTextMessage,
    "properties" => array(
        "charset" => self::$messageProperties["charset"]["values"][0],
        "content-transfer-encoding" => self::$messageProperties["content-transfer-encoding"]["values"][0]
    )
   );

   // set html
   $this->html=array(
    "message" => self::defaultHtmlMessage,
    "properties" => array(
        "charset" => self::$messageProperties["charset"]["values"][0],
        "content-transfer-encoding" => self::$messageProperties["content-transfer-encoding"]["values"][1]
    )
   );

   // set related and attachments
   $this->related=array();
   $this->attachments=array();

   // set finalizater counter
   $this->finalized=false;

   $this->headerMessage="";
   $this->bodyMessage="";

   $this->boundaries=array(
    "multipart/alternative" => md5(uniqid(microtime())),
    "multipart/related" => md5(uniqid(microtime())),
    "multipart/mixed" => md5(uniqid(microtime()))
   );

  }

  public function setTo($to, &$errorString) {
   if(self::valid_eMailAddress($to)) {
    $this->to=$to;
    return true;
   } else {
    $errorString=eMailAddressErrorMessage;
    return false;
   }
  }

  public function setFrom($from, &$errorString) {
   if(self::valid_eMailAddress($from)) {
    $this->from=$from;
    return true;
   } else {
    $errorString=eMailAddressErrorMessage;
    return false;
   }
  }

  public function setSubject($subject=self::defaultSubject) {
   $this->subject=$subject;
  }

  public function setTextMessage($textMessage=self::defaultTextMessage) {
   $this->text["message"]=$textMessage;
  }

  public function setTextMessageProperty($key, $value, &$errorString) {

   $key=strtolower($key);
   $value=strtolower($value);

   if(isset(self::$messageProperties[$key])) {
    if(in_array($value, self::$messageProperties[$key]["values"])) {
     if(self::$messageProperties[$key]["modifiable"]) {
       $this->text["properties"][$key]=$value;
       return true;
     } else {
      $errorString="Il valore della propriet? indicata non ? modificabile.";
      return false;
     }
    } else {
     $errorString="Il valore indicato per questa propriet? non ? valido.";
     return false;
    }
   } else {
    $errorString="Non esiste questa propriet? per i messaggi html.";
    return false;
   }
  }

  public function setHtmlMessage($htmlMessage=self::defaultHtmlMessage) {
   $this->html["message"]=$htmlMessage;
  }

  public function setHtmlMessageProperty($key, $value, &$errorString) {

   $key=strtolower($key);
   $value=strtolower($value);

   if(isset(self::$messageProperties[$key])) {
    if(in_array($value, self::$messageProperties[$key]["values"])) {
     if(self::$messageProperties[$key]["modifiable"]) {
      $this->html["properties"][$key]=$value;
      return true;
     } else {
      $errorString="Il valore della propriet? indicata non ? modificabile.";
      return false;
     }
    } else {
     $errorString="Il valore indicato per questa propriet? non ? valido.";
     return false;
    }
   } else {
    $errorString="Non esiste questa propriet? per i messaggi html.";
    return false;
   }
  }

  public function addRelated($fileName, $relatedKey, $contentId, &$errorString) {
   if(is_file($fileName)) {
    if($fileHandle=fopen($fileName, "r")) {
     if(self::validContentId($contentId)) {
      if(!isset($this->related[$relatedKey])) {
       if(self::validContentKey($relatedKey)) {
        $this->related[$relatedKey]=array(
    "fileName" => basename($fileName),
    "properties" => array(
        "content-type" => self::mime_content_type($fileName),
        "content-transfer-encoding" => self::$relatedProperties["content-transfer-encoding"]["values"][0],
        "content-id" => $contentId
    ),
    "source" => base64_encode(
        fread($fileHandle, filesize($fileName))
    )
        );
        return true;
       } else {
        $errorString="L' id specificato non ? valido.";
        return false;
       }
      } else {
       $errorString="La chiave specificata ? gi? associata ad un altro related.";
       return false;
      }
     } else {
      $errorString="La chiave specificata per il related non ? valida.";
      return false;
     }
    } else {
     $errorString="Non ? possibile aprire il file indicato.";
     return false;
    }
   } else {
    $errorString="Il nome del file indicato non ? valido.";
    return false;
   }
  }

  public function setRelatedProperty($relatedKey, $key, $value, &$errorString) {

   $key=strtolower($key);
   $value=strtolower($value);
  
   if(isset(self::$relatedProperties[$key])) {
    if(in_array($value, self::$relatedProperties[$key]["values"])) {
     if(self::$relatedProperties[$key]["modifiable"]) {
      if(isset($this->related[$relatedKey])) {
       $this->related[$relatedKey]["properties"][$key]=$value;
       return true;
      } else {
       $errorString="Il related indicato non esiste.";
       return false;
      }
     } else {
      $errorString="Il valore della propriet? indicata non ? modificabile.";
      return false;
     }
    } else {
     $errorString="Il valore indicato per questa propriet? non ? valido.";
     return false;
    }
   } else {
    $errorString="Non esiste questa propriet? per i related.";
    return false;
   }
  }

  public function addAttachment($fileName, $attachmentKey, &$errorString) {
   if(is_file($fileName)) {
    if($fileHandle=fopen($fileName, "r")) {
     if(self::validContentKey($attachmentKey)) {
      if(!isset($this->attachments[$attachmentKey])) {
       $this->attachments[$attachmentKey]=array(
    "fileName" => basename($fileName),
    "properties" => array(
        "content-type" => self::$attachmentProperties["content-type"]["values"][0],
        "content-disposition" => self::$attachmentProperties["content-disposition"]["values"][0],
        "content-transfer-encoding" => self::$attachmentProperties["content-transfer-encoding"]["values"][0]
    ),
    "source" => base64_encode(
        fread($fileHandle, filesize($fileName))
    )
       );
       return true;
      } else {
       $errorString="La chiave specificata ? gi? associata ad un altro allegato.";
       return false;
      }
     } else {
      $errorString="La chiave specificata per l'allegato non ? valida.";
      return false;
     }
    } else {
     $errorString="Non ? possibile aprire il file indicato.";
     return false;
    }
   } else {
    $errorString="Il nome del file indicato non ? valido.";
    return false;
   }
  }

  public function setAttachmentProperty($attachmentKey, $key, $value, &$errorString) {

   $key=strtolower($key);
   $value=strtolower($value);

   if(isset(self::$attachmentProperties[$key])) {
    if(in_array($value, self::$attachmentProperties[$key]["values"])) {
     if(self::$attachmentProperties[$key]["modifiable"]) {
      if(isset($this->attachments[$attachmentKey])) {
       $this->attachments[$attachmentKey]["properties"][$key]=$value;
       return true;
      } else {
       $errorString="L'allegato indicato non esiste.";
       return false;
      }
     } else {
      $errorString="Il valore della propriet? indicata non ? modificabile.";
      return false;
     }
    } else {
     $errorString="Il valore indicato per questa propriet? non ? valido.";
     return false;
    }
   } else {
    $errorString="Non esiste questa propriet? per gli allegati.";
    return false;
   }
  }

  public function finalize(&$errorString) {
   if(!$this->finalized) {
    $this->headerMessage="from: ".($this->from)."\n";
    $this->headerMessage.="to: ".($this->to)."\n";
    $this->headerMessage.="subject: ".($this->subject)."\n";
    $this->headerMessage.="mime-version: 1.0\n";

    if(($countAttachments=count($this->attachments))>0) {
     $this->headerMessage.="content-type: multipart/mixed; boundary=\"".($this->boundaries["multipart/mixed"])."\"\n\n";
     $this->headerMessage.=self::defaultHeaderMessage;
     $this->headerMessage.="\n\n";

     $this->bodyMessage="--".($this->boundaries["multipart/mixed"])."\n";

     if(($countRelated=count($this->related))>0) {
      $this->bodyMessage.="content-type: multipart/related; type=\"multipart/alternative\"; boundary=\"".($this->boundaries["multipart/related"])."\"\n\n";

      $this->bodyMessage.="--".($this->boundaries["multipart/related"])."\n";

      $this->bodyMessage.="content-type: multipart/alternative; boundary=\"".($this->boundaries["multipart/alternative"])."\"\n\n";
      $this->createMultipartAlternativeMessage($this->boundaries["multipart/alternative"]);
      $this->bodyMessage.="--".($this->boundaries["multipart/alternative"])."--\n\n";

      // aggiungere i related e chiudere

      $relatedCounter=0;
      while(list($key,)=each($this->related)) {
       $relatedCounter++;
      
       $this->bodyMessage.="--".$this->boundaries["multipart/related"]."\n";
       $this->createMultipartRelatedMessage($key);
       if($relatedCounter!=$countRelated) $this->bodyMessage.="--".($this->boundaries["multipart/related"])."\n";
       else $this->bodyMessage.="--".($this->boundaries["multipart/related"])."--\n\n";
      }
     } else {
      $this->bodyMessage.="content-type: multipart/alternative; boundary=\"".($this->boundaries["multipart/alternative"])."\"\n\n";
      $this->createMultipartAlternativeMessage();
      $this->bodyMessage.="--".($this->boundaries["multipart/alternative"])."--\n\n";
     }

     $attachmentsCounter=0;
     while(list($key,)=each($this->attachments)) {
      $attachmentsCounter++;
      $this->bodyMessage.="--".($this->boundaries["multipart/mixed"])."\n";
      $this->createMultipartMixedMessage($key);
      if($attachmentsCounter!=$countAttachments) $this->bodyMessage.="--".($this->boundaries["multipart/mixed"])."\n";
      else $this->bodyMessage.="--".($this->boundaries["multipart/mixed"])."--\n\n";
     }
    } else {
     if(($countRelated=count($this->related))>0) {
      $this->headerMessage.="content-type: multipart/related; type=\"multipart/alternative\"; boundary=\"".($this->boundaries["multipart/related"])."\"\n\n";
      $this->headerMessage.=self::defaultHeaderMessage;
      $this->headerMessage.="\n\n";

      $this->bodyMessage="--".($this->boundaries["multipart/related"])."\n";
      $this->bodyMessage.="content-type: multipart/alternative; boundary=\"".($this->boundaries["multipart/alternative"])."\"\n\n";
      $this->createMultipartAlternativeMessage();
      $this->bodyMessage.="--".($this->boundaries["multipart/alternative"])."--\n\n";

      $relatedCounter=0;
      while(list($key,)=each($this->related)) {
       $relatedCounter++;
       $this->bodyMessage.="--".$this->boundaries["multipart/related"]."\n";
       $this->createMultipartRelatedMessage($key);
       if($relatedCounter!=$countRelated) $this->bodyMessage.="--".($this->boundaries["multipart/related"])."\n";
       else $this->bodyMessage.="--".($this->boundaries["multipart/related"])."--\n\n";
      }
     } else {
      $this->headerMessage.="content-type: multipart/alternative; boundary=\"".($this->boundaries["multipart/alternative"])."\"\n\n";
      $this->headerMessage.=self::defaultHeaderMessage;
      $this->headerMessage.="\n\n";

      $this->createMultipartAlternativeMessage();
      $this->bodyMessage.="--".($this->boundaries["multipart/alternative"])."--";

     }
    }
    $this->finalized=true;
    return true;
   } else {
    $errorString="Al momento non ? possibile finalizzare.";
    return false;
   }
  }

  private function createMultipartAlternativeMessage() {
   $multipartAlternativeBoundary=$this->boundaries["multipart/alternative"];
   $this->bodyMessage.="--$multipartAlternativeBoundary\n";
   $this->bodyMessage.="content-type: text/plain; charset=\"".($this->text["properties"]["charset"])."\"\n";
   $this->bodyMessage.="content-transfer-encoding: ".($this->text["properties"]["content-transfer-encoding"])."\n\n";
   $this->bodyMessage.=$this->text["message"];
   $this->bodyMessage.="\n\n";
   $this->bodyMessage.="--$multipartAlternativeBoundary\n";
   $this->bodyMessage.="content-type: text/html; charset=\"".($this->html["properties"]["charset"])."\"\n";
   $this->bodyMessage.="content-transfer-encoding: ".($this->html["properties"]["content-transfer-encoding"])."\n\n";
   $this->bodyMessage.=$this->html["message"];
   $this->bodyMessage.="\n\n";
  }

  private function createMultipartRelatedMessage($key) {
   $obj=$this->related[$key];
   $this->bodyMessage.="content-type: ".($obj["properties"]["content-type"])."; name=\"".($obj["fileName"])."\"\n";
   $this->bodyMessage.="content-transfer-encoding: ".($obj["properties"]["content-transfer-encoding"])."\n";
   $this->bodyMessage.="content-id: <".($obj["properties"]["content-id"]).">\n\n";
   $this->bodyMessage.=$obj["source"];
   $this->bodyMessage.="\n\n";
  }

  private function createMultipartMixedMessage($key) {
   $obj=$this->attachments[$key];
   $this->bodyMessage.="content-type: ".($obj["properties"]["content-type"])."; name=\"".($obj["fileName"])."\"\n";
   $this->bodyMessage.="content-transfer-encoding: ".($obj["properties"]["content-transfer-encoding"])."\n";
   $this->bodyMessage.="content-disposition: ".($obj["properties"]["content-disposition"])."; filename=\"".($obj["fileName"])."\"\n\n";
   $this->bodyMessage.=$obj["source"];
   $this->bodyMessage.="\n\n";
  }

  public function getSource(&$errorString) {
   if($this->finalized) {
    return ($this->headerMessage).($this->bodyMessage);
   } else {
    $errorString="Ancora non ? avvenuta la finalizzazione.";
    return false;
   }
  }

  public function sendMail(&$errorString) {
   if($this->finalized) {
    mail($this->to, $this->subject, $this->bodyMessage, $this->headerMessage);
    $this->finalized=false;
    return true;
   } else {
    $errorString="Ancora non ? avvenuta la finalizzazione.";
    return false;
   }
  }
}

?>
============================================================








^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Patch for PHP5 support for etags
  2011-04-17 13:17 ` Francesco Potortì
@ 2011-04-17 13:29   ` Lennart Borgman
  2011-04-26 12:25     ` Francesco Potortì
  0 siblings, 1 reply; 14+ messages in thread
From: Lennart Borgman @ 2011-04-17 13:29 UTC (permalink / raw)
  To: Francesco Potortì; +Cc: james borden, emacs-devel

On Sun, Apr 17, 2011 at 3:17 PM, Francesco Potortì <pot@gnu.org> wrote:
>
> I have this old mail in my archive, to which I never got an answer.
>
> Date: 12 Oct 2009 21:47:01 +0200
> From: Francesco Potortì <pot@gnu.org>
> To: Jordi Gutiérrez Hermoso <jordigh@gmail.com>,
>    Lennart Borgman <lennart.borgman@gmail.com>
> CC: Emacs-devel@gnu.org
> In-reply-to: <25857155.post@talk.nabble.com> (jordigh@gmail.com)
> Subject: Re: [Fwd: [Patch] etags support for php5]
>
>>Lennart Borgman (gmail) wrote:
>>> Was this ever added to etags?
>>
>>Indeed, I'd like to know too. Was this ever added to etags? It doesn't look
>>like it was, two years later.
>>- Jordi G. H.
>
> No, it wasn't.  I am guilty of not having solicited a response.  This is
> a mail I sent long ago to which I did not receive any answer.  Again, my
> fault to have forgotten this.  Would someone please reply?
>
> ________________________________________________________________
> Date: 17 Aug 2008 19:47:47 +0200
> From: Francesco Potorti` <Potorti@isti.cnr.it>
> To: Lennart Borgman <lennart.borgman@gmail.com>,
>    Bas Kok <bakotaco@gmail.com>
> Cc: Stefan Monnier <monnier@iro.umontreal.ca>
> In-reply-to: <jwv3anz3x0s.fsf-monnier+emacs@gnu.org>
> Subject: Re: [Lennart Borgman (gmail)] [Fwd: [Patch] etags support for php5]
> Organization: ISTI-CNR, via Moruzzi 1, I-56124 Pisa, +39-0503153058
>
> Dear Lennart and Bas,
>
> thank you for your patch to etags to support php5 keywords, and sorry
> for the delay in checking it.  I only managed to test it now, during my
> vacations.
>
> However, I obtain strange results from my tests, so I would ask you to
> send me a php5 source file together with the expected results.

I am not really involved, I just wanted to make sure the patch was
applied (and tested).



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Patch for PHP5 support for etags
  2011-04-17 13:29   ` Lennart Borgman
@ 2011-04-26 12:25     ` Francesco Potortì
  2011-04-26 12:36       ` Lennart Borgman
  0 siblings, 1 reply; 14+ messages in thread
From: Francesco Potortì @ 2011-04-26 12:25 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: james borden, emacs-devel

>On Sun, Apr 17, 2011 at 3:17 PM, Francesco Potortì <pot@gnu.org> wrote:
>>
>> I have this old mail in my archive, to which I never got an answer.
>>
>> Date: 12 Oct 2009 21:47:01 +0200
>> From: Francesco Potortì <pot@gnu.org>
>> To: Jordi Gutiérrez Hermoso <jordigh@gmail.com>,
>>    Lennart Borgman <lennart.borgman@gmail.com>
>> CC: Emacs-devel@gnu.org
>> In-reply-to: <25857155.post@talk.nabble.com> (jordigh@gmail.com)
>> Subject: Re: [Fwd: [Patch] etags support for php5]
>>
>>>Lennart Borgman (gmail) wrote:
>>>> Was this ever added to etags?
>>>
>>>Indeed, I'd like to know too. Was this ever added to etags? It doesn't look
>>>like it was, two years later.
>>>- Jordi G. H.
>>
>> No, it wasn't.  I am guilty of not having solicited a response.  This is
>> a mail I sent long ago to which I did not receive any answer.  Again, my
>> fault to have forgotten this.  Would someone please reply?
>>
>> ________________________________________________________________
>> Date: 17 Aug 2008 19:47:47 +0200
>> From: Francesco Potorti` <Potorti@isti.cnr.it>
>> To: Lennart Borgman <lennart.borgman@gmail.com>,
>>    Bas Kok <bakotaco@gmail.com>
>> Cc: Stefan Monnier <monnier@iro.umontreal.ca>
>> In-reply-to: <jwv3anz3x0s.fsf-monnier+emacs@gnu.org>
>> Subject: Re: [Lennart Borgman (gmail)] [Fwd: [Patch] etags support for php5]
>> Organization: ISTI-CNR, via Moruzzi 1, I-56124 Pisa, +39-0503153058
>>
>> Dear Lennart and Bas,
>>
>> thank you for your patch to etags to support php5 keywords, and sorry
>> for the delay in checking it.  I only managed to test it now, during my
>> vacations.
>>
>> However, I obtain strange results from my tests, so I would ask you to
>> send me a php5 source file together with the expected results.
>
>I am not really involved, I just wanted to make sure the patch was
>applied (and tested).

Yes, I applied the patch.  I tested it and got strange results.  So I
need a php5 source file together with the expected results, so that I
can check it with more confidence.  Can you provide that, or point me to
someone else who can?




^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Patch for PHP5 support for etags
  2011-04-26 12:25     ` Francesco Potortì
@ 2011-04-26 12:36       ` Lennart Borgman
  2012-02-24 10:36         ` Olivier Sirven
  0 siblings, 1 reply; 14+ messages in thread
From: Lennart Borgman @ 2011-04-26 12:36 UTC (permalink / raw)
  To: Francesco Potortì; +Cc: james borden, emacs-devel

On Tue, Apr 26, 2011 at 2:25 PM, Francesco Potortì <pot@gnu.org> wrote:
>
> Yes, I applied the patch.  I tested it and got strange results.  So I
> need a php5 source file together with the expected results, so that I
> can check it with more confidence.  Can you provide that, or point me to
> someone else who can?

Maybe some of those that have contributed to php-mode.el can?



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Patch for PHP5 support for etags
  2011-04-26 12:36       ` Lennart Borgman
@ 2012-02-24 10:36         ` Olivier Sirven
  2012-03-08  9:42           ` Olivier Sirven
  0 siblings, 1 reply; 14+ messages in thread
From: Olivier Sirven @ 2012-02-24 10:36 UTC (permalink / raw)
  To: emacs-devel

On 2011-04-26 14:36:35, Lennart Borgman wrote:
> On Tue, Apr 26, 2011 at 2:25 PM, Francesco Potortì <pot@gnu.org> wrote:
>>
>> Yes, I applied the patch.  I tested it and got strange results.  So I
>> need a php5 source file together with the expected results, so that I
>> can check it with more confidence.  Can you provide that, or point me to
>> someone else who can?
>
> Maybe some of those that have contributed to php-mode.el can?

I'm no php-mode.el contributor but I do code in PHP5 every single
working day using emacs for a long time now. 
I was previously forcing language detection to java in order to have
something usable even though not perfect.

I've just found out about this PHP5 patch for etags and just gave it a
try. As far as I can see it works just fine, all my declarations are
there and I don't see any strange results.

If you need any help getting this into the main code base I'd be glad to
help. But first I need to understand what you mean by "strange results"
so I can check whether or not I do have the same issue

-- 
Oliv




^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Patch for PHP5 support for etags
  2012-02-24 10:36         ` Olivier Sirven
@ 2012-03-08  9:42           ` Olivier Sirven
  2012-03-08 15:18             ` Stefan Monnier
  2012-03-08 19:10             ` Francesco Potortì
  0 siblings, 2 replies; 14+ messages in thread
From: Olivier Sirven @ 2012-03-08  9:42 UTC (permalink / raw)
  To: emacs-devel

On 2012-02-24 11:36:06, Olivier Sirven wrote:
> On 2011-04-26 14:36:35, Lennart Borgman wrote:
>> On Tue, Apr 26, 2011 at 2:25 PM, Francesco Potortì <pot@gnu.org> wrote:
>>>
>>> Yes, I applied the patch.  I tested it and got strange results.  So I
>>> need a php5 source file together with the expected results, so that I
>>> can check it with more confidence.  Can you provide that, or point me to
>>> someone else who can?
>>
>> Maybe some of those that have contributed to php-mode.el can?
>
> I'm no php-mode.el contributor but I do code in PHP5 every single
> working day using emacs for a long time now. 
> I was previously forcing language detection to java in order to have
> something usable even though not perfect.
>
> I've just found out about this PHP5 patch for etags and just gave it a
> try. As far as I can see it works just fine, all my declarations are
> there and I don't see any strange results.
>
> If you need any help getting this into the main code base I'd be glad to
> help. But first I need to understand what you mean by "strange results"
> so I can check whether or not I do have the same issue

I see nobody has interest into PHP5 for etags...so sad!

So maybe I'm the only one but what can/should I do to get this patch
merged?

-- 
Oliv




^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Patch for PHP5 support for etags
  2012-03-08  9:42           ` Olivier Sirven
@ 2012-03-08 15:18             ` Stefan Monnier
  2012-03-08 15:25               ` Olivier Sirven
  2012-03-08 19:10             ` Francesco Potortì
  1 sibling, 1 reply; 14+ messages in thread
From: Stefan Monnier @ 2012-03-08 15:18 UTC (permalink / raw)
  To: Olivier Sirven; +Cc: emacs-devel

>>>>> "Olivier" == Olivier Sirven <<the.slaa@gmail.com> > writes:
> I see nobody has interest into PHP5 for etags...so sad!
> So maybe I'm the only one but what can/should I do to get this patch
> merged?

Francesco potorì is the maintainer, and he said (I quote from your message):

>>>> Yes, I applied the patch.  I tested it and got strange results.  So I
>>>> need a php5 source file together with the expected results, so that I
>>>> can check it with more confidence.  Can you provide that, or point me to
>>>> someone else who can?


        Stefan



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Patch for PHP5 support for etags
  2012-03-08 15:18             ` Stefan Monnier
@ 2012-03-08 15:25               ` Olivier Sirven
  0 siblings, 0 replies; 14+ messages in thread
From: Olivier Sirven @ 2012-03-08 15:25 UTC (permalink / raw)
  To: emacs-devel

On 2012-03-08 16:18:10, Stefan Monnier wrote:
>>>>>> "Olivier" == Olivier Sirven <<the.slaa@gmail.com> > writes:
>> I see nobody has interest into PHP5 for etags...so sad!
>> So maybe I'm the only one but what can/should I do to get this patch
>> merged?
>
> Francesco potorì is the maintainer, and he said (I quote from your message):
>
>>>>> Yes, I applied the patch.  I tested it and got strange results.  So I
>>>>> need a php5 source file together with the expected results, so that I
>>>>> can check it with more confidence.  Can you provide that, or point me to
>>>>> someone else who can?

Yeah that's why in my first message I wrote:
,----
| But first I need to understand what you mean by "strange results"
| so I can check whether or not I do have the same issue
`----

-- 
Oliv




^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Patch for PHP5 support for etags
  2012-03-08  9:42           ` Olivier Sirven
  2012-03-08 15:18             ` Stefan Monnier
@ 2012-03-08 19:10             ` Francesco Potortì
  2012-03-12 14:25               ` Olivier Sirven
  2012-03-16 16:52               ` Olivier Sirven
  1 sibling, 2 replies; 14+ messages in thread
From: Francesco Potortì @ 2012-03-08 19:10 UTC (permalink / raw)
  To: Olivier Sirven; +Cc: emacs-devel

>On 2012-02-24 11:36:06, Olivier Sirven wrote:
>> On 2011-04-26 14:36:35, Lennart Borgman wrote:
>>> On Tue, Apr 26, 2011 at 2:25 PM, Francesco Potortì <pot@gnu.org> wrote:
>>>>
>>>> Yes, I applied the patch.  I tested it and got strange results.  So I
>>>> need a php5 source file together with the expected results, so that I
>>>> can check it with more confidence.  Can you provide that, or point me to
>>>> someone else who can?
>>>
>>> Maybe some of those that have contributed to php-mode.el can?
>>
>> I'm no php-mode.el contributor but I do code in PHP5 every single
>> working day using emacs for a long time now. 
>> I was previously forcing language detection to java in order to have
>> something usable even though not perfect.
>>
>> I've just found out about this PHP5 patch for etags and just gave it a
>> try. As far as I can see it works just fine, all my declarations are
>> there and I don't see any strange results.
>>
>> If you need any help getting this into the main code base I'd be glad to
>> help. But first I need to understand what you mean by "strange results"
>> so I can check whether or not I do have the same issue

Ok, I must have lost this mail of yours, at least I cannot find it in my
records.  Sorry about that.  That said, I am lagging behind with work on
etags.  Much, much behind.  And yes, if some other maintainer steps in
to volunteer, I will pass the baton.

Today I tried to recompile etags locally for the first time in a couple
years at least and I am seeing some problems (etags should be able to
compile even outside of the Emacs tree).

>I see nobody has interest into PHP5 for etags...so sad!
>
>So maybe I'm the only one but what can/should I do to get this patch
>merged?

If you would like to try, you are welcome!  As a start, please try and
start from the current etags.c version in Emacs trunk.  Then write to
me, I'll try to help you get going, if necessary.

Else, I'll try to reapply the patch and see what comes out.




^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Patch for PHP5 support for etags
  2012-03-08 19:10             ` Francesco Potortì
@ 2012-03-12 14:25               ` Olivier Sirven
  2012-03-16 16:52               ` Olivier Sirven
  1 sibling, 0 replies; 14+ messages in thread
From: Olivier Sirven @ 2012-03-12 14:25 UTC (permalink / raw)
  To: emacs-devel

Hi,

On 2012-03-08 20:10:25, Francesco Potortì wrote:
>>On 2012-02-24 11:36:06, Olivier Sirven wrote:
>>> On 2011-04-26 14:36:35, Lennart Borgman wrote:
>>>> On Tue, Apr 26, 2011 at 2:25 PM, Francesco Potortì <pot@gnu.org> wrote:
>>>>>
>>>>> Yes, I applied the patch.  I tested it and got strange results.  So I
>>>>> need a php5 source file together with the expected results, so that I
>>>>> can check it with more confidence.  Can you provide that, or point me to
>>>>> someone else who can?
>>>>
>>>> Maybe some of those that have contributed to php-mode.el can?
>>>
>>> I'm no php-mode.el contributor but I do code in PHP5 every single
>>> working day using emacs for a long time now. 
>>> I was previously forcing language detection to java in order to have
>>> something usable even though not perfect.
>>>
>>> I've just found out about this PHP5 patch for etags and just gave it a
>>> try. As far as I can see it works just fine, all my declarations are
>>> there and I don't see any strange results.
>>>
>>> If you need any help getting this into the main code base I'd be glad to
>>> help. But first I need to understand what you mean by "strange results"
>>> so I can check whether or not I do have the same issue
>
> Ok, I must have lost this mail of yours, at least I cannot find it in my
> records.  Sorry about that.  That said, I am lagging behind with work on
> etags.  Much, much behind.  And yes, if some other maintainer steps in
> to volunteer, I will pass the baton.
>
> Today I tried to recompile etags locally for the first time in a couple
> years at least and I am seeing some problems (etags should be able to
> compile even outside of the Emacs tree).

,----[ make etags ]
| $ make etags
| gcc -std=gnu99   -Wimplicit-function-declaration -Wold-style-definition -Wdeclaration-after-statement  -DHAVE_CONFIG_H -I. -I../src -I../lib -I/home/slaanesh/src/emacs/trunk/lib-src -I/home/slaanesh/src/emacs/trunk/lib-src/../src -I/home/slaanesh/src/emacs/trunk/lib-src/../lib    -g -O2 -DEMACS_NAME="\"GNU Emacs\"" \
| 	  -DVERSION="\"24.0.94\"" /home/slaanesh/src/emacs/trunk/lib-src/etags.c \
| 	  regex.o ../lib/libgnu.a  -o etags
| /tmp/cceEvudD.o: In function `main':
| /home/slaanesh/src/emacs/trunk/lib-src/etags.c:1191: undefined reference to `rpl_optarg'
| /home/slaanesh/src/emacs/trunk/lib-src/etags.c:1166: undefined reference to `rpl_optarg'
| /home/slaanesh/src/emacs/trunk/lib-src/etags.c:1166: undefined reference to `rpl_optarg'
| /home/slaanesh/src/emacs/trunk/lib-src/etags.c:1170: undefined reference to `rpl_optarg'
| /home/slaanesh/src/emacs/trunk/lib-src/etags.c:1147: undefined reference to `rpl_optarg'
| /tmp/cceEvudD.o:/home/slaanesh/src/emacs/trunk/lib-src/etags.c:1114: more undefined references to `rpl_optarg' follow
| /tmp/cceEvudD.o: In function `main':
| /home/slaanesh/src/emacs/trunk/lib-src/etags.c:1208: undefined reference to `rpl_optind'
| /home/slaanesh/src/emacs/trunk/lib-src/etags.c:1208: undefined reference to `rpl_optind'
| ../lib/libgnu.a(getopt1.o): In function `rpl_getopt_long':
| /home/slaanesh/src/emacs/trunk/lib/getopt1.c:43: undefined reference to `rpl_getopt_internal'
| ../lib/libgnu.a(getopt1.o): In function `rpl_getopt_long_only':
| /home/slaanesh/src/emacs/trunk/lib/getopt1.c:66: undefined reference to `rpl_getopt_internal'
| collect2: ld returned 1 exit status
| make: *** [etags] Error 1
`----

it seems etags compilation is broken even in the emacs tree (using a
up-to-date bzr tree). Am I doing something wrong here?

>>I see nobody has interest into PHP5 for etags...so sad!
>>
>>So maybe I'm the only one but what can/should I do to get this patch
>>merged?
>
> If you would like to try, you are welcome!  As a start, please try and
> start from the current etags.c version in Emacs trunk.  Then write to
> me, I'll try to help you get going, if necessary.
>
> Else, I'll try to reapply the patch and see what comes out.

Would be my pleasure to do it for sure :)

-- 
Oliv




^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Patch for PHP5 support for etags
  2012-03-08 19:10             ` Francesco Potortì
  2012-03-12 14:25               ` Olivier Sirven
@ 2012-03-16 16:52               ` Olivier Sirven
  2012-03-16 17:04                 ` Francesco Potortì
  1 sibling, 1 reply; 14+ messages in thread
From: Olivier Sirven @ 2012-03-16 16:52 UTC (permalink / raw)
  To: emacs-devel

On 2012-03-08 20:10:25, Francesco Potortì wrote:
>>So maybe I'm the only one but what can/should I do to get this patch
>>merged?
>
> If you would like to try, you are welcome!  As a start, please try and
> start from the current etags.c version in Emacs trunk.  Then write to
> me, I'll try to help you get going, if necessary.
>
> Else, I'll try to reapply the patch and see what comes out.

Sp I reapplied the patch and everything went quite smoothly as far as I
can see. What is the next step?

-- 
Oliv




^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Patch for PHP5 support for etags
  2012-03-16 16:52               ` Olivier Sirven
@ 2012-03-16 17:04                 ` Francesco Potortì
  2012-03-19  8:14                   ` Olivier Sirven
  0 siblings, 1 reply; 14+ messages in thread
From: Francesco Potortì @ 2012-03-16 17:04 UTC (permalink / raw)
  To: Olivier Sirven; +Cc: emacs-devel

>Sp I reapplied the patch and everything went quite smoothly as far as I
>can see. What is the next step?

Be sure to have applied the patch to the latest trunk version.  Write a
Changelog entry for your patch.  Submit the patch and changelog entry to
this list.



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Patch for PHP5 support for etags
  2012-03-16 17:04                 ` Francesco Potortì
@ 2012-03-19  8:14                   ` Olivier Sirven
  0 siblings, 0 replies; 14+ messages in thread
From: Olivier Sirven @ 2012-03-19  8:14 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 345 bytes --]

On 2012-03-16 18:04:33, Francesco Potortì wrote:
>>Sp I reapplied the patch and everything went quite smoothly as far as I
>>can see. What is the next step?
>
> Be sure to have applied the patch to the latest trunk version.  Write a
> Changelog entry for your patch.  Submit the patch and changelog entry to
> this list.

There you go

-- 
Oliv

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: etags.patch --]
[-- Type: text/x-diff, Size: 1702 bytes --]

=== modified file 'etc/ChangeLog'
--- etc/ChangeLog	2012-03-16 23:20:37 +0000
+++ etc/ChangeLog	2012-03-19 08:11:15 +0000
@@ -1,3 +1,7 @@
+2012-03-19  Olivier Sirven  <the.slaa@gmail.com>
+
+	* lib-src/etags.c: Add support for PHP5 syntax
+
 2012-03-16  Glenn Morris  <rgm@gnu.org>
 
 	* HELLO: Say that this is not a comprehensive list.

=== modified file 'lib-src/etags.c'
--- lib-src/etags.c	2012-01-19 07:21:25 +0000
+++ lib-src/etags.c	2012-03-19 08:05:30 +0000
@@ -4466,6 +4466,39 @@
 		    lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
 	  search_identifier = FALSE;
 	}
+      else if (LOOKING_AT (cp, "public") ||
+	       LOOKING_AT (cp, "private") ||
+	       LOOKING_AT (cp, "protected") ||
+	       LOOKING_AT (cp, "static"))
+	{
+	  cp = skip_spaces (cp);
+	  if (LOOKING_AT (cp, "function"))
+	    {
+	      if(*cp == '&')
+		cp = skip_spaces (cp+1);
+	      if(*cp != '\0')
+		{
+		  name = cp;
+		  while (!notinname (*cp))
+		    cp++;
+		  make_tag (name, cp - name, TRUE,
+			    lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
+		}
+	      else
+		search_identifier = TRUE;
+	    }
+	  else if (members
+		   && *cp == '$')
+	    {
+	      name = cp;
+	      while (!notinname(*cp))
+		cp++;
+	      make_tag (name, cp - name, FALSE,
+			lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
+	    }
+	  else
+	    search_identifier = TRUE;
+	}
       else if (LOOKING_AT (cp, "function"))
 	{
 	  if (*cp == '&')
@@ -4507,7 +4540,8 @@
 		    lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
 	}
       else if (members
-	       && LOOKING_AT (cp, "var")
+	       && (LOOKING_AT (cp, "var")
+		   || LOOKING_AT (cp, "const"))
 	       && *cp == '$')
 	{
 	  name = cp;


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2012-03-19  8:14 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-16 17:00 Patch for PHP5 support for etags james borden
2011-04-17 13:17 ` Francesco Potortì
2011-04-17 13:29   ` Lennart Borgman
2011-04-26 12:25     ` Francesco Potortì
2011-04-26 12:36       ` Lennart Borgman
2012-02-24 10:36         ` Olivier Sirven
2012-03-08  9:42           ` Olivier Sirven
2012-03-08 15:18             ` Stefan Monnier
2012-03-08 15:25               ` Olivier Sirven
2012-03-08 19:10             ` Francesco Potortì
2012-03-12 14:25               ` Olivier Sirven
2012-03-16 16:52               ` Olivier Sirven
2012-03-16 17:04                 ` Francesco Potortì
2012-03-19  8:14                   ` Olivier Sirven

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).