From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?S=C3=A9bastien_Vauban?= Subject: Re: [PATCH] Allow code edit buffer to inherit active region Date: Thu, 30 Sep 2010 10:02:40 +0200 Message-ID: <878w2jacbj.fsf@mundaneum.com> References: <871v992xzy.fsf@stats.ox.ac.uk> <87eicwcuw0.fsf@stats.ox.ac.uk> <2193BA26-48F8-42D2-A376-933E60756893@gmail.com> <8762xz18dk.fsf@stats.ox.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org Hi Dan, Dan Davison wrote: > Now, if the region is contained within a src block, then it will be > inherited by the language major mode edit buffer. One consequence is that > commands like M-; (comment-region) and C-M-\ (indent-region) can be called > with their native effects from a src block in the Org buffer. Am I right assuming we still need such a code in order to get the wanted effect with the native keys (I mean, for example, =3DM-;=3D instead of =3DC= -c C-v C-x M-;=3D)? --8<---------------cut here---------------start------------->8--- ;; allow comment region in the code edit buffer (according to language) (defun my/org-comment-dwim (&optional arg) (interactive "P") (or (org-babel-do-key-sequence-in-edit-buffer (kbd "M-;")) (comment-dwim arg))) (define-key org-mode-map (kbd "M-;") 'my/org-comment-dwim) ;; allow indent region in the code edit buffer (according to language) (defun my/org-indent-region (&optional arg) (interactive "P") (or (org-babel-do-key-sequence-in-edit-buffer (kbd "C-M-\\")) (indent-region arg))) (define-key org-mode-map (kbd "C-M-\\") 'my/org-indent-region) --8<---------------cut here---------------end--------------->8--- BTW, note that I make use of =3Dkbd=3D to have a more intuitive writing of = the key bindings (just copy what =3DC-h k=3D shows, except for the =3D\=3D that has= to be escaped). Isn't this more portable (other versions of Emacs, or XEmacs)? Best regards, Seb --=20 S=C3=A9bastien Vauban _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode-mXXj517/zsQ@public.gmane.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode