Hot answers tagged

7

If I understood you correctly, you want follow-mode. It comes with emacs. First, show the same buffer in two side by side windows (Ctl-x 3). Then turn on follow-mode. Page up and down, and watch the magic.


6

Actually for org-table-copy-region it isn't necessary to mark the exact column width! Just mark the beginning of the column somewhere in a cell, then the end by going down the required number of rows and do C-c C-x M-w (for M-x o-t-c-r). Then go to another cell, where you want to add the column and do C-c C-x C-y (for M-x org-table-paste-rectangle).


5

Just positioning at the column: cursor here | V | Name |■Age | |--------+-----| | Tarzan | 40 | | Jane | 39 | and using M-S-right (org-table-insert-column) makes it: | Name | | Age | |--------+---+-----| | Tarzan | | 40 | | Jane | | 39 | From the org-mode manual: M-S-<right> (org-table-insert-column)...


5

You can also achieve this using shell-command-on-region and the Unix utility cut. Highlight the region. Press C-u M-|, enter "cut -d= -f1", press RET. The prefix argument C-u tells shell-command-on-region to replace the region with results. If you don't want to (or can't) modify the current buffer, you can still use M-| (now without the prefix argument). In ...


4

Following is a method using an elisp formula: | hex | comment | |------+---------| | 0x00 | | | 0x01 | | | 0x02 | | | 0x03 | | | 0x04 | | | 0x05 | | | 0x06 | | | 0x07 | | | 0x08 | | | 0x09 | | | 0x0A | | | 0x0B | | | 0x0C | | #+TBLFM: $1='(format "0x%02X"...


4

I believe you're looking for something like: (setq scroll-preserve-screen-position 'always)


3

You can use C-M-% (query-replace-regexp) to delete text matching the pattern " .*$". i.e., everything, starting with whitespace, up to the end of the line.


3

Keeping in mind that column numbers are zero-based, and assuming that column zero is currently visible, then you can use scroll-left with the desired column as a prefix argument. e.g.: C-u 16 C-x<


3

I'm not sure whether the following will help in your case, but I hope it will be of some use (and it may be useful to others). You can control the width of a column with cookies. The Tables/Column width and alignment section of the manual describes this as follows (and contains additional useful information): Sometimes a single field or a few fields need ...


3

The two commands org-table-select-col and org-table-copy-col in the following lisp code allow the selection and the copying of the current table column. You can bind it to the key of your liking and/or insert it via easy-menu-define-key into org-tbl-menu. (defun org-table-goto-col-beginning () "Go to beginning of current column and return `point'." (...


3

If the major mode works with font-lock-mode you can add a font-lock keyword in the major mode hook. If you include newlines in the match the line is highlighted over the full width of the window (if that is what you actually want). The following example does that for lines only consisting of a single percent character in LaTeX-mode buffers: (defcustom my-...


2

You can do this with library Isearch+. As far as I know, this is the only library that offers this possibility. Set or bind option isearchp-restrict-to-region-flag to non-nil. This means that when the region is active and you start isearching the search will be limited to the region. Select the text between the upper-left and lower-right corners of the ...


2

You can use M-x align-regexp RET like RET. Thereby like stands for the regexp identifying the part of the line that should be aligned. Note that the variable align-to-tab-stop influences the alignment. If it is set to indent-tabs-mode tabs are inserted for alignment. Set it to nil if you want spaces instead. There is also the "expert mode" of align-regexp ...


2

It turns out that this is intentional and the fault of ert-batch-backtrace-right-margin which is set to 70 by default. Its docstring instructs you: Use nil for no limit (caution: backtrace lines can be very long).


2

This is an answer to question 1 based on keyboard macros and calc. Prepare Calc Set calc to display in radix 16. C-x * c d r 16 q Record a suitable Macro f3 f3 M-b C-x * w C-x * w C-e RET f4 Use the Macro f4 f4 ... Beautification Use e.g. search and replace to change the format of the list.


2

It feels as if the combination of the multiple-cursors and iy-go-to-char packages is to do exactly this kind of stuff. First of all, if you don't have those packages installed, they can be installed via MELPA. Select all the lines you need and then do M-x mc/edit-lines (or the default binding C-S-c C-S-c). Move all the cursors to the beginning of the lines (...


2

Emacs including the installed packages does itself some fancy matching between the two calls of M-:. With (match-data) and relatives you get the match data of the last search operation. That search-op was most certainly not yours. If you want to get the end of your looking-at operation you should use the following command. M-: RET (progn (looking-at "1\\. "...


2

You don't really want to use rectangles for this, because the desired end result is not aligned as rectangles. Either use a keyboard macro. e.g.: <f3> - start recording C-kC-ySPC=SPCC-y - transform the first line <right><f4> - move to the next line, and stop recording <f4><f4><f4> - replay for the remaining lines Or query-replace-regexp: ...


1

Q: How can I fix this? A1: Now that you know that the environment variable makes the difference, see if you can get the intended effect without it. Searching the net for "LANG vs. LC_CTYPE", this question pops up: https://stackoverflow.com/questions/30479607/explain-the-effects-of-export-lang-lc-ctype-lc-all, which explains: LC_CTYPE This variable ...


1

;; Here we create the concept of a 'tab-column.' ;; Set the tab column where you want by positioning the cursor and typeing M-+ ;; Then move to another line and type M-=, and EMACS will insert enough spaces ;; to get you to the column. This is useful for alinging columns of text without tabs. ;; tab-column is a silly name; I need a better one. (defun set-...


1

Here is advice that should do what you want: (defun goal-column-advice (&rest _args) "Advice inserting spaces when needed to obey `goal-column'. This advice is intended as :after advice for commands `previous-line' and `next-line'. Normally, these commands will attempt to obey any `goal-column' setting, but only on lines that are long enough that ...


1

Sorry, as soon as I posted this, I found a response. tested on emacs 24.3.1. Here's what you need to do: M-x vline-mode You may have to install the appropriate package. You can then customize the face so that the color for vline is not too obtrusive. You could also add the minor mode vline-mode to your major mode hooks like so (in your init.el): (defun ...


1

There are many ways to do this. 1. Using built-in emacs stuff Switch to a programming mode where aligning at the equal sign makes sense, e.g.: M-x python-mode Place point right at the end of the line with the last =. Call M-x align. Call copy-rectangle-as-kill on the rectangle before the =. Undo the alignment with C-x u 2. Using the versatile matches ...


1

"Point" means something in Emacs. It is the buffer position just before the text cursor - the position at which text is self-inserted. It is confusing to name a parameter POINT, since point typically does not correspond to whatever position might be passed to the function as argument. Better to call it POSITION or POS or POSN, following convention, or ...


Only top voted, non community-wiki answers of a minimum length are eligible