Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

The tag has no usage guidance.

0
votes
0answers
30 views

Auto-sort a block of text on save in Spacemacs

When I have a large discriminated union in my code, or a large pattern match, or a large block of constants, I like to have some consistent easy way of organizing them, and so I like to :sort them. ...
0
votes
2answers
28 views

How to sort lines ignoring a pattern?

I would like to sort some lines, ignoring a leading part of them. Here's an example from my .spacemacs file: '( better-defaults elixir emacs-lisp erlang evil-commentary ...
2
votes
1answer
75 views

How does sorting work within habits?

I think I have a reasonable handle on agenda custom sorting, but I can't figure out how habits sort themselves within that agendas. For a certain agenda view I sort as '(time-up habit-down todo-state-...
0
votes
1answer
34 views

How to convert paragraph into the line?

I've need a function which convert a paragraph into the line, sort each space separated set of characters and fill it back to paragraph. In: Supposedly there are over one million words in the ...
1
vote
1answer
37 views

Sort entire hirearchy in an Org mode buffer

Running Emacs 25.2.2. Consider the following heading hierarchy: * L1 ** C *** 2 *** 1 ** B *** 3 *** 2 I want to sort it to: * L1 ** B *** 1 *** 2 ** C *** 2 ...
0
votes
1answer
20 views

Sort js object by name

I'd like to sort objects by prop name, eg const a = { method: "GET", url: "asd", headers: { Content: "application/json", Authorization: "token", }, } then select only ...
0
votes
1answer
33 views

How to NOT sort icicles menu output?

Using an icicles menu with emacs 26.1, I'm now having the menu sorted. The menu used to be unsorted (items appeared in the order they were given). In the previous version of emacs they were unsorted. ...
0
votes
1answer
25 views

How to sort a list of files/directories by hierarchical depth?

I am working on implementing my own feature request -- http://debbugs.gnu.org/cgi/bugreport.cgi?bug=31601 -- to give wdired the ability to handle a dired- buffer that contains an arbitrary list of ...
1
vote
0answers
34 views

Sort CSS declarations alphanumerically

As per the Google style guide (but this is a generally recognized as good practice) the CSS declarations should be sorted within rules blocks. So given the following code: .ruleOne { width: 40px; ...
3
votes
2answers
184 views

Sort list by decreasing length of the strings

I have this list: (setq MYLIST '("J. Phys." "New. J. Phys." "J. Phys. Soc. Jap." "Phys. Plasmas")) How can I get a new list ordered by the decreasing ...
3
votes
2answers
75 views

How to sort bash functions alphabetically?

My boss is a bit of a neat freak. He wants the functions in my functions.sh be ordered alphabetically. foo() { echo foo } baa() { echo baa } So baa should appear first in the file. Can emacs ...
0
votes
1answer
99 views

Open emacs in Dired mode

I would like to open emacs in dired mode . files and folders should be organised in most recent file first order. Moreover I would like to highlight the Org files for easy selection. Is this possible?
5
votes
2answers
121 views

Find files with find-dired sorting by date and by size

I often use find-dired and find-named-dired. But I wanted to get the results sorted by date and by size. How can I do that?
2
votes
1answer
134 views

How to sort an association list (alist)?

Is there a way to sort an association list? In my case I would like to sort the alist elements by the values in each list element (represented by the integers in the example below). Example: (setq ...
1
vote
0answers
28 views

Is it possible to sort todos by completion?

Is it possible to sort todos by completion? * Bar [0%] ** TODO Bar1 ** TODO Bar2 * Foo [100%] ** DONE Foo1 CLOSED: [2017-06-18 So 17:51] ** DONE Foo2 CLOSED: [2017-06-18 So 17:51] * Foo1 [0%] **...
1
vote
0answers
50 views

emacs dired ignores LC_COLLATE=C when using sudo?

My emacs dired changes sort order from ASCII to case-insensitive whenever I view a directory listing under sudo::. Checking getenv on LC_COLLATE shows that emacs still thinks the value is 'C'; and ls -...
2
votes
3answers
98 views

Elisp: sorting SYM VAL pairs in a setq expression

I wrote a rather clunky elisp function to sort the SYM VAL args in a setq expression alphabetically by SYM. For example: (setq c "blah" (setq a 9 b '(more stuff) --> b '(...
1
vote
1answer
128 views

sort lines by regexp

I have a todo list in a text file that I maintain with TaskAgent and emacs. TaskAgent adds trailing text to a line to indicate priority (#!!! represents highest, #! represents low, and no mark is ...
1
vote
1answer
98 views

wanderlust: default summary sort order?

I would like my all my wanderlust *Summary* buffers to be sorted by "number" in "reverse" order. I know how to manually request a sort, but I want this specified sort order to always be the default ...
0
votes
1answer
63 views

Custom function to map through nested lists sorting by time-stamp

In the following example, please assume that we are using time-to-seconds to convert each times-stamp into a decimal representation. I have already converted the time-stamps to seconds in this ...
0
votes
1answer
99 views

org mode sort problems with (numerical) properties

I use the property "pages" for the number of pages of an article or book. There are two problems. First: If I use C-c ^ to sort the items by the value of pages org-sort seems to interpret the ...
0
votes
1answer
38 views

Custom sort order based on certain elements of a list

Q:  Each sub-list within the main list contains one of five possible categories. How can I customize the sort in the following order: CUSTOM SORT ORDER: 1. TASKS 2. EVENTS 3. UNDATED 4. ...
0
votes
1answer
39 views

Idiomatic boolean comparators

Are there idiomatic boolean comparators in emacs lisp? Something like: (my/bool< nil t) => t (my/bool< 1 2) => nil For example, a comparator that returns t if the first argument is ...
1
vote
1answer
389 views

org-agenda-sorting-strategy: items containing no time-of-day specification first

The manual says For the daily/weekly agenda, the items for each day are sorted. The default order is to first collect all items containing an explicit time-of-day specification. 8:30-13:...
3
votes
1answer
292 views

Reverse suggestions from hippie-expand

I currently have the following settings for hippie-expand in my .emacs file: (setq hippie-expand-try-functions-list '(try-expand-dabbrev try-expand-dabbrev-all-buffers try-expand-dabbrev-...
2
votes
2answers
149 views

org-sort-entries recursively

A natural approach to sorting an outline recursively would be the following: (org-map-entries (lambda () (org-sort-entries nil ?f 'my/sort-function) nil 'tree) ...
1
vote
1answer
88 views

shuffling the paragraphs in a buffer

Is there a package/function for shuffling the paragraphs in the buffer? (I mean to sort the paragraphs with a random order, not changing the paragraphs, just randomizing their order). Motivation: ...
1
vote
0answers
92 views

order agenda so all-day and multi-day duration items appear on top

My problem is with two of my main use-cases for time-stamped items (essentially events). Consider these two org-mode items: * Clojure Dojo at uSwitch <2016-11-14 Mon 19:00> * Trip to Jamaica &...
1
vote
1answer
130 views

Is there a way to sort buffers alphabetically in speedbar

By default speedbar displays buffers as they are in the buffer list. Is there a way to sort them by their name alphabetically, either automatically or by triggering the sorting?
4
votes
1answer
366 views

dired - sort and hide by default

More often than not, when I open a dired buffer, I press ( to run dired-hide-details-mode s to rundired-sort-toggle-or-edit What's a good way to have these done automatically every time I open a ...
1
vote
1answer
51 views

Org mode customized alphabetic sorting

The children of a heading at point can be sorted alphabetically with C-c ^ a. Can this sorting method be customized? What I want is to sort Greek words according to their Latin translitteration. For ...
0
votes
0answers
149 views

Org-mode: manually sorting headlines column view

I love that we can quickly re-order our outlines with the M-<Up|Down> arrow keys. For whatever reason, I can't get this to work in column view. I would like to enable this behavior. Any ideas ...
1
vote
1answer
93 views

Sort Dewey Decimal list?

If I have a list of books' call numbers in Dewey Decimal in a buffer, is this something I could sort with Emacs regex -- or is this an elisp task? For example, 261.1 C87 comes before 261.104 Z99 ...
4
votes
2answers
86 views

sorting paragraphs of a document by paragraph numbers (not lexicographically)

I have a document whose paragraphs start with a number like this: 101 kjwdujd dkjcjiekrd wekdhehwrd kwedhiehrc wekdhchjedc kjdchhedch . 99 dsjcoiedc wdhiwedc wedhiuwhediuhewdkdeh wedghiuwghediughedc ...
4
votes
1answer
98 views

Randomize headers in Org mode

How can I randomize headers in org mode? e.g. If I had a list like this, : * apple 1 * lemon 2 * banana * orange How can I randomize those headers and get lists like these?: * lemon 2 * ...
6
votes
1answer
99 views

Sort by a suffix in file names in dired

I would like to sort the dired buffer by a suffix in the file names. For instance, with the following buffer content: /nixos/nix/store: total used in directory 140344 available 17530560 drwxrwxr-t ...
2
votes
0answers
52 views

Dired: manual files sorting for specific directories

I have a directory with many folder. When I open it in dired I see this: bundles ckeditor companies contries failitators induction jquery_update lwt_shared members messages offices ... I often work ...
9
votes
1answer
173 views

Sorting lines with accented characters

When sorting the lines by sort-lines the lines beginning with ä comes after the lines starting with z. It would be nice if the lines could be sorted ignoring the accents, Umlauts, etc, like in a ...
3
votes
1answer
93 views

how to sort describe-variable completion list by recency (or frequency)?

When I run describe-variable, then choose something, I often wind up looking at the same variable again later or next session. However, when I do describe-variable again, the helm list of variables ...
4
votes
2answers
133 views

Sorting an org-table numerically, ignoring commas (org-table-sort-lines)

I have the following org-table: | Row # | Facility | Recycled Off-site | |-------+--------------------------+-------------------+ | 1 | 1234, 12th st, jamestown | 216,...
1
vote
2answers
178 views

Most efficient way of sorting a list

Given a plain list like: - buy tea - call Anna - Reply email to John - pay bill 1 - phone Derick - Reply to grad-pa which you don't want to sort alphabetically, how can you sort it? Things like '...
2
votes
2answers
102 views

How to put buffers named with an asterisk at the end of ido's selection list?

with (ido-switch-buffer), when I type stuff, "*magit: stuff*" comes before Stuff.txt. the sorting seems to be done by recency, rather than the buffer name. more generally, a custom sort function ...
5
votes
1answer
582 views

Sorting org-mode org-agenda file

I have an org-mode file in standard agenda format: * Dentist <2015-10-01> * Put up shelves <2015-10-05> I'm just starting to use org-agenda but I still use just that single file a lot ...
4
votes
1answer
232 views

Change field separator for sort-fields

sort-fields and sort-numeric-fields work great; but the field separator is whitespace. I would like to use a different delimiter (e.g.: [colon-char]). I want this feature because I find myself ...
2
votes
1answer
134 views

Sort minor-mode-alist alphabetically (in the mode-line) using :lighter

Q: How to sort the minor-mode-alist alphabetically (in the mode-line) using the :lighter as the criteria for alphabetization. Rough draft that does not work: (setq mode-line-format '( (:eval ...
5
votes
2answers
283 views

How to make private python methods the last company-mode choices?

I'm using emacs with company-mode and I'd like the 'private' methods (method that start with underline) to be shown last, since they are kind of useless for imported libraries in python. See the image:...
18
votes
3answers
4k views

org: How to sort headings by TODO and then by priority?

I often have a list like this: * Main heading ** TODO [#A] Make world better ** TODO [#B] Make Emacs better ** TODO [#B] Customize emacs ** DONE [#C] some task ** TODO [#A] Launch rocket to mars I ...
7
votes
2answers
180 views

Change order of symbols for «sort-lines»

I am using «sort-lines» to sort includes in C/C++ files before saving. The problem that arises is that a headers with " symbols sorted higher than ones with < symbols. But I want the reverse. How ...
3
votes
4answers
379 views

Sorting words with hyphens (e.g. in a Lisp mode)

SortWords in the EmacsWiki suggests this function as a way to sort words: (defun sort-words (reverse beg end) "Sort words in region alphabetically, in REVERSE if negative. When prefixed with ...
8
votes
2answers
3k views

Sorting headings in an ORG file

I'm taking notes in a largish org-mode file that has the following structure: * Toto, A Notes about Toto. * Titi, C Notes about Titi. * Tutu, A Notes about Tutu. I'd like to sort the file so that ...