all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Editing comments
@ 2015-06-05  6:45 Andreas Röhler
  2015-06-05 21:49 ` Robert Thorpe
  2015-06-08 14:24 ` Phillip Lord
  0 siblings, 2 replies; 10+ messages in thread
From: Andreas Röhler @ 2015-06-05  6:45 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,

commented code might need some edits too. In that case some basic 
commands like forward-sexp are not available.

Is there a minor-mode, un-commenting temporarily, writing back the result?

Thanks,

Andreas



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

* Re: Editing comments
  2015-06-05  6:45 Editing comments Andreas Röhler
@ 2015-06-05 21:49 ` Robert Thorpe
  2015-06-07 17:33   ` Andreas Röhler
       [not found]   ` <mailman.4519.1433698446.904.help-gnu-emacs@gnu.org>
  2015-06-08 14:24 ` Phillip Lord
  1 sibling, 2 replies; 10+ messages in thread
From: Robert Thorpe @ 2015-06-05 21:49 UTC (permalink / raw)
  To: Andreas Röhler; +Cc: help-gnu-emacs

Andreas Röhler <andreas.roehler@easy-emacs.de> writes:
> commented code might need some edits too. In that case some basic 
> commands like forward-sexp are not available.
>
> Is there a minor-mode, un-commenting temporarily, writing back the result?

What I do in this situation is I first mark the commented region.  I
then narrow to the region, then uncomment it, after that I widen.

So, something like:
* C-SPC
* M-} or M-C-f, etc
* C-x n n
* M-;
* Edit
* C-x h
* M-;
* C-x n w

There is probably a better way.

BR,
Rob



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

* Re: Editing comments
  2015-06-05 21:49 ` Robert Thorpe
@ 2015-06-07 17:33   ` Andreas Röhler
  2015-06-07 19:08     ` Artur Malabarba
       [not found]   ` <mailman.4519.1433698446.904.help-gnu-emacs@gnu.org>
  1 sibling, 1 reply; 10+ messages in thread
From: Andreas Röhler @ 2015-06-07 17:33 UTC (permalink / raw)
  To: Robert Thorpe; +Cc: help-gnu-emacs


Am 05.06.2015 um 23:49 schrieb Robert Thorpe:
> Andreas Röhler <andreas.roehler@easy-emacs.de> writes:
>> commented code might need some edits too. In that case some basic
>> commands like forward-sexp are not available.
>>
>> Is there a minor-mode, un-commenting temporarily, writing back the result?
> What I do in this situation is I first mark the commented region.  I
> then narrow to the region, then uncomment it, after that I widen.
>
> So, something like:
> * C-SPC
> * M-} or M-C-f, etc
> * C-x n n
> * M-;
> * Edit
> * C-x h
> * M-;
> * C-x n w
>
> There is probably a better way.
>
> BR,
> Rob

Thanks. IMO that's worth a minor-mode like wdired.

That would reduce needed keystrokes towards two - while marking comments 
already may cost severals.

Cheers,

Andreas




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

* Re: Editing comments
       [not found]   ` <mailman.4519.1433698446.904.help-gnu-emacs@gnu.org>
@ 2015-06-07 18:47     ` Javier
  2015-06-07 20:38       ` Robert Thorpe
  0 siblings, 1 reply; 10+ messages in thread
From: Javier @ 2015-06-07 18:47 UTC (permalink / raw)
  To: help-gnu-emacs

>> Andreas Röhler <andreas.roehler@easy-emacs.de> writes:
>>> commented code might need some edits too. In that case some basic
>>> commands like forward-sexp are not available.
>>>
>>> Is there a minor-mode, un-commenting temporarily, writing back the result?

You can always disable a block of code by an if(false).  The emacs
major mode will work fine that way and reactivating the code is just
changing 0 by 1.

Python
if(0):
    ...

C with preprocessor directives
#if 0
...
#endif

TeX
\iffalse
...
\fi

LaTeX with the comment environment in the verbatim package.
\begin{comment}
...
\end{comment}



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

* Re: Editing comments
  2015-06-07 17:33   ` Andreas Röhler
@ 2015-06-07 19:08     ` Artur Malabarba
  2015-06-08  4:59       ` Andreas Röhler
  0 siblings, 1 reply; 10+ messages in thread
From: Artur Malabarba @ 2015-06-07 19:08 UTC (permalink / raw)
  To: Andreas Röhler; +Cc: help-gnu-emacs, Robert Thorpe

> Thanks. IMO that's worth a minor-mode like wdired.
>
> That would reduce needed keystrokes towards two - while marking comments
already may cost severals.

I've never used it, but you might be looking for poporg. From their doc:

poporg is a small Emacs Lisp project to help editing program strings and
comments using Org mode (or any other major mode). This can be useful as it
is often more convenient to edit large pieces of text, like Emacs Lisp or
Python docstrings, in an org-mode buffer instead of in a comment or a
string.


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

* Re: Editing comments
  2015-06-07 18:47     ` Javier
@ 2015-06-07 20:38       ` Robert Thorpe
  0 siblings, 0 replies; 10+ messages in thread
From: Robert Thorpe @ 2015-06-07 20:38 UTC (permalink / raw)
  To: help-gnu-emacs

Javier <nospam@nospam.com> writes:

> Python
> if(0):
>     ...

Yes, and for lisp you can use:

