You can get depth image at OpenGL or Vulkan. This article assumes VK_FORMAT_D32_SFLOAT of Vulkan is used as format of depth buffer..
In this case, pixel value of depth image is z-value at NDC space. So, you can reconstruct it's position in world space by using inverse of transformation matrix including perspective matrix.
Then, how can you get this depth image at Blender?
First of all, to get depth value at Blender, you have to make Output-File-Node of OpenEXR image format, and connect it to Depth (or Z) attribute.
But, value stored in this image is not depth(Z) value in NDC space. It's depth value at your view space. So, it's good practice clamping value between near-Z and far-Z.
That is value is between near-Z and far-Z. To get real z-value in NDC space, you can use your projection matrix(usually perspective matrix).
You don't need to know (x, y) value corresponding to this depth value - you can easily capture this by having a look perspective matrix multiplication.
In summary, you have to follow below steps.
- Getting OpenEXR depth image of view space at Blender.
- Convert it by using projection matrix to get depth value at NDC space.

    : You can use even Python: cv2, struct.(un)pack, torchvision, PIL and so on.

- Use (u,v) value and depth value of image to reconstruct position in view space.

In case of promise is NOT fullfilled forever, mocha doens't give any information about this.
See test below.

    describe('test', function () {
        it('test', async () => {
            await new Promise((r, j) => {});
            console.log('hello');
        });
    })

This gives only following result in terminal

    test
      test
Waiting for the debugger to disconnect...
Killed

No more informations!

        {
            "type": "node",
            "request": "launch",
            "name": "Mocha Current File",
            "program": "${workspaceFolder}/node_modules/.bin/_mocha",   ⇐ “_mocha” NOT “mocha”
            "runtimeArgs": [
                "--nolazy",
                "--max_old_space_size=16384",
                "--preserve-symlinks"    <=== Important. Related with way of resolving module by node.
            ],
            "args": [
                "-r",
                "ts-node/register",
                "--no-timeouts",
                "--colors",
                "src/index.spec.ts"
            ],
            "outFiles": [
                "${workspaceFolder}/build"  <=== This is very important NOT "${workspaceFolder}/build/**/*.js"
            ],
            "console": "integratedTerminal",
            "sourceMaps": true,
            "skipFiles": [
                "node_modules/**/*.js",
                "<node_internals>/**/*.js"
            ],
            "internalConsoleOptions": "neverOpen"
        }


<IMPORTANT NOTE>

if “program” is “ts” file; then
    outFiles: ["${workspaceFolder}/build/**/*.js"]
else if “program” is other executable using ‘ts-node/register’; then
    outFiles SHOULD be removed.
fi

*** In case of Mocha, if ‘outFiles’ are described, breakpoint cannot be reached!

GNUMake document says

"An argument that contains ‘=’ specifies the value of a variable: ‘v=x’ sets the value of the variable v to x. If you specify a value in this way, all ordinary assignments of the same variable in the makefile are ignored; we say they have been overridden by the command line argument"


This means, value defined as command-line argument has top priority in terms of variable definition.


< Make file >

PRIV_V=hello_OUT

$(info $(PRIV_V))


all: a b

@echo all


a: PRIV_V := hello_A

a:

@echo $(PRIV_V)


b: PRIV_V := hello_B

b:

@echo $(PRIV_V)




< Test >

$ export PRIV_V=ENV

$ make

hello_OUT

hello_A

hello_B

all


$ make PRIV_V=CMD

CMD

CMD

CMD

all


* Tips : Variable definition in gnumake command line.

Variable definition syntax in the Makefile, is also available as command line argument.

Example.

$ make CC=Hello

$ make CC:=Hello

$ make CC+=Hello

Commands in Rule is called after entire 'make' is parsed.

Ex.

A:=a
B:=a

define prv
    @echo $(1) : $(A) / $(B)
endef

a: b
	$(call prv,[a])

B:=b

b:
	$(call prv,[b])

B:=c


Above 'make' gives following results

[b] : a / c
[a] : a / c

That is, commands are executed after executing last 'make' statement 'B:=c'.


But, assignment in dependency phase is something special.

In this case, assigned value is effective only in that target and it's dependents in rule chain.

And, after checking all dependencies, command is executed.

Ex.


Above 'make' gives following results

A:=a
B:=a

define prv
    @echo $(1) : $(A) / $(B)
endef

a: d b e
	$(call prv,[a])

B:=b

b: B:=x
b: c
	$(call prv,[b])
b: B:=y

c:
	$(call prv,[c])

d:
	$(call prv,[d])

e:
	$(call prv,[e])

B:=c
Above 'make' gives following results
[d] : a / c
[c] : a / y
[b] : a / y
[e] : a / c
[a] : a / c

One interesting point here is, dependency is checked in order. So, for target 'a', dependency is checked  by 'd' -> 'b' -> 'e' order.

[ will be updated time to time. ]

[ From GNUMake documenet ]

We say that expansion is deferred if

expansion is not performed immediately. Expansion of a deferred construct is not performed

until either the construct appears later in an immediate context, or until the second phase.


Variable Assignment

Variable definitions are parsed as follows:

immediate = deferred

immediate ?= deferred

immediate := immediate

immediate += deferred or immediate


define immediate

deferred

endef


define immediate =

deferred

endef


define immediate ?=

deferred

endef


define immediate :=

immediate

endef


define immediate +=

deferred or immediate

endef


For the append operator, ‘+=’, the right-hand side is considered immediate if the variable

was previously set as a simple variable (‘:=’), and deferred otherwise.


[M-x replace-string] : unconditional replace
[M-%] : find and replace [space/y (yes) | DEL/n (no)]]


emacs -l .emacs-ede.el tree.c

================= Etc ===============
[M-x replace-string] : unconditional replace
[M-%] : find and replace [space/y (yes) | DEL/n (no)]]

emacs -l .emacs-ede.el tree.c

=================  Hightlight ===============
C-x w r : unhighlight-regexp
C-x w h : highlight-regexp

=================  Diff Mode (M-x diff) ===============
M-n
Move to the next hunk-start (diff-hunk-next).
This command has a side effect: it refines the hunk you move to, highlighting its changes with better granularity. To disable this feature, type M-x diff-auto-refine-mode to toggle off the minor mode Diff Auto-Refine mode. To disable Diff Auto Refine mode by default, add this to your init file (see Hooks):

          (add-hook 'diff-mode-hook
                    (lambda () (diff-auto-refine-mode -1)))

M-p
Move to the previous hunk-start (diff-hunk-prev). Like M-n, this has the side-effect of refining the hunk you move to, unless you disable Diff Auto-Refine mode.

M-}
Move to the next file-start, in a multi-file patch (diff-file-next).

