bonjour, je voudrai créer un raccourcis pour commenter, dé-commenter du code
en fouillant sur le net j'ai trouvé ceci
Code :
 - ;; comment-or-uncomment-region-or-line
 - ; it's almost the same as in textmate.el but I wrote it before I know about
 - ; textmate.el, in fact that's how I found textmate.el, by googling this
 - ; function to see if somebody already did that in a better way than me.
 - (defun comment-or-uncomment-region-or-line ()
 -   "Like comment-or-uncomment-region, but if there's no mark \(that means no
 - region\) apply comment-or-uncomment to the current line"
 -   (interactive)
 -   (if (not mark-active)
 -       (comment-or-uncomment-region
 -         (line-beginning-position) (line-end-position))
 -       (if (< (point) (mark))
 -           (comment-or-uncomment-region (point) (mark))
 -         (comment-or-uncomment-region (mark) (point)))))
 - (global-set-key (kbd "C-/" ) 'comment-or-uncomment-region-or-line)
 
  | 
qui correspond exactement à ce que je cherche
si je lance la nouvelle commande comment-or-uncomment-region-or-line elle fonctionne
en revanche le raccourcis clavier...
 
j'ai essayé différente orthographe mais sans succès
merci de votre aide
 
Message édité par dams78 le 03-06-2009 à 14:26:58
 ---------------
			
dam's (debianer), ma galerie Flickr