Can I make “comment-region” comment empty lines?Modify org-mode's definition of comment lines?How to change comment string used by comment-region?If I am in a comment (including empty lines), how do I get to the beginning of the comment?add a space after the comment delimiterHow to get emacs to automatically insert block comment prefixes?How to treat region between conflict markers as comment?How to protect LaTeX comment lines from indentation?auto-fill-mode fails in comment with empty second linecommand to mark a block comment as regionHow to align both of comments and macro of multiple lines with space instead tabs for C/C++ code?
What is going on with Captain Marvel's blood colour?
Plain language with long required phrases
UK: Is there precedent for the governments e-petition site changing the direction of a government decision?
Neighboring nodes in the network
How can I tell someone that I want to be his or her friend?
Anagram holiday
Why does Kotter return in Welcome Back Kotter
What does it mean to describe someone as a butt steak?
Can one be a co-translator of a book, if he does not know the language that the book is translated into?
Western buddy movie with a supernatural twist where a woman turns into an eagle at the end
Increase size of symbol intercal when in superscript position
What mechanic is there to disable a threat instead of killing it?
Is it possible to download Internet Explorer on my Mac running OS X El Capitan?
Watching something be written to a file live with tail
Why can't we play rap on piano?
Cronab fails because shell path not found
How would I stat a creature to be immune to everything but the Magic Missile spell? (just for fun)
Can a virus destroy the BIOS of a modern computer?
How to take photos in burst mode, without vibration?
How can I prevent hyper evolved versions of regular creatures from wiping out their cousins?
Where does SFDX store details about scratch orgs?
Why doesn't H₄O²⁺ exist?
intersection of two sorted vectors in C++
Python: return float 1.0 as int 1 but float 1.5 as float 1.5
Can I make “comment-region” comment empty lines?
Modify org-mode's definition of comment lines?How to change comment string used by comment-region?If I am in a comment (including empty lines), how do I get to the beginning of the comment?add a space after the comment delimiterHow to get emacs to automatically insert block comment prefixes?How to treat region between conflict markers as comment?How to protect LaTeX comment lines from indentation?auto-fill-mode fails in comment with empty second linecommand to mark a block comment as regionHow to align both of comments and macro of multiple lines with space instead tabs for C/C++ code?
In LaTeX code I can have:
Lorem ipsum dolor sit amet, consectetur
begincomment
adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation
endcomment
ullamco laboris nisi ut aliquip ex ea commodo consequat.
If I use comment-region (in a script) to comment the comment environment in la LaTeX code i obtain:
Lorem ipsum dolor sit amet, consectetur
%% begincomment
%% adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
%% Ut enim ad minim veniam, quis nostrud exercitation
%% endcomment
ullamco laboris nisi ut aliquip ex ea commodo consequat.
This is not good because LaTeX interpret the empty line(s) (outside of comment environment) as a paragraph break.
My question is: Can I make comment-region comment empty lines?
I tried customizing (let-bind) the comment-syle variable but all the options I've seen do not comment empty lines.
An alternative could be a "built-in" (otherwise I already know how to make this funcion by myself) function that let me append a string on every line of a region (not a triangle). Remember, I need to do it programmatically.
comment
add a comment |
In LaTeX code I can have:
Lorem ipsum dolor sit amet, consectetur
begincomment
adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation
endcomment
ullamco laboris nisi ut aliquip ex ea commodo consequat.
If I use comment-region (in a script) to comment the comment environment in la LaTeX code i obtain:
Lorem ipsum dolor sit amet, consectetur
%% begincomment
%% adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
%% Ut enim ad minim veniam, quis nostrud exercitation
%% endcomment
ullamco laboris nisi ut aliquip ex ea commodo consequat.
This is not good because LaTeX interpret the empty line(s) (outside of comment environment) as a paragraph break.
My question is: Can I make comment-region comment empty lines?
I tried customizing (let-bind) the comment-syle variable but all the options I've seen do not comment empty lines.
An alternative could be a "built-in" (otherwise I already know how to make this funcion by myself) function that let me append a string on every line of a region (not a triangle). Remember, I need to do it programmatically.
comment
add a comment |
In LaTeX code I can have:
Lorem ipsum dolor sit amet, consectetur
begincomment
adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation
endcomment
ullamco laboris nisi ut aliquip ex ea commodo consequat.
If I use comment-region (in a script) to comment the comment environment in la LaTeX code i obtain:
Lorem ipsum dolor sit amet, consectetur
%% begincomment
%% adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
%% Ut enim ad minim veniam, quis nostrud exercitation
%% endcomment
ullamco laboris nisi ut aliquip ex ea commodo consequat.
This is not good because LaTeX interpret the empty line(s) (outside of comment environment) as a paragraph break.
My question is: Can I make comment-region comment empty lines?
I tried customizing (let-bind) the comment-syle variable but all the options I've seen do not comment empty lines.
An alternative could be a "built-in" (otherwise I already know how to make this funcion by myself) function that let me append a string on every line of a region (not a triangle). Remember, I need to do it programmatically.
comment
In LaTeX code I can have:
Lorem ipsum dolor sit amet, consectetur
begincomment
adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation
endcomment
ullamco laboris nisi ut aliquip ex ea commodo consequat.
If I use comment-region (in a script) to comment the comment environment in la LaTeX code i obtain:
Lorem ipsum dolor sit amet, consectetur
%% begincomment
%% adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
%% Ut enim ad minim veniam, quis nostrud exercitation
%% endcomment
ullamco laboris nisi ut aliquip ex ea commodo consequat.
This is not good because LaTeX interpret the empty line(s) (outside of comment environment) as a paragraph break.
My question is: Can I make comment-region comment empty lines?
I tried customizing (let-bind) the comment-syle variable but all the options I've seen do not comment empty lines.
An alternative could be a "built-in" (otherwise I already know how to make this funcion by myself) function that let me append a string on every line of a region (not a triangle). Remember, I need to do it programmatically.
comment
comment
edited 4 hours ago
Gabriele Nicolardi
asked 4 hours ago
Gabriele NicolardiGabriele Nicolardi
514112
514112
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Customize option comment-empty-lines.
comment-empty-linesis a variable defined innewcomment.el.
Documentation:
Ifnil,comment-regiondoes not comment out empty lines.
Ift, it always comments out empty lines.
Ifeolit only comments out empty lines if comments are
terminated by the end of line (i.e.comment-endis empty).
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "583"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2femacs.stackexchange.com%2fquestions%2f48764%2fcan-i-make-comment-region-comment-empty-lines%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Customize option comment-empty-lines.
comment-empty-linesis a variable defined innewcomment.el.
Documentation:
Ifnil,comment-regiondoes not comment out empty lines.
Ift, it always comments out empty lines.
Ifeolit only comments out empty lines if comments are
terminated by the end of line (i.e.comment-endis empty).
add a comment |
Customize option comment-empty-lines.
comment-empty-linesis a variable defined innewcomment.el.
Documentation:
Ifnil,comment-regiondoes not comment out empty lines.
Ift, it always comments out empty lines.
Ifeolit only comments out empty lines if comments are
terminated by the end of line (i.e.comment-endis empty).
add a comment |
Customize option comment-empty-lines.
comment-empty-linesis a variable defined innewcomment.el.
Documentation:
Ifnil,comment-regiondoes not comment out empty lines.
Ift, it always comments out empty lines.
Ifeolit only comments out empty lines if comments are
terminated by the end of line (i.e.comment-endis empty).
Customize option comment-empty-lines.
comment-empty-linesis a variable defined innewcomment.el.
Documentation:
Ifnil,comment-regiondoes not comment out empty lines.
Ift, it always comments out empty lines.
Ifeolit only comments out empty lines if comments are
terminated by the end of line (i.e.comment-endis empty).
edited 3 hours ago
Drew
49k463108
49k463108
answered 3 hours ago
muffinmadmuffinmad
33112
33112
add a comment |
add a comment |
Thanks for contributing an answer to Emacs Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2femacs.stackexchange.com%2fquestions%2f48764%2fcan-i-make-comment-region-comment-empty-lines%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown