A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/bbatsov/prelude/commit/8c55c6f4bb8fab04040e178b97a9e68006525403 below:

Added helper to open file with emacsclient using filename:line path · bbatsov/prelude@8c55c6f · GitHub

File tree Expand file treeCollapse file tree 2 files changed

+27

-0

lines changed

Filter options

Expand file treeCollapse file tree 2 files changed

+27

-0

lines changed Original file line number Diff line number Diff line change

@@ -234,6 +234,14 @@ alias vi='emacsclient -t'

234 234

The last two aliases are helpful if you're used to editing files from

235 235

the command line using `vi(m)`.

236 236 237 +

Also you can open a file with cursor on choosen line:

238 + 239 +

```bash

240 +

emacsclient somefile:1234

241 +

```

242 + 243 +

This will open file 'somefile' and set cursor on line 1234.

244 + 237 245

## Getting to know Prelude

238 246 239 247

Certainly the best way to understand how Prelude enhances the default

Original file line number Diff line number Diff line change

@@ -397,6 +397,25 @@ indent yanked text (with prefix arg don't indent)."

397 397

("%" . apply-operation-to-number-at-point)

398 398

("'" . operate-on-number-at-point)))

399 399 400 +

(defadvice server-visit-files (before parse-numbers-in-lines (files proc &optional nowait) activate)

401 +

"Open file with emacsclient with cursors positioned on requested line.

402 +

Most of console-based utilities prints filename in format

403 +

'filename:linenumber'. So you may wish to open filename in that format.

404 +

Just call:

405 + 406 +

emacsclient filename:linenumber

407 + 408 +

and file 'filename' will be opened and cursor set on line 'linenumber'"

409 +

(ad-set-arg 0

410 +

(mapcar (lambda (fn)

411 +

(let ((name (car fn)))

412 +

(if (string-match "^\\(.*?\\):\\([0-9]+\\)\\(?::\\([0-9]+\\)\\)?$" name)

413 +

(cons

414 +

(match-string 1 name)

415 +

(cons (string-to-number (match-string 2 name))

416 +

(string-to-number (or (match-string 3 name) ""))))

417 +

fn))) files)))

418 + 400 419

(provide 'prelude-editor)

401 420 402 421

;;; prelude-editor.el ends here

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4