'(
...
)

BR,
Robert Thorpe



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

* Re: Editing comments
  2015-06-07 19:08     ` Artur Malabarba
@ 2015-06-08  4:59       ` Andreas Röhler
  0 siblings, 0 replies; 10+ messages in thread
From: Andreas Röhler @ 2015-06-08  4:59 UTC (permalink / raw)
  Cc: help-gnu-emacs


Am 07.06.2015 um 21:08 schrieb Artur Malabarba:
>
> > Thanks. IMO that's worth a minor-mode like wdired.
> >
> > That would reduce needed keystrokes towards two - while marking 
> comments already may cost severals.
>
> I've never used it, but you might be looking for poporg. From their doc:
>
> poporg is a small Emacs Lisp project to help editing program strings 
> and comments using Org mode (or any other major mode). This can be 
> useful as it is often more convenient to edit large pieces of text, 
> like Emacs Lisp or Python docstrings, in an org-mode buffer instead of 
> in a comment or a string.
>

Thanks for the hint,

Andreas



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

* Re: Editing comments
  2015-06-05  6:45 Editing comments Andreas Röhler
  2015-06-05 21:49 ` Robert Thorpe
@ 2015-06-08 14:24 ` Phillip Lord
  2015-06-08 18:24   ` Andreas Röhler
  1 sibling, 1 reply; 10+ messages in thread
From: Phillip Lord @ 2015-06-08 14:24 UTC (permalink / raw)
  To: Andreas Röhler; +Cc: help-gnu-emacs



lentic

You can use it to have two buffers one in (say) emacs-lisp and one is
(say) org-mode. You can edit either view and everything stays in sync.

The two buffers can be different -- so in the emacs-lisp view, all the
documentation is commented out, while in the org-mode view it is not.

Phil

Andreas Röhler <andreas.roehler@easy-emacs.de> writes:

> Hi,
>
> commented code might need some edits too. In that case some basic commands
> like forward-sexp are not available.
>
> Is there a minor-mode, un-commenting temporarily, writing back the result?
>
> Thanks,
>
> Andreas
>
>
>

-- 
Phillip Lord,                           Phone: +44 (0) 191 208 7827
Lecturer in Bioinformatics,             Email: phillip.lord@newcastle.ac.uk
School of Computing Science,            http://homepages.cs.ncl.ac.uk/phillip.lord
Room 914 Claremont Tower,               skype: russet_apples
Newcastle University,                   twitter: phillord
NE1 7RU                                 



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

* Re: Editing comments
  2015-06-08 14:24 ` Phillip Lord
@ 2015-06-08 18:24   ` Andreas Röhler
  2015-06-09  9:18     ` Phillip Lord
  0 siblings, 1 reply; 10+ messages in thread
From: Andreas Röhler @ 2015-06-08 18:24 UTC (permalink / raw)
  To: Phillip Lord; +Cc: help-gnu-emacs


Am 08.06.2015 um 16:24 schrieb Phillip Lord:
>
> lentic
>
> You can use it to have two buffers one in (say) emacs-lisp and one is
> (say) org-mode. You can edit either view and everything stays in sync.
>
> The two buffers can be different -- so in the emacs-lisp view, all the
> documentation is commented out, while in the org-mode view it is not.
>
> Phil
>
>

Cloned.

My usecase for lentic probably will be edits at different parts of 
buffer - while keeping the other part in view. Very interesting, thanks 
a lot!

Andreas



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

* Re: Editing comments
  2015-06-08 18:24   ` Andreas Röhler
@ 2015-06-09  9:18     ` Phillip Lord
  0 siblings, 0 replies; 10+ messages in thread
From: Phillip Lord @ 2015-06-09  9:18 UTC (permalink / raw)
  To: Andreas Röhler; +Cc: help-gnu-emacs

Andreas Röhler <andreas.roehler@easy-emacs.de> writes:

> Am 08.06.2015 um 16:24 schrieb Phillip Lord:
>>
>> lentic
>>
>> You can use it to have two buffers one in (say) emacs-lisp and one is
>> (say) org-mode. You can edit either view and everything stays in sync.
>>
>> The two buffers can be different -- so in the emacs-lisp view, all the
>> documentation is commented out, while in the org-mode view it is not.
>>
>> Phil
>>
>>
>
> Cloned.
>
> My usecase for lentic probably will be edits at different parts of buffer -
> while keeping the other part in view. Very interesting, thanks a lot!


It's worth mentioning that there is an outstanding bug with that --
sometimes it loses the location of point. I know how to fix this, I
think, but have not had leisure. Let me know if it affects you, and I
will move it up the list.

Phil



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

end of thread, other threads:[~2015-06-09  9:18 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-05  6:45 Editing comments Andreas Röhler
2015-06-05 21:49 ` Robert Thorpe
2015-06-07 17:33   ` Andreas Röhler
2015-06-07 19:08     ` Artur Malabarba
2015-06-08  4:59       ` Andreas Röhler
     [not found]   ` <mailman.4519.1433698446.904.help-gnu-emacs@gnu.org>
2015-06-07 18:47     ` Javier
2015-06-07 20:38       ` Robert Thorpe
2015-06-08 14:24 ` Phillip Lord
2015-06-08 18:24   ` Andreas Röhler
2015-06-09  9:18     ` Phillip Lord

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.