I am working with rather longish file names and when viewing the buffer list, the width of the Buffer column is too short for my purposes.
How can I increase that width (at the expense of, say, the width of the Mode or the File columns).
Width I am trying to increase marked with yellow in the screenshot below:
In Emacs 24.3 and later, this is controlled by the variable Buffer-menu-name-width, which defaults to 19 on my system. Something like
(setq Buffer-menu-name-width 40)
should help. Alternatively, you can use something like M-x customize-variable to change it.
In older Emacs versions, Buffer-menu-buffer+size-width should be modified instead. Thanks to the OP for his edit pointing this out.
It looks like the File column fills up whatever space is left over, so this change should take space away from it. If you prefer to take space from the Mode column, you could also modify the Buffer-menu-mode-width variable to something smaller.
Related
I would like to make a column on the left side of the buffer "strongly read-only". The cursor should not be able to go there. A multi-line highlight should skip the column. Text search should skip the column. Etc.
Is it possible?
Each row of the column carries information about the corresponding line of the original buffer. I considered making the column into a separate vertical buffer, but then I would have to worry about keeping them in vertical sync.
I imagine including the column of predecessor counts in the text buffer, as ordinary text. If I did that, I would have to rewrite a lot of commands (cursor movement, highlight, text search, ...) to ignore the column.
I found how to make a region "weakly read-only", such that it can be copied and searched, just not edited.
Sounds like you just want to use the margin. Look it up in the Emacs Lisp manual (info "(elisp)Display Margins"). Or check C-h o set-window-margins RET and the documentation of the display text-property.
What if one buffer was just a view of two others?
I was playing around with word wrapping yesterday and now I am getting an annoying behavior in my emacs (23.1). When typing in my latex documents the paragraphs are automatically wrapping. As an example, if I open a finished tex document and want to add a space in the middle of a paragraph the entire paragraph gets resized from covering the entire width of the screen to only covering approximately 1/4 of the screen (lines are wrapping around 68-72 columns wide).
Prior to changing anything I saved my original .emacs file, and I have restored the original .emacs to no benefit. I suspect I may have screwed something up in my AucTex configuration, but I cannot find anything to fix this. Any pointers on places to check will be appreciated.
Is there a way to tell org-mode to load only the first N lines of a long text file? I would like to keep the whole file open to be able to search through it, but have org-mode display on the first N lines of my file, which is where I edit new content.
If you have a structured outline in org-mode, you can set the global file visibility with the #+STARTUP markup, or the visibility of any heading with the VISIBILITY property, see Visibility Cycling for details. The benefit of using the built-in org-mode properties is that it's easy to have a file open up in exactly the state you want.
I have my journal file set up to accomplish something similar what I think you're asking for using these org-mode properties. The "Today" section is opened so I can see everything, but older archives are collapsed.
I'm not sure the title really fits the description?
I think you just want use buffer narrowing, which lets you hide everything outside of the specified region for as long as necessary.
You can manually narrow the buffer by marking the region and typing C-xnn
Widen the display back to the full buffer with C-xnw
I guess you could use an eval Local Variable to automate this to a pre-defined region, if you really wanted to.
There's also narrow-to-defun (C-xnd) and narrow-to-page (C-xnp). If you throw a page break into your org file (C-qC-l), the latter might prove handy.
In Emacs, how can I enforce a maximum line length of, say, 80 characters? I want it to insert proper line breaks in my code, much like fill-paragraph for text, if possible, with the correct insertion of the second part of the line.
Here a little example:
LongNameType<PrettyLong, AlsoLong> doSomethingWithLongFunctionName(int a, int b);
foo();
If I actually do fill-paragraph it becomes:
LongNameType<PrettyLong, AlsoLong>
doSomethingWithLongFunctionName(int a, int b); foo();
whereas I'd prefer this:
LongNameType<PrettyLong, AlsoLong>
doSomethingWithLongFunctionName(int a, int b);
foo();
There are a number of packages which warn you of line length limits. Personally, I use wide-column, which changes the cursor color depending on its current column.
fill-paragraph and auto-fill-mode deliberately don't wrap code. There are just too many ways to do it and it'd probably get it wrong. They will wrap comments, but that doesn't help you here.
The only way I've ever done it to to explicitly put the where I want the text to break. Then the auto-indent should put the broken line in the right place.
Are you trying to reflow a large body of existing code? Or trying to have auto-fill work on code you are writing now?
Not really an emacser, but what happens if you turn on auto-fill-mode while in c++-mode?
C++ mode should give you auto-indent, and auto-fill-mode gives you line-wrapping....
I use modeline-posn package. It highlights column number in the modeline if it's greater than specified value.
You should check out one of the many "vertical line" libraries for Emacs. Some keep a vertical highlight line over the entire buffer at point at all times (not really what you want) but other libraries put the vertical highlight on a fix column at all times, which is not really what you want, but you can immediately see when you ought to be wrapping lines.
Try
'(c-max-one-liner-length 80)
'(fill-column 80)
'(c-ignore-auto-fill (quote (string cpp)))
Hope it helps.
You could use the more advanced clang-format package.
You have to install clang-fromat along with it's emacs package.
Add this to your .emacs (setq clang-format-style "file") or add to custom-set-variables '(clang-format-style "file").
Generate your template style by clang-format -style=gnu -dump-config > .clang-format then place into your project's root.
Customize .clang-format as you like and change ColumnLimit: 120 to 80 or whatever value you want.
That would force column limit using clang-format tool.
Reference:
ClangFormatStyleOptions.
Related question
I am hacking up a tagging application for emacs. I have got a tag cloud/weighted list successfully displaying on a buffer, but i am running into a snag. I need to be able to properly word-wrap the buffer, but I haven't a clue where to start.
The font I am using is a variable width font. On top of that, each tag is going to be in a different size, depending on how many times it shows up on the buffer. Finally, the window that displays the tagcloud could be in a window that is 200 pixels wide, or the full screen width.
I really have no idea where to start. I tried longlines mode on the tagcloud buffer, but that didn't work.
Source code is at: http://emacswiki.org/cgi-bin/emacs/free-tagging.el
You probably want to track posn-at-point and posn-at-x-y as you put the tags in the buffer.
Can you use (fill-paragraph) or (fill-region) or similar? They wrap at a column, so don't have variable width font smarts, but if the fill column is low they might work for next to no effort. At least until you get a pixel-perfect solution sorted out :-) (maybe YAGNI...)