Re: Major mode for EIEIO custom buffers

Leo P White <[email protected]> 07 Jun 2012 12:03:05 +0100
Newsgroups gmane.emacs.eieio
Message-ID <[email protected]>
I haven't made a copyright assignment before. What forms do I need?

Leo

On Jun 7 2012, Eric M. Ludlam wrote:

>Hi Leo,
>
>That is an interesting idea.  It seems better than just using 
>fundamental mode.
>
>Have you ever made a copyright assignment for contributions to Emacs? 
>Your patch is probably small enough that it isn't needed, but it would 
>be better if you already had provided a release.
>
>Thanks
>Eric
>
>
>On 06/06/2012 10:29 AM, Leo P White wrote:
>> Hi,
>>
>> I think it would be an improvement if eieio-custom.el had its own major
>> mode for the buffers it creates.
>>
>> I need this because I have a minor mode that defines new key bindings 
>> for RET and TAB, which shadow the ones in widget-keymap. This is easily 
>> remedied, but it requires a hook for the buffers that eieio-custom 
>> creates. Rather than just adding a hook, it seems more sensible to 
>> create a simple major mode, as this would also improve documentation.
>>
>> I've included a simple patch below.
>>
>> Regards,
>>
>> Leo
>>
>> -----------------------------------------------------------------
>>
>> diff -ruN old/eieio-custom.el new/eieio-custom.el
>> --- old/eieio-custom.el	2012-06-06 14:55:00.258634000 +0100
>> +++ new/eieio-custom.el	2012-06-06 15:05:15.311976000 +0100
>> @@ -332,6 +332,16 @@
>>   Optional argument GROUP is the sub-group of slots to display."
>>     (eieio-customize-object obj group))
>>
>> +(defvar eieio-custom-mode-map
>> +  (let ((map (make-sparse-keymap)))
>> +    (set-keymap-parent map widget-keymap)
>> +    map)
>> +  "Keymap for EIEIO Custom mode")
>> +
>> +(define-derived-mode eieio-custom-mode fundamental-mode "EIEIO Custom"
>> +  "Major mode for customizing EIEIO objects.
>> +\\{eieio-custom-mode-map}")
>> +
>>   (defmethod eieio-customize-object ((obj eieio-default-superclass)
>>   				&optional group)
>>     "Customize OBJ in a specialized custom buffer.
>> @@ -347,6 +357,7 @@
>>   			       (symbol-name g) "*")))
>>       (setq buffer-read-only nil)
>>       (kill-all-local-variables)
>> +    (eieio-custom-mode)
>>       (erase-buffer)
>>       (let ((all (overlay-lists)))
>>         ;; Delete all the overlays.
>> @@ -363,7 +374,6 @@
>>       (widget-insert "\n")
>>       (eieio-custom-object-apply-reset obj)
>>       ;; Now initialize the buffer
>> -    (use-local-map widget-keymap)
>>       (widget-setup)
>>       ;;(widget-minor-mode)
>>       (goto-char (point-min))
>>
>>
>>
>>  
>>  
>> ------------------------------------------------------------------------------ 
>> Live Security Virtual Conference Exclusive live event will cover all the 
>> ways today's security and threat landscape has changed and how IT 
>> managers can respond. Discussions will include endpoint security, mobile 
>> security and the latest in malware threats. 
>> http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ 
>> _______________________________________________ cedet-eieio mailing list 
>> [email protected] 
>> https://lists.sourceforge.net/lists/listinfo/cedet-eieio
>>
>

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/