M-{
Move to the previous file-start, in a multi-file patch (diff-file-prev).

M-k
Kill the hunk at point (diff-hunk-kill).

M-K
In a multi-file patch, kill the current file part. (diff-file-kill).

C-c C-a
Apply this hunk to its target file (diff-apply-hunk). With a prefix argument of C-u, revert this hunk.

C-c C-b
Highlight the changes of the hunk at point with a finer granularity (diff-refine-hunk). This allows you to see exactly which parts of each changed line were actually changed.

C-c C-c
Go to the source file and line corresponding to this hunk (diff-goto-source).

C-c C-e
Start an Ediff session with the patch (diff-ediff-patch). See Ediff.

C-c C-n
Restrict the view to the current hunk (diff-restrict-view). See Narrowing. With a prefix argument of C-u, restrict the view to the current file of a multiple-file patch. To widen again, use C-x n w (widen).

C-c C-r
Reverse the direction of comparison for the entire buffer (diff-reverse-direction).

C-c C-s
Split the hunk at point (diff-split-hunk). This is for manually editing patches, and only works with the unified diff format produced by the -u or --unified options to the diff program. If you need to split a hunk in the context diff format produced by the -c or --context options to diff, first convert the buffer to the unified diff format with C-c C-u.

C-c C-d
Convert the entire buffer to the context diff format (diff-unified->context). With a prefix argument, convert only the text within the region.

C-c C-u
Convert the entire buffer to unified diff format (diff-context->unified). With a prefix argument, convert unified format to context format. When the mark is active, convert only the text within the region.

C-c C-w
Refine the current hunk so that it disregards changes in whitespace (diff-refine-hunk).

C-x 4 A
Generate a ChangeLog entry, like C-x 4 a does (see Change Log), for each one of the hunks (diff-add-change-log-entries-other-window). This creates a skeleton of the log of changes that you can later fill with the actual descriptions of the changes. C-x 4 a itself in Diff mode operates on behalf of the current hunk's file, but gets the function name from the patch itself. This is useful for making log entries for functions that are deleted by the patch.

================= ECB ===============
C-c . g 1
C-c . g d
C-c . g s
C-c . g h
C-c . g m

================= Modes ===============
M-x hexl-mode : hex edit mode
M-x calculator :
M-x calendar

================= CC Mode ===============
C-c C-s : To know which syntatic symbols affect the offset calculations for the line.
C-c C-o : To change offset of syntatic symbol interactively.
M-h C-c C-c : comment region
M-h C-u C-c C-c" : uncomment region
M-C-f    : To the end of block - ex parenthesis, bracket, brace
M-C-b    : To the beginning of block
========================================================
EDE :
+ To add files easily : DirEd mode -> Mark files ("m") -> ". a" to add to target
+ use "M-x customize-target RET" while inside some source file in a target to customize things like compiler flags.

C-x r [SPC] [CHR]
C-x r j [CHR]

================= Key code =============
C : control
M : meta (alt)
S : shift
C-S : control + shift
<f8> : F8 key
<left> <right> <down> <up>
\e : escape key (usually same with meta key)
[(control return)] : control + return key.

(global-set-key [f9] 'alexott-compile)

================= Keyboard macro =============
'C-x (' : start defining a keyboard macro
'C-x )' : stop defining the keyboard macro
'C-x e' : execute the keyboard macro
'C-u 37 C-x e' : execute the macro 37 times.
'C-u 0 C-x e' : execute the macro an infinite number of times until the end of file is reached.
'M-x name-last-kbd-macro' : Name the last-defined keyboard macro
'M-x my-macro' : execute macro by name.

================= Search =============
M-s w : If incremental search is active, toggle word search mode (isearch-toggle-word); otherwise, begin an incremental forward word search (isearch-forward-word).
M-s w <RET> words <RET> : Search for words, using a forward nonincremental word search.
M-s w C-r <RET> words <RET> : Search backward for words, using a nonincremental word search.
M-c to toggle search case-sensitivity
(setq case-fold-search t)   ; make searches case insensitive

================== Online-Help ==================
C-h c which command does this keystroke invoke
C-h k which command does this keystroke invoke and what does it do?
C-h l what were my last 100 typed keys
C-h w what key-combo does this command have?
C-h f what does this function do
C-h v what's this variable and what is it's value
C-h b show all keycommands for this buffer
C-h t start the emacs tutorial
C-h i start the info reader
C-h C-k start up info reader and go to a certain key-combo point
C-h F show the emacs FAQ
C-h p show infos about the Elisp package on this machine

================= Basics ===============
C-x 4 f find file in other window
C-x 4 o change to other window
C-x 4 0 kill buffer and window
C-x 5 2 make new frame
C-x 5 f find file in other frame
C-x 5 o change to other frame
C-x 5 0 close this frame

C-x r m : bookmark-set
C-x r b : bookmark-jump
C-x r l : bookmark-menu-list (list all your bookmarks)

M-C-f / M-C-b : find matching brace in forward/backward direction.

C-M-v : (scroll-other-window) scroll other window down
C-M-S-v : scroll other window up.

==================== misc =====================
tabify : change spaces to tab in selected region <-> untabify

================= functions ===================
load-library : load files whose extension is .elc, .el and no-ext(specified name alone)  in the directories.
eval-current-buffer : evaluate all the Lisp expressions in the buffer.


==================== elisp ==============
C-x C-e : eval-last-sexp : evaluate lisp expresstion to the left of the cursor
eval-region : select lisp code and evaluate it.
ielm : turns the buffer into a interactive elisp command line interface.
C-h f : describe-function : finds inline documentation of a function
elisp-index-search : finds the documentation of a function in the official GNU Emacs Lisp Reference Manual.

====================================================
C-x r <SPC> r :    Record the position of point and the current buffer in register r (point-to-register).
C-x r j r :    Jump to the position and buffer saved in register r (jump-to-register).

==================== Semantic =====================
C-x B : semantic-mrub-switch-tag :
C-c , j : semantic-complete-jump-local
C-c , n : senator-next-tag
C-c , p : senator-previous-tag
C-c , u : senator-go-to-up-reference : move cursor to the "parent" tag.

==================== gtags =====================
\e* : gtags-pop-stack
\e. : gtags-find-tag
\C-x4. : gtags-find-tag-other-window


==================== gud gdb ======================
gdb-many-windows : t (M-x gdb-many-windows)

C-x <SPC>    Set a breakpoint on the source line that point is on.
C-c C-l
C-x C-a C-l
    Display in another window the last line referred to in the GUD buffer (that is, the line indicated in the last location message). This runs the command gud-refresh.
C-c C-s
C-x C-a C-s
    Execute a single line of code (gud-step). If the line contains a function call, execution stops after entering the called function.
C-c C-n
C-x C-a C-n
    Execute a single line of code, stepping across entire function calls at full speed (gud-next).
C-c C-i
C-x C-a C-i
    Execute a single machine instruction (gud-stepi).
C-c C-p
C-x C-a C-p
    Evaluate the expression at point (gud-print). If Emacs does not print the exact expression that you want, mark it as a region first.
C-c C-r
C-x C-a C-r
    Continue execution without specifying any stopping point. The program will run until it hits a breakpoint, terminates, or gets a signal that the debugger is checking for (gud-cont).
C-c C-d
C-x C-a C-d
    Delete the breakpoint(s) on the current source line, if any (gud-remove). If you use this command in the GUD interaction buffer, it applies to the line where the program last stopped.
C-c C-t
C-x C-a C-t
    Set a temporary breakpoint on the current source line, if any (gud-tbreak). If you use this command in the GUD interaction buffer, it applies to the line where the program last stopped.
C-c <
C-x C-a <
    Select the next enclosing stack frame (gud-up). This is equivalent to the GDB command ‘up’.
C-c >
C-x C-a >
    Select the next inner stack frame (gud-down). This is equivalent to the GDB command ‘down’.
C-c C-u
C-x C-a C-u
    Continue execution to the current line (gud-until). The program will run until it hits a breakpoint, terminates, gets a signal that the debugger is checking for, or reaches the line on which the cursor currently sits.
C-c C-f
C-x C-a C-f
    Run the program until the selected stack frame returns or stops for some other reason (gud-finish).

If you are using GDB, these additional key bindings are available:

C-x C-a C-j
    Only useful in a source buffer, gud-jump transfers the program's execution point to the current line. In other words, the next line that the program executes will be the one where you gave the command. If the new execution line is in a different function from the previously one, GDB prompts for confirmation since the results may be bizarre. See the GDB manual entry regarding jump for details.
<TAB>
    With GDB, complete a symbol name (gud-gdb-complete-command). This key is available only in the GUD interaction buffer.



==================== Version control ======================
C-x v v     vc-next-action
    perform the next logical control operation on file
(C-x C-q     by default, C-x C-q is no longer bound, so it's better to use the above binding)

C-u C-x v v
    To switch between branches, type and specify the revision ID you want to select

C-x v i     vc-register
    add a new file to version control
 
C-x v I        vc-log-incoming
    Display the changes that will be received with a pull operation.

C-x v O     vc-log-outgoing
    Display the changes that will be sent by the next push operation.

C-x v ~     vc-version-other-window
    Prompt for a revision of the current file, and visit it in a buffer of its own

C-x v =     vc-diff
    Compare the files in the current fileset with the working revision(s) you started from. With a prefix argument, prompt for two revisions of the current fileset and compare them. You can call this command from a Dired buffer (Dired)

C-x v D     vc-root-diff
    Compare the entire tree corresponding to the current fileset with the tree you started from. With a prefix argument, prompt for two revisions and compare their trees.

C-x v g     vc-annotate
    Display an annotated version of the file: for each line, show the latest revision in which it was modified (vc-annotate).    
   
C-x v d     vc-directory
    View VC-Directory-Mode.
   
C-x v s     vc-create-snapshot
    tag all the files with a symbolic name
   
C-x v r     vc-retrieve-snapshot
    undo checkouts and return to a snapshot with a symbolic name

C-x v l     vc-print-log
    show log for current file (not in ChangeLog format)
   
C-x v L     vc-print-root-log
    Display the change history for the current repository
   
C-x v a     vc-update-change-log
    Visit the current directory's change log file and, for registered files in that directory, create new entries for versions checked in since the most recent entry in the change log file. ().
    This command works with RCS or CVS only, not with any of the other back ends.

C-u C-x v a
    As above, but only find entries for the current buffer's file.

M-1 C-x v a
    As above, but find entries for all the currently visited files that are maintained with version control. This works only with RCS, and it puts all entries in the log for the default directory, which may not be appropriate.

C-x v m     vc-merge
    Merge changes into the work file.

C-x v h     vc-insert-headers
    Insert headers in a file for use with your version-control system.

C-x v u     vc-revert-buffer
    Revert the buffer and the file to the working revision from which you started editing the file.
   
C-x v c     vc-rollback
    Remove the last-entered change from the master for the visited file. This undoes your last check-in.

M-x vc-find-conflicted-file

M-x vc-resolve-conflicts
    pop up an ediff-merge session on a file with conflict markers



[ VC Directory Commands ]
-------------------------

Up- and down-arrow keys
    move in the buffer;
   
n and p
    also move vertically as in other list-browsing modes.

<SPC> and <TAB>
    behave like down-arrow

<BackTab>
    behaves like up-arrow.

o    visits that file in another window.

q    dismisses the directory buffer.

f    visit the file on the current line.

C-m    Same with above

x    hides up-to-date files.

m    marks the file or directory on the current line. If the region is active, m marks all the files in the region. There are some restrictions when marking: a file cannot be marked if any of its parent directories are marked, and a directory cannot be marked if any files in it or in its child directories are marked.

M    marks all the files with the same VC state as the current file if the cursor is on a file. If the cursor is on a directory, it marks all child files. With a prefix argument: marks all files and directories.

u    unmarks the file or directory on the current line. If the region is active, it unmarks all the files in the region.

U    marks all the files with the same VC state as the current file if the cursor is on a file. If the cursor is on a directory, it unmarks all child files. With a prefix argument: unmarks all marked files and directories.


* It is possible to do search, search and replace, incremental search, and incremental regexp search on multiple files. These commands will work on all the marked files or the current file if nothing is marked. If a directory is marked, the files in that directory shown in the VC directory buffer will be used.

S    searches the marked files.

Q    does a query replace on the marked files.

M-s a C-s
    does an incremental search on the marked files.

M-s a C-M-s
    does an incremental regular expression search on the marked files.

* Commands are also accessible from the VC-dir menu. Note that some VC backends use the VC-dir menu to make available extra, backend-specific, commands. For example, Git and Bazaar allow you to manipulate stashes and shelves. (These provide a mechanism to temporarily store uncommitted changes somewhere out of the way, and bring them back at a later time.)

* Normal VC commands with the C-x v prefix work in VC directory buffers. Some single-key shortcuts are available as well; =, +, l, i, and v behave as through prefixed with C-x v.

The command C-x v v (vc-next-action) operates on all the marked files.

When C-x v v (vc-next-action) operates on multiple files, all of those files must be either in the same state or in compatible states (added, modified and removed states are considered compatible). Otherwise it signals an error. This differs from the behavior of older versions of VC, which did not have fileset operations and simply did vc-next-action on each file individually.

If any files are in a state that calls for commit, C-x v v reads a single log entry and uses it for the changeset as a whole. If the underling VCS is file- rather than changeset-oriented, the log entry will be replicated into the history of each file.



[ In '*vc-change-log* ]
-----------------------

p    Move to the previous revision-item in the buffer. (Revision entries in the log buffer are usually in reverse-chronological order, so the previous revision-item usually corresponds to a newer revision.) A numeric prefix argument is a repeat count.

n    Move to the next revision-item (which most often corresponds to the previous revision of the file). A numeric prefix argument is a repeat count.

P    Move to the log of the previous file, when the logs of multiple files are in the log buffer (see VC Directory Mode). Otherwise, just move to the beginning of the log. A numeric prefix argument is a repeat count, so C-u 10 P would move backward 10 files.

N    Move to the log of the next file, when the logs of multiple files are in the log buffer (see VC Directory Mode). It also takes a numeric prefix argument as a repeat count.

a    Annotate the revision indicated by the current line.

e    Modify the change comment displayed at point. Note that not all VC systems support modifying change comments.

f    Visit the revision indicated at the current line, like typing C-x v ~ and specifying this revision's ID (see Old Revisions).

d    Display the diff (see Comparing Files) between the revision indicated at the current line and the next earlier revision. This is useful to see what actually changed in the file when the revision indicated on the current line was committed.

D    Display the changeset diff (see Comparing Files) between the revision indicated at the current line and the next earlier revision. This is useful to see all the changes to all files that the revision indicated on the current line did when it was committed.


   
[ VC-Annotate menu ]
--------------------

From the annotate buffer, these and other color scaling options are available from the ‘VC-Annotate’ menu. In this buffer, you can also use the following keys to browse the annotations of past revisions, view diffs, or view log entries:

p    Annotate the previous revision, that is to say, the revision before the one currently annotated. A numeric prefix argument is a repeat count, so C-u 10 p would take you back 10 revisions.

n    Annotate the next revision—the one after the revision currently annotated. A numeric prefix argument is a repeat count.

j    Annotate the revision indicated by the current line.

a    Annotate the revision before the one indicated by the current line. This is useful to see the state the file was in before the change on the current line was made.

f    Show in a buffer the file revision indicated by the current line.

d    Display the diff between the current line's revision and the previous revision. This is useful to see what the current line's revision actually changed in the file.

D    Display the diff between the current line's revision and the previous revision for all files in the changeset (for VC systems that support changesets). This is useful to see what the current line's revision actually changed in the tree.

l    Show the log of the current line's revision. This is useful to see the author's description of the changes in the revision on the current line.

w    Annotate the working revision–the one you are editing. If you used p and n to browse to other revisions, use this key to return to your working revision.

v    Toggle the annotation visibility. This is useful for looking just at the file contents without distraction from the annotations.    


======================================================================


Emacs Commands List

C = Control
M = Meta = Alt|Esc

[Basics]
C-x C-f "find" file i.e. open/create a file in buffer
C-x C-s save the file
C-x C-w write the text to an alternate name
C-x C-v find alternate file
C-x i insert file at cursor position
C-x b create/switch buffers
C-x C-b show buffer list
C-x k kill buffer
C-z suspend emacs
C-X C-c close down emacs

[Basic movement]
C-f forward char
C-b backward char
C-p previous line
C-n next line
M-f forward one word
M-b backward one word
C-a beginning of line
C-e end of line
C-v one page up
M-v scroll down one page
M-< beginning of text
M-> end of text

[Editing]
M-n repeat the following command n times
C-u repeat the following command 4 times
C-u n repeat n times
C-d delete a char
M-d delete word
M-Del delete word backwards
C-k kill line

C-Space Set beginning mark (for region marking for example)
C-W "kill" (delete) the marked region region
M-W copy the marked region
C-y "yank" (paste) the copied/killed region/line
M-y yank earlier text (cycle through kill buffer)
C-x C-x exchange cursor and mark

C-t transpose two chars
M-t transpose two words
C-x C-t transpose lines
M-u make letters uppercase in word from cursor position to end
M-c simply make first letter in word uppercase
M-l opposite to M-u

[Important]
C-g quit the running/entered command
C-x u undo previous action
M-x revert-buffer RETURN (insert like this) undo all changes since last save
M-x recover-file RETURN Recover text from an autosave-file
M-x recover-session RETURN if you edited several files

[Online-Help]
C-h c which command does this keystroke invoke
C-h k which command does this keystroke invoke and what does it do?
C-h l what were my last 100 typed keys
C-h w what key-combo does this command have?
C-h f what does this function do
C-h v what's this variable and what is it's value
C-h b show all keycommands for this buffer
C-h t start the emacs tutorial
C-h i start the info reader
C-h C-k start up info reader and go to a certain key-combo point
C-h F show the emacs FAQ
C-h p show infos about the Elisp package on this machine

[Search/Replace]
C-s Search forward
C-r search backward
C-g return to where search started (if you are still in search mode)
M-% query replace

    Space or y replace this occurence
    Del or n don't replace
    . only replace this and exit (replace)
    , replace and pause (resume with Space or y)
    ! replace all following occurences
    ^ back to previous match
    RETURN or q quit replace


Search/Replace with regular expressions
Characters to use in regular expressions:
^ beginning of line
$ end of line
. single char
.* group or null of chars
\< beginning of a word
\> end of a word
[] every char inside the backets (for example [a-z] means every small letter)

M C-s RETURN search for regular expression forward
M C-r RETURN search for regular expression backward
M C-s incremental search
C-s repeat incremental search
M C-r incremental search backwards
C-r repeat backwards
M-x query-replace-regexp search and replace

[Window-Commands]
C-x 2 split window vertically
C-x o change to other window
C-x 0 delete window
C-x 1 close all windows except the one the cursors in
C-x ^ enlarge window
M-x shrink-window command says it ;-)
M C-v scroll other window
C-x 4 f find file in other window
C-x 4 o change to other window
C-x 4 0 kill buffer and window
C-x 5 2 make new frame
C-x 5 f find file in other frame
C-x 5 o change to other frame
C-x 5 0 close this frame

[Bookmark commands]
C-x r m set a bookmark at current cursor pos
C-x r b jump to bookmark
M-x bookmark-rename says it
M-x bookmark-delete "
M-x bookmark-save "
C-x r l list bookmarks

    d mark bookmark for deletion
    r rename bookmark
    s save all listed bookmarks
    f show bookmark the cursor is over
    m mark bookmarks to be shown in multiple window
    v show marked bookmarks (or the one the cursor is over)
    t toggle listing of the corresponding paths
    w " path to this file
    x delete marked bookmarks
    Del ?
    q quit bookmark list


M-x bookmark-write write all bookmarks in given file
M-x bookmark-load load bookmark from given file

[Shell]
M-x shell starts shell modus
C-c C-c same as C-c under unix (stop running job)
C-d delete char forward
C-c C-d Send EOF
C-c C-z suspend job (C-z under unix)
M-p show previous commands

[DIRectory EDitor (dired)]
C-x d start up dired
C (large C) copy
d mark for erase
D delete right away
e or f open file or directory
g reread directory structure from file
G change group permissions (chgrp)
k delete line from listing on screen (don't actually delete)
m mark with *
n move to next line
o open file in other window and go there
C-o open file in other window but don't change there
P print file
q quit dired
Q do query-replace in marked files
R rename file
u remove mark
v view file content
x delete files marked with D
z compress file
M-Del remove all marks (whatever kind)
~ mark backup files (name~ files) for deletion
# mark auto-save files (#name#) for deletion
*/ mark directory with * (C-u * removes that mark again)
= compare this file with marked file
M-= compare this file with it's backup file
! apply shell command to this file
M-} change to the next file marked with * od D
M-{ " previous "
% d mark files described through regular expression for deletion
% m " (with *)
+ create directory
> changed to next dir
< change to previous dir
s toggle between sorting by name or date

Maybe into this category also fits this command:
M-x speedbar starts up a separate window with a directory view

[Telnet]
M-x telnet starts up telnet-modus
C-d either delete char or send EOF
C-c C-c stop running job (similar to C-c under unix)
C-c C-d send EOF
C-c C-o clear output of last command
C-c C-z suspend execution of command
C-c C-u kill line backwards
M-p recall previous command

[Text]
Works only in text mode
M-s center line
M-S center paragraph
M-x center-region name says

[Macro-commands]
C-x ( start macro definition
C-x ) end of macro definition
C-x e execute last definied macro
M-n C-x e execute last defined macro n times
M-x name-last-kbd-macro give name to macro (for saving)
M-x insert-keyboard-macro save named macro into file
M-x load-file load macro
M-x macroname execute macroname

[Programming]
M C-\ indent region between cursor and mark
M-m move to first (non-space) char in this line
M-^ attach this line to previous
M-; formatize and indent comment

[C, C++ and Java Modes]
M-a beginning of statement
M-e end of statement
M C-a beginning of function
M C-e end of function
C-c RETURN Set cursor to beginning of function and mark at the end
C-c C-q indent the whole function according to indention style
C-c C-a toggle modus in which after electric signs (like {}:';./*) emacs does the indention
C-c C-d toggle auto hungry mode in which emacs deletes groups of spaces with one del-press
C-c C-u go to beginning of this preprocessor statement
C-c C-c comment out marked area

More general (I guess)
M-x outline-minor-mode collapses function definitions in a file to a mere {...}
M-x show-subtree If you are in one of the collapsed functions, this un-collapses it

In order to achive some of the feats coming up now you have to run etags *.c *.h *.cpp (or what ever ending you source files have) in the source directory
M-. (Thats Meta dot) If you are in a function call, this will take you to it's definition
M-x tags-search ENTER Searches through all you etaged
M-, (Meta comma) jumps to the next occurence for tags-search
M-x tags-query-replace yum. This lets you replace some text in all the tagged files

[GDB (Debugger)]
M-x gdb starts up gdm in an extra window

[Version Control]
C-x v d show all registered files in this dir
C-x v = show diff between versions
C-x v u remove all changes since last checkin
C-x v ~ show certain version in different window
C-x v l print log
C-x v i mark file for version control add
C-x v h insert version control header into file
C-x v r check out named snapshot
C-x v s create named snapshot
C-x v a create changelog file in gnu-style


Dependency can be defined more than one place. It's very interesting.

        Syntax : Take you attention that there is NO command in rule.
        <target> : <dep>
       
At abve case, <dep> is ADDED to <target>'s existing dependency (NOT "replace"!!)
But, if there is COMMAND at above rule, old COMMAND is "REPLACED" (NOTE that, dependency is still ADDED).
See below examples to help understanding.
   
    < Makefile >
    all: a
        touch all0
    a
        touch a
    all: b
    b
        touch b
   
    > make
        touch a
        touch b
        touch all0
       
    ----------------------
       
    < Makefile >
    all: a
    a
        touch a
    all: b
        touch all1
    b
        touch b
   
    > make
        touch b
        touch a
        touch all1
       
    ----------------------
       
    < Makefile >
    all: a
        touch all0
    a
        touch a
    all: b
        touch all1
    b
        touch b
   
    > make
        touch b
        touch a
        touch all1
       
    # Same with above
    # That is, older command for target is replaced with newer one.

GNU Global(henceforth Global) is good tagging tool.
In Global, user can add file or directory list to skip during parsing in the configuration file (~/.globalrc by default).

[ Customization 1 ]
But, in case of monster-like-huge-system, this file list becomes too big and complex.
So, one of my option to resolve this issue is "Using regular expression(henceforth regex.) directly in the configuration file."

To do this, source code of Global should be modified, definitely.
Following source code diff. is based on GNU Global 5.9.7

diff --git a/libutil/find.c b/libutil/find.c
index aa12e81..a49bcdf 100644
--- a/libutil/find.c
+++ b/libutil/find.c
@@ -263,9 +263,18 @@ prepare_skip(void)
                char *skipf = p;
                if ((p = locatestring(p, ",", MATCH_FIRST)) != NULL)
                        *p++ = 0;
+               /*
+                * [ Modification For My Private Usage! ]
+                * string starts with '/' is treated as regular expression.
+                * (Not file name!)
+                */
                if (*skipf == '/') {
-                       list_count++;
-                       strbuf_puts0(list, skipf);
+                       reg_count++;
+                       /* put it as it is as regular expression! */
+                       for (q = skipf + 1; *q; q++)
+                               strbuf_putc(reg, *q);
+                       if (p)
+                               strbuf_putc(reg, '|');
                } else {
                        reg_count++;
                        strbuf_putc(reg, '/');
@@ -288,6 +297,8 @@ prepare_skip(void)
                /*
                 * compile regular expression.
                 */
+               printf("********* skip regular expression ***********\n%s\n"
+                      ,strbuf_value(reg));
                skip = &skip_area;
                retval = regcomp(skip, strbuf_value(reg), flags);
                if (retval != 0)

Global keeps its skip list with following form.

(/<path0>|/<path1> ...)

And characters that can be used as regex. is replaced with leading escape character '\'.
So, all characters are treated as character itself and don't have meta meaning during regex. compilation.
To use regex. directly, modifying this code area is required and above diff. is for this.
Another thing to know to use regex. directly is that file path that is used in Global for parsing always starts with './'

Original Global supports absolute path.
But, in my case, it was almost useless.
So, instead of using absolute path, I modified it to use this for regex. syntax.
That is, syntax for absolute path is used as the one for regex. of configuration file in modified Global.
(printf is for debugging configuration file. :-) )

Here is example at the modified version.
(Leading automatically-added-default-expression  is omitted.)

Standard case
-------------

[ Configuration ]
:skip=tags,project/bin/,/b[0-9]+\.txt$:

[ Regular expression string ]
(/tags$|/project/bin/)

=> absolute path is stored at other list - not in regex.

Customized case
---------------

[ Configuration ]
 :skip=tags,project/bin/,/b[0-9]+\.c:

[ Regular expression string ]
(/tags$|/project/bin/|b[0-9]+.txt$)

[ Customization 2 ]

There is no well-described official document about Global configuration file.
So, I'm not sure that following case is intentional or not.

In configuration file, default leading string of regex. is '/'.
That is, "skip=build/:" is transformed to "/build/" in regex.
Therefore, this matches not only "./build" but also "xxxxx/build/xxxxx".
But this always confused me.
So, let me introduce modification to overcome this.

--- a/libutil/find.c
+++ b/libutil/find.c
@@ -277,7 +277,10 @@ prepare_skip(void)
                                strbuf_putc(reg, '|');
                } else {
                        reg_count++;
-                       strbuf_putc(reg, '/');
+                       /*
+                        * all local files are started with './'
+                        */
+                       strbuf_puts(reg, "^\\./");
                        for (q = skipf; *q; q++) {
                                if (isregexchar(*q))
                                        strbuf_putc(reg, '\\');

This means, "all file path is relative path from gtags' root."
For me, this is much better and clearer than original version.

Enjoy!

'Tools' 카테고리의 다른 글

[ Emacs ] key-bindings.... (my environment)  (0) 2012.03.23
Interesting rule of GNU make.  (0) 2012.03.23
[Tools] 'Tab' means 'Command' in Make.  (0) 2011.01.26
[Emacs] use Semantic with global...  (0) 2010.06.29
[Tool] gnumake...  (0) 2010.02.19

Remind! :
'make' can tell difference between normal line and command only by using 'tab'.

It's same in GNU Automake.
Here two simple 'Makefile.am' - A, B.

[A]
...
if COND_X
[spaces]VARX=xxx
endif
...

[B]
...
if COND_X
[tab]VARX=xxx
endif
...

Only difference is leading spaces [A] and leading tab [B].
But, in case of [B], make regard 'VARX=xxx' as command.
So, 'Makefile.in' generated by 'automake' looks like follows.

[A]
...
(usually, at the head of Makefile.in)
VARX=xxx
...
(start rules)
all: config.h ...

[B]
...
(usually, at the end of Makefile.in)
.PHONY
[tab]VARX=xxx
...

So, in case [B], 'VARX' cannot be used as a variable at the 'rule' part!
The point is, "'Tab' means 'Command' in 'Make'!".
Keep this in mind!

+ Recent